diff options
| author | 2018-07-17 19:14:08 +0200 | |
|---|---|---|
| committer | 2018-07-17 19:14:08 +0200 | |
| commit | a88175ffc95792b88a8724f66db6dda2b8cc32ee (patch) | |
| tree | 65895bbc6cf1766f4ca01e1257619ab1993e71dc /src/main/java/cuchaz/enigma/mapping/MappingsSRGWriter.java | |
| parent | Merge pull request #3 from thiakil/src-jar (diff) | |
| download | enigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.tar.gz enigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.tar.xz enigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.zip | |
ASM Based Class Translator (#1)
* Initial port to ASM
* Package updates
* Annotation + inner class translation
* Fix inner class mapping
* More bytecode translation
* Signature refactoring
* Fix highlighting of mapped names
* Fix parameter name offset
* Fix anonymous class generation
* Fix issues with inner class signature transformation
* Fix bridged method detection
* Fix compile issues
* Resolve all failed tests
* Apply deobfuscated name to transformed classes
* Fix class signatures not being translated
* Fix frame array type translation
* Fix frame array type translation
* Fix array translation in method calls
* Fix method reference and bridge detection
* Fix handling of null deobf mappings
* Parameter translation in interfaces
* Fix enum parameter index offset
* Fix parsed local variable indexing
* Fix stackoverflow on rebuilding method names
* Ignore invalid decompiled variable indices
* basic source jar
* Output directly to file on source export
* Make decompile parallel
* fix incorrect super calls
* Use previous save state to delete old mapping files
* Fix old mappings not properly being removed
* Fix old mappings not properly being removed
* make isMethodProvider public
(cherry picked from commit ebad6a9)
* speed up Deobfuscator's getSources by using a single TranslatingTypeloader and caching the ClassLoaderTypeloader
* ignore .idea project folders
* move SynchronizedTypeLoader to a non-inner
* fix signature remap of inners for now
* index & resolve method/field references for usages view
* Allow reader/writer subclasses to provide the underlying file operations
* fix giving obf classes a name not removing them from the panel
* buffer the ParsedJar class entry inputstream, allow use with a jarinputstream
* make CachingClasspathTypeLoader public
* make CachingClasspathTypeLoader public
* support enum switches with obfuscated SwitchMaps
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/MappingsSRGWriter.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/MappingsSRGWriter.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/MappingsSRGWriter.java b/src/main/java/cuchaz/enigma/mapping/MappingsSRGWriter.java index b0eb826..32f0ee9 100644 --- a/src/main/java/cuchaz/enigma/mapping/MappingsSRGWriter.java +++ b/src/main/java/cuchaz/enigma/mapping/MappingsSRGWriter.java | |||
| @@ -2,6 +2,7 @@ package cuchaz.enigma.mapping; | |||
| 2 | 2 | ||
| 3 | import com.google.common.base.Charsets; | 3 | import com.google.common.base.Charsets; |
| 4 | import cuchaz.enigma.analysis.TranslationIndex; | 4 | import cuchaz.enigma.analysis.TranslationIndex; |
| 5 | import cuchaz.enigma.mapping.entry.ReferencedEntryPool; | ||
| 5 | 6 | ||
| 6 | import java.io.*; | 7 | import java.io.*; |
| 7 | import java.util.ArrayList; | 8 | import java.util.ArrayList; |
| @@ -19,7 +20,7 @@ public class MappingsSRGWriter { | |||
| 19 | } | 20 | } |
| 20 | file.createNewFile(); | 21 | file.createNewFile(); |
| 21 | 22 | ||
| 22 | TranslationIndex index = new TranslationIndex(); | 23 | TranslationIndex index = new TranslationIndex(new ReferencedEntryPool()); |
| 23 | 24 | ||
| 24 | PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8)); | 25 | PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8)); |
| 25 | List<String> fieldMappings = new ArrayList<>(); | 26 | List<String> fieldMappings = new ArrayList<>(); |
| @@ -43,7 +44,7 @@ public class MappingsSRGWriter { | |||
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | for (MethodMapping methodMapping : sorted(innerClassMapping.methods())) { | 46 | for (MethodMapping methodMapping : sorted(innerClassMapping.methods())) { |
| 46 | methodMappings.add("MD: " + innerClassName + "/" + methodMapping.getObfName() + " " + methodMapping.getObfSignature() + " " + innerDeobfClassName + "/" + methodMapping.getDeobfName() + " " + mappings.getTranslator(TranslationDirection.Deobfuscating, index).translateSignature(methodMapping.getObfSignature())); | 47 | methodMappings.add("MD: " + innerClassName + "/" + methodMapping.getObfName() + " " + methodMapping.getObfDesc() + " " + innerDeobfClassName + "/" + methodMapping.getDeobfName() + " " + mappings.getTranslator(TranslationDirection.DEOBFUSCATING, index).getTranslatedMethodDesc(methodMapping.getObfDesc())); |
| 47 | } | 48 | } |
| 48 | } | 49 | } |
| 49 | 50 | ||
| @@ -52,7 +53,7 @@ public class MappingsSRGWriter { | |||
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | for (MethodMapping methodMapping : sorted(classMapping.methods())) { | 55 | for (MethodMapping methodMapping : sorted(classMapping.methods())) { |
| 55 | methodMappings.add("MD: " + classMapping.getObfFullName() + "/" + methodMapping.getObfName() + " " + methodMapping.getObfSignature() + " " + classMapping.getDeobfName() + "/" + methodMapping.getDeobfName() + " " + mappings.getTranslator(TranslationDirection.Deobfuscating, index).translateSignature(methodMapping.getObfSignature())); | 56 | methodMappings.add("MD: " + classMapping.getObfFullName() + "/" + methodMapping.getObfName() + " " + methodMapping.getObfDesc() + " " + classMapping.getDeobfName() + "/" + methodMapping.getDeobfName() + " " + mappings.getTranslator(TranslationDirection.DEOBFUSCATING, index).getTranslatedMethodDesc(methodMapping.getObfDesc())); |
| 56 | } | 57 | } |
| 57 | } | 58 | } |
| 58 | for (String fd : fieldMappings) { | 59 | for (String fd : fieldMappings) { |