use of net.runelite.deob.deobfuscators.UnreachedCode in project runelite by runelite.
the class Deob method main.
public static void main(String[] args) throws IOException {
if (args == null || args.length < 2) {
System.err.println("Syntax: input_jar output_jar");
System.exit(-1);
}
logger.info("Deobfuscator revision {}", DeobProperties.getRevision());
Stopwatch stopwatch = Stopwatch.createStarted();
ClassGroup group = JarUtil.loadJar(new File(args[0]));
// remove except RuntimeException
run(group, new RuntimeExceptions());
run(group, new ControlFlowDeobfuscator());
run(group, new RenameUnique());
// remove unused methods - this leaves Code with no instructions,
// which is not valid, so unused methods is run after
run(group, new UnreachedCode());
run(group, new UnusedMethods());
// remove illegal state exceptions, frees up some parameters
run(group, new IllegalStateExceptions());
// remove constant logically dead parameters
run(group, new ConstantParameter());
// remove unhit blocks
run(group, new UnreachedCode());
run(group, new UnusedMethods());
// remove unused parameters
run(group, new UnusedParameters());
// remove unused fields
run(group, new UnusedFields());
run(group, new FieldInliner());
// order uses class name order for sorting fields/methods,
// so run it before removing classes below
run(group, new Order());
run(group, new UnusedClass());
runMath(group);
run(group, new ExprArgOrder());
run(group, new Lvt());
run(group, new CastNull());
run(group, new EnumDeobfuscator());
new OpcodesTransformer().transform(group);
// run(group, new PacketHandlerOrder());
// run(group, new PacketWriteDeobfuscator());
run(group, new MenuActionDeobfuscator());
new GetPathTransformer().transform(group);
new ClientErrorTransformer().transform(group);
new ReflectionTransformer().transform(group);
new MaxMemoryTransformer().transform(group);
// new RuneliteBufferTransformer().transform(group);
JarUtil.saveJar(group, new File(args[1]));
stopwatch.stop();
logger.info("Done in {}", stopwatch);
}
Aggregations