diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cuchaz/enigma/Deobfuscator.java | 2 | ||||
| -rw-r--r-- | src/cuchaz/enigma/Main.java | 3 | ||||
| -rw-r--r-- | src/cuchaz/enigma/TranslatingTypeLoader.java | 1 | ||||
| -rw-r--r-- | src/cuchaz/enigma/analysis/SourceIndex.java | 2 | ||||
| -rw-r--r-- | src/cuchaz/enigma/gui/GuiController.java | 1 | ||||
| -rw-r--r-- | src/cuchaz/enigma/mapping/ClassMapping.java | 28 | ||||
| -rw-r--r-- | src/cuchaz/enigma/mapping/Mappings.java | 26 | ||||
| -rw-r--r-- | src/cuchaz/enigma/mapping/MappingsRenamer.java | 11 | ||||
| -rw-r--r-- | src/cuchaz/enigma/mapping/Translator.java | 104 |
9 files changed, 73 insertions, 105 deletions
diff --git a/src/cuchaz/enigma/Deobfuscator.java b/src/cuchaz/enigma/Deobfuscator.java index d45ffb41..7e0f0927 100644 --- a/src/cuchaz/enigma/Deobfuscator.java +++ b/src/cuchaz/enigma/Deobfuscator.java | |||
| @@ -261,7 +261,7 @@ public class Deobfuscator | |||
| 261 | Translator translator = m_translatorCache.get( direction ); | 261 | Translator translator = m_translatorCache.get( direction ); |
| 262 | if( translator == null ) | 262 | if( translator == null ) |
| 263 | { | 263 | { |
| 264 | translator = m_mappings.getTranslator( m_jarIndex.getTranslationIndex(), direction ); | 264 | translator = m_mappings.getTranslator( direction ); |
| 265 | m_translatorCache.put( direction, translator ); | 265 | m_translatorCache.put( direction, translator ); |
| 266 | } | 266 | } |
| 267 | return translator; | 267 | return translator; |
diff --git a/src/cuchaz/enigma/Main.java b/src/cuchaz/enigma/Main.java index bbd734c6..371662bc 100644 --- a/src/cuchaz/enigma/Main.java +++ b/src/cuchaz/enigma/Main.java | |||
| @@ -13,6 +13,7 @@ package cuchaz.enigma; | |||
| 13 | import java.io.File; | 13 | import java.io.File; |
| 14 | 14 | ||
| 15 | import cuchaz.enigma.gui.Gui; | 15 | import cuchaz.enigma.gui.Gui; |
| 16 | import cuchaz.enigma.mapping.ClassEntry; | ||
| 16 | 17 | ||
| 17 | public class Main | 18 | public class Main |
| 18 | { | 19 | { |
| @@ -32,7 +33,7 @@ public class Main | |||
| 32 | } | 33 | } |
| 33 | 34 | ||
| 34 | // DEBUG | 35 | // DEBUG |
| 35 | //gui.getController().openDeclaration( new ClassEntry( "none/bub" ) ); | 36 | gui.getController().openDeclaration( new ClassEntry( "none/ry" ) ); |
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | private static File getFile( String path ) | 39 | private static File getFile( String path ) |
diff --git a/src/cuchaz/enigma/TranslatingTypeLoader.java b/src/cuchaz/enigma/TranslatingTypeLoader.java index 86e52a34..939e342d 100644 --- a/src/cuchaz/enigma/TranslatingTypeLoader.java +++ b/src/cuchaz/enigma/TranslatingTypeLoader.java | |||
| @@ -13,7 +13,6 @@ package cuchaz.enigma; | |||
| 13 | import java.io.ByteArrayOutputStream; | 13 | import java.io.ByteArrayOutputStream; |
| 14 | import java.io.IOException; | 14 | import java.io.IOException; |
| 15 | import java.io.InputStream; | 15 | import java.io.InputStream; |
| 16 | import java.util.Arrays; | ||
| 17 | import java.util.Map; | 16 | import java.util.Map; |
| 18 | import java.util.jar.JarEntry; | 17 | import java.util.jar.JarEntry; |
| 19 | import java.util.jar.JarFile; | 18 | import java.util.jar.JarFile; |
diff --git a/src/cuchaz/enigma/analysis/SourceIndex.java b/src/cuchaz/enigma/analysis/SourceIndex.java index 21a499e8..0e33de00 100644 --- a/src/cuchaz/enigma/analysis/SourceIndex.java +++ b/src/cuchaz/enigma/analysis/SourceIndex.java | |||
| @@ -90,7 +90,7 @@ public class SourceIndex | |||
| 90 | //System.out.println( String.format( "%s \"%s\" region: %s", node.getNodeType(), name, region ) ); | 90 | //System.out.println( String.format( "%s \"%s\" region: %s", node.getNodeType(), name, region ) ); |
| 91 | 91 | ||
| 92 | // for tokens representing inner classes, make sure we only get the simple name | 92 | // for tokens representing inner classes, make sure we only get the simple name |
| 93 | int pos = node.getText().lastIndexOf( '$' ); | 93 | int pos = name.lastIndexOf( '$' ); |
| 94 | if( pos >= 0 ) | 94 | if( pos >= 0 ) |
| 95 | { | 95 | { |
| 96 | token.end -= pos + 1; | 96 | token.end -= pos + 1; |
diff --git a/src/cuchaz/enigma/gui/GuiController.java b/src/cuchaz/enigma/gui/GuiController.java index 2862ebed..646bb87d 100644 --- a/src/cuchaz/enigma/gui/GuiController.java +++ b/src/cuchaz/enigma/gui/GuiController.java | |||
| @@ -43,6 +43,7 @@ import cuchaz.enigma.mapping.MappingsReader; | |||
| 43 | import cuchaz.enigma.mapping.MappingsWriter; | 43 | import cuchaz.enigma.mapping.MappingsWriter; |
| 44 | import cuchaz.enigma.mapping.MethodEntry; | 44 | import cuchaz.enigma.mapping.MethodEntry; |
| 45 | import cuchaz.enigma.mapping.TranslationDirection; | 45 | import cuchaz.enigma.mapping.TranslationDirection; |
| 46 | import cuchaz.enigma.mapping.Translator; | ||
| 46 | 47 | ||
| 47 | public class GuiController | 48 | public class GuiController |
| 48 | { | 49 | { |
diff --git a/src/cuchaz/enigma/mapping/ClassMapping.java b/src/cuchaz/enigma/mapping/ClassMapping.java index ee02781e..e084d4df 100644 --- a/src/cuchaz/enigma/mapping/ClassMapping.java +++ b/src/cuchaz/enigma/mapping/ClassMapping.java | |||
| @@ -117,6 +117,16 @@ public class ClassMapping implements Serializable, Comparable<ClassMapping> | |||
| 117 | return m_innerClassesByDeobf.get( deobfName ); | 117 | return m_innerClassesByDeobf.get( deobfName ); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | public ClassMapping getInnerClassByDeobfThenObf( String name ) | ||
| 121 | { | ||
| 122 | ClassMapping classMapping = getInnerClassByDeobf( name ); | ||
| 123 | if( classMapping == null ) | ||
| 124 | { | ||
| 125 | classMapping = getInnerClassByObf( name ); | ||
| 126 | } | ||
| 127 | return classMapping; | ||
| 128 | } | ||
| 129 | |||
| 120 | public String getObfInnerClassName( String deobfName ) | 130 | public String getObfInnerClassName( String deobfName ) |
| 121 | { | 131 | { |
| 122 | assert( isSimpleClassName( deobfName ) ); | 132 | assert( isSimpleClassName( deobfName ) ); |
| @@ -392,9 +402,18 @@ public class ClassMapping implements Serializable, Comparable<ClassMapping> | |||
| 392 | buf.append( "\n" ); | 402 | buf.append( "\n" ); |
| 393 | } | 403 | } |
| 394 | buf.append( "Methods:\n" ); | 404 | buf.append( "Methods:\n" ); |
| 395 | for( MethodMapping methodIndex : m_methodsByObf.values() ) | 405 | for( MethodMapping methodMapping : m_methodsByObf.values() ) |
| 396 | { | 406 | { |
| 397 | buf.append( methodIndex.toString() ); | 407 | buf.append( methodMapping.toString() ); |
| 408 | buf.append( "\n" ); | ||
| 409 | } | ||
| 410 | buf.append( "Inner Classes:\n" ); | ||
| 411 | for( ClassMapping classMapping : m_innerClassesByObf.values() ) | ||
| 412 | { | ||
| 413 | buf.append( "\t" ); | ||
| 414 | buf.append( classMapping.getObfName() ); | ||
| 415 | buf.append( " <-> " ); | ||
| 416 | buf.append( classMapping.getDeobfName() ); | ||
| 398 | buf.append( "\n" ); | 417 | buf.append( "\n" ); |
| 399 | } | 418 | } |
| 400 | return buf.toString(); | 419 | return buf.toString(); |
| @@ -403,6 +422,11 @@ public class ClassMapping implements Serializable, Comparable<ClassMapping> | |||
| 403 | @Override | 422 | @Override |
| 404 | public int compareTo( ClassMapping other ) | 423 | public int compareTo( ClassMapping other ) |
| 405 | { | 424 | { |
| 425 | // sort by a, b, c, ... aa, ab, etc | ||
| 426 | if( m_obfName.length() != other.m_obfName.length() ) | ||
| 427 | { | ||
| 428 | return m_obfName.length() - other.m_obfName.length(); | ||
| 429 | } | ||
| 406 | return m_obfName.compareTo( other.m_obfName ); | 430 | return m_obfName.compareTo( other.m_obfName ); |
| 407 | } | 431 | } |
| 408 | 432 | ||
diff --git a/src/cuchaz/enigma/mapping/Mappings.java b/src/cuchaz/enigma/mapping/Mappings.java index 45b41bcd..3a39d100 100644 --- a/src/cuchaz/enigma/mapping/Mappings.java +++ b/src/cuchaz/enigma/mapping/Mappings.java | |||
| @@ -24,7 +24,6 @@ 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; | ||
| 28 | import cuchaz.enigma.mapping.SignatureUpdater.ClassNameUpdater; | 27 | import cuchaz.enigma.mapping.SignatureUpdater.ClassNameUpdater; |
| 29 | 28 | ||
| 30 | public class Mappings implements Serializable | 29 | public class Mappings implements Serializable |
| @@ -125,35 +124,16 @@ public class Mappings implements Serializable | |||
| 125 | return m_classesByDeobf.get( deobfName ); | 124 | return m_classesByDeobf.get( deobfName ); |
| 126 | } | 125 | } |
| 127 | 126 | ||
| 128 | public Translator getTranslator( TranslationIndex index, TranslationDirection direction ) | 127 | public Translator getTranslator( TranslationDirection direction ) |
| 129 | { | 128 | { |
| 130 | switch( direction ) | 129 | switch( direction ) |
| 131 | { | 130 | { |
| 132 | case Deobfuscating: | 131 | case Deobfuscating: |
| 133 | 132 | ||
| 134 | return new Translator( direction, m_classesByObf, index ); | 133 | return new Translator( direction, m_classesByObf ); |
| 135 | 134 | ||
| 136 | case Obfuscating: | 135 | case Obfuscating: |
| 137 | 136 | ||
| 138 | // deobfuscate the index | ||
| 139 | index = new TranslationIndex( index ); | ||
| 140 | Map<String,String> renames = Maps.newHashMap(); | ||
| 141 | for( ClassMapping classMapping : classes() ) | ||
| 142 | { | ||
| 143 | if( classMapping.getDeobfName() != null ) | ||
| 144 | { | ||
| 145 | renames.put( classMapping.getObfName(), classMapping.getDeobfName() ); | ||
| 146 | } | ||
| 147 | for( ClassMapping innerClassMapping : classMapping.innerClasses() ) | ||
| 148 | { | ||
| 149 | if( innerClassMapping.getDeobfName() != null ) | ||
| 150 | { | ||
| 151 | renames.put( innerClassMapping.getObfName(), innerClassMapping.getDeobfName() ); | ||
| 152 | } | ||
| 153 | } | ||
| 154 | } | ||
| 155 | index.renameClasses( renames ); | ||
| 156 | |||
| 157 | // fill in the missing deobf class entries with obf entries | 137 | // fill in the missing deobf class entries with obf entries |
| 158 | Map<String,ClassMapping> classes = Maps.newHashMap(); | 138 | Map<String,ClassMapping> classes = Maps.newHashMap(); |
| 159 | for( ClassMapping classMapping : classes() ) | 139 | for( ClassMapping classMapping : classes() ) |
| @@ -168,7 +148,7 @@ public class Mappings implements Serializable | |||
| 168 | } | 148 | } |
| 169 | } | 149 | } |
| 170 | 150 | ||
| 171 | return new Translator( direction, classes, index ); | 151 | return new Translator( direction, classes ); |
| 172 | 152 | ||
| 173 | default: | 153 | default: |
| 174 | throw new Error( "Invalid translation direction!" ); | 154 | throw new Error( "Invalid translation direction!" ); |
diff --git a/src/cuchaz/enigma/mapping/MappingsRenamer.java b/src/cuchaz/enigma/mapping/MappingsRenamer.java index 24ec7318..3e5f1a4d 100644 --- a/src/cuchaz/enigma/mapping/MappingsRenamer.java +++ b/src/cuchaz/enigma/mapping/MappingsRenamer.java | |||
| @@ -121,11 +121,11 @@ public class MappingsRenamer | |||
| 121 | deobfName = NameValidator.validateMethodName( deobfName ); | 121 | deobfName = NameValidator.validateMethodName( deobfName ); |
| 122 | for( MethodEntry entry : implementations ) | 122 | for( MethodEntry entry : implementations ) |
| 123 | { | 123 | { |
| 124 | String deobfSignature = getTranslator( TranslationDirection.Deobfuscating ).translateSignature( obf.getSignature() ); | 124 | String deobfSignature = m_mappings.getTranslator( TranslationDirection.Deobfuscating ).translateSignature( obf.getSignature() ); |
| 125 | MethodEntry targetEntry = new MethodEntry( entry.getClassEntry(), deobfName, deobfSignature ); | 125 | MethodEntry targetEntry = new MethodEntry( entry.getClassEntry(), deobfName, deobfSignature ); |
| 126 | if( m_mappings.containsDeobfMethod( entry.getClassEntry(), deobfName, entry.getSignature() ) || m_index.containsObfBehavior( targetEntry ) ) | 126 | if( m_mappings.containsDeobfMethod( entry.getClassEntry(), deobfName, entry.getSignature() ) || m_index.containsObfBehavior( targetEntry ) ) |
| 127 | { | 127 | { |
| 128 | String deobfClassName = getTranslator( TranslationDirection.Deobfuscating ).translateClass( entry.getClassName() ); | 128 | String deobfClassName = m_mappings.getTranslator( TranslationDirection.Deobfuscating ).translateClass( entry.getClassName() ); |
| 129 | throw new IllegalNameException( deobfName, "There is already a method with that name and signature in class " + deobfClassName ); | 129 | throw new IllegalNameException( deobfName, "There is already a method with that name and signature in class " + deobfClassName ); |
| 130 | } | 130 | } |
| 131 | } | 131 | } |
| @@ -142,7 +142,7 @@ public class MappingsRenamer | |||
| 142 | MethodEntry targetEntry = new MethodEntry( obf.getClassEntry(), deobfName, obf.getSignature() ); | 142 | MethodEntry targetEntry = new MethodEntry( obf.getClassEntry(), deobfName, obf.getSignature() ); |
| 143 | if( m_mappings.containsDeobfMethod( obf.getClassEntry(), deobfName, obf.getSignature() ) || m_index.containsObfBehavior( targetEntry ) ) | 143 | if( m_mappings.containsDeobfMethod( obf.getClassEntry(), deobfName, obf.getSignature() ) || m_index.containsObfBehavior( targetEntry ) ) |
| 144 | { | 144 | { |
| 145 | String deobfClassName = getTranslator( TranslationDirection.Deobfuscating ).translateClass( obf.getClassName() ); | 145 | String deobfClassName = m_mappings.getTranslator( TranslationDirection.Deobfuscating ).translateClass( obf.getClassName() ); |
| 146 | throw new IllegalNameException( deobfName, "There is already a method with that name and signature in class " + deobfClassName ); | 146 | throw new IllegalNameException( deobfName, "There is already a method with that name and signature in class " + deobfClassName ); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| @@ -288,9 +288,4 @@ public class MappingsRenamer | |||
| 288 | } | 288 | } |
| 289 | return classMapping; | 289 | return classMapping; |
| 290 | } | 290 | } |
| 291 | |||
| 292 | private Translator getTranslator( TranslationDirection direction ) | ||
| 293 | { | ||
| 294 | return m_mappings.getTranslator( m_index.getTranslationIndex(), direction ); | ||
| 295 | } | ||
| 296 | } | 291 | } |
diff --git a/src/cuchaz/enigma/mapping/Translator.java b/src/cuchaz/enigma/mapping/Translator.java index 1c69b2f4..6cb52402 100644 --- a/src/cuchaz/enigma/mapping/Translator.java +++ b/src/cuchaz/enigma/mapping/Translator.java | |||
| @@ -10,33 +10,27 @@ | |||
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | package cuchaz.enigma.mapping; | 11 | package cuchaz.enigma.mapping; |
| 12 | 12 | ||
| 13 | import java.util.ArrayList; | ||
| 14 | import java.util.List; | ||
| 15 | import java.util.Map; | 13 | import java.util.Map; |
| 16 | 14 | ||
| 17 | import com.google.common.collect.Maps; | 15 | import com.google.common.collect.Maps; |
| 18 | 16 | ||
| 19 | import cuchaz.enigma.analysis.TranslationIndex; | ||
| 20 | import cuchaz.enigma.mapping.SignatureUpdater.ClassNameUpdater; | 17 | import cuchaz.enigma.mapping.SignatureUpdater.ClassNameUpdater; |
| 21 | 18 | ||
| 22 | public class Translator | 19 | public class Translator |
| 23 | { | 20 | { |
| 24 | private TranslationDirection m_direction; | 21 | private TranslationDirection m_direction; |
| 25 | private Map<String,ClassMapping> m_classes; | 22 | private Map<String,ClassMapping> m_classes; |
| 26 | private TranslationIndex m_index; | ||
| 27 | 23 | ||
| 28 | public Translator( ) | 24 | public Translator( ) |
| 29 | { | 25 | { |
| 30 | m_direction = null; | 26 | m_direction = null; |
| 31 | m_classes = Maps.newHashMap(); | 27 | m_classes = Maps.newHashMap(); |
| 32 | m_index = new TranslationIndex(); | ||
| 33 | } | 28 | } |
| 34 | 29 | ||
| 35 | public Translator( TranslationDirection direction, Map<String,ClassMapping> classes, TranslationIndex index ) | 30 | public Translator( TranslationDirection direction, Map<String,ClassMapping> classes ) |
| 36 | { | 31 | { |
| 37 | m_direction = direction; | 32 | m_direction = direction; |
| 38 | m_classes = classes; | 33 | m_classes = classes; |
| 39 | m_index = index; | ||
| 40 | } | 34 | } |
| 41 | 35 | ||
| 42 | @SuppressWarnings( "unchecked" ) | 36 | @SuppressWarnings( "unchecked" ) |
| @@ -138,28 +132,18 @@ public class Translator | |||
| 138 | 132 | ||
| 139 | public String translate( FieldEntry in ) | 133 | public String translate( FieldEntry in ) |
| 140 | { | 134 | { |
| 141 | for( String className : getSelfAndAncestors( in.getClassName() ) ) | 135 | // look for the class |
| 136 | ClassMapping classMapping = findClassMapping( in.getClassEntry() ); | ||
| 137 | if( classMapping != null ) | ||
| 142 | { | 138 | { |
| 143 | // look for the class | 139 | // look for the field |
| 144 | ClassMapping classMapping = findClassMapping( new ClassEntry( className ) ); | 140 | String translatedName = m_direction.choose( |
| 145 | if( classMapping != null ) | 141 | classMapping.getDeobfFieldName( in.getName() ), |
| 146 | { | 142 | classMapping.getObfFieldName( in.getName() ) |
| 147 | // look for the field | 143 | ); |
| 148 | String translatedName = m_direction.choose( | 144 | if( translatedName != null ) |
| 149 | classMapping.getDeobfFieldName( in.getName() ), | ||
| 150 | classMapping.getObfFieldName( in.getName() ) | ||
| 151 | ); | ||
| 152 | if( translatedName != null ) | ||
| 153 | { | ||
| 154 | return translatedName; | ||
| 155 | } | ||
| 156 | } | ||
| 157 | |||
| 158 | // is the field implemented in this class? | ||
| 159 | if( m_index.containsField( className, in.getName() ) ) | ||
| 160 | { | 145 | { |
| 161 | // stop traversing the superclass chain | 146 | return translatedName; |
| 162 | break; | ||
| 163 | } | 147 | } |
| 164 | } | 148 | } |
| 165 | return null; | 149 | return null; |
| @@ -180,27 +164,23 @@ public class Translator | |||
| 180 | 164 | ||
| 181 | public String translate( MethodEntry in ) | 165 | public String translate( MethodEntry in ) |
| 182 | { | 166 | { |
| 183 | for( String className : getSelfAndAncestors( in.getClassName() ) ) | 167 | // look for class |
| 168 | ClassMapping classMapping = findClassMapping( in.getClassEntry() ); | ||
| 169 | if( classMapping != null ) | ||
| 184 | { | 170 | { |
| 185 | // look for class | 171 | // look for the method |
| 186 | ClassMapping classMapping = findClassMapping( new ClassEntry( className ) ); | 172 | MethodMapping methodMapping = m_direction.choose( |
| 187 | if( classMapping != null ) | 173 | classMapping.getMethodByObf( in.getName(), in.getSignature() ), |
| 174 | classMapping.getMethodByDeobf( in.getName(), translateSignature( in.getSignature() ) ) | ||
| 175 | ); | ||
| 176 | if( methodMapping != null ) | ||
| 188 | { | 177 | { |
| 189 | // look for the method | 178 | return m_direction.choose( |
| 190 | MethodMapping methodMapping = m_direction.choose( | 179 | methodMapping.getDeobfName(), |
| 191 | classMapping.getMethodByObf( in.getName(), in.getSignature() ), | 180 | methodMapping.getObfName() |
| 192 | classMapping.getMethodByDeobf( in.getName(), translateSignature( in.getSignature() ) ) | ||
| 193 | ); | 181 | ); |
| 194 | if( methodMapping != null ) | ||
| 195 | { | ||
| 196 | return m_direction.choose( | ||
| 197 | methodMapping.getDeobfName(), | ||
| 198 | methodMapping.getObfName() | ||
| 199 | ); | ||
| 200 | } | ||
| 201 | } | 182 | } |
| 202 | } | 183 | } |
| 203 | |||
| 204 | return null; | 184 | return null; |
| 205 | } | 185 | } |
| 206 | 186 | ||
| @@ -248,27 +228,23 @@ public class Translator | |||
| 248 | 228 | ||
| 249 | public String translate( ArgumentEntry in ) | 229 | public String translate( ArgumentEntry in ) |
| 250 | { | 230 | { |
| 251 | for( String className : getSelfAndAncestors( in.getClassName() ) ) | 231 | // look for the class |
| 232 | ClassMapping classMapping = findClassMapping( in.getClassEntry() ); | ||
| 233 | if( classMapping != null ) | ||
| 252 | { | 234 | { |
| 253 | // look for the class | 235 | // look for the method |
| 254 | ClassMapping classMapping = findClassMapping( new ClassEntry( className ) ); | 236 | MethodMapping methodMapping = m_direction.choose( |
| 255 | if( classMapping != null ) | 237 | classMapping.getMethodByObf( in.getMethodName(), in.getMethodSignature() ), |
| 238 | classMapping.getMethodByDeobf( in.getMethodName(), translateSignature( in.getMethodSignature() ) ) | ||
| 239 | ); | ||
| 240 | if( methodMapping != null ) | ||
| 256 | { | 241 | { |
| 257 | // look for the method | 242 | return m_direction.choose( |
| 258 | MethodMapping methodMapping = m_direction.choose( | 243 | methodMapping.getDeobfArgumentName( in.getIndex() ), |
| 259 | classMapping.getMethodByObf( in.getMethodName(), in.getMethodSignature() ), | 244 | methodMapping.getObfArgumentName( in.getIndex() ) |
| 260 | classMapping.getMethodByDeobf( in.getMethodName(), translateSignature( in.getMethodSignature() ) ) | ||
| 261 | ); | 245 | ); |
| 262 | if( methodMapping != null ) | ||
| 263 | { | ||
| 264 | return m_direction.choose( | ||
| 265 | methodMapping.getDeobfArgumentName( in.getIndex() ), | ||
| 266 | methodMapping.getObfArgumentName( in.getIndex() ) | ||
| 267 | ); | ||
| 268 | } | ||
| 269 | } | 246 | } |
| 270 | } | 247 | } |
| 271 | |||
| 272 | return null; | 248 | return null; |
| 273 | } | 249 | } |
| 274 | 250 | ||
| @@ -303,14 +279,6 @@ public class Translator | |||
| 303 | } ); | 279 | } ); |
| 304 | } | 280 | } |
| 305 | 281 | ||
| 306 | private List<String> getSelfAndAncestors( String className ) | ||
| 307 | { | ||
| 308 | List<String> ancestry = new ArrayList<String>(); | ||
| 309 | ancestry.add( className ); | ||
| 310 | ancestry.addAll( m_index.getAncestry( className ) ); | ||
| 311 | return ancestry; | ||
| 312 | } | ||
| 313 | |||
| 314 | private ClassMapping findClassMapping( ClassEntry classEntry ) | 282 | private ClassMapping findClassMapping( ClassEntry classEntry ) |
| 315 | { | 283 | { |
| 316 | ClassMapping classMapping = m_classes.get( classEntry.getOuterClassName() ); | 284 | ClassMapping classMapping = m_classes.get( classEntry.getOuterClassName() ); |
| @@ -318,7 +286,7 @@ public class Translator | |||
| 318 | { | 286 | { |
| 319 | classMapping = m_direction.choose( | 287 | classMapping = m_direction.choose( |
| 320 | classMapping.getInnerClassByObf( classEntry.getInnerClassName() ), | 288 | classMapping.getInnerClassByObf( classEntry.getInnerClassName() ), |
| 321 | classMapping.getInnerClassByDeobf( classEntry.getInnerClassName() ) | 289 | classMapping.getInnerClassByDeobfThenObf( classEntry.getInnerClassName() ) |
| 322 | ); | 290 | ); |
| 323 | } | 291 | } |
| 324 | return classMapping; | 292 | return classMapping; |