Launch Args Cleanup

This commit is contained in:
Konloch 2021-07-06 16:54:20 -07:00
parent 0a4f234841
commit de8cb5b4e7
2 changed files with 7 additions and 7 deletions

View file

@ -114,7 +114,7 @@ import static the.bytecode.club.bytecodeviewer.util.MiscUtils.guessLanguage;
public class BytecodeViewer public class BytecodeViewer
{ {
public static String[] args; public static String[] launchArgs;
public static MainViewerGUI viewer = null; public static MainViewerGUI viewer = null;
public static ClassNodeLoader loader = new ClassNodeLoader(); //might be insecure due to assholes targeting BCV, 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, 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) public static void main(String[] args)
{ {
BytecodeViewer.args = args; launchArgs = args;
//welcome message //welcome message
System.out.println("https://the.bytecode.club - Created by @Konloch - Bytecode Viewer " + VERSION + ", " + "Fat-Jar: " + FAT_JAR); 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"); System.out.println("Start up took " + ((System.currentTimeMillis() - Configuration.start) / 1000) + " seconds");
if (!cli) if (!cli)
if (args.length >= 1) if (launchArgs.length >= 1)
for (String s : args) for (String s : launchArgs)
openFiles(new File[]{new File(s)}, true); openFiles(new File[]{new File(s)}, true);
} }

View file

@ -15,7 +15,7 @@ import java.util.List;
import static the.bytecode.club.bytecodeviewer.Constants.nl; 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. * This broke with maven so now only FatJar builds will work.
* *
@ -105,11 +105,11 @@ public class BootCheck implements Runnable
Boot.globalstop = false; Boot.globalstop = false;
Boot.hide(); Boot.hide();
if (CommandLineInput.parseCommandLine(BytecodeViewer.args) == CommandLineInput.OPEN_FILE) if (CommandLineInput.parseCommandLine(BytecodeViewer.launchArgs) == CommandLineInput.OPEN_FILE)
BytecodeViewer.boot(false); BytecodeViewer.boot(false);
else { else {
BytecodeViewer.boot(true); BytecodeViewer.boot(true);
CommandLineInput.executeCommandLine(BytecodeViewer.args); CommandLineInput.executeCommandLine(BytecodeViewer.launchArgs);
} }
} }
} }