Add interface support to EmptyClassTransformer

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 5 years ago
parent 9faa519e86
commit c03673a1e8
  1. 7
      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
}

Loading…
Cancel
Save