From 4ec4ef84c2dd88ca2ce19d53439e26030a73d2b0 Mon Sep 17 00:00:00 2001 From: Graham Date: Thu, 9 Apr 2020 22:01:21 +0100 Subject: [PATCH] Rename unpacker.jar to unpackclass.jar This is more consistent with the original jar name (unpackclass.pack). Signed-off-by: Graham --- .../dev/openrs2/decompiler/DecompileCommand.kt | 2 +- .../openrs2/deob/ast/DeobfuscateAstCommand.kt | 2 +- .../main/java/dev/openrs2/deob/Deobfuscator.kt | 18 +++++++++--------- .../dev/openrs2/deob/remap/TypedRemapper.kt | 2 +- settings.gradle.kts | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/decompiler/src/main/java/dev/openrs2/decompiler/DecompileCommand.kt b/decompiler/src/main/java/dev/openrs2/decompiler/DecompileCommand.kt index 90d69ed907..d9141a4cb5 100644 --- a/decompiler/src/main/java/dev/openrs2/decompiler/DecompileCommand.kt +++ b/decompiler/src/main/java/dev/openrs2/decompiler/DecompileCommand.kt @@ -15,7 +15,7 @@ class DecompileCommand : CliktCommand(name = "decompile") { deobOutput.resolve("loader_gl.jar"), deobOutput.resolve("signlink_gl.jar"), deobOutput.resolve("unpack_gl.jar"), - deobOutput.resolve("unpacker_gl.jar") + deobOutput.resolve("unpackclass_gl.jar") ) Decompiler(sources, ::getDestination).use { it.run() diff --git a/deob-ast/src/main/java/dev/openrs2/deob/ast/DeobfuscateAstCommand.kt b/deob-ast/src/main/java/dev/openrs2/deob/ast/DeobfuscateAstCommand.kt index abacdc761d..c143836165 100644 --- a/deob-ast/src/main/java/dev/openrs2/deob/ast/DeobfuscateAstCommand.kt +++ b/deob-ast/src/main/java/dev/openrs2/deob/ast/DeobfuscateAstCommand.kt @@ -14,7 +14,7 @@ class DeobfuscateAstCommand : CliktCommand(name = "deob-ast") { Paths.get("nonfree/loader/src/main/java"), Paths.get("nonfree/signlink/src/main/java"), Paths.get("nonfree/unpack/src/main/java"), - Paths.get("nonfree/unpacker/src/main/java") + Paths.get("nonfree/unpackclass/src/main/java") ) ) deobfuscator.run() diff --git a/deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt b/deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt index 8dd2973e80..e9f6f27439 100644 --- a/deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt +++ b/deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt @@ -43,8 +43,8 @@ class Deobfuscator(private val input: Path, private val output: Path) { fun run() { // read input jars/packs logger.info { "Reading input jars" } - val unpacker = readJar(input.resolve("unpackclass.pack")) - val glUnpacker = Library(unpacker) + val unpackClass = readJar(input.resolve("unpackclass.pack")) + val glUnpackClass = Library(unpackClass) val loader = readJar(input.resolve("loader.jar")) val glLoader = readJar(input.resolve("loader_gl.jar")) val gl = readPack(input.resolve("jaggl.pack200")) @@ -76,23 +76,23 @@ class Deobfuscator(private val input: Path, private val output: Path) { glUnpack.add(glLoader.remove("unpack")!!) // 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" } + logger.info { "Prefixing loader and unpackclass class names" } loader.remap(create(loader, "loader_")) glLoader.remap(create(glLoader, "loader_")) - unpacker.remap(create(unpacker, "unpacker_")) - glUnpacker.remap(create(glUnpacker, "unpacker_")) + unpackClass.remap(create(unpackClass, "unpackclass_")) + glUnpackClass.remap(create(glUnpackClass, "unpackclass_")) // bundle libraries together into a common classpath val runtime = ClassLoader.getPlatformClassLoader() val classPath = ClassPath( runtime, dependencies = emptyList(), - libraries = listOf(client, loader, signLink, unpack, unpacker) + libraries = listOf(client, loader, signLink, unpack, unpackClass) ) val glClassPath = ClassPath( runtime, dependencies = listOf(gl), - libraries = listOf(glClient, glLoader, glSignLink, glUnpack, glUnpacker) + libraries = listOf(glClient, glLoader, glSignLink, glUnpack, glUnpackClass) ) val unsignedClassPath = ClassPath( runtime, @@ -128,14 +128,14 @@ class Deobfuscator(private val input: Path, private val output: Path) { loader.writeJar(classPath, output.resolve("loader.jar")) signLink.writeJar(classPath, output.resolve("signlink.jar")) unpack.writeJar(classPath, output.resolve("unpack.jar")) - unpacker.writeJar(classPath, output.resolve("unpacker.jar")) + unpackClass.writeJar(classPath, output.resolve("unpackclass.jar")) gl.writeJar(glClassPath, output.resolve("jaggl.jar")) glClient.writeJar(glClassPath, output.resolve("runescape_gl.jar")) glLoader.writeJar(glClassPath, output.resolve("loader_gl.jar")) glSignLink.writeJar(glClassPath, output.resolve("signlink_gl.jar")) glUnpack.writeJar(glClassPath, output.resolve("unpack_gl.jar")) - glUnpacker.writeJar(glClassPath, output.resolve("unpacker_gl.jar")) + glUnpackClass.writeJar(glClassPath, output.resolve("unpackclass_gl.jar")) unsignedClient.writeJar(unsignedClassPath, output.resolve("runescape_unsigned.jar")) } diff --git a/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt b/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt index c8649c686b..d7ebd71ae9 100644 --- a/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt +++ b/deob/src/main/java/dev/openrs2/deob/remap/TypedRemapper.kt @@ -79,7 +79,7 @@ class TypedRemapper private constructor( } private fun verifyMapping(name: String, mappedName: String) { - val originalName = name.replace("^(?:loader|unpacker)_".toRegex(), "") + val originalName = name.replace("^(?:loader|unpackclass)_".toRegex(), "") if (originalName.length > MAX_OBFUSCATED_NAME_LEN && originalName != mappedName) { logger.warn { "Remapping probably unobfuscated name $originalName to $mappedName" } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 4a80ea63a9..368773dad1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -27,6 +27,6 @@ if (Files.exists(rootProject.projectDir.toPath().resolve("nonfree/build.gradle.k "nonfree:loader", "nonfree:signlink", "nonfree:unpack", - "nonfree:unpacker" + "nonfree:unpackclass" ) }