Convert CanvasTransformer to Kotlin

master
Graham 5 years ago
parent b1582ce3a0
commit a2afcf341b
  1. 24
      deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.java
  2. 26
      deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.kt

@ -1,24 +0,0 @@
package dev.openrs2.deob.transform;
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.tree.ClassNode;
public final class CanvasTransformer extends Transformer {
@Override
public boolean transformClass(ClassPath classPath, Library library, ClassNode clazz) {
if (!"java/awt/Canvas".equals(clazz.superName)) {
return false;
}
if ((clazz.access & Opcodes.ACC_FINAL) == 0) {
return false;
}
clazz.interfaces.remove("java/awt/event/FocusListener");
return false;
}
}

@ -0,0 +1,26 @@
package dev.openrs2.deob.transform
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.tree.ClassNode
class CanvasTransformer : Transformer() {
public override fun transformClass(
classPath: ClassPath,
library: Library,
clazz: ClassNode
): Boolean {
if (clazz.superName != "java/awt/Canvas") {
return false
}
if (clazz.access and Opcodes.ACC_FINAL == 0) {
return false
}
clazz.interfaces.remove("java/awt/event/FocusListener")
return false
}
}
Loading…
Cancel
Save