summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/gui/GuiController.java
diff options
context:
space:
mode:
authorGravatar Modmuss502018-07-18 13:46:00 +0100
committerGravatar GitHub2018-07-18 13:46:00 +0100
commit1ebe691c12f68beea378b133ddc4bcbde7f3f795 (patch)
treefb051d9fde5644bd144a7e9d7bcecc70a256359c /src/main/java/cuchaz/enigma/gui/GuiController.java
parentRecursively rebuild method names (diff)
parentUpdate version number (diff)
downloadenigma-fork-1ebe691c12f68beea378b133ddc4bcbde7f3f795.tar.gz
enigma-fork-1ebe691c12f68beea378b133ddc4bcbde7f3f795.tar.xz
enigma-fork-1ebe691c12f68beea378b133ddc4bcbde7f3f795.zip
Merge pull request #62 from OpenModLoader/asm
ASM based class translator
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/GuiController.java')
-rw-r--r--src/main/java/cuchaz/enigma/gui/GuiController.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/GuiController.java b/src/main/java/cuchaz/enigma/gui/GuiController.java
index 6d98743..ae1b652 100644
--- a/src/main/java/cuchaz/enigma/gui/GuiController.java
+++ b/src/main/java/cuchaz/enigma/gui/GuiController.java
@@ -18,6 +18,10 @@ import cuchaz.enigma.Deobfuscator;
18import cuchaz.enigma.analysis.*; 18import cuchaz.enigma.analysis.*;
19import cuchaz.enigma.gui.dialog.ProgressDialog; 19import cuchaz.enigma.gui.dialog.ProgressDialog;
20import cuchaz.enigma.mapping.*; 20import cuchaz.enigma.mapping.*;
21import cuchaz.enigma.mapping.entry.ClassEntry;
22import cuchaz.enigma.mapping.entry.Entry;
23import cuchaz.enigma.mapping.entry.FieldEntry;
24import cuchaz.enigma.mapping.entry.MethodEntry;
21import cuchaz.enigma.throwables.MappingParseException; 25import cuchaz.enigma.throwables.MappingParseException;
22import cuchaz.enigma.utils.ReadableToken; 26import cuchaz.enigma.utils.ReadableToken;
23 27
@@ -51,10 +55,10 @@ public class GuiController {
51 return this.isDirty; 55 return this.isDirty;
52 } 56 }
53 57
54 public void openJar(final JarFile jar) { 58 public void openJar(final JarFile jar) throws IOException {
55 this.gui.onStartOpenJar(); 59 this.gui.onStartOpenJar();
56 this.deobfuscator = new Deobfuscator(jar); 60 this.deobfuscator = new Deobfuscator(jar);
57 this.gui.onFinishOpenJar(this.deobfuscator.getJarName()); 61 this.gui.onFinishOpenJar(jar.getName());
58 refreshClasses(); 62 refreshClasses();
59 } 63 }
60 64
@@ -161,24 +165,24 @@ public class GuiController {
161 165
162 public ClassInheritanceTreeNode getClassInheritance(ClassEntry deobfClassEntry) { 166 public ClassInheritanceTreeNode getClassInheritance(ClassEntry deobfClassEntry) {
163 ClassEntry obfClassEntry = this.deobfuscator.obfuscateEntry(deobfClassEntry); 167 ClassEntry obfClassEntry = this.deobfuscator.obfuscateEntry(deobfClassEntry);
164 ClassInheritanceTreeNode rootNode = this.deobfuscator.getJarIndex().getClassInheritance(this.deobfuscator.getTranslator(TranslationDirection.Deobfuscating), obfClassEntry); 168 ClassInheritanceTreeNode rootNode = this.deobfuscator.getJarIndex().getClassInheritance(this.deobfuscator.getTranslator(TranslationDirection.DEOBFUSCATING), obfClassEntry);
165 return ClassInheritanceTreeNode.findNode(rootNode, obfClassEntry); 169 return ClassInheritanceTreeNode.findNode(rootNode, obfClassEntry);
166 } 170 }
167 171
168 public ClassImplementationsTreeNode getClassImplementations(ClassEntry deobfClassEntry) { 172 public ClassImplementationsTreeNode getClassImplementations(ClassEntry deobfClassEntry) {
169 ClassEntry obfClassEntry = this.deobfuscator.obfuscateEntry(deobfClassEntry); 173 ClassEntry obfClassEntry = this.deobfuscator.obfuscateEntry(deobfClassEntry);
170 return this.deobfuscator.getJarIndex().getClassImplementations(this.deobfuscator.getTranslator(TranslationDirection.Deobfuscating), obfClassEntry); 174 return this.deobfuscator.getJarIndex().getClassImplementations(this.deobfuscator.getTranslator(TranslationDirection.DEOBFUSCATING), obfClassEntry);
171 } 175 }
172 176
173 public MethodInheritanceTreeNode getMethodInheritance(MethodEntry deobfMethodEntry) { 177 public MethodInheritanceTreeNode getMethodInheritance(MethodEntry deobfMethodEntry) {
174 MethodEntry obfMethodEntry = this.deobfuscator.obfuscateEntry(deobfMethodEntry); 178 MethodEntry obfMethodEntry = this.deobfuscator.obfuscateEntry(deobfMethodEntry);
175 MethodInheritanceTreeNode rootNode = this.deobfuscator.getJarIndex().getMethodInheritance(this.deobfuscator.getTranslator(TranslationDirection.Deobfuscating), obfMethodEntry); 179 MethodInheritanceTreeNode rootNode = this.deobfuscator.getJarIndex().getMethodInheritance(this.deobfuscator.getTranslator(TranslationDirection.DEOBFUSCATING), obfMethodEntry);
176 return MethodInheritanceTreeNode.findNode(rootNode, obfMethodEntry); 180 return MethodInheritanceTreeNode.findNode(rootNode, obfMethodEntry);
177 } 181 }
178 182
179 public MethodImplementationsTreeNode getMethodImplementations(MethodEntry deobfMethodEntry) { 183 public MethodImplementationsTreeNode getMethodImplementations(MethodEntry deobfMethodEntry) {
180 MethodEntry obfMethodEntry = this.deobfuscator.obfuscateEntry(deobfMethodEntry); 184 MethodEntry obfMethodEntry = this.deobfuscator.obfuscateEntry(deobfMethodEntry);
181 List<MethodImplementationsTreeNode> rootNodes = this.deobfuscator.getJarIndex().getMethodImplementations(this.deobfuscator.getTranslator(TranslationDirection.Deobfuscating), obfMethodEntry); 185 List<MethodImplementationsTreeNode> rootNodes = this.deobfuscator.getJarIndex().getMethodImplementations(this.deobfuscator.getTranslator(TranslationDirection.DEOBFUSCATING), obfMethodEntry);
182 if (rootNodes.isEmpty()) { 186 if (rootNodes.isEmpty()) {
183 return null; 187 return null;
184 } 188 }
@@ -190,14 +194,14 @@ public class GuiController {
190 194
191 public FieldReferenceTreeNode getFieldReferences(FieldEntry deobfFieldEntry) { 195 public FieldReferenceTreeNode getFieldReferences(FieldEntry deobfFieldEntry) {
192 FieldEntry obfFieldEntry = this.deobfuscator.obfuscateEntry(deobfFieldEntry); 196 FieldEntry obfFieldEntry = this.deobfuscator.obfuscateEntry(deobfFieldEntry);
193 FieldReferenceTreeNode rootNode = new FieldReferenceTreeNode(this.deobfuscator.getTranslator(TranslationDirection.Deobfuscating), obfFieldEntry); 197 FieldReferenceTreeNode rootNode = new FieldReferenceTreeNode(this.deobfuscator.getTranslator(TranslationDirection.DEOBFUSCATING), obfFieldEntry);
194 rootNode.load(this.deobfuscator.getJarIndex(), true); 198 rootNode.load(this.deobfuscator.getJarIndex(), true);
195 return rootNode; 199 return rootNode;
196 } 200 }
197 201
198 public BehaviorReferenceTreeNode getMethodReferences(BehaviorEntry deobfBehaviorEntry) { 202 public MethodReferenceTreeNode getMethodReferences(MethodEntry deobfMethodEntry) {
199 BehaviorEntry obfBehaviorEntry = this.deobfuscator.obfuscateEntry(deobfBehaviorEntry); 203 MethodEntry obfMethodEntry = this.deobfuscator.obfuscateEntry(deobfMethodEntry);
200 BehaviorReferenceTreeNode rootNode = new BehaviorReferenceTreeNode(this.deobfuscator.getTranslator(TranslationDirection.Deobfuscating), obfBehaviorEntry); 204 MethodReferenceTreeNode rootNode = new MethodReferenceTreeNode(this.deobfuscator.getTranslator(TranslationDirection.DEOBFUSCATING), obfMethodEntry);
201 rootNode.load(this.deobfuscator.getJarIndex(), true); 205 rootNode.load(this.deobfuscator.getJarIndex(), true);
202 return rootNode; 206 return rootNode;
203 } 207 }