From c03673a1e8aebed3b73840f5b31f7bc3366a1d1b Mon Sep 17 00:00:00 2001 From: Graham Date: Mon, 1 Jun 2020 22:12:56 +0100 Subject: [PATCH] Add interface support to EmptyClassTransformer Signed-off-by: Graham --- .../dev/openrs2/deob/transform/EmptyClassTransformer.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deob/src/main/java/dev/openrs2/deob/transform/EmptyClassTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/EmptyClassTransformer.kt index 4a40b524..7543e8e7 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/EmptyClassTransformer.kt +++ b/deob/src/main/java/dev/openrs2/deob/transform/EmptyClassTransformer.kt @@ -4,7 +4,6 @@ import com.github.michaelbull.logging.InlineLogger import dev.openrs2.asm.classpath.ClassPath import dev.openrs2.asm.classpath.Library import dev.openrs2.asm.transform.Transformer -import org.objectweb.asm.Opcodes import org.objectweb.asm.Type import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.FieldNode @@ -30,7 +29,7 @@ class EmptyClassTransformer : Transformer() { } override fun transformClass(classPath: ClassPath, library: Library, clazz: ClassNode): Boolean { - if (clazz.access and Opcodes.ACC_INTERFACE == 0 && clazz.fields.isEmpty() && clazz.methods.isEmpty()) { + if (clazz.fields.isEmpty() && clazz.methods.isEmpty()) { emptyClasses.add(clazz.name) } @@ -38,6 +37,10 @@ class EmptyClassTransformer : Transformer() { referencedClasses.add(clazz.superName) } + for (superInterface in clazz.interfaces) { + referencedClasses.add(superInterface) + } + return false }