diff --git a/src/main/java/net/runelite/deob/deobfuscators/rename/MappingExecutorUtil.java b/src/main/java/net/runelite/deob/deobfuscators/rename/MappingExecutorUtil.java index c2dac7ed25..f093fc68c8 100644 --- a/src/main/java/net/runelite/deob/deobfuscators/rename/MappingExecutorUtil.java +++ b/src/main/java/net/runelite/deob/deobfuscators/rename/MappingExecutorUtil.java @@ -25,49 +25,7 @@ import net.runelite.asm.execution.Variables; import net.runelite.asm.signature.Signature; public class MappingExecutorUtil -{ - // won't work with static funcs etc. this is all wrong. XXX - public static boolean isMappable(Method m1, Method m2) - { - assert (m1.getCode() == null) == (m2.getCode() == null); - - if (m1.getCode() == null || m2.getCode() == null) - return false; - - List l1 = m1.getCode().getInstructions().getInstructions().stream().filter(i -> i instanceof MappableInstruction).collect(Collectors.toList()); - List l2 = m2.getCode().getInstructions().getInstructions().stream().filter(i -> i instanceof MappableInstruction).collect(Collectors.toList()); - - if (l1.size() != l2.size()) - return false; - - Map map1 = new HashMap<>(), - map2 = new HashMap<>(); - - for (int i = 0; i < l1.size(); ++i) - { - Instruction i1 = l1.get(i); - - Integer c = map1.get(i1.getClass()); - if (c == null) - map1.put(i1.getClass(), 1); - else - map1.put(i1.getClass(), c + 1); - } - - for (int i = 0; i < l2.size(); ++i) - { - Instruction i2 = l2.get(i); - - Integer c = map2.get(i2.getClass()); - if (c == null) - map2.put(i2.getClass(), 1); - else - map2.put(i2.getClass(), c + 1); - } - - return map1.equals(map2); - } - +{ public static ParallelExecutorMapping map(Method m1, Method m2) { ClassGroup group1 = m1.getMethods().getClassFile().getGroup(); diff --git a/src/test/java/net/runelite/deob/deobfuscators/rename/MapTest.java b/src/test/java/net/runelite/deob/deobfuscators/rename/MapTest.java index 700da913dd..c8d1279aaf 100644 --- a/src/test/java/net/runelite/deob/deobfuscators/rename/MapTest.java +++ b/src/test/java/net/runelite/deob/deobfuscators/rename/MapTest.java @@ -5,23 +5,10 @@ import java.io.IOException; import net.runelite.asm.ClassGroup; import net.runelite.asm.Method; import net.runelite.deob.util.JarUtil; -import org.junit.Assert; import org.junit.Test; public class MapTest { - @Test - public void testMappable() throws IOException - { - ClassGroup group1 = JarUtil.loadJar(new File("d:/rs/07/adamin1.jar")); - ClassGroup group2 = JarUtil.loadJar(new File("d:/rs/07/adamin2.jar")); - - Assert.assertTrue(MappingExecutorUtil.isMappable( - group1.findClass("class99").findMethod("method2220"), - group2.findClass("class99").findMethod("method2149") - )); - } - @Test public void test() throws IOException {