Revert "project: 184 (#1670)"

This reverts commit 42acd14658.
This commit is contained in:
Kyle
2019-09-28 17:11:53 +01:00
committed by GitHub
parent 42acd14658
commit b5c6468d19
341 changed files with 90740 additions and 90582 deletions

View File

@@ -64,7 +64,7 @@ public class Deob
{
private static final Logger logger = LoggerFactory.getLogger(Deob.class);
public static final int OBFUSCATED_NAME_MAX_LEN = 3;
public static final int OBFUSCATED_NAME_MAX_LEN = 2;
private static final boolean CHECK_EXEC = false;
public static void main(String[] args) throws IOException
@@ -152,15 +152,7 @@ public class Deob
public static boolean isObfuscated(String name)
{
if (name.length() <= OBFUSCATED_NAME_MAX_LEN)
{
return !name.equals("run") && !name.equals("add");
}
return name.startsWith("method")
|| name.startsWith("vmethod")
|| name.startsWith("field")
|| name.startsWith("class")
|| name.startsWith("__");
return name.length() <= OBFUSCATED_NAME_MAX_LEN || name.startsWith("method") || name.startsWith("vmethod") || name.startsWith("field") || name.startsWith("class") || name.startsWith("__");
}
private static void runMath(ClassGroup group)

View File

@@ -48,9 +48,7 @@ public class RenameUnique implements Deobfuscator
for (ClassFile cf : group.getClasses())
{
if (cf.getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN)
{
continue;
}
map.map(cf.getPoolClass(), "class" + i++);
}
@@ -63,10 +61,8 @@ public class RenameUnique implements Deobfuscator
for (ClassFile cf : group.getClasses())
for (Field field : cf.getFields())
{
if (!Deob.isObfuscated(field.getName()) || field.getName().equals(DeobAnnotations.getExportedName(field.getAnnotations())))
{
if (field.getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN && !field.getName().startsWith("__") || field.getName().equals(DeobAnnotations.getExportedName(field.getAnnotations())))
continue;
}
map.map(field.getPoolField(), "field" + i++);
}
@@ -79,10 +75,8 @@ public class RenameUnique implements Deobfuscator
for (ClassFile cf : group.getClasses())
for (Method method : cf.getMethods())
{
if (!Deob.isObfuscated(method.getName()) || method.getName().equals(DeobAnnotations.getExportedName(method.getAnnotations())))
{
if (method.getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN && !method.getName().startsWith("__") || method.getName().equals(DeobAnnotations.getExportedName(method.getAnnotations())))
continue;
}
List<Method> virtualMethods = VirtualMethods.getVirtualMethods(method);
assert !virtualMethods.isEmpty();

View File

@@ -112,9 +112,7 @@ public class RenameUniqueTest
InvokeInstruction ii = (InvokeInstruction) i;
Assert.assertTrue(ii.getMethod().getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN
|| ii.getMethod().getClazz().getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN
|| ii.getMethod().getName().equals("run")
|| ii.getMethod().getName().equals("add"));
|| ii.getMethod().getClazz().getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN);
}
}
}