diff options
Diffstat (limited to 'src/cuchaz/enigma/gui/GuiController.java')
| -rw-r--r-- | src/cuchaz/enigma/gui/GuiController.java | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/cuchaz/enigma/gui/GuiController.java b/src/cuchaz/enigma/gui/GuiController.java index c7efbce..2862ebe 100644 --- a/src/cuchaz/enigma/gui/GuiController.java +++ b/src/cuchaz/enigma/gui/GuiController.java | |||
| @@ -23,6 +23,7 @@ import com.google.common.collect.Queues; | |||
| 23 | import com.strobel.decompiler.languages.java.ast.CompilationUnit; | 23 | import com.strobel.decompiler.languages.java.ast.CompilationUnit; |
| 24 | 24 | ||
| 25 | import cuchaz.enigma.Deobfuscator; | 25 | import cuchaz.enigma.Deobfuscator; |
| 26 | import cuchaz.enigma.Deobfuscator.ProgressListener; | ||
| 26 | import cuchaz.enigma.analysis.BehaviorReferenceTreeNode; | 27 | import cuchaz.enigma.analysis.BehaviorReferenceTreeNode; |
| 27 | import cuchaz.enigma.analysis.ClassImplementationsTreeNode; | 28 | import cuchaz.enigma.analysis.ClassImplementationsTreeNode; |
| 28 | import cuchaz.enigma.analysis.ClassInheritanceTreeNode; | 29 | import cuchaz.enigma.analysis.ClassInheritanceTreeNode; |
| @@ -32,6 +33,7 @@ import cuchaz.enigma.analysis.MethodImplementationsTreeNode; | |||
| 32 | import cuchaz.enigma.analysis.MethodInheritanceTreeNode; | 33 | import cuchaz.enigma.analysis.MethodInheritanceTreeNode; |
| 33 | import cuchaz.enigma.analysis.SourceIndex; | 34 | import cuchaz.enigma.analysis.SourceIndex; |
| 34 | import cuchaz.enigma.analysis.Token; | 35 | import cuchaz.enigma.analysis.Token; |
| 36 | import cuchaz.enigma.gui.ProgressDialog.ProgressRunnable; | ||
| 35 | import cuchaz.enigma.mapping.BehaviorEntry; | 37 | import cuchaz.enigma.mapping.BehaviorEntry; |
| 36 | import cuchaz.enigma.mapping.ClassEntry; | 38 | import cuchaz.enigma.mapping.ClassEntry; |
| 37 | import cuchaz.enigma.mapping.Entry; | 39 | import cuchaz.enigma.mapping.Entry; |
| @@ -110,28 +112,29 @@ public class GuiController | |||
| 110 | refreshCurrentClass(); | 112 | refreshCurrentClass(); |
| 111 | } | 113 | } |
| 112 | 114 | ||
| 113 | public void export( final File dirOut ) | 115 | public void exportSource( final File dirOut ) |
| 114 | { | 116 | { |
| 115 | new Thread( ) | 117 | ProgressDialog.runInThread( m_gui.getFrame(), new ProgressRunnable( ) |
| 116 | { | 118 | { |
| 117 | @Override | 119 | @Override |
| 118 | public void run( ) | 120 | public void run( ProgressListener progress ) |
| 121 | throws Exception | ||
| 119 | { | 122 | { |
| 120 | ProgressDialog progress = new ProgressDialog( m_gui.getFrame() ); | 123 | m_deobfuscator.writeSources( dirOut, progress ); |
| 121 | try | ||
| 122 | { | ||
| 123 | m_deobfuscator.writeSources( dirOut, progress ); | ||
| 124 | } | ||
| 125 | catch( Exception ex ) | ||
| 126 | { | ||
| 127 | throw new Error( ex ); | ||
| 128 | } | ||
| 129 | finally | ||
| 130 | { | ||
| 131 | progress.close(); | ||
| 132 | } | ||
| 133 | } | 124 | } |
| 134 | }.start(); | 125 | } ); |
| 126 | } | ||
| 127 | |||
| 128 | public void exportJar( final File fileOut ) | ||
| 129 | { | ||
| 130 | ProgressDialog.runInThread( m_gui.getFrame(), new ProgressRunnable( ) | ||
| 131 | { | ||
| 132 | @Override | ||
| 133 | public void run( ProgressListener progress ) | ||
| 134 | { | ||
| 135 | m_deobfuscator.writeJar( fileOut, progress ); | ||
| 136 | } | ||
| 137 | } ); | ||
| 135 | } | 138 | } |
| 136 | 139 | ||
| 137 | public Token getToken( int pos ) | 140 | public Token getToken( int pos ) |