diff --git a/asm/src/main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt b/asm/src/main/java/dev/openrs2/asm/ClassForNameUtils.kt similarity index 78% rename from asm/src/main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt rename to asm/src/main/java/dev/openrs2/asm/ClassForNameUtils.kt index 64e7507daf..c1d44322ae 100644 --- a/asm/src/main/java/dev/openrs2/asm/remap/ClassForNameRemapper.kt +++ b/asm/src/main/java/dev/openrs2/asm/ClassForNameUtils.kt @@ -1,15 +1,12 @@ -package dev.openrs2.asm.remap +package dev.openrs2.asm -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 import org.objectweb.asm.tree.MethodInsnNode import org.objectweb.asm.tree.MethodNode -object ClassForNameRemapper { +object ClassForNameUtils { private val INVOKE_MATCHER = InsnMatcher.compile("LDC INVOKESTATIC") private fun isClassForName(match: List): Boolean { @@ -25,7 +22,8 @@ object ClassForNameRemapper { } fun remap(remapper: Remapper, method: MethodNode) { - for (match in INVOKE_MATCHER.match(method).filter(ClassForNameRemapper::isClassForName)) { + for (match in INVOKE_MATCHER.match(method).filter( + ClassForNameUtils::isClassForName)) { val ldc = match[0] as LdcInsnNode val name = remapper.map((ldc.cst as String).toInternalClassName()) if (name != null) { diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt b/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt index 6405fbe3f1..316b1fdb2c 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt @@ -2,7 +2,7 @@ package dev.openrs2.asm.classpath import com.github.michaelbull.logging.InlineLogger import dev.openrs2.asm.hasCode -import dev.openrs2.asm.remap.ClassForNameRemapper +import dev.openrs2.asm.ClassForNameUtils import dev.openrs2.common.crypto.Pkcs12KeyStore import dev.openrs2.common.io.DeterministicJarOutputStream import dev.openrs2.common.io.SkipOutputStream @@ -64,7 +64,7 @@ class Library constructor() : Iterable { for (clazz in classes.values) { for (method in clazz.methods) { if (method.hasCode()) { - ClassForNameRemapper.remap(remapper, method) + ClassForNameUtils.remap(remapper, method) } }