Rename unique test

This commit is contained in:
Adam
2016-03-21 11:17:06 -04:00
parent 9830f4a339
commit e8a5eba8f4
5 changed files with 44 additions and 7 deletions

View File

@@ -150,7 +150,8 @@ public class InvokeStatic extends Instruction implements InvokeInstruction
return null; // not our class
net.runelite.asm.Method other = otherClass.findMethodDeepStatic(method.getNameAndType());
assert other != null;
if (other == null)
return null; // when regenerating the pool after renaming the method this can be null.
return other;
}

View File

@@ -34,7 +34,7 @@ class NonloadingClassWriter extends ClassWriter
if (c == c2)
return c.getName();
throw new RuntimeException("No common base");
return "java/lang/Object";
}
ClassFile found;

View File

@@ -1,10 +1,6 @@
package net.runelite.deob.deobfuscators;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.runelite.asm.ClassFile;
import net.runelite.asm.ClassGroup;

View File

@@ -16,7 +16,6 @@ import java.util.jar.Manifest;
import net.runelite.asm.ClassFile;
import net.runelite.asm.ClassGroup;
import net.runelite.asm.objectwebasm.AsmUtils;
import org.objectweb.asm.ClassReader;
public class JarUtil
{

View File

@@ -0,0 +1,41 @@
package net.runelite.deob.deobfuscators;
import java.io.File;
import java.io.IOException;
import net.runelite.asm.ClassGroup;
import net.runelite.deob.util.JarUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class RenameUniqueTest
{
private static final File GAMEPACK = new File(RenameUniqueTest.class.getResource("/gamepack_v16.jar").getFile());
@Rule
public TemporaryFolder folder = new TemporaryFolder();
private ClassGroup group;
@Before
public void before() throws IOException
{
group = JarUtil.loadJar(GAMEPACK);
}
@After
public void after() throws IOException
{
JarUtil.saveJar(group, folder.newFile());
}
@Test
public void testRun()
{
RenameUnique renameUnique = new RenameUnique();
renameUnique.run(group);
}
}