project: update from 184 to 184 (#1675)
* 184 * checkstyle * project: fix exports.
This commit is contained in:
@@ -64,7 +64,7 @@ public class Deob
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(Deob.class);
|
||||
|
||||
public static final int OBFUSCATED_NAME_MAX_LEN = 2;
|
||||
public static final int OBFUSCATED_NAME_MAX_LEN = 3;
|
||||
private static final boolean CHECK_EXEC = false;
|
||||
|
||||
public static void main(String[] args) throws IOException
|
||||
@@ -152,7 +152,15 @@ public class Deob
|
||||
|
||||
public static boolean isObfuscated(String name)
|
||||
{
|
||||
return name.length() <= OBFUSCATED_NAME_MAX_LEN || name.startsWith("method") || name.startsWith("vmethod") || name.startsWith("field") || name.startsWith("class") || name.startsWith("__");
|
||||
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("__");
|
||||
}
|
||||
|
||||
private static void runMath(ClassGroup group)
|
||||
|
||||
@@ -48,7 +48,9 @@ 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++);
|
||||
}
|
||||
@@ -61,8 +63,10 @@ public class RenameUnique implements Deobfuscator
|
||||
for (ClassFile cf : group.getClasses())
|
||||
for (Field field : cf.getFields())
|
||||
{
|
||||
if (field.getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN && !field.getName().startsWith("__") || field.getName().equals(DeobAnnotations.getExportedName(field.getAnnotations())))
|
||||
if (!Deob.isObfuscated(field.getName()) || field.getName().equals(DeobAnnotations.getExportedName(field.getAnnotations())))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
map.map(field.getPoolField(), "field" + i++);
|
||||
}
|
||||
@@ -75,8 +79,10 @@ public class RenameUnique implements Deobfuscator
|
||||
for (ClassFile cf : group.getClasses())
|
||||
for (Method method : cf.getMethods())
|
||||
{
|
||||
if (method.getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN && !method.getName().startsWith("__") || method.getName().equals(DeobAnnotations.getExportedName(method.getAnnotations())))
|
||||
if (!Deob.isObfuscated(method.getName()) || method.getName().equals(DeobAnnotations.getExportedName(method.getAnnotations())))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
List<Method> virtualMethods = VirtualMethods.getVirtualMethods(method);
|
||||
assert !virtualMethods.isEmpty();
|
||||
|
||||
@@ -112,7 +112,9 @@ 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().getClazz().getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN
|
||||
|| ii.getMethod().getName().equals("run")
|
||||
|| ii.getMethod().getName().equals("add"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user