From cc1a1adde759c32fff9f87a2dc1fc4e58fa91ae6 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 3 Aug 2019 14:45:01 +0100 Subject: [PATCH] Add seperate jar for the jaggl DRI classes --- .../main/java/dev/openrs2/decompiler/Decompiler.java | 3 +++ deob/src/main/java/dev/openrs2/deob/Deobfuscator.java | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/decompiler/src/main/java/dev/openrs2/decompiler/Decompiler.java b/decompiler/src/main/java/dev/openrs2/decompiler/Decompiler.java index 616585f8..5642764f 100644 --- a/decompiler/src/main/java/dev/openrs2/decompiler/Decompiler.java +++ b/decompiler/src/main/java/dev/openrs2/decompiler/Decompiler.java @@ -24,6 +24,8 @@ public final class Decompiler implements Closeable { archive = "client"; } else if (archive.equals("jaggl")) { archive = "gl"; + } else if (archive.equals("jaggl_dri")) { + archive = "gl-dri"; } return Paths.get("nonfree").resolve(archive).resolve("src/main/java"); } @@ -33,6 +35,7 @@ public final class Decompiler implements Closeable { var sources = List.of( deobOutput.resolve("runescape_gl.jar"), deobOutput.resolve("jaggl.jar"), + deobOutput.resolve("jaggl_dri.jar"), deobOutput.resolve("loader_gl.jar"), deobOutput.resolve("signlink_gl.jar"), deobOutput.resolve("unpack_gl.jar"), diff --git a/deob/src/main/java/dev/openrs2/deob/Deobfuscator.java b/deob/src/main/java/dev/openrs2/deob/Deobfuscator.java index f8694e52..0acce02e 100644 --- a/deob/src/main/java/dev/openrs2/deob/Deobfuscator.java +++ b/deob/src/main/java/dev/openrs2/deob/Deobfuscator.java @@ -82,6 +82,13 @@ public final class Deobfuscator { var glUnpack = new Library(); glUnpack.add(glLoader.remove("unpack")); + /* move DRI classes out of jaggl (so we can place javah-generated headers in a separate directory) */ + logger.info("Moving DRI classes from jaggl to jaggl_dri"); + var glDri = new Library(); + glDri.add(gl.remove("com/sun/opengl/impl/x11/DRIHack")); + glDri.add(gl.remove("com/sun/opengl/impl/x11/DRIHack$1")); + glDri.add(gl.remove("jaggl/X11/dri")); + /* prefix remaining loader/unpacker classes (to avoid conflicts when we rename in the same classpath as the client) */ logger.info("Prefixing loader and unpacker class names"); ClassNamePrefixer.addPrefix(loader, "loader_"); @@ -92,7 +99,7 @@ public final class Deobfuscator { /* bundle libraries together into a common classpath */ var runtime = ClassLoader.getPlatformClassLoader(); var classPath = new ClassPath(runtime, List.of(), List.of(client, loader, signLink, unpack, unpacker)); - var glClassPath = new ClassPath(runtime, List.of(gl), List.of(glClient, glLoader, glSignLink, glUnpack, glUnpacker)); + var glClassPath = new ClassPath(runtime, List.of(gl, glDri), List.of(glClient, glLoader, glSignLink, glUnpack, glUnpacker)); var unsignedClassPath = new ClassPath(runtime, List.of(), List.of(unsignedClient)); /* deobfuscate */ @@ -150,6 +157,7 @@ public final class Deobfuscator { unpacker.writeJar(output.resolve("unpacker.jar"), remapper); gl.writeJar(output.resolve("jaggl.jar"), glRemapper); + glDri.writeJar(output.resolve("jaggl_dri.jar"), glRemapper); glClient.writeJar(output.resolve("runescape_gl.jar"), glRemapper); glLoader.writeJar(output.resolve("loader_gl.jar"), glRemapper); glSignLink.writeJar(output.resolve("signlink_gl.jar"), glRemapper);