|
|
@ -1,6 +1,7 @@ |
|
|
|
package dev.openrs2.asm.transform; |
|
|
|
package dev.openrs2.asm.transform; |
|
|
|
|
|
|
|
|
|
|
|
import dev.openrs2.asm.classpath.ClassPath; |
|
|
|
import dev.openrs2.asm.classpath.ClassPath; |
|
|
|
|
|
|
|
import dev.openrs2.asm.classpath.Library; |
|
|
|
import org.objectweb.asm.Opcodes; |
|
|
|
import org.objectweb.asm.Opcodes; |
|
|
|
import org.objectweb.asm.tree.ClassNode; |
|
|
|
import org.objectweb.asm.tree.ClassNode; |
|
|
|
import org.objectweb.asm.tree.FieldNode; |
|
|
|
import org.objectweb.asm.tree.FieldNode; |
|
|
@ -18,17 +19,17 @@ public abstract class Transformer { |
|
|
|
prePass(classPath); |
|
|
|
prePass(classPath); |
|
|
|
for (var library : classPath.getLibraries()) { |
|
|
|
for (var library : classPath.getLibraries()) { |
|
|
|
for (var clazz : library) { |
|
|
|
for (var clazz : library) { |
|
|
|
changed |= transformClass(clazz); |
|
|
|
changed |= transformClass(classPath, library, clazz); |
|
|
|
|
|
|
|
|
|
|
|
for (var field : clazz.fields) { |
|
|
|
for (var field : clazz.fields) { |
|
|
|
changed |= transformField(clazz, field); |
|
|
|
changed |= transformField(classPath, library, clazz, field); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (var method : clazz.methods) { |
|
|
|
for (var method : clazz.methods) { |
|
|
|
changed |= transformMethod(clazz, method); |
|
|
|
changed |= transformMethod(classPath, library, clazz, method); |
|
|
|
|
|
|
|
|
|
|
|
if ((method.access & (Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT)) == 0) { |
|
|
|
if ((method.access & (Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT)) == 0) { |
|
|
|
changed |= transformCode(clazz, method); |
|
|
|
changed |= transformCode(classPath, library, clazz, method); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -47,19 +48,19 @@ public abstract class Transformer { |
|
|
|
/* empty */ |
|
|
|
/* empty */ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected boolean transformClass(ClassNode clazz) throws AnalyzerException { |
|
|
|
protected boolean transformClass(ClassPath classPath, Library library, ClassNode clazz) throws AnalyzerException { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected boolean transformField(ClassNode clazz, FieldNode field) throws AnalyzerException { |
|
|
|
protected boolean transformField(ClassPath classPath, Library library, ClassNode clazz, FieldNode field) throws AnalyzerException { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected boolean transformMethod(ClassNode clazz, MethodNode method) throws AnalyzerException { |
|
|
|
protected boolean transformMethod(ClassPath classPath, Library library, ClassNode clazz, MethodNode method) throws AnalyzerException { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected boolean transformCode(ClassNode clazz, MethodNode method) throws AnalyzerException { |
|
|
|
protected boolean transformCode(ClassPath classPath, Library library, ClassNode clazz, MethodNode method) throws AnalyzerException { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|