Convert PrefixRemapper to Kotlin

bzip2
Graham 5 years ago
parent 44d7b3703f
commit e319493e81
  1. 26
      deob/src/main/java/dev/openrs2/deob/remap/PrefixRemapper.java
  2. 22
      deob/src/main/java/dev/openrs2/deob/remap/PrefixRemapper.kt

@ -1,26 +0,0 @@
package dev.openrs2.deob.remap;
import java.util.HashMap;
import dev.openrs2.asm.classpath.Library;
import org.objectweb.asm.commons.Remapper;
import org.objectweb.asm.commons.SimpleRemapper;
public final class PrefixRemapper {
public static Remapper create(Library library, String prefix) {
var mapping = new HashMap<String, String>();
for (var clazz : library) {
if (TypedRemapper.EXCLUDED_CLASSES.contains(clazz.name)) {
mapping.put(clazz.name, clazz.name);
} else {
mapping.put(clazz.name, prefix + clazz.name);
}
}
return new SimpleRemapper(mapping);
}
private PrefixRemapper() {
/* empty */
}
}

@ -0,0 +1,22 @@
package dev.openrs2.deob.remap
import dev.openrs2.asm.classpath.Library
import org.objectweb.asm.commons.Remapper
import org.objectweb.asm.commons.SimpleRemapper
object PrefixRemapper {
@JvmStatic
fun create(library: Library, prefix: String): Remapper {
val mapping = mutableMapOf<String, String>()
for (clazz in library) {
if (TypedRemapper.EXCLUDED_CLASSES.contains(clazz.name)) {
mapping[clazz.name] = clazz.name
} else {
mapping[clazz.name] = prefix + clazz.name
}
}
return SimpleRemapper(mapping)
}
}
Loading…
Cancel
Save