From a2afcf341b1531301eecb85cbfb2452fe1b6ea37 Mon Sep 17 00:00:00 2001 From: Graham Date: Mon, 23 Dec 2019 13:35:32 +0000 Subject: [PATCH] Convert CanvasTransformer to Kotlin --- .../deob/transform/CanvasTransformer.java | 24 ----------------- .../deob/transform/CanvasTransformer.kt | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+), 24 deletions(-) delete mode 100644 deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.java create mode 100644 deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.kt diff --git a/deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.java b/deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.java deleted file mode 100644 index f41d71c37b..0000000000 --- a/deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.java +++ /dev/null @@ -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; - } -} diff --git a/deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.kt new file mode 100644 index 0000000000..a6e18d5c3a --- /dev/null +++ b/deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.kt @@ -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 + } +}