diff options
| author | 2016-07-02 18:04:57 +1000 | |
|---|---|---|
| committer | 2016-07-02 18:04:57 +1000 | |
| commit | 64c359d3c1d2347001e5c6becb1d7561457f52cc (patch) | |
| tree | bc2f37325b770475237437d204e95254dbfa0b3d /src/main/java/cuchaz/enigma/bytecode/InnerClassWriter.java | |
| parent | Fixed Null.json and #4 (diff) | |
| download | enigma-fork-64c359d3c1d2347001e5c6becb1d7561457f52cc.tar.gz enigma-fork-64c359d3c1d2347001e5c6becb1d7561457f52cc.tar.xz enigma-fork-64c359d3c1d2347001e5c6becb1d7561457f52cc.zip | |
Renamed Fields
Diffstat (limited to 'src/main/java/cuchaz/enigma/bytecode/InnerClassWriter.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/bytecode/InnerClassWriter.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/cuchaz/enigma/bytecode/InnerClassWriter.java b/src/main/java/cuchaz/enigma/bytecode/InnerClassWriter.java index 25ac7d6..6d92610 100644 --- a/src/main/java/cuchaz/enigma/bytecode/InnerClassWriter.java +++ b/src/main/java/cuchaz/enigma/bytecode/InnerClassWriter.java | |||
| @@ -27,10 +27,10 @@ import javassist.bytecode.InnerClassesAttribute; | |||
| 27 | 27 | ||
| 28 | public class InnerClassWriter { | 28 | public class InnerClassWriter { |
| 29 | 29 | ||
| 30 | private JarIndex m_index; | 30 | private JarIndex index; |
| 31 | 31 | ||
| 32 | public InnerClassWriter(JarIndex index) { | 32 | public InnerClassWriter(JarIndex index) { |
| 33 | m_index = index; | 33 | this.index = index; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | public void write(CtClass c) { | 36 | public void write(CtClass c) { |
| @@ -43,7 +43,7 @@ public class InnerClassWriter { | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | ClassEntry obfClassEntry = EntryFactory.getClassEntry(c); | 45 | ClassEntry obfClassEntry = EntryFactory.getClassEntry(c); |
| 46 | List<ClassEntry> obfClassChain = m_index.getObfClassChain(obfClassEntry); | 46 | List<ClassEntry> obfClassChain = this.index.getObfClassChain(obfClassEntry); |
| 47 | 47 | ||
| 48 | boolean isInnerClass = obfClassChain.size() > 1; | 48 | boolean isInnerClass = obfClassChain.size() > 1; |
| 49 | if (isInnerClass) { | 49 | if (isInnerClass) { |
| @@ -51,7 +51,7 @@ public class InnerClassWriter { | |||
| 51 | // it's an inner class, rename it to the fully qualified name | 51 | // it's an inner class, rename it to the fully qualified name |
| 52 | c.setName(obfClassEntry.buildClassEntry(obfClassChain).getName()); | 52 | c.setName(obfClassEntry.buildClassEntry(obfClassChain).getName()); |
| 53 | 53 | ||
| 54 | BehaviorEntry caller = m_index.getAnonymousClassCaller(obfClassEntry); | 54 | BehaviorEntry caller = this.index.getAnonymousClassCaller(obfClassEntry); |
| 55 | if (caller != null) { | 55 | if (caller != null) { |
| 56 | 56 | ||
| 57 | // write the enclosing method attribute | 57 | // write the enclosing method attribute |
| @@ -64,7 +64,7 @@ public class InnerClassWriter { | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | // does this class have any inner classes? | 66 | // does this class have any inner classes? |
| 67 | Collection<ClassEntry> obfInnerClassEntries = m_index.getInnerClasses(obfClassEntry); | 67 | Collection<ClassEntry> obfInnerClassEntries = this.index.getInnerClasses(obfClassEntry); |
| 68 | 68 | ||
| 69 | if (isInnerClass || !obfInnerClassEntries.isEmpty()) { | 69 | if (isInnerClass || !obfInnerClassEntries.isEmpty()) { |
| 70 | 70 | ||
| @@ -112,14 +112,14 @@ public class InnerClassWriter { | |||
| 112 | int innerClassNameIndex = 0; | 112 | int innerClassNameIndex = 0; |
| 113 | int accessFlags = AccessFlag.PUBLIC; | 113 | int accessFlags = AccessFlag.PUBLIC; |
| 114 | // TODO: need to figure out if we can put static or not | 114 | // TODO: need to figure out if we can put static or not |
| 115 | if (!m_index.isAnonymousClass(obfClassEntry)) { | 115 | if (!this.index.isAnonymousClass(obfClassEntry)) { |
| 116 | innerClassNameIndex = constPool.addUtf8Info(obfInnerClassEntry.getInnermostClassName()); | 116 | innerClassNameIndex = constPool.addUtf8Info(obfInnerClassEntry.getInnermostClassName()); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | attr.append(innerClassIndex, parentClassIndex, innerClassNameIndex, accessFlags); | 119 | attr.append(innerClassIndex, parentClassIndex, innerClassNameIndex, accessFlags); |
| 120 | 120 | ||
| 121 | /* DEBUG | 121 | /* DEBUG |
| 122 | System.out.println(String.format("\tOBF: %s -> ATTR: %s,%s,%s (replace %s with %s)", | 122 | System.out.println(String.format("\tOBF: %s -> ATTR: %s,%s,%s (replace %s with %s)", |
| 123 | obfClassEntry, | 123 | obfClassEntry, |
| 124 | attr.innerClass(attr.tableLength() - 1), | 124 | attr.innerClass(attr.tableLength() - 1), |
| 125 | attr.outerClass(attr.tableLength() - 1), | 125 | attr.outerClass(attr.tableLength() - 1), |