Constant parameter test, kind of slow though, 46s.
This commit is contained in:
@@ -491,6 +491,9 @@ public class ConstantParameter implements Deobfuscator
|
|||||||
for (Instruction i : instructions.getInstructions())
|
for (Instruction i : instructions.getInstructions())
|
||||||
i.replace(ins, to);
|
i.replace(ins, to);
|
||||||
|
|
||||||
|
for (net.runelite.asm.attributes.code.Exception e : instructions.getCode().getExceptions().getExceptions())
|
||||||
|
e.replace(ins, to);
|
||||||
|
|
||||||
instructions.remove(ins);
|
instructions.remove(ins);
|
||||||
|
|
||||||
assert instructions.getInstructions().contains(to);
|
assert instructions.getInstructions().contains(to);
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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 ConstantParameterTest
|
||||||
|
{
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
ConstantParameter cp = new ConstantParameter();
|
||||||
|
cp.run(group);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user