diff options
Diffstat (limited to 'src/cuchaz/enigma/mapping/Mappings.java')
| -rw-r--r-- | src/cuchaz/enigma/mapping/Mappings.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cuchaz/enigma/mapping/Mappings.java b/src/cuchaz/enigma/mapping/Mappings.java index c5e38f4..cc560a8 100644 --- a/src/cuchaz/enigma/mapping/Mappings.java +++ b/src/cuchaz/enigma/mapping/Mappings.java | |||
| @@ -24,6 +24,7 @@ import com.google.common.collect.Maps; | |||
| 24 | import com.google.common.collect.Sets; | 24 | import com.google.common.collect.Sets; |
| 25 | 25 | ||
| 26 | import cuchaz.enigma.Util; | 26 | import cuchaz.enigma.Util; |
| 27 | import cuchaz.enigma.analysis.TranslationIndex; | ||
| 27 | import cuchaz.enigma.mapping.SignatureUpdater.ClassNameUpdater; | 28 | import cuchaz.enigma.mapping.SignatureUpdater.ClassNameUpdater; |
| 28 | 29 | ||
| 29 | public class Mappings implements Serializable { | 30 | public class Mappings implements Serializable { |
| @@ -104,11 +105,11 @@ public class Mappings implements Serializable { | |||
| 104 | return m_classesByDeobf.get(deobfName); | 105 | return m_classesByDeobf.get(deobfName); |
| 105 | } | 106 | } |
| 106 | 107 | ||
| 107 | public Translator getTranslator(TranslationDirection direction) { | 108 | public Translator getTranslator(TranslationDirection direction, TranslationIndex index) { |
| 108 | switch (direction) { | 109 | switch (direction) { |
| 109 | case Deobfuscating: | 110 | case Deobfuscating: |
| 110 | 111 | ||
| 111 | return new Translator(direction, m_classesByObf); | 112 | return new Translator(direction, m_classesByObf, index); |
| 112 | 113 | ||
| 113 | case Obfuscating: | 114 | case Obfuscating: |
| 114 | 115 | ||
| @@ -122,7 +123,11 @@ public class Mappings implements Serializable { | |||
| 122 | } | 123 | } |
| 123 | } | 124 | } |
| 124 | 125 | ||
| 125 | return new Translator(direction, classes); | 126 | // translate the translation index |
| 127 | // NOTE: this isn't actually recursive | ||
| 128 | TranslationIndex deobfIndex = new TranslationIndex(index, getTranslator(TranslationDirection.Deobfuscating, index)); | ||
| 129 | |||
| 130 | return new Translator(direction, classes, deobfIndex); | ||
| 126 | 131 | ||
| 127 | default: | 132 | default: |
| 128 | throw new Error("Invalid translation direction!"); | 133 | throw new Error("Invalid translation direction!"); |