01-21-2015, 01:24 AM
(01-21-2015, 12:31 AM)Swizzbeat Wrote: Nice, mine differs slightly:
Code:public static void dumpJar(List<ClassNode> classes, Manifest manifest, String absolutePath) {
try (JarOutputStream jos = new JarOutputStream(new FileOutputStream(new File(absolutePath)), manifest)) {
for (ClassNode cn : classes) {
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
jos.putNextEntry(new JarEntry(cn.name + ".class"));
cn.accept(writer);
jos.write(writer.toByteArray());
}
} catch (IOException e) {
e.printStackTrace();
}
}
Gotta have a manifest to make it runnable xD
Very true! Haha