Move field/method exclusions to the TypedRemapper

master
Graham 5 years ago
parent df4afccccc
commit b27763a699
  1. 8
      deob/src/main/java/dev/openrs2/deob/classpath/ClassPath.java
  2. 14
      deob/src/main/java/dev/openrs2/deob/classpath/TypedRemapper.java

@ -121,10 +121,6 @@ public final class ClassPath {
}
for (var field : clazz.getFields()) {
if (TypedRemapper.EXCLUDED_FIELDS.contains(field.getName())) {
continue;
}
disjointSet.add(new MemberRef(clazz.getName(), field));
ancestors.add(field);
}
@ -180,10 +176,6 @@ public final class ClassPath {
}
for (var method : clazz.getMethods()) {
if (TypedRemapper.EXCLUDED_METHODS.contains(method.getName())) {
continue;
}
disjointSet.add(new MemberRef(clazz.getName(), method));
ancestors.add(method);
}

@ -25,14 +25,14 @@ public final class TypedRemapper extends Remapper {
"unpack",
"unpackclass"
);
public static final Set<String> EXCLUDED_METHODS = Set.of(
private static final Set<String> EXCLUDED_METHODS = Set.of(
"<clinit>",
"<init>",
"main",
"providesignlink",
"quit"
);
public static final Set<String> EXCLUDED_FIELDS = Set.of(
private static final Set<String> EXCLUDED_FIELDS = Set.of(
"cache"
);
private static final int MAX_OBFUSCATED_NAME_LEN = 2;
@ -120,6 +120,11 @@ public final class TypedRemapper extends Remapper {
for (var field : partition) {
var clazz = classPath.get(field.getOwner());
if (EXCLUDED_FIELDS.contains(field.getName())) {
skip = true;
break;
}
if (clazz.isDependency()) {
skip = true;
break;
@ -179,6 +184,11 @@ public final class TypedRemapper extends Remapper {
for (var method : partition) {
var clazz = classPath.get(method.getOwner());
if (EXCLUDED_METHODS.contains(method.getName())) {
skip = true;
break;
}
if (clazz.isDependency()) {
skip = true;
break;

Loading…
Cancel
Save