Rename getNode() to getClassNode()

Signed-off-by: Graham <gpe@openrs2.dev>
Graham 5 years ago
parent ff96cf70a2
commit 49a90c1cf5
  1. 2
      asm/src/main/java/dev/openrs2/asm/classpath/ClassPath.kt
  2. 2
      deob/src/main/java/dev/openrs2/deob/transform/ConstantArgTransformer.kt
  3. 2
      deob/src/main/java/dev/openrs2/deob/transform/CounterTransformer.kt
  4. 2
      deob/src/main/java/dev/openrs2/deob/transform/ResetTransformer.kt

@ -73,7 +73,7 @@ class ClassPath(
return@computeIfAbsent ReflectionClassMetadata(this, clazz) return@computeIfAbsent ReflectionClassMetadata(this, clazz)
} }
fun getNode(name: String): ClassNode? { fun getClassNode(name: String): ClassNode? {
for (library in libraries) { for (library in libraries) {
val clazz = library[name] val clazz = library[name]
if (clazz != null) { if (clazz != null) {

@ -95,7 +95,7 @@ class ConstantArgTransformer : Transformer() {
private fun analyzeMethod(classPath: ClassPath, ref: MemberRef) { private fun analyzeMethod(classPath: ClassPath, ref: MemberRef) {
// find ClassNode/MethodNode // find ClassNode/MethodNode
val owner = classPath.getNode(ref.owner) ?: return val owner = classPath.getClassNode(ref.owner) ?: return
val originalMethod = owner.methods.singleOrNull { it.name == ref.name && it.desc == ref.desc } ?: return val originalMethod = owner.methods.singleOrNull { it.name == ref.name && it.desc == ref.desc } ?: return
if (!originalMethod.hasCode()) { if (!originalMethod.hasCode()) {
return return

@ -77,7 +77,7 @@ class CounterTransformer : Transformer() {
continue continue
} }
val owner = classPath.getNode(counter.owner)!! val owner = classPath.getClassNode(counter.owner)!!
owner.fields.removeIf { it.name == counter.name && it.desc == counter.desc } owner.fields.removeIf { it.name == counter.name && it.desc == counter.desc }
counters.add(counter) counters.add(counter)
} }

@ -33,7 +33,7 @@ class ResetTransformer : Transformer() {
val masterReset = findMasterReset(method) ?: continue val masterReset = findMasterReset(method) ?: continue
logger.info { "Identified master reset method $masterReset" } logger.info { "Identified master reset method $masterReset" }
val resetClass = classPath.getNode("client")!! val resetClass = classPath.getClassNode("client")!!
val resetMethod = resetClass.methods.first { val resetMethod = resetClass.methods.first {
it.name == masterReset.name && it.desc == masterReset.desc it.name == masterReset.name && it.desc == masterReset.desc
} }

Loading…
Cancel
Save