summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/ConvertMain.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cuchaz/enigma/ConvertMain.java')
-rw-r--r--src/cuchaz/enigma/ConvertMain.java15
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;
10import cuchaz.enigma.convert.MatchesReader; 10import cuchaz.enigma.convert.MatchesReader;
11import cuchaz.enigma.convert.MatchesWriter; 11import cuchaz.enigma.convert.MatchesWriter;
12import cuchaz.enigma.gui.MatchingGui; 12import cuchaz.enigma.gui.MatchingGui;
13import cuchaz.enigma.gui.MatchingGui.SaveListener;
13import cuchaz.enigma.mapping.MappingParseException; 14import cuchaz.enigma.mapping.MappingParseException;
14import cuchaz.enigma.mapping.Mappings; 15import cuchaz.enigma.mapping.Mappings;
15import cuchaz.enigma.mapping.MappingsReader; 16import 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)