diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/analysis/JarIndex.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/analysis/JarIndex.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/JarIndex.java b/src/main/java/cuchaz/enigma/analysis/JarIndex.java index 851f3fa..e501540 100644 --- a/src/main/java/cuchaz/enigma/analysis/JarIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/JarIndex.java | |||
| @@ -38,6 +38,7 @@ public class JarIndex { | |||
| 38 | private Map<ClassEntry, ClassEntry> outerClassesByInner; | 38 | private Map<ClassEntry, ClassEntry> outerClassesByInner; |
| 39 | private Map<ClassEntry, BehaviorEntry> anonymousClasses; | 39 | private Map<ClassEntry, BehaviorEntry> anonymousClasses; |
| 40 | private Map<MethodEntry, MethodEntry> bridgedMethods; | 40 | private Map<MethodEntry, MethodEntry> bridgedMethods; |
| 41 | private Set<MethodEntry> syntheticMethods; | ||
| 41 | 42 | ||
| 42 | public JarIndex() { | 43 | public JarIndex() { |
| 43 | this.obfClassEntries = Sets.newHashSet(); | 44 | this.obfClassEntries = Sets.newHashSet(); |
| @@ -52,6 +53,7 @@ public class JarIndex { | |||
| 52 | this.outerClassesByInner = Maps.newHashMap(); | 53 | this.outerClassesByInner = Maps.newHashMap(); |
| 53 | this.anonymousClasses = Maps.newHashMap(); | 54 | this.anonymousClasses = Maps.newHashMap(); |
| 54 | this.bridgedMethods = Maps.newHashMap(); | 55 | this.bridgedMethods = Maps.newHashMap(); |
| 56 | this.syntheticMethods = Sets.newHashSet(); | ||
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | public void indexJar(JarFile jar, boolean buildInnerClasses) { | 59 | public void indexJar(JarFile jar, boolean buildInnerClasses) { |
| @@ -155,6 +157,11 @@ public class JarIndex { | |||
| 155 | if (behaviorEntry instanceof MethodEntry) { | 157 | if (behaviorEntry instanceof MethodEntry) { |
| 156 | MethodEntry methodEntry = (MethodEntry) behaviorEntry; | 158 | MethodEntry methodEntry = (MethodEntry) behaviorEntry; |
| 157 | 159 | ||
| 160 | // is synthetic | ||
| 161 | if ((behavior.getModifiers() & AccessFlag.SYNTHETIC) != 0) { | ||
| 162 | syntheticMethods.add(methodEntry); | ||
| 163 | } | ||
| 164 | |||
| 158 | // index implementation | 165 | // index implementation |
| 159 | this.methodImplementations.put(behaviorEntry.getClassName(), methodEntry); | 166 | this.methodImplementations.put(behaviorEntry.getClassName(), methodEntry); |
| 160 | 167 | ||
| @@ -720,6 +727,10 @@ public class JarIndex { | |||
| 720 | return this.anonymousClasses.containsKey(obfInnerClassEntry); | 727 | return this.anonymousClasses.containsKey(obfInnerClassEntry); |
| 721 | } | 728 | } |
| 722 | 729 | ||
| 730 | public boolean isSyntheticMethod(MethodEntry methodEntry) { | ||
| 731 | return this.syntheticMethods.contains(methodEntry); | ||
| 732 | } | ||
| 733 | |||
| 723 | public BehaviorEntry getAnonymousClassCaller(ClassEntry obfInnerClassName) { | 734 | public BehaviorEntry getAnonymousClassCaller(ClassEntry obfInnerClassName) { |
| 724 | return this.anonymousClasses.get(obfInnerClassName); | 735 | return this.anonymousClasses.get(obfInnerClassName); |
| 725 | } | 736 | } |