From 2dbcb8bb7d43f3824deb8217320c62d79d1bb2d2 Mon Sep 17 00:00:00 2001 From: Konloch Date: Tue, 6 Jul 2021 21:45:39 -0700 Subject: [PATCH] Cleanup --- .../club/bytecodeviewer/BytecodeViewer.java | 19 +++++++++++++++---- .../gui/components/RunOptions.java | 9 +++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java index b13cc3fc..c9e10dd1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java @@ -12,6 +12,7 @@ import org.apache.commons.io.FileUtils; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bootloader.Boot; import the.bytecode.club.bytecodeviewer.api.ClassNodeLoader; +import the.bytecode.club.bytecodeviewer.api.ExceptionUI; import the.bytecode.club.bytecodeviewer.gui.components.*; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.TabbedPane; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ClassViewer; @@ -222,7 +223,10 @@ public class BytecodeViewer */ public static void boot(boolean cli) { + //delete files in the temp folder cleanupAsync(); + + //shutdown hooks Runtime.getRuntime().addShutdownHook(new Thread(() -> { for (Process proc : createdProcesses) @@ -231,7 +235,10 @@ public class BytecodeViewer cleanup(); }, "Shutdown Hook")); + //setup the viewer viewer.calledAfterLoad(); + + //setup the recent files Settings.resetRecentFilesMenu(); //ping back once on first boot to add to global user count @@ -240,15 +247,19 @@ public class BytecodeViewer pingBack.start(); Configuration.pingback = true; } - + + //version checking if (viewer.updateCheck.isSelected()) versionChecker.start(); + //show the main UI if (!cli) viewer.setVisible(true); + //print startup time System.out.println("Start up took " + ((System.currentTimeMillis() - Configuration.start) / 1000) + " seconds"); - + + //open files from launch args if (!cli) if (launchArgs.length >= 1) for (String s : launchArgs) @@ -580,7 +591,7 @@ public class BytecodeViewer */ public static void handleException(Throwable t) { - BytecodeViewer.handleException(t); + handleException(t, ExceptionUI.KONLOCH); } /** @@ -588,7 +599,7 @@ public class BytecodeViewer */ public static void handleException(Throwable t, String author) { - BytecodeViewer.handleException(t, author); + new ExceptionUI(t, author); } /** diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/RunOptions.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/RunOptions.java index c69764c5..2f00fa71 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/RunOptions.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/RunOptions.java @@ -38,6 +38,11 @@ import the.bytecode.club.bytecodeviewer.plugin.preinstalled.EZInjection; public class RunOptions extends JFrame { + private final JTextField mainMethodFQN; + private final JCheckBox debugMethodCalls; + private final JTextField debugClasses; + private final JTextField socksProxy; + public RunOptions() { this.setIconImages(Resources.iconList); @@ -125,8 +130,4 @@ public class RunOptions extends JFrame } private static final long serialVersionUID = -2662514582647810868L; - private final JTextField mainMethodFQN; - private final JCheckBox debugMethodCalls; - private final JTextField debugClasses; - private final JTextField socksProxy; }