Remove unintentional static imports

Some of these method names only make sense when accompanied with the
class name. I think most of these were mistakes in the Java -> Kotlin
port.

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 5 years ago
parent 3c051fe8c1
commit 76f940e734
  1. 29
      deob/src/main/java/dev/openrs2/deob/Deobfuscator.kt
  2. 5
      deob/src/main/java/dev/openrs2/deob/analysis/IntBranch.kt

@ -3,11 +3,8 @@ package dev.openrs2.deob
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.classpath.ClassPath
import dev.openrs2.asm.classpath.Library import dev.openrs2.asm.classpath.Library
import dev.openrs2.asm.classpath.Library.Companion.readJar
import dev.openrs2.asm.classpath.Library.Companion.readPack
import dev.openrs2.asm.transform.Transformer import dev.openrs2.asm.transform.Transformer
import dev.openrs2.deob.SignedClassUtils.move import dev.openrs2.deob.remap.PrefixRemapper
import dev.openrs2.deob.remap.PrefixRemapper.create
import java.nio.file.Files import java.nio.file.Files
import java.nio.file.Path import java.nio.file.Path
import javax.inject.Inject import javax.inject.Inject
@ -20,13 +17,13 @@ class Deobfuscator @Inject constructor(
fun run(input: Path, output: Path) { fun run(input: Path, output: Path) {
// read input jars/packs // read input jars/packs
logger.info { "Reading input jars" } logger.info { "Reading input jars" }
val unpackClass = readJar(input.resolve("unpackclass.pack")) val unpackClass = Library.readJar(input.resolve("unpackclass.pack"))
val glUnpackClass = Library(unpackClass) val glUnpackClass = Library(unpackClass)
val loader = readJar(input.resolve("loader.jar")) val loader = Library.readJar(input.resolve("loader.jar"))
val glLoader = readJar(input.resolve("loader_gl.jar")) val glLoader = Library.readJar(input.resolve("loader_gl.jar"))
val gl = readPack(input.resolve("jaggl.pack200")) val gl = Library.readPack(input.resolve("jaggl.pack200"))
val client = readJar(input.resolve("runescape.jar")) val client = Library.readJar(input.resolve("runescape.jar"))
val glClient = readPack(input.resolve("runescape_gl.pack200")) val glClient = Library.readPack(input.resolve("runescape_gl.pack200"))
// TODO(gpe): it'd be nice to have separate signlink.jar and // TODO(gpe): it'd be nice to have separate signlink.jar and
// signlink-unsigned.jar files so we don't (effectively) deobfuscate // signlink-unsigned.jar files so we don't (effectively) deobfuscate
@ -37,11 +34,11 @@ class Deobfuscator @Inject constructor(
// overwrite client's classes with signed classes from the loader // overwrite client's classes with signed classes from the loader
logger.info { "Moving signed classes from loader" } logger.info { "Moving signed classes from loader" }
val signLink = Library() val signLink = Library()
move(loader, client, signLink) SignedClassUtils.move(loader, client, signLink)
logger.info { "Moving signed classes from loader_gl" } logger.info { "Moving signed classes from loader_gl" }
val glSignLink = Library() val glSignLink = Library()
move(glLoader, glClient, glSignLink) SignedClassUtils.move(glLoader, glClient, glSignLink)
// move unpack class out of the loader (so the unpacker and loader can both depend on it) // move unpack class out of the loader (so the unpacker and loader can both depend on it)
logger.info { "Moving unpack from loader to unpack" } logger.info { "Moving unpack from loader to unpack" }
@ -54,10 +51,10 @@ class Deobfuscator @Inject constructor(
// prefix remaining loader/unpacker classes (to avoid conflicts when we rename in the same classpath as the client) // prefix remaining loader/unpacker classes (to avoid conflicts when we rename in the same classpath as the client)
logger.info { "Prefixing loader and unpackclass class names" } logger.info { "Prefixing loader and unpackclass class names" }
loader.remap(create(loader, "loader_")) loader.remap(PrefixRemapper.create(loader, "loader_"))
glLoader.remap(create(glLoader, "loader_")) glLoader.remap(PrefixRemapper.create(glLoader, "loader_"))
unpackClass.remap(create(unpackClass, "unpackclass_")) unpackClass.remap(PrefixRemapper.create(unpackClass, "unpackclass_"))
glUnpackClass.remap(create(glUnpackClass, "unpackclass_")) glUnpackClass.remap(PrefixRemapper.create(glUnpackClass, "unpackclass_"))
// bundle libraries together into a common classpath // bundle libraries together into a common classpath
val runtime = ClassLoader.getPlatformClassLoader() val runtime = ClassLoader.getPlatformClassLoader()

@ -1,6 +1,5 @@
package dev.openrs2.deob.analysis package dev.openrs2.deob.analysis
import dev.openrs2.deob.analysis.IntBranchResult.Companion.fromTakenNotTaken
import org.objectweb.asm.Opcodes.IFEQ import org.objectweb.asm.Opcodes.IFEQ
import org.objectweb.asm.Opcodes.IFGE import org.objectweb.asm.Opcodes.IFGE
import org.objectweb.asm.Opcodes.IFGT import org.objectweb.asm.Opcodes.IFGT
@ -29,7 +28,7 @@ object IntBranch {
} }
} }
return fromTakenNotTaken(taken, notTaken) return IntBranchResult.fromTakenNotTaken(taken, notTaken)
} }
private fun evaluateUnary(opcode: Int, value: Int): Boolean { private fun evaluateUnary(opcode: Int, value: Int): Boolean {
@ -61,7 +60,7 @@ object IntBranch {
} }
} }
return fromTakenNotTaken(taken, notTaken) return IntBranchResult.fromTakenNotTaken(taken, notTaken)
} }
private fun evaluateBinary(opcode: Int, value1: Int, value2: Int): Boolean { private fun evaluateBinary(opcode: Int, value1: Int, value2: Int): Boolean {

Loading…
Cancel
Save