summaryrefslogtreecommitdiff
path: root/enigma/src/main/java/cuchaz
diff options
context:
space:
mode:
authorGravatar Yanis482020-12-15 19:37:13 +0100
committerGravatar Yanis482020-12-15 19:37:13 +0100
commit559bac70027bd5161697a3c8dd0907cf89111d31 (patch)
tree92a1fd25917e95c6b6ccd6d30eef66f3c87aff13 /enigma/src/main/java/cuchaz
parentFix automapped entries (diff)
downloadenigma-fork-559bac70027bd5161697a3c8dd0907cf89111d31.tar.gz
enigma-fork-559bac70027bd5161697a3c8dd0907cf89111d31.tar.xz
enigma-fork-559bac70027bd5161697a3c8dd0907cf89111d31.zip
Fix automapped again
Diffstat (limited to 'enigma/src/main/java/cuchaz')
-rw-r--r--enigma/src/main/java/cuchaz/enigma/analysis/StructureTreeNode.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/enigma/src/main/java/cuchaz/enigma/analysis/StructureTreeNode.java b/enigma/src/main/java/cuchaz/enigma/analysis/StructureTreeNode.java
index 312c2fe..876b5ca 100644
--- a/enigma/src/main/java/cuchaz/enigma/analysis/StructureTreeNode.java
+++ b/enigma/src/main/java/cuchaz/enigma/analysis/StructureTreeNode.java
@@ -3,6 +3,7 @@ package cuchaz.enigma.analysis;
3import cuchaz.enigma.EnigmaProject; 3import cuchaz.enigma.EnigmaProject;
4import cuchaz.enigma.api.service.NameProposalService; 4import cuchaz.enigma.api.service.NameProposalService;
5import cuchaz.enigma.api.service.ObfuscationTestService; 5import cuchaz.enigma.api.service.ObfuscationTestService;
6import cuchaz.enigma.translation.TranslateResult;
6import cuchaz.enigma.translation.mapping.EntryRemapper; 7import cuchaz.enigma.translation.mapping.EntryRemapper;
7import cuchaz.enigma.translation.representation.TypeDescriptor; 8import cuchaz.enigma.translation.representation.TypeDescriptor;
8import cuchaz.enigma.translation.representation.entry.*; 9import cuchaz.enigma.translation.representation.entry.*;
@@ -84,24 +85,26 @@ public class StructureTreeNode extends DefaultMutableTreeNode {
84 85
85 @Override 86 @Override
86 public String toString() { 87 public String toString() {
87 ParentedEntry translatedEntry = this.mapper.deobfuscate(this.entry); 88 TranslateResult<ParentedEntry> translateResult = this.mapper.extendedDeobfuscate(this.entry);
88 String result = translatedEntry.getName(); 89 String result = translateResult.getValue().getName();
89 90
90 if (!this.nameProposalServices.isEmpty()) { 91 if (translateResult.isObfuscated()) {
91 for (NameProposalService service : this.nameProposalServices) { 92 if (!this.nameProposalServices.isEmpty()) {
92 if (service.proposeName(this.entry, this.mapper).isPresent()) { 93 for (NameProposalService service : this.nameProposalServices) {
93 result = service.proposeName(this.entry, this.mapper).get(); 94 if (service.proposeName(this.entry, this.mapper).isPresent()) {
95 result = service.proposeName(this.entry, this.mapper).get();
96 }
94 } 97 }
95 } 98 }
96 } 99 }
97 100
98 if (this.entry instanceof FieldDefEntry) { 101 if (this.entry instanceof FieldDefEntry) {
99 FieldDefEntry field = (FieldDefEntry) translatedEntry; 102 FieldDefEntry field = (FieldDefEntry) translateResult.getValue();
100 String returnType = this.parseDesc(field.getDesc()); 103 String returnType = this.parseDesc(field.getDesc());
101 104
102 result = result + ": " + returnType; 105 result = result + ": " + returnType;
103 } else if (this.entry instanceof MethodDefEntry) { 106 } else if (this.entry instanceof MethodDefEntry) {
104 MethodDefEntry method = (MethodDefEntry) translatedEntry; 107 MethodDefEntry method = (MethodDefEntry) translateResult.getValue();
105 String args = this.parseArgs(method.getDesc().getArgumentDescs()); 108 String args = this.parseArgs(method.getDesc().getArgumentDescs());
106 String returnType = this.parseDesc(method.getDesc().getReturnDesc()); 109 String returnType = this.parseDesc(method.getDesc().getReturnDesc());
107 110