diff options
| author | 2015-03-07 16:00:44 -0500 | |
|---|---|---|
| committer | 2015-03-07 16:00:44 -0500 | |
| commit | 59ba32f0285aa6d6b367e6283cae9268e8947fed (patch) | |
| tree | 10bc21f028a2ddd80a761c0e666be20b6e7e45bc /src/cuchaz/enigma/ConvertMain.java | |
| parent | added simple renamer for local variable table (diff) | |
| download | enigma-fork-59ba32f0285aa6d6b367e6283cae9268e8947fed.tar.gz enigma-fork-59ba32f0285aa6d6b367e6283cae9268e8947fed.tar.xz enigma-fork-59ba32f0285aa6d6b367e6283cae9268e8947fed.zip | |
match/unmatch button works
Diffstat (limited to 'src/cuchaz/enigma/ConvertMain.java')
| -rw-r--r-- | src/cuchaz/enigma/ConvertMain.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/cuchaz/enigma/ConvertMain.java b/src/cuchaz/enigma/ConvertMain.java index 4fc58e8..cad49f5 100644 --- a/src/cuchaz/enigma/ConvertMain.java +++ b/src/cuchaz/enigma/ConvertMain.java | |||
| @@ -10,6 +10,7 @@ import cuchaz.enigma.convert.Matches; | |||
| 10 | import cuchaz.enigma.convert.MatchesReader; | 10 | import cuchaz.enigma.convert.MatchesReader; |
| 11 | import cuchaz.enigma.convert.MatchesWriter; | 11 | import cuchaz.enigma.convert.MatchesWriter; |
| 12 | import cuchaz.enigma.gui.MatchingGui; | 12 | import cuchaz.enigma.gui.MatchingGui; |
| 13 | import cuchaz.enigma.gui.MatchingGui.SaveListener; | ||
| 13 | import cuchaz.enigma.mapping.MappingParseException; | 14 | import cuchaz.enigma.mapping.MappingParseException; |
| 14 | import cuchaz.enigma.mapping.Mappings; | 15 | import cuchaz.enigma.mapping.Mappings; |
| 15 | import cuchaz.enigma.mapping.MappingsReader; | 16 | import cuchaz.enigma.mapping.MappingsReader; |
| @@ -49,7 +50,7 @@ public class ConvertMain { | |||
| 49 | System.out.println("Wrote:\n\t" + matchingFile.getAbsolutePath()); | 50 | System.out.println("Wrote:\n\t" + matchingFile.getAbsolutePath()); |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | private static void editMatches(File matchingFile, JarFile sourceJar, JarFile destJar, Mappings mappings) | 53 | private static void editMatches(final File matchingFile, JarFile sourceJar, JarFile destJar, Mappings mappings) |
| 53 | throws IOException { | 54 | throws IOException { |
| 54 | System.out.println("Reading matches..."); | 55 | System.out.println("Reading matches..."); |
| 55 | Matches matches = MatchesReader.read(matchingFile); | 56 | Matches matches = MatchesReader.read(matchingFile); |
| @@ -58,9 +59,17 @@ public class ConvertMain { | |||
| 58 | sourceDeobfuscator.setMappings(mappings); | 59 | sourceDeobfuscator.setMappings(mappings); |
| 59 | System.out.println("Indexing dest jar..."); | 60 | System.out.println("Indexing dest jar..."); |
| 60 | Deobfuscator destDeobfuscator = new Deobfuscator(destJar); | 61 | Deobfuscator destDeobfuscator = new Deobfuscator(destJar); |
| 61 | destDeobfuscator.setMappings(MappingsConverter.newMappings(matches, mappings, sourceDeobfuscator, destDeobfuscator)); | ||
| 62 | System.out.println("Starting GUI..."); | 62 | System.out.println("Starting GUI..."); |
| 63 | new MatchingGui(matches, sourceDeobfuscator, destDeobfuscator); | 63 | new MatchingGui(matches, sourceDeobfuscator, destDeobfuscator).setSaveListener(new SaveListener() { |
| 64 | @Override | ||
| 65 | public void save(Matches matches) { | ||
| 66 | try { | ||
| 67 | MatchesWriter.write(matches, matchingFile); | ||
| 68 | } catch (IOException ex) { | ||
| 69 | throw new Error(ex); | ||
| 70 | } | ||
| 71 | } | ||
| 72 | }); | ||
| 64 | } | 73 | } |
| 65 | 74 | ||
| 66 | private static void convertMappings(File outMappingsFile, Mappings mappings, File matchingFile) | 75 | private static void convertMappings(File outMappingsFile, Mappings mappings, File matchingFile) |