Remove FocusListener from class that claims to implement it but doesn't

bzip2
Graham 5 years ago
parent cdf7ea435e
commit ded582dd06
  1. 4
      deob/src/main/java/dev/openrs2/deob/Deobfuscator.java
  2. 20
      deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.java

@ -13,6 +13,7 @@ import dev.openrs2.asm.Library;
import dev.openrs2.asm.Transformer; import dev.openrs2.asm.Transformer;
import dev.openrs2.deob.classpath.ClassPath; import dev.openrs2.deob.classpath.ClassPath;
import dev.openrs2.deob.classpath.TypedRemapper; import dev.openrs2.deob.classpath.TypedRemapper;
import dev.openrs2.deob.transform.CanvasTransformer;
import dev.openrs2.deob.transform.ClassForNameTransformer; import dev.openrs2.deob.transform.ClassForNameTransformer;
import dev.openrs2.deob.transform.ExceptionTracingTransformer; import dev.openrs2.deob.transform.ExceptionTracingTransformer;
import dev.openrs2.deob.transform.OpaquePredicateTransformer; import dev.openrs2.deob.transform.OpaquePredicateTransformer;
@ -25,7 +26,8 @@ public final class Deobfuscator {
private static final List<Transformer> TRANSFORMERS = List.of( private static final List<Transformer> TRANSFORMERS = List.of(
new OpaquePredicateTransformer(), new OpaquePredicateTransformer(),
new ExceptionTracingTransformer() new ExceptionTracingTransformer(),
new CanvasTransformer()
); );
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {

@ -0,0 +1,20 @@
package dev.openrs2.deob.transform;
import dev.openrs2.asm.Transformer;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
public final class CanvasTransformer extends Transformer {
@Override
public void transformClass(ClassNode clazz) {
if (!"java/awt/Canvas".equals(clazz.superName)) {
return;
}
if ((clazz.access & Opcodes.ACC_FINAL) == 0) {
return;
}
clazz.interfaces.remove("java/awt/event/FocusListener");
}
}
Loading…
Cancel
Save