From e371a76c98116f140a996c2eab0e9ecc7db2d6c1 Mon Sep 17 00:00:00 2001 From: Konloch Date: Fri, 23 Jul 2021 19:17:20 -0700 Subject: [PATCH] Moved BootState --- .../club/bytecodeviewer/BytecodeViewer.java | 5 +-- .../club/bytecodeviewer/Configuration.java | 8 ++--- .../bytecodeviewer/bootloader/BootState.java | 31 +++++++++++++++++++ .../DecompilerSelectionPane.java | 3 +- 4 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 src/main/java/the/bytecode/club/bytecodeviewer/bootloader/BootState.java diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java index d3e50618..a04abc57 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java @@ -16,6 +16,7 @@ import me.konloch.kontainer.io.DiskReader; import the.bytecode.club.bytecodeviewer.api.BCV; import the.bytecode.club.bytecodeviewer.api.ExceptionUI; import the.bytecode.club.bytecodeviewer.bootloader.Boot; +import the.bytecode.club.bytecodeviewer.bootloader.BootState; import the.bytecode.club.bytecodeviewer.bootloader.InstallFatJar; import the.bytecode.club.bytecodeviewer.bootloader.UpdateCheck; import the.bytecode.club.bytecodeviewer.gui.MainViewerGUI; @@ -193,7 +194,7 @@ public class BytecodeViewer //load settings and set swing components state SettingsSerializer.loadSettings(); - Configuration.bootState = Configuration.BootState.SETTINGS_LOADED; + Configuration.bootState = BootState.SETTINGS_LOADED; //set translation language if (!Settings.hasSetLanguageAsSystemLanguage) @@ -219,7 +220,7 @@ public class BytecodeViewer if (CLI == CommandLineInput.GUI) { BytecodeViewer.boot(false); - Configuration.bootState = Configuration.BootState.GUI_SHOWING; + Configuration.bootState = BootState.GUI_SHOWING; } else //CLI arguments say keep it CLI { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java b/src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java index a5d8f46a..ec40e9e3 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java @@ -1,5 +1,6 @@ package the.bytecode.club.bytecodeviewer; +import the.bytecode.club.bytecodeviewer.bootloader.BootState; import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme; import the.bytecode.club.bytecodeviewer.gui.theme.RSTATheme; import the.bytecode.club.bytecodeviewer.translation.Language; @@ -12,6 +13,7 @@ import java.io.File; * @author Konloch * @since 6/21/2021 */ + public class Configuration { public static String python2 = ""; @@ -108,10 +110,4 @@ public class Configuration return new File("."); } - public enum BootState - { - START_UP, - SETTINGS_LOADED, - GUI_SHOWING, - } } \ No newline at end of file diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/BootState.java b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/BootState.java new file mode 100644 index 00000000..9fc05162 --- /dev/null +++ b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/BootState.java @@ -0,0 +1,31 @@ +package the.bytecode.club.bytecodeviewer.bootloader; + +/*************************************************************************** + * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * + * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +/** + * @author Konloch + * @since 7/23/2021 + */ + +public enum BootState +{ + START_UP, + SETTINGS_LOADED, + GUI_SHOWING, +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/DecompilerSelectionPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/DecompilerSelectionPane.java index 80d4ed21..3b021243 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/DecompilerSelectionPane.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/DecompilerSelectionPane.java @@ -2,6 +2,7 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.SettingsSerializer; +import the.bytecode.club.bytecodeviewer.bootloader.BootState; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; @@ -110,7 +111,7 @@ public class DecompilerSelectionPane AbstractButton button = it.nextElement(); button.addActionListener((event)-> { - if(Configuration.bootState != Configuration.BootState.GUI_SHOWING) + if(Configuration.bootState != BootState.GUI_SHOWING) return; SettingsSerializer.saveSettingsAsync();