From 6c90b5f41ec9ea8c512981e4dbe69d5d9769651f Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 11 Aug 2016 14:18:43 +0100 Subject: Allow exporting mappings as SRG or Enigma --- src/main/java/cuchaz/enigma/gui/GuiController.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/cuchaz/enigma/gui/GuiController.java') diff --git a/src/main/java/cuchaz/enigma/gui/GuiController.java b/src/main/java/cuchaz/enigma/gui/GuiController.java index c301594..fe7d097 100644 --- a/src/main/java/cuchaz/enigma/gui/GuiController.java +++ b/src/main/java/cuchaz/enigma/gui/GuiController.java @@ -17,6 +17,7 @@ import com.strobel.decompiler.languages.java.ast.CompilationUnit; import java.io.File; import java.io.FileReader; +import java.io.FileWriter; import java.io.IOException; import java.util.Collection; import java.util.Deque; @@ -87,6 +88,17 @@ public class GuiController { this.isDirty = false; } + public void saveOldMappings(File file) throws IOException { + FileWriter out = new FileWriter(file); + new MappingsOldWriter().write(out, this.deobfuscator.getMappings()); + this.isDirty = false; + } + + public void saveSRGMappings(File file) throws IOException { + new MappingsSRGWriter().write(file, this.deobfuscator); + this.isDirty = false; + } + public void closeMappings() { this.deobfuscator.setMappings(null); this.gui.setMappingsFile(null); -- cgit v1.2.3