Move remapping into a RemapTransformer

This allows us to run the remapping immediately between
OriginalNameTransformer and DummyArgTransformer.
bzip2
Graham 5 years ago
parent 46f908bdb0
commit 557f2fb504
  1. 9
      deob/src/main/java/dev/openrs2/deob/Deobfuscator.java
  2. 12
      deob/src/main/java/dev/openrs2/deob/transform/RemapTransformer.java

@ -12,7 +12,6 @@ import dev.openrs2.asm.transform.Transformer;
import dev.openrs2.bundler.transform.HostCheckTransformer;
import dev.openrs2.bundler.transform.RightClickTransformer;
import dev.openrs2.deob.remap.PrefixRemapper;
import dev.openrs2.deob.remap.TypedRemapper;
import dev.openrs2.deob.transform.BitShiftTransformer;
import dev.openrs2.deob.transform.BitwiseOpTransformer;
import dev.openrs2.deob.transform.CanvasTransformer;
@ -23,6 +22,7 @@ import dev.openrs2.deob.transform.ExceptionTracingTransformer;
import dev.openrs2.deob.transform.FieldOrderTransformer;
import dev.openrs2.deob.transform.OpaquePredicateTransformer;
import dev.openrs2.deob.transform.OriginalNameTransformer;
import dev.openrs2.deob.transform.RemapTransformer;
import org.objectweb.asm.tree.analysis.AnalyzerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -41,6 +41,7 @@ public final class Deobfuscator {
new CanvasTransformer(),
new FieldOrderTransformer(),
new BitwiseOpTransformer(),
new RemapTransformer(),
new DummyArgTransformer(),
new DummyLocalTransformer()
);
@ -131,12 +132,6 @@ public final class Deobfuscator {
transformer.transform(unsignedClassPath);
}
/* remap all class, method and field names */
logger.info("Remapping");
classPath.remap(TypedRemapper.create(classPath));
glClassPath.remap(TypedRemapper.create(glClassPath));
unsignedClassPath.remap(TypedRemapper.create(unsignedClassPath));
/* write output jars */
logger.info("Writing output jars");

@ -0,0 +1,12 @@
package dev.openrs2.deob.transform;
import dev.openrs2.asm.classpath.ClassPath;
import dev.openrs2.asm.transform.Transformer;
import dev.openrs2.deob.remap.TypedRemapper;
public final class RemapTransformer extends Transformer {
@Override
protected void preTransform(ClassPath classPath) {
classPath.remap(TypedRemapper.create(classPath));
}
}
Loading…
Cancel
Save