Move field/method exclusions to the TypedRemapper

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

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

Loading…
Cancel
Save