Rename unique first
This commit is contained in:
@@ -2,6 +2,7 @@ package info.sigterm.deob.deobfuscators;
|
||||
|
||||
import info.sigterm.deob.ClassFile;
|
||||
import info.sigterm.deob.ClassGroup;
|
||||
import info.sigterm.deob.Deob;
|
||||
import info.sigterm.deob.Deobfuscator;
|
||||
import info.sigterm.deob.Method;
|
||||
import info.sigterm.deob.execution.Execution;
|
||||
@@ -24,9 +25,7 @@ public class UnusedMethods implements Deobfuscator
|
||||
{
|
||||
for (Method m : new ArrayList<>(cf.getMethods().getMethods()))
|
||||
{
|
||||
// assume obfuscated names are <= 2 chars
|
||||
// constructors can be unused, too
|
||||
if (m.getName().length() > 2 && !m.getName().equals("<init>"))
|
||||
if (!Deob.isObfuscated(m.getName()))
|
||||
continue;
|
||||
|
||||
if (!execution.methods.contains(m))
|
||||
|
||||
@@ -2,6 +2,7 @@ package info.sigterm.deob.deobfuscators;
|
||||
|
||||
import info.sigterm.deob.ClassFile;
|
||||
import info.sigterm.deob.ClassGroup;
|
||||
import info.sigterm.deob.Deob;
|
||||
import info.sigterm.deob.Deobfuscator;
|
||||
import info.sigterm.deob.Method;
|
||||
import info.sigterm.deob.attributes.Code;
|
||||
@@ -206,7 +207,7 @@ public class UnusedParameters implements Deobfuscator
|
||||
{
|
||||
for (Method m : cf.getMethods().getMethods())
|
||||
{
|
||||
if (done.contains(m) || m.getName().length() > 2) // ctors not uniquely renamed. overriding jre methods can't just remove a parameter
|
||||
if (done.contains(m) || !Deob.isObfuscated(m.getName()))
|
||||
continue;
|
||||
|
||||
int offset = m.isStatic() ? 0 : 1;
|
||||
|
||||
Reference in New Issue
Block a user