From de8cb5b4e7b30a750d0346e034430055720cdf8a Mon Sep 17 00:00:00 2001 From: Konloch Date: Tue, 6 Jul 2021 16:54:20 -0700 Subject: [PATCH] Launch Args Cleanup --- .../the/bytecode/club/bytecodeviewer/BytecodeViewer.java | 8 ++++---- .../the/bytecode/club/bytecodeviewer/util/BootCheck.java | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java index d6cb81ce..bace70c9 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java @@ -114,7 +114,7 @@ import static the.bytecode.club.bytecodeviewer.util.MiscUtils.guessLanguage; public class BytecodeViewer { - public static String[] args; + public static String[] launchArgs; public static MainViewerGUI viewer = null; public static ClassNodeLoader loader = new ClassNodeLoader(); //might be insecure due to assholes targeting BCV, public static SecurityMan sm = new SecurityMan(); //might be insecure due to assholes targeting BCV, @@ -137,7 +137,7 @@ public class BytecodeViewer */ public static void main(String[] args) { - BytecodeViewer.args = args; + launchArgs = args; //welcome message System.out.println("https://the.bytecode.club - Created by @Konloch - Bytecode Viewer " + VERSION + ", " + "Fat-Jar: " + FAT_JAR); @@ -235,8 +235,8 @@ public class BytecodeViewer System.out.println("Start up took " + ((System.currentTimeMillis() - Configuration.start) / 1000) + " seconds"); if (!cli) - if (args.length >= 1) - for (String s : args) + if (launchArgs.length >= 1) + for (String s : launchArgs) openFiles(new File[]{new File(s)}, true); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/BootCheck.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/BootCheck.java index 1aa2ea6e..07ed2917 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/BootCheck.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/BootCheck.java @@ -15,7 +15,7 @@ import java.util.List; import static the.bytecode.club.bytecodeviewer.Constants.nl; /** - * Loads the libraries on boot. + * Loads the libraries on boot. If booting failed for some reason, this kicks in as a fail safe. * * This broke with maven so now only FatJar builds will work. * @@ -105,11 +105,11 @@ public class BootCheck implements Runnable Boot.globalstop = false; Boot.hide(); - if (CommandLineInput.parseCommandLine(BytecodeViewer.args) == CommandLineInput.OPEN_FILE) + if (CommandLineInput.parseCommandLine(BytecodeViewer.launchArgs) == CommandLineInput.OPEN_FILE) BytecodeViewer.boot(false); else { BytecodeViewer.boot(true); - CommandLineInput.executeCommandLine(BytecodeViewer.args); + CommandLineInput.executeCommandLine(BytecodeViewer.launchArgs); } } }