diff options
| author | 2020-12-15 19:37:13 +0100 | |
|---|---|---|
| committer | 2020-12-15 19:37:13 +0100 | |
| commit | 559bac70027bd5161697a3c8dd0907cf89111d31 (patch) | |
| tree | 92a1fd25917e95c6b6ccd6d30eef66f3c87aff13 /enigma/src | |
| parent | Fix automapped entries (diff) | |
| download | enigma-fork-559bac70027bd5161697a3c8dd0907cf89111d31.tar.gz enigma-fork-559bac70027bd5161697a3c8dd0907cf89111d31.tar.xz enigma-fork-559bac70027bd5161697a3c8dd0907cf89111d31.zip | |
Fix automapped again
Diffstat (limited to 'enigma/src')
| -rw-r--r-- | enigma/src/main/java/cuchaz/enigma/analysis/StructureTreeNode.java | 21 |
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; | |||
| 3 | import cuchaz.enigma.EnigmaProject; | 3 | import cuchaz.enigma.EnigmaProject; |
| 4 | import cuchaz.enigma.api.service.NameProposalService; | 4 | import cuchaz.enigma.api.service.NameProposalService; |
| 5 | import cuchaz.enigma.api.service.ObfuscationTestService; | 5 | import cuchaz.enigma.api.service.ObfuscationTestService; |
| 6 | import cuchaz.enigma.translation.TranslateResult; | ||
| 6 | import cuchaz.enigma.translation.mapping.EntryRemapper; | 7 | import cuchaz.enigma.translation.mapping.EntryRemapper; |
| 7 | import cuchaz.enigma.translation.representation.TypeDescriptor; | 8 | import cuchaz.enigma.translation.representation.TypeDescriptor; |
| 8 | import cuchaz.enigma.translation.representation.entry.*; | 9 | import 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 | ||