Make ClassForNameRemapper compatible with packaged classes

bzip2
Graham 5 years ago
parent 3c7989455b
commit cad451d3e1
  1. 6
      asm/src/main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt

@ -1,6 +1,8 @@
package dev.openrs2.asm.remap package dev.openrs2.asm.remap
import dev.openrs2.asm.InsnMatcher 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.commons.Remapper
import org.objectweb.asm.tree.AbstractInsnNode import org.objectweb.asm.tree.AbstractInsnNode
import org.objectweb.asm.tree.LdcInsnNode import org.objectweb.asm.tree.LdcInsnNode
@ -25,9 +27,9 @@ object ClassForNameRemapper {
fun remap(remapper: Remapper, method: MethodNode) { fun remap(remapper: Remapper, method: MethodNode) {
for (match in INVOKE_MATCHER.match(method).filter(ClassForNameRemapper::isClassForName)) { for (match in INVOKE_MATCHER.match(method).filter(ClassForNameRemapper::isClassForName)) {
val ldc = match[0] as LdcInsnNode 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) { if (name != null) {
ldc.cst = name ldc.cst = name.toBinaryClassName()
} }
} }
} }

Loading…
Cancel
Save