Reduce method visibility in Transformers

bzip2
Graham 5 years ago
parent 11050ce735
commit 64b8ea5fe7
  1. 6
      deob/src/main/java/dev/openrs2/deob/transform/BitShiftTransformer.kt
  2. 2
      deob/src/main/java/dev/openrs2/deob/transform/CanvasTransformer.kt
  3. 6
      deob/src/main/java/dev/openrs2/deob/transform/ExceptionTracingTransformer.kt
  4. 2
      deob/src/main/java/dev/openrs2/deob/transform/FieldOrderTransformer.kt
  5. 6
      deob/src/main/java/dev/openrs2/deob/transform/OriginalNameTransformer.kt

@ -13,11 +13,11 @@ import org.objectweb.asm.tree.MethodNode
class BitShiftTransformer : Transformer() { class BitShiftTransformer : Transformer() {
private var simplified = 0 private var simplified = 0
public override fun preTransform(classPath: ClassPath) { override fun preTransform(classPath: ClassPath) {
simplified = 0 simplified = 0
} }
public override fun transformCode( override fun transformCode(
classPath: ClassPath, classPath: ClassPath,
library: Library, library: Library,
clazz: ClassNode, clazz: ClassNode,
@ -40,7 +40,7 @@ class BitShiftTransformer : Transformer() {
return false return false
} }
public override fun postTransform(classPath: ClassPath) { override fun postTransform(classPath: ClassPath) {
logger.info { "Simplified $simplified bit shifts" } logger.info { "Simplified $simplified bit shifts" }
} }

@ -7,7 +7,7 @@ import org.objectweb.asm.Opcodes
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode
class CanvasTransformer : Transformer() { class CanvasTransformer : Transformer() {
public override fun transformClass( override fun transformClass(
classPath: ClassPath, classPath: ClassPath,
library: Library, library: Library,
clazz: ClassNode clazz: ClassNode

@ -12,11 +12,11 @@ import org.objectweb.asm.tree.MethodNode
class ExceptionTracingTransformer : Transformer() { class ExceptionTracingTransformer : Transformer() {
private var tracingTryCatches = 0 private var tracingTryCatches = 0
public override fun preTransform(classPath: ClassPath) { override fun preTransform(classPath: ClassPath) {
tracingTryCatches = 0 tracingTryCatches = 0
} }
public override fun transformCode( override fun transformCode(
classPath: ClassPath, classPath: ClassPath,
library: Library, library: Library,
clazz: ClassNode, clazz: ClassNode,
@ -35,7 +35,7 @@ class ExceptionTracingTransformer : Transformer() {
return false return false
} }
public override fun postTransform(classPath: ClassPath) { override fun postTransform(classPath: ClassPath) {
logger.info { "Removed $tracingTryCatches tracing try/catch blocks" } logger.info { "Removed $tracingTryCatches tracing try/catch blocks" }
} }

@ -9,7 +9,7 @@ import org.objectweb.asm.tree.ClassNode
import org.objectweb.asm.tree.FieldInsnNode import org.objectweb.asm.tree.FieldInsnNode
class FieldOrderTransformer : Transformer() { class FieldOrderTransformer : Transformer() {
public override fun transformClass(classPath: ClassPath, library: Library, clazz: ClassNode): Boolean { override fun transformClass(classPath: ClassPath, library: Library, clazz: ClassNode): Boolean {
sortFields(clazz, CONSTRUCTOR, Opcodes.PUTFIELD) sortFields(clazz, CONSTRUCTOR, Opcodes.PUTFIELD)
sortFields(clazz, STATIC_CONSTRUCTOR, Opcodes.PUTSTATIC) sortFields(clazz, STATIC_CONSTRUCTOR, Opcodes.PUTSTATIC)
return false return false

@ -13,7 +13,7 @@ import org.objectweb.asm.tree.FieldNode
import org.objectweb.asm.tree.MethodNode import org.objectweb.asm.tree.MethodNode
class OriginalNameTransformer : Transformer() { class OriginalNameTransformer : Transformer() {
public override fun transformClass(classPath: ClassPath, library: Library, clazz: ClassNode): Boolean { override fun transformClass(classPath: ClassPath, library: Library, clazz: ClassNode): Boolean {
if (clazz.invisibleAnnotations == null) { if (clazz.invisibleAnnotations == null) {
clazz.invisibleAnnotations = mutableListOf() clazz.invisibleAnnotations = mutableListOf()
} }
@ -21,7 +21,7 @@ class OriginalNameTransformer : Transformer() {
return false return false
} }
public override fun transformField( override fun transformField(
classPath: ClassPath, classPath: ClassPath,
library: Library, library: Library,
clazz: ClassNode, clazz: ClassNode,
@ -34,7 +34,7 @@ class OriginalNameTransformer : Transformer() {
return false return false
} }
public override fun preTransformMethod( override fun preTransformMethod(
classPath: ClassPath, classPath: ClassPath,
library: Library, library: Library,
clazz: ClassNode, clazz: ClassNode,

Loading…
Cancel
Save