Move deobfuscation methods to their own files

This commit is contained in:
Adam
2015-06-13 14:24:04 -04:00
parent 3140a51f3f
commit 6cac8c1cc9
9 changed files with 385 additions and 284 deletions

View File

@@ -0,0 +1,34 @@
package info.sigterm.deob.deobfuscators;
import info.sigterm.deob.ClassFile;
import info.sigterm.deob.ClassGroup;
import info.sigterm.deob.Method;
import java.util.ArrayList;
public class UnusedMethods
{
public void run(ClassGroup group)
{
group.buildCallGraph();
int i = 0;
for (ClassFile cf : group.getClasses())
{
for (Method m : new ArrayList<>(cf.getMethods().getMethods()))
{
/* assume obfuscated names are <= 2 chars */
if (m.getName().length() > 2)
continue;
if (!m.isUsed())
{
cf.getMethods().removeMethod(m);
++i;
}
}
}
System.out.println("Removed " + i + " methods");
}
}