diff options
| author | 2019-01-30 21:05:32 +0200 | |
|---|---|---|
| committer | 2019-01-30 21:05:32 +0200 | |
| commit | ba7a354efae7d49833c887cf147ac940c975a1fa (patch) | |
| tree | 02e14fda81dd5984e24f2df392c57c6e829fc875 /src/test/java/cuchaz/enigma/TestSourceIndex.java | |
| parent | Rewrite the Jenkinsfile to use the new declarative pipeline syntax, lets hope... (diff) | |
| download | enigma-fork-ba7a354efae7d49833c887cf147ac940c975a1fa.tar.gz enigma-fork-ba7a354efae7d49833c887cf147ac940c975a1fa.tar.xz enigma-fork-ba7a354efae7d49833c887cf147ac940c975a1fa.zip | |
Remap sources (#106)
* Source remapping beginnings
* Fix navigation to remapped classes
* Translate identifier info reference
* Remap local variables with default names in source
* Caching translator
* Fix lack of highlighting for first opened class
* Fix unicode variable names
* Unicode checker shouldn't be checking just alphanumeric
* Fix package tree being built from obf names
* Don't index `this` as method call for method::reference
* Apply proposed names
* Fix source export issues
* Replace unicode var names at bytecode level uniquely
* Drop imports from editor source
* Class selector fixes
* Delta keep track of base mappings to enable lookup of old names
* Optimize source remapping by remapping source with a StringBuffer instead of copying
* Bump version
Diffstat (limited to 'src/test/java/cuchaz/enigma/TestSourceIndex.java')
| -rw-r--r-- | src/test/java/cuchaz/enigma/TestSourceIndex.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/java/cuchaz/enigma/TestSourceIndex.java b/src/test/java/cuchaz/enigma/TestSourceIndex.java index a5f5f71..ce5d631 100644 --- a/src/test/java/cuchaz/enigma/TestSourceIndex.java +++ b/src/test/java/cuchaz/enigma/TestSourceIndex.java | |||
| @@ -13,6 +13,7 @@ package cuchaz.enigma; | |||
| 13 | 13 | ||
| 14 | import com.google.common.collect.Sets; | 14 | import com.google.common.collect.Sets; |
| 15 | import com.strobel.decompiler.languages.java.ast.CompilationUnit; | 15 | import com.strobel.decompiler.languages.java.ast.CompilationUnit; |
| 16 | import cuchaz.enigma.analysis.SourceIndex; | ||
| 16 | import cuchaz.enigma.translation.representation.entry.ClassEntry; | 17 | import cuchaz.enigma.translation.representation.entry.ClassEntry; |
| 17 | import org.junit.Test; | 18 | import org.junit.Test; |
| 18 | 19 | ||
| @@ -50,11 +51,13 @@ public class TestSourceIndex { | |||
| 50 | } | 51 | } |
| 51 | } | 52 | } |
| 52 | 53 | ||
| 54 | SourceProvider sourceProvider = deobfuscator.getObfSourceProvider(); | ||
| 53 | for (ClassEntry obfClassEntry : classEntries) { | 55 | for (ClassEntry obfClassEntry : classEntries) { |
| 54 | try { | 56 | try { |
| 55 | CompilationUnit tree = deobfuscator.getSourceTree(obfClassEntry.getName()); | 57 | CompilationUnit tree = sourceProvider.getSources(obfClassEntry.getName()); |
| 56 | String source = deobfuscator.getSource(tree); | 58 | String source = sourceProvider.writeSourceToString(tree); |
| 57 | deobfuscator.getSourceIndex(tree, source); | 59 | |
| 60 | SourceIndex.buildIndex(source, tree, true); | ||
| 58 | } catch (Throwable t) { | 61 | } catch (Throwable t) { |
| 59 | throw new Error("Unable to index " + obfClassEntry, t); | 62 | throw new Error("Unable to index " + obfClassEntry, t); |
| 60 | } | 63 | } |