use of os.rs.paint.CanvasInjector in project OSJR by zeruth.
the class JarInjector method run.
public void run() {
classnodes = new CanvasInjector(classnodes).run();
try {
injectedJar = new File("./export/gamepack_injected.jar");
JarOutputStream jos = new JarOutputStream(new FileOutputStream(injectedJar));
for (ClassNode cn : classnodes.values()) {
ClassWriter cw = new ClassWriter(1);
cn.accept(cw);
JarEntry entry = new JarEntry(cn.name + ".class");
jos.putNextEntry(entry);
jos.write(cw.toByteArray());
jos.closeEntry();
}
jos.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations