diff options
| -rw-r--r-- | src/main/java/cuchaz/enigma/Deobfuscator.java | 2 | ||||
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/JarIndex.java | 19 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/main/java/cuchaz/enigma/Deobfuscator.java b/src/main/java/cuchaz/enigma/Deobfuscator.java index c1992259..4a945cdb 100644 --- a/src/main/java/cuchaz/enigma/Deobfuscator.java +++ b/src/main/java/cuchaz/enigma/Deobfuscator.java | |||
| @@ -603,8 +603,10 @@ public class Deobfuscator { | |||
| 603 | if (((MethodEntry) obfEntry).isConstructor()) { | 603 | if (((MethodEntry) obfEntry).isConstructor()) { |
| 604 | throw new IllegalArgumentException("Cannot rename constructors"); | 604 | throw new IllegalArgumentException("Cannot rename constructors"); |
| 605 | } | 605 | } |
| 606 | |||
| 606 | this.renamer.setMethodTreeName((MethodEntry) obfEntry, newName); | 607 | this.renamer.setMethodTreeName((MethodEntry) obfEntry, newName); |
| 607 | } else if (obfEntry instanceof LocalVariableEntry) { | 608 | } else if (obfEntry instanceof LocalVariableEntry) { |
| 609 | // TODO: Discern between arguments (propagate) and local vars (don't) | ||
| 608 | this.renamer.setLocalVariableTreeName((LocalVariableEntry) obfEntry, newName); | 610 | this.renamer.setLocalVariableTreeName((LocalVariableEntry) obfEntry, newName); |
| 609 | } else { | 611 | } else { |
| 610 | throw new Error("Unknown entry desc: " + obfEntry.getClass().getName()); | 612 | throw new Error("Unknown entry desc: " + obfEntry.getClass().getName()); |
diff --git a/src/main/java/cuchaz/enigma/analysis/JarIndex.java b/src/main/java/cuchaz/enigma/analysis/JarIndex.java index e8bda8ef..820ecbbf 100644 --- a/src/main/java/cuchaz/enigma/analysis/JarIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/JarIndex.java | |||
| @@ -363,6 +363,11 @@ public class JarIndex { | |||
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | public Set<MethodEntry> getRelatedMethodImplementations(MethodEntry obfMethodEntry) { | 365 | public Set<MethodEntry> getRelatedMethodImplementations(MethodEntry obfMethodEntry) { |
| 366 | AccessFlags flags = getAccessFlags(obfMethodEntry); | ||
| 367 | if (flags.isPrivate() || flags.isStatic()) { | ||
| 368 | return Collections.singleton(obfMethodEntry); | ||
| 369 | } | ||
| 370 | |||
| 366 | Set<MethodEntry> methodEntries = Sets.newHashSet(); | 371 | Set<MethodEntry> methodEntries = Sets.newHashSet(); |
| 367 | getRelatedMethodImplementations(methodEntries, getMethodInheritance(new DirectionalTranslator(entryPool), obfMethodEntry)); | 372 | getRelatedMethodImplementations(methodEntries, getMethodInheritance(new DirectionalTranslator(entryPool), obfMethodEntry)); |
| 368 | return methodEntries; | 373 | return methodEntries; |
| @@ -375,8 +380,11 @@ public class JarIndex { | |||
| 375 | } | 380 | } |
| 376 | 381 | ||
| 377 | if (containsObfMethod(methodEntry)) { | 382 | if (containsObfMethod(methodEntry)) { |
| 378 | // collect the entry | 383 | AccessFlags flags = getAccessFlags(methodEntry); |
| 379 | methodEntries.add(methodEntry); | 384 | if (!flags.isPrivate() && !flags.isStatic()) { |
| 385 | // collect the entry | ||
| 386 | methodEntries.add(methodEntry); | ||
| 387 | } | ||
| 380 | } | 388 | } |
| 381 | 389 | ||
| 382 | // look at bridge methods! | 390 | // look at bridge methods! |
| @@ -400,8 +408,11 @@ public class JarIndex { | |||
| 400 | private void getRelatedMethodImplementations(Set<MethodEntry> methodEntries, MethodImplementationsTreeNode node) { | 408 | private void getRelatedMethodImplementations(Set<MethodEntry> methodEntries, MethodImplementationsTreeNode node) { |
| 401 | MethodEntry methodEntry = node.getMethodEntry(); | 409 | MethodEntry methodEntry = node.getMethodEntry(); |
| 402 | if (containsObfMethod(methodEntry)) { | 410 | if (containsObfMethod(methodEntry)) { |
| 403 | // collect the entry | 411 | AccessFlags flags = getAccessFlags(methodEntry); |
| 404 | methodEntries.add(methodEntry); | 412 | if (!flags.isPrivate() && !flags.isStatic()) { |
| 413 | // collect the entry | ||
| 414 | methodEntries.add(methodEntry); | ||
| 415 | } | ||
| 405 | } | 416 | } |
| 406 | 417 | ||
| 407 | // look at bridge methods! | 418 | // look at bridge methods! |