Fixes to unique rename, just use getMethods() instead of comparing names

This commit is contained in:
Adam
2015-07-11 13:34:32 -04:00
parent e263694eac
commit 3fbb69e102
6 changed files with 24 additions and 13 deletions

View File

@@ -180,7 +180,8 @@ public class InvokeInterface extends Instruction implements InvokeInstruction
@Override
public void renameMethod(info.sigterm.deob.Method m, String name)
{
if (method.getNameAndType().equals(m.getNameAndType()) && method.getClassEntry().getName().equals(m.getMethods().getClassFile().getName()))
method = new InterfaceMethod(method.getClassEntry(), new NameAndType(name, method.getNameAndType().getDescriptor()));
for (info.sigterm.deob.Method m2 : getMethods())
if (m2.equals(m))
method = new InterfaceMethod(method.getClassEntry(), new NameAndType(name, method.getNameAndType().getDescriptor()));
}
}

View File

@@ -52,6 +52,7 @@ public class InvokeSpecial extends Instruction implements InvokeInstruction
return new ArrayList<>(); // not our class
info.sigterm.deob.Method other = otherClass.findMethodDeep(method.getNameAndType());
assert other != null;
List<info.sigterm.deob.Method> list = new ArrayList<>();
list.add(other);
@@ -172,7 +173,8 @@ public class InvokeSpecial extends Instruction implements InvokeInstruction
@Override
public void renameMethod(info.sigterm.deob.Method m, String name)
{
if (method.getNameAndType().equals(m.getNameAndType()) && method.getClassEntry().getName().equals(m.getMethods().getClassFile().getName()))
method = new Method(method.getClassEntry(), new NameAndType(name, method.getNameAndType().getDescriptor()));
for (info.sigterm.deob.Method m2 : getMethods())
if (m2.equals(m))
method = new Method(method.getClassEntry(), new NameAndType(name, method.getNameAndType().getDescriptor()));
}
}

View File

@@ -52,6 +52,7 @@ public class InvokeStatic extends Instruction implements InvokeInstruction
return new ArrayList<>(); // not our class
info.sigterm.deob.Method other = otherClass.findMethodDeep(method.getNameAndType());
assert other != null;
List<info.sigterm.deob.Method> list = new ArrayList<>();
list.add(other);
@@ -169,7 +170,14 @@ public class InvokeStatic extends Instruction implements InvokeInstruction
@Override
public void renameMethod(info.sigterm.deob.Method m, String name)
{
if (method.getNameAndType().equals(m.getNameAndType()) && method.getClassEntry().getName().equals(m.getMethods().getClassFile().getName()))
ClassGroup group = this.getInstructions().getCode().getAttributes().getClassFile().getGroup();
ClassFile otherClass = group.findClass(method.getClassEntry().getName());
if (otherClass == null)
return; // not our class
info.sigterm.deob.Method other = otherClass.findMethodDeep(method.getNameAndType());
if (other.equals(m))
method = new Method(method.getClassEntry(), new NameAndType(name, method.getNameAndType().getDescriptor()));
}
}

View File

@@ -179,7 +179,8 @@ public class InvokeVirtual extends Instruction implements InvokeInstruction
@Override
public void renameMethod(info.sigterm.deob.Method m, String name)
{
if (method.getNameAndType().equals(m.getNameAndType()) && method.getClassEntry().getName().equals(m.getMethods().getClassFile().getName()))
method = new Method(method.getClassEntry(), new NameAndType(name, method.getNameAndType().getDescriptor()));
for (info.sigterm.deob.Method m2 : getMethods())
if (m2.equals(m))
method = new Method(method.getClassEntry(), new NameAndType(name, method.getNameAndType().getDescriptor()));
}
}