Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ASM Save ArrayList ClassNode as Zip File
#1
Code:
    public static void saveAsJar(ArrayList<ClassNode> nodeList, String fileName) {
        try {
            JarOutputStream out = new JarOutputStream(new FileOutputStream(fileName));
            for (ClassNode cn : nodeList) {
                ClassWriter cw = new ClassWriter(0);
                cn.accept(cw);
                
                out.putNextEntry(new ZipEntry(cn.name + ".class"));
                out.write(cw.toByteArray());
                out.closeEntry();
            }
            
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
Reply
 


Messages In This Thread
ASM Save ArrayList ClassNode as Zip File - by Konloch - 10-11-2014, 09:51 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)

About The Bytecode Club

We're a community focused on Reverse Engineering, we try to target Java/Android but we also include other langauges/platforms. We pride ourselves in supporting and free and open sourced applications.

Website