diff --git a/asm/src/main/java/dev/openrs2/asm/transform/Transformer.kt b/asm/src/main/java/dev/openrs2/asm/transform/Transformer.kt index 7c81379a..68466113 100644 --- a/asm/src/main/java/dev/openrs2/asm/transform/Transformer.kt +++ b/asm/src/main/java/dev/openrs2/asm/transform/Transformer.kt @@ -13,9 +13,8 @@ abstract class Transformer { var changed: Boolean do { - changed = false + changed = prePass(classPath) - prePass(classPath) for (library in classPath.libraries) { for (clazz in library) { changed = changed or transformClass(classPath, library, clazz) @@ -35,7 +34,8 @@ abstract class Transformer { } } } - postPass(classPath) + + changed = changed or postPass(classPath) } while (changed) postTransform(classPath) @@ -45,8 +45,8 @@ abstract class Transformer { // empty } - protected open fun prePass(classPath: ClassPath) { - // empty + protected open fun prePass(classPath: ClassPath): Boolean { + return false } protected open fun transformClass(classPath: ClassPath, library: Library, clazz: ClassNode): Boolean { @@ -89,8 +89,8 @@ abstract class Transformer { return false } - protected open fun postPass(classPath: ClassPath) { - // empty + protected open fun postPass(classPath: ClassPath): Boolean { + return false } protected open fun postTransform(classPath: ClassPath) { diff --git a/deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt index 695a9c1a..110257a4 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt +++ b/deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt @@ -149,9 +149,10 @@ class DummyArgTransformer : Transformer() { constantsInlined = 0 } - override fun prePass(classPath: ClassPath) { + override fun prePass(classPath: ClassPath): Boolean { argValues.clear() conditionalCalls.clear() + return false } override fun transformCode( @@ -327,7 +328,7 @@ class DummyArgTransformer : Transformer() { return changed } - override fun postPass(classPath: ClassPath) { + override fun postPass(classPath: ClassPath): Boolean { for (method in inheritedMethodSets) { val args = (Type.getArgumentsAndReturnSizes(method.first().desc) shr 2) - 1 @@ -348,6 +349,8 @@ class DummyArgTransformer : Transformer() { constArgs[method] = parameters } } + + return false } override fun postTransform(classPath: ClassPath) {