Skip to content

Commit 66537d9

Browse files
committed
1.2
-Prevent GUIs from being resized -Stop the execution of the deobfuscator after console has been closed
1 parent 1e57e53 commit 66537d9

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/io/github/thistestuser/DeobfuscatorFrame.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
public class DeobfuscatorFrame
3030
{
31-
private static final String VERSION = "1.1";
31+
private static final String VERSION = "1.2";
3232
private JFrame frame;
3333
private JTextField deobfuscatorField;
3434
private File deobfuscatorPath;
@@ -80,6 +80,7 @@ private void initialize()
8080
frame = new JFrame();
8181
frame.getContentPane().setFont(new Font("Tahoma", Font.PLAIN, 11));
8282
frame.setBounds(100, 100, 580, 560);
83+
frame.setResizable(false);
8384
frame.setTitle("Deobfuscator-GUI " + VERSION + " By ThisTestUser");
8485
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
8586
frame.getContentPane().setLayout(null);
@@ -373,6 +374,7 @@ public void actionPerformed(ActionEvent e)
373374
JFrame newFrame = new JFrame();
374375
newFrame.setTitle("Load Config");
375376
newFrame.setBounds(100, 100, 450, 150);
377+
newFrame.setResizable(false);
376378
newFrame.getContentPane().setLayout(null);
377379

378380
JLabel lblPasteYourCommand = new JLabel("<html>Paste your command that you use to run java-deobfuscator here.<br>\r\nThis should be the command you paste via the command line.</html>");
@@ -436,6 +438,7 @@ public void actionPerformed(ActionEvent e)
436438
JFrame newFrame = new JFrame();
437439
newFrame.setTitle("Copy Config");
438440
newFrame.setBounds(100, 100, 450, 200);
441+
newFrame.setResizable(false);
439442
newFrame.getContentPane().setLayout(null);
440443

441444
JLabel lblCopyYourCommand = new JLabel("<html>Copy the command below and execute it via\r\nyour command executor to run it.</html>");
@@ -522,16 +525,7 @@ public void actionPerformed(ActionEvent e)
522525
newFrame.pack();
523526
newFrame.setSize(800, 600);
524527
newFrame.setVisible(true);
525-
newFrame.addWindowListener(new WindowAdapter()
526-
{
527-
@Override
528-
public void windowClosing(WindowEvent e)
529-
{
530-
btnRun.setEnabled(true);
531-
e.getWindow().dispose();
532-
}
533-
});
534-
new SwingWorker<Void, String>()
528+
SwingWorker<Void, String> worker = new SwingWorker<Void, String>()
535529
{
536530
@Override
537531
protected Void doInBackground() throws Exception
@@ -555,7 +549,18 @@ protected void process(List<String> chunks)
555549
area.append("\n");
556550
}
557551
}
558-
}.execute();
552+
};
553+
worker.execute();
554+
newFrame.addWindowListener(new WindowAdapter()
555+
{
556+
@Override
557+
public void windowClosing(WindowEvent e)
558+
{
559+
btnRun.setEnabled(true);
560+
worker.cancel(true);
561+
e.getWindow().dispose();
562+
}
563+
});
559564
}
560565
});
561566
}

0 commit comments

Comments
 (0)