From cad451d3e182f2a106a2224f4b195a3927375189 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 29 Feb 2020 14:12:17 +0000 Subject: [PATCH] Make ClassForNameRemapper compatible with packaged classes --- .../main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/asm/src/main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt b/asm/src/main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt index 01218501..64e7507d 100644 --- a/asm/src/main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt +++ b/asm/src/main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt @@ -1,6 +1,8 @@ package dev.openrs2.asm.remap import dev.openrs2.asm.InsnMatcher +import dev.openrs2.asm.toBinaryClassName +import dev.openrs2.asm.toInternalClassName import org.objectweb.asm.commons.Remapper import org.objectweb.asm.tree.AbstractInsnNode import org.objectweb.asm.tree.LdcInsnNode @@ -25,9 +27,9 @@ object ClassForNameRemapper { fun remap(remapper: Remapper, method: MethodNode) { for (match in INVOKE_MATCHER.match(method).filter(ClassForNameRemapper::isClassForName)) { val ldc = match[0] as LdcInsnNode - val name = remapper.map(ldc.cst as String) + val name = remapper.map((ldc.cst as String).toInternalClassName()) if (name != null) { - ldc.cst = name + ldc.cst = name.toBinaryClassName() } } }