GUI Code Cleanup
This commit is contained in:
parent
784eb1921a
commit
c940bf5c8d
29 changed files with 177 additions and 261 deletions
|
@ -26,9 +26,9 @@ import the.bytecode.club.bytecodeviewer.compilers.Compilers;
|
|||
import the.bytecode.club.bytecodeviewer.gui.ClassViewer;
|
||||
import the.bytecode.club.bytecodeviewer.gui.ResourceListPane;
|
||||
import the.bytecode.club.bytecodeviewer.gui.MainViewerGUI;
|
||||
import the.bytecode.club.bytecodeviewer.gui.RunOptions;
|
||||
import the.bytecode.club.bytecodeviewer.gui.extras.RunOptions;
|
||||
import the.bytecode.club.bytecodeviewer.gui.SearchBoxPane;
|
||||
import the.bytecode.club.bytecodeviewer.gui.SystemErrConsole;
|
||||
import the.bytecode.club.bytecodeviewer.gui.extras.SystemErrConsole;
|
||||
import the.bytecode.club.bytecodeviewer.gui.WorkPane;
|
||||
import the.bytecode.club.bytecodeviewer.obfuscators.mapping.Refactorer;
|
||||
import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
|
||||
|
@ -374,7 +374,7 @@ public class BytecodeViewer
|
|||
* @return true if no errors, false if it failed to compile.
|
||||
*/
|
||||
public static boolean compile(boolean message) {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
boolean actuallyTried = false;
|
||||
|
||||
for (java.awt.Component c : BytecodeViewer.viewer.workPane.getLoadedViewers()) {
|
||||
|
@ -401,7 +401,7 @@ public class BytecodeViewer
|
|||
} else {
|
||||
BytecodeViewer.showMessage("There has been an error with assembling your Smali code, "
|
||||
+ "please check this. Class: " + origNode.name);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ public class BytecodeViewer
|
|||
} else {
|
||||
BytecodeViewer.showMessage("There has been an error with assembling your Krakatau "
|
||||
+ "Bytecode, please check this. Class: " + origNode.name);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -463,7 +463,7 @@ public class BytecodeViewer
|
|||
errConsole.pretty();
|
||||
errConsole.setVisible(true);
|
||||
errConsole.finished();
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ public class BytecodeViewer
|
|||
else
|
||||
BytecodeViewer.showMessage("You have no editable panes opened, make one editable and try again.");
|
||||
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -493,7 +493,7 @@ public class BytecodeViewer
|
|||
if (f.exists())
|
||||
BytecodeViewer.addRecentFile(f);
|
||||
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
Configuration.needsReDump = true;
|
||||
Thread t = new Thread(new OpenFile(files));
|
||||
t.start();
|
||||
|
@ -698,9 +698,9 @@ public class BytecodeViewer
|
|||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
Configuration.lastDirectory = fc.getSelectedFile().getAbsolutePath();
|
||||
try {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
BytecodeViewer.openFiles(new File[]{fc.getSelectedFile()}, true);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e1) {
|
||||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e1);
|
||||
}
|
||||
|
@ -773,11 +773,11 @@ public class BytecodeViewer
|
|||
|
||||
final File file2 = file;
|
||||
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
Thread t1 = new Thread(() -> {
|
||||
JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(),
|
||||
file2.getAbsolutePath());
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
});
|
||||
t1.start();
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ public class BytecodeViewer {
|
|||
* @param busy if it should display the busy icon or not
|
||||
*/
|
||||
public static void setBusy(boolean busy) {
|
||||
the.bytecode.club.bytecodeviewer.BytecodeViewer.viewer.setIcon(busy);
|
||||
the.bytecode.club.bytecodeviewer.BytecodeViewer.viewer.updateBusyStatus(busy);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,7 +32,7 @@ public abstract class Plugin extends Thread {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
try {
|
||||
if (BytecodeViewer.getLoadedClasses().isEmpty()) {
|
||||
BytecodeViewer.showMessage("First open a class, jar, zip, apk or dex file.");
|
||||
|
@ -43,7 +43,7 @@ public abstract class Plugin extends Thread {
|
|||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
} finally {
|
||||
finished = true;
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
|
||||
import com.jhe.hexed.JHexEditor;
|
||||
import the.bytecode.club.bytecodeviewer.gui.hexviewer.JHexEditor;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
|
@ -460,7 +460,7 @@ public class ClassViewer extends Viewer {
|
|||
viewer = THIS;
|
||||
decompiler = pane1;
|
||||
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
if (pane1 == 1) { // procyon
|
||||
panelArea = new RSyntaxTextArea();
|
||||
panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
|
||||
|
@ -834,7 +834,7 @@ public class ClassViewer extends Viewer {
|
|||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
} finally {
|
||||
resetDivider();
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
if (button != null)
|
||||
button.setEnabled(true);
|
||||
}
|
||||
|
@ -850,7 +850,7 @@ public class ClassViewer extends Viewer {
|
|||
viewer = THIS;
|
||||
decompiler = pane2;
|
||||
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
if (pane2 == 1) {
|
||||
panelArea = new RSyntaxTextArea();
|
||||
panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
|
||||
|
@ -1223,7 +1223,7 @@ public class ClassViewer extends Viewer {
|
|||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
} finally {
|
||||
resetDivider();
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
if (button != null)
|
||||
button.setEnabled(true);
|
||||
}
|
||||
|
@ -1239,7 +1239,7 @@ public class ClassViewer extends Viewer {
|
|||
viewer = THIS;
|
||||
decompiler = pane3;
|
||||
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
if (pane3 == 1) {
|
||||
panelArea = new RSyntaxTextArea();
|
||||
panelArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
|
||||
|
@ -1612,7 +1612,7 @@ public class ClassViewer extends Viewer {
|
|||
//new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
} finally {
|
||||
resetDivider();
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
if (button != null)
|
||||
button.setEnabled(true);
|
||||
}
|
||||
|
@ -1620,7 +1620,7 @@ public class ClassViewer extends Viewer {
|
|||
};
|
||||
|
||||
Thread t = new Thread(() -> {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
while (Configuration.currentlyDumping) {
|
||||
//wait until it's not dumping
|
||||
try {
|
||||
|
@ -1631,7 +1631,7 @@ public class ClassViewer extends Viewer {
|
|||
}
|
||||
tempFiles = BytecodeViewer.dumpTempFile(container);
|
||||
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
|
||||
if (pane1 > 0)
|
||||
t1.start();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
|
||||
import com.jhe.hexed.JHexEditor;
|
||||
import the.bytecode.club.bytecodeviewer.gui.hexviewer.JHexEditor;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
|
|
@ -28,6 +28,10 @@ import the.bytecode.club.bytecodeviewer.Configuration;
|
|||
import the.bytecode.club.bytecodeviewer.Resources;
|
||||
import the.bytecode.club.bytecodeviewer.Settings;
|
||||
import the.bytecode.club.bytecodeviewer.api.ExceptionUI;
|
||||
import the.bytecode.club.bytecodeviewer.gui.extras.AboutWindow;
|
||||
import the.bytecode.club.bytecodeviewer.gui.extras.RunOptions;
|
||||
import the.bytecode.club.bytecodeviewer.gui.plugins.MaliciousCodeScannerOptions;
|
||||
import the.bytecode.club.bytecodeviewer.gui.plugins.ReplaceStringsOptions;
|
||||
import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameClasses;
|
||||
import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameFields;
|
||||
import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameMethods;
|
||||
|
@ -66,17 +70,20 @@ import static the.bytecode.club.bytecodeviewer.Constants.*;
|
|||
*
|
||||
* @author Konloch
|
||||
*/
|
||||
public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
||||
public class MainViewerGUI extends JFrame {
|
||||
|
||||
public static final long serialVersionUID = 1851409230530948543L;
|
||||
private static final ArrayList<VisibleComponent> uiComponents = new ArrayList<>();
|
||||
public AboutWindow aboutWindow = new AboutWindow();
|
||||
public ResourceListPane resourcePane = new ResourceListPane(this);
|
||||
public SearchBoxPane searchBoxPane;
|
||||
public boolean isMaximized;
|
||||
public final JMenuItem[] waitIcons;
|
||||
|
||||
//main UI components
|
||||
private static final ArrayList<VisibleComponent> uiComponents = new ArrayList<>();
|
||||
public final WorkPane workPane = new WorkPane();
|
||||
public final ResourceListPane resourcePane = new ResourceListPane();
|
||||
public final SearchBoxPane searchBoxPane = new SearchBoxPane();
|
||||
public JSplitPane splitPane1;
|
||||
public JSplitPane splitPane2;
|
||||
public final JMenuItem[] waitIcons;
|
||||
|
||||
//the root menu bar
|
||||
public final JMenuBar rootMenu = new JMenuBar();
|
||||
|
@ -119,12 +126,31 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
public final JMenuItem zStringArrayDecrypter = new JMenuItem("ZStringArray Decrypter");
|
||||
|
||||
//all of the settings main menu components
|
||||
private final JCheckBoxMenuItem deleteForeignOutdatedLibs = new JCheckBoxMenuItem("Delete Foreign/Outdated Libs");
|
||||
public final ButtonGroup apkConversionGroup = new ButtonGroup();
|
||||
public final JRadioButtonMenuItem apkConversionDex = new JRadioButtonMenuItem("Dex2Jar");
|
||||
public final JRadioButtonMenuItem apkConversionEnjarify = new JRadioButtonMenuItem("Enjarify");
|
||||
public final JMenu fontSize = new JMenu("Font Size");
|
||||
public final JSpinner fontSpinner = new JSpinner();
|
||||
//BCV settings
|
||||
public final JCheckBoxMenuItem refreshOnChange = new JCheckBoxMenuItem("Refresh On View Change");
|
||||
private final JCheckBoxMenuItem deleteForeignOutdatedLibs = new JCheckBoxMenuItem("Delete Foreign/Outdated Libs");
|
||||
public final JMenu settingsMainMenu = new JMenu("Settings");
|
||||
public final JMenu visualSettings = new JMenu("Visual Settings");
|
||||
public final JMenu apkConversion = new JMenu("APK Conversion");
|
||||
public final JMenu bytecodeDecompilerSettingsSecondaryMenu = new JMenu("Bytecode Decompiler");
|
||||
public final JCheckBoxMenuItem updateCheck = new JCheckBoxMenuItem("Update Check");
|
||||
public final JMenuItem setPython2 = new JMenuItem("Set Python 2.7 Executable");
|
||||
public final JMenuItem setPython3 = new JMenuItem("Set Python 3.X Executable");
|
||||
public final JMenuItem setJRERT = new JMenuItem("Set JRE RT Library");
|
||||
public final JMenuItem setJavac = new JMenuItem("Set Javac Executable");
|
||||
public final JMenuItem setOptionalLibrary = new JMenuItem("Set Optional Library Folder");
|
||||
public final JCheckBoxMenuItem compileOnSave = new JCheckBoxMenuItem("Compile On Save");
|
||||
public final JCheckBoxMenuItem showFileInTabTitle = new JCheckBoxMenuItem("Show File In Tab Title");
|
||||
public final JCheckBoxMenuItem forcePureAsciiAsText = new JCheckBoxMenuItem("Force Pure Ascii As Text");
|
||||
public final JCheckBoxMenuItem autoCompileOnRefresh = new JCheckBoxMenuItem("Compile On Refresh");
|
||||
public final JCheckBoxMenuItem decodeAPKResources = new JCheckBoxMenuItem("Decode APK Resources");
|
||||
public final JCheckBoxMenuItem synchronizedViewing = new JCheckBoxMenuItem("Synchronized Viewing");
|
||||
public final JCheckBoxMenuItem showClassMethods = new JCheckBoxMenuItem("Show Class Methods");
|
||||
//CFIDE settings
|
||||
public final JCheckBoxMenuItem appendBracketsToLabels = new JCheckBoxMenuItem("Append Brackets To Labels");
|
||||
public JCheckBoxMenuItem debugHelpers = new JCheckBoxMenuItem("Debug Helpers");
|
||||
|
@ -161,6 +187,10 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
public final JCheckBoxMenuItem mergeVariables = new JCheckBoxMenuItem("Merge Variables");
|
||||
public final JCheckBoxMenuItem forceExplicitTypeArguments = new JCheckBoxMenuItem("Force Explicit Type Arguments");
|
||||
public final JCheckBoxMenuItem forceExplicitImports = new JCheckBoxMenuItem("Force Explicit Imports");
|
||||
public final JCheckBoxMenuItem flattenSwitchBlocks = new JCheckBoxMenuItem("Flatten Switch Blocks");
|
||||
public final JCheckBoxMenuItem retainPointlessSwitches = new JCheckBoxMenuItem("Retain Pointless Switches");
|
||||
public final JCheckBoxMenuItem retainRedunantCasts = new JCheckBoxMenuItem("Retain Redundant Casts");
|
||||
public final JCheckBoxMenuItem unicodeOutputEnabled = new JCheckBoxMenuItem("Unicode Output Enabled");
|
||||
//CFR
|
||||
public final JMenu cfrSettingsSecondaryMenu = new JMenu("CFR");
|
||||
public final JCheckBoxMenuItem decodeEnumSwitch = new JCheckBoxMenuItem("Decode Enum Switch");
|
||||
|
@ -186,6 +216,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
public final JCheckBoxMenuItem comments = new JCheckBoxMenuItem("Comments");
|
||||
public final JCheckBoxMenuItem forceTopSort = new JCheckBoxMenuItem("Force Top Sort");
|
||||
public final JCheckBoxMenuItem forceTopSortAggress = new JCheckBoxMenuItem("Force Top Sort Aggress");
|
||||
public final JCheckBoxMenuItem forceExceptionPrune = new JCheckBoxMenuItem("Force Exception Prune");
|
||||
public final JCheckBoxMenuItem stringBuffer = new JCheckBoxMenuItem("String Buffer");
|
||||
public final JCheckBoxMenuItem stringBuilder = new JCheckBoxMenuItem("String Builder");
|
||||
public final JCheckBoxMenuItem silent = new JCheckBoxMenuItem("Silent");
|
||||
|
@ -206,12 +237,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
public final JCheckBoxMenuItem recoveryTypehInts = new JCheckBoxMenuItem("Recover Type Hints");
|
||||
public final JCheckBoxMenuItem forceTurningIFs = new JCheckBoxMenuItem("Force Returning IFs");
|
||||
public final JCheckBoxMenuItem forLoopAGGCapture = new JCheckBoxMenuItem("For Loop AGG Capture");
|
||||
public final JCheckBoxMenuItem forceExceptionPrune = new JCheckBoxMenuItem("Force Exception Prune");
|
||||
public final JCheckBoxMenuItem unicodeOutputEnabled = new JCheckBoxMenuItem("Unicode Output Enabled");
|
||||
public final JCheckBoxMenuItem retainPointlessSwitches = new JCheckBoxMenuItem("Retain Pointless Switches");
|
||||
public final JCheckBoxMenuItem retainRedunantCasts = new JCheckBoxMenuItem("Retain Redundant Casts");
|
||||
public final JCheckBoxMenuItem flattenSwitchBlocks = new JCheckBoxMenuItem("Flatten Switch Blocks");
|
||||
public final JCheckBoxMenuItem updateCheck = new JCheckBoxMenuItem("Update Check");
|
||||
//obfuscation
|
||||
public final JMenu obfuscate = new JMenu("Obfuscate");
|
||||
public final JMenuItem renameFields = new JMenuItem("Rename Fields");
|
||||
public final JMenuItem renameMethods = new JMenuItem("Rename Methods");
|
||||
|
@ -222,24 +248,8 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
public final JRadioButtonMenuItem strongObf = new JRadioButtonMenuItem("Strong Obfuscation");
|
||||
public final JRadioButtonMenuItem lightObf = new JRadioButtonMenuItem("Light Obfuscation");
|
||||
public final JMenuItem renameClasses = new JMenuItem("Rename Classes");
|
||||
public final JMenu settingsMainMenu = new JMenu("Settings");
|
||||
public final JCheckBoxMenuItem compileOnSave = new JCheckBoxMenuItem("Compile On Save");
|
||||
public final JCheckBoxMenuItem showFileInTabTitle = new JCheckBoxMenuItem("Show File In Tab Title");
|
||||
public final JCheckBoxMenuItem forcePureAsciiAsText = new JCheckBoxMenuItem("Force Pure Ascii As Text");
|
||||
public final JCheckBoxMenuItem autoCompileOnRefresh = new JCheckBoxMenuItem("Compile On Refresh");
|
||||
public final JMenuItem setPython2 = new JMenuItem("Set Python 2.7 Executable");
|
||||
public final JMenuItem setJRERT = new JMenuItem("Set JRE RT Library");
|
||||
public final JCheckBoxMenuItem decodeAPKResources = new JCheckBoxMenuItem("Decode APK Resources");
|
||||
public final JCheckBoxMenuItem synchronizedViewing = new JCheckBoxMenuItem("Synchronized Viewing");
|
||||
public final JCheckBoxMenuItem showClassMethods = new JCheckBoxMenuItem("Show Class Methods");
|
||||
public final JMenu visualSettings = new JMenu("Visual Settings");
|
||||
public final JMenu apkConversion = new JMenu("APK Conversion");
|
||||
public final JMenuItem setPython3 = new JMenuItem("Set Python 3.X Executable");
|
||||
public final JMenuItem setOptionalLibrary = new JMenuItem("Set Optional Library Folder");
|
||||
public final JMenuItem setJavac = new JMenuItem("Set Javac Executable");
|
||||
public final JMenu bytecodeDecompilerSettingsSecondaryMenu = new JMenu("Bytecode Decompiler");
|
||||
|
||||
public synchronized void setIcon(final boolean busy) {
|
||||
public synchronized void updateBusyStatus(final boolean busy) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
if (busy) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
|
@ -268,9 +278,6 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
public void calledAfterLoad() {
|
||||
deleteForeignOutdatedLibs.setSelected(Configuration.deleteForeignLibraries);
|
||||
}
|
||||
|
||||
public final JCheckBoxMenuItem refreshOnChange = new JCheckBoxMenuItem("Refresh On View Change");
|
||||
public final WorkPane workPane = new WorkPane(this);
|
||||
|
||||
public MainViewerGUI()
|
||||
{
|
||||
|
@ -302,24 +309,21 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
|
||||
getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.X_AXIS));
|
||||
|
||||
// scrollPane.setViewportView(tree);
|
||||
resourcePane.setMinimumSize(new Dimension(200, 50));
|
||||
// panel.add(cn);
|
||||
searchBoxPane = new SearchBoxPane(this);
|
||||
resourcePane.setPreferredSize(new Dimension(200, 50));
|
||||
resourcePane.setMaximumSize(new Dimension(200, 2147483647));
|
||||
|
||||
searchBoxPane.setPreferredSize(new Dimension(200, 50));
|
||||
searchBoxPane.setMinimumSize(new Dimension(200, 50));
|
||||
searchBoxPane.setMaximumSize(new Dimension(200, 2147483647));
|
||||
// panel.add(s);
|
||||
|
||||
splitPane1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, resourcePane, searchBoxPane);
|
||||
// panel.add(sp1);
|
||||
resourcePane.setPreferredSize(new Dimension(200, 50));
|
||||
resourcePane.setMaximumSize(new Dimension(200, 2147483647));
|
||||
splitPane2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, splitPane1, workPane);
|
||||
getContentPane().add(splitPane2);
|
||||
splitPane2.setResizeWeight(0.05);
|
||||
splitPane1.setResizeWeight(0.5);
|
||||
|
||||
uiComponents.add(resourcePane);
|
||||
|
||||
uiComponents.add(searchBoxPane);
|
||||
uiComponents.add(workPane);
|
||||
|
||||
|
@ -667,18 +671,12 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
appendBracketsToLabels.setSelected(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openClassFile(final FileContainer container, final String name, final ClassNode cn) {
|
||||
for (final VisibleComponent vc : uiComponents) {
|
||||
vc.openClassFile(container, name, cn);
|
||||
}
|
||||
workPane.addWorkingFile(container, name, cn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openFile(final FileContainer container, final String name, byte[] content) {
|
||||
for (final VisibleComponent vc : uiComponents) {
|
||||
vc.openFile(container, name, content);
|
||||
}
|
||||
workPane.addFile(container, name, content);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -729,9 +727,9 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
Configuration.lastDirectory = fc.getSelectedFile().getAbsolutePath();
|
||||
try {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
BytecodeViewer.openFiles(new File[]{fc.getSelectedFile()}, true);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e1) {
|
||||
new ExceptionUI(e1);
|
||||
}
|
||||
|
@ -962,9 +960,9 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
|
||||
if (returnVal == JFileChooser.APPROVE_OPTION)
|
||||
try {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
BytecodeViewer.startPlugin(fc.getSelectedFile());
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e1) {
|
||||
new ExceptionUI(e1);
|
||||
}
|
||||
|
@ -990,5 +988,4 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
|
|||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -40,7 +40,6 @@ import javax.swing.tree.TreePath;
|
|||
import org.objectweb.asm.tree.ClassNode;
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
import the.bytecode.club.bytecodeviewer.Resources;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileChangeNotifier;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileContainer;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileDrop;
|
||||
import the.bytecode.club.bytecodeviewer.util.LazyNameUtil;
|
||||
|
@ -71,10 +70,8 @@ import the.bytecode.club.bytecodeviewer.util.LazyNameUtil;
|
|||
* @author afffsdd
|
||||
*/
|
||||
|
||||
public class ResourceListPane extends VisibleComponent implements
|
||||
FileDrop.Listener {
|
||||
|
||||
FileChangeNotifier fcn;
|
||||
public class ResourceListPane extends VisibleComponent implements FileDrop.Listener
|
||||
{
|
||||
JCheckBox exact = new JCheckBox("Exact");
|
||||
JButton open = new JButton("+");
|
||||
JButton close = new JButton("-");
|
||||
|
@ -245,9 +242,8 @@ public class ResourceListPane extends VisibleComponent implements
|
|||
LazyNameUtil.removeName(fileContainer.name);
|
||||
}
|
||||
|
||||
public ResourceListPane(final FileChangeNotifier fcn) {
|
||||
public ResourceListPane() {
|
||||
super("ClassNavigation");
|
||||
this.fcn = fcn;
|
||||
tree.setRootVisible(false);
|
||||
tree.setShowsRootHandles(true);
|
||||
quickSearch.setForeground(Color.gray);
|
||||
|
@ -374,11 +370,11 @@ public class ResourceListPane extends VisibleComponent implements
|
|||
}
|
||||
|
||||
public void openClassFileToWorkSpace(final FileContainer container, final String name, final ClassNode node) {
|
||||
fcn.openClassFile(container, name, node);
|
||||
BytecodeViewer.viewer.openClassFile(container, name, node);
|
||||
}
|
||||
|
||||
public void openFileToWorkSpace(final FileContainer container, String name, byte[] contents) {
|
||||
fcn.openFile(container, name, contents);
|
||||
BytecodeViewer.viewer.openFile(container, name, contents);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,7 +26,6 @@ import the.bytecode.club.bytecodeviewer.searching.RegexInsnFinder;
|
|||
import the.bytecode.club.bytecodeviewer.searching.RegexSearch;
|
||||
import the.bytecode.club.bytecodeviewer.searching.SearchResultNotifier;
|
||||
import the.bytecode.club.bytecodeviewer.searching.SearchTypeDetails;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileChangeNotifier;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileContainer;
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -61,8 +60,6 @@ public class SearchBoxPane extends VisibleComponent {
|
|||
public static final SearchRadius[] SEARCH_RADII = SearchRadius.values();
|
||||
public static final SearchType[] SEARCH_TYPES = SearchType.values();
|
||||
|
||||
FileChangeNotifier fcn;
|
||||
|
||||
JCheckBox exact = new JCheckBox("Exact");
|
||||
DefaultMutableTreeNode treeRoot = new DefaultMutableTreeNode("Results");
|
||||
JTree tree;
|
||||
|
@ -81,11 +78,9 @@ public class SearchBoxPane extends VisibleComponent {
|
|||
};
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public SearchBoxPane(final FileChangeNotifier fcn) {
|
||||
public SearchBoxPane() {
|
||||
super("Search");
|
||||
|
||||
this.fcn = fcn;
|
||||
|
||||
final JPanel optionPanel = new JPanel(new BorderLayout());
|
||||
|
||||
final JPanel searchRadiusOpt = new JPanel(new BorderLayout());
|
||||
|
@ -186,8 +181,7 @@ public class SearchBoxPane extends VisibleComponent {
|
|||
public void doSearch() {
|
||||
|
||||
try {
|
||||
Pattern.compile(RegexInsnFinder.processRegex(RegexSearch.searchText.getText()),
|
||||
Pattern.MULTILINE);
|
||||
Pattern.compile(RegexInsnFinder.processRegex(RegexSearch.searchText.getText()), Pattern.MULTILINE);
|
||||
} catch (PatternSyntaxException ex) {
|
||||
BytecodeViewer.showMessage("You have an error in your regex syntax.");
|
||||
}
|
||||
|
@ -196,23 +190,23 @@ public class SearchBoxPane extends VisibleComponent {
|
|||
for (ClassNode c : container.classes)
|
||||
searchType.details.search(container, c, srn, exact.isSelected());
|
||||
|
||||
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class)).search.setEnabled(true);
|
||||
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class)).search.setText(
|
||||
"Search");
|
||||
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class))
|
||||
.search.setEnabled(true);
|
||||
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class))
|
||||
.search.setText("Search");
|
||||
|
||||
tree.expandPath(new TreePath(tree.getModel().getRoot()));
|
||||
tree.updateUI();
|
||||
}
|
||||
|
||||
};
|
||||
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class)).search
|
||||
.setEnabled(false);
|
||||
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class)).search
|
||||
.setText("Searching, please wait..");
|
||||
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class))
|
||||
.search.setEnabled(false);
|
||||
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class))
|
||||
.search.setText("Searching, please wait..");
|
||||
t.start();
|
||||
} else { // this should really never be called.
|
||||
BytecodeViewer
|
||||
.showMessage("You currently have a search performing in the background, please wait for that "
|
||||
+ "to finish.");
|
||||
BytecodeViewer.showMessage("You currently have a search performing in the background, please wait for that to finish.");
|
||||
}
|
||||
} else if (radius == SearchRadius.Current_Class) {
|
||||
final Viewer cv = Objects.requireNonNull(MainViewerGUI.getComponent(WorkPane.class)).getCurrentViewer();
|
||||
|
@ -243,8 +237,4 @@ public class SearchBoxPane extends VisibleComponent {
|
|||
treeRoot.removeAllChildren();
|
||||
tree.updateUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openFile(final FileContainer container, String name, byte[] contents) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package the.bytecode.club.bytecodeviewer.gui;
|
|||
|
||||
import javax.swing.JInternalFrame;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileChangeNotifier;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileContainer;
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -24,34 +23,18 @@ import the.bytecode.club.bytecodeviewer.util.FileContainer;
|
|||
***************************************************************************/
|
||||
|
||||
/**
|
||||
* Used to represent all the panes inside of Bytecode Viewer, this is temp code
|
||||
* that was included from porting in J-RET, this needs to be re-written.
|
||||
* Used to represent all the panes inside of Bytecode Viewer.
|
||||
*
|
||||
* @author Konloch
|
||||
* @author WaterWolf
|
||||
*/
|
||||
|
||||
public abstract class VisibleComponent extends JInternalFrame implements
|
||||
FileChangeNotifier {
|
||||
|
||||
public abstract class VisibleComponent extends JInternalFrame
|
||||
{
|
||||
private static final long serialVersionUID = -6453413772343643526L;
|
||||
|
||||
public VisibleComponent(final String title) {
|
||||
public VisibleComponent(final String title)
|
||||
{
|
||||
super(title, false, false, false, false);
|
||||
this.setFrameIcon(null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private VisibleComponent() { // because we want to enforce the title
|
||||
// argument
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openClassFile(final FileContainer container, final String name, final ClassNode cn) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openFile(final FileContainer container, final String name, byte[] contents) {
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,7 +20,6 @@ import javax.swing.JTabbedPane;
|
|||
import org.objectweb.asm.tree.ClassNode;
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
import the.bytecode.club.bytecodeviewer.Configuration;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileChangeNotifier;
|
||||
import the.bytecode.club.bytecodeviewer.util.FileContainer;
|
||||
|
||||
import static the.bytecode.club.bytecodeviewer.Constants.BLOCK_TAB_MENU;
|
||||
|
@ -54,7 +53,6 @@ public class WorkPane extends VisibleComponent implements ActionListener {
|
|||
|
||||
private static final long serialVersionUID = 6542337997679487946L;
|
||||
|
||||
FileChangeNotifier fcn;
|
||||
public JTabbedPane tabs;
|
||||
|
||||
JPanel buttonPanel;
|
||||
|
@ -62,12 +60,11 @@ public class WorkPane extends VisibleComponent implements ActionListener {
|
|||
|
||||
HashMap<String, Integer> workingOn = new HashMap<>();
|
||||
|
||||
public WorkPane(final FileChangeNotifier fcn) {
|
||||
public WorkPane() {
|
||||
super("WorkPanel");
|
||||
setTitle("Work Space");
|
||||
|
||||
this.tabs = new JTabbedPane();
|
||||
this.fcn = fcn;
|
||||
|
||||
|
||||
JPopupMenu pop_up = new JPopupMenu() {
|
||||
|
@ -251,16 +248,6 @@ public class WorkPane extends VisibleComponent implements ActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openClassFile(final FileContainer container, final String name, final ClassNode cn) {
|
||||
addWorkingFile(container, name, cn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openFile(final FileContainer container, final String name, byte[] content) {
|
||||
addFile(container, name, content);
|
||||
}
|
||||
|
||||
public Viewer getCurrentViewer() {
|
||||
return (Viewer) tabs.getSelectedComponent();
|
||||
}
|
||||
|
@ -285,14 +272,14 @@ public class WorkPane extends VisibleComponent implements ActionListener {
|
|||
if (tabComp != null) {
|
||||
if (tabComp instanceof ClassViewer) {
|
||||
src.setEnabled(false);
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
((ClassViewer) tabComp).startPaneUpdater(src);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} else if (tabComp instanceof FileViewer) {
|
||||
src.setEnabled(false);
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
((FileViewer) tabComp).refresh(src);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
package the.bytecode.club.bytecodeviewer.gui.extras;
|
||||
|
||||
import java.awt.CardLayout;
|
||||
import java.awt.Color;
|
|
@ -1,4 +1,4 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
package the.bytecode.club.bytecodeviewer.gui.extras;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import javax.swing.BoxLayout;
|
||||
|
@ -59,11 +59,11 @@ public class ExportJar extends JFrame {
|
|||
getContentPane().add(btnNewButton);
|
||||
|
||||
btnNewButton.addActionListener(arg0 -> {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
Thread t = new Thread(() -> {
|
||||
JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(), jarPath,
|
||||
mani.getText());
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
});
|
||||
t.start();
|
||||
dispose();
|
|
@ -1,4 +1,4 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
package the.bytecode.club.bytecodeviewer.gui.extras;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import javax.swing.JButton;
|
|
@ -1,4 +1,4 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
package the.bytecode.club.bytecodeviewer.gui.extras;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jhe.hexed;
|
||||
package the.bytecode.club.bytecodeviewer.gui.hexviewer;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jhe.hexed;
|
||||
package the.bytecode.club.bytecodeviewer.gui.hexviewer;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jhe.hexed;
|
||||
package the.bytecode.club.bytecodeviewer.gui.hexviewer;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
|
@ -1,4 +1,4 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
package the.bytecode.club.bytecodeviewer.gui.plugins;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
|
@ -1,4 +1,4 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
package the.bytecode.club.bytecodeviewer.gui.plugins;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import javax.swing.JButton;
|
|
@ -1,4 +1,4 @@
|
|||
package the.bytecode.club.bytecodeviewer.gui;
|
||||
package the.bytecode.club.bytecodeviewer.gui.plugins;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import javax.swing.JButton;
|
|
@ -33,12 +33,12 @@ public abstract class JavaObfuscator extends Thread {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
Configuration.runningObfuscation = true;
|
||||
obfuscate();
|
||||
BytecodeViewer.refactorer.run();
|
||||
Configuration.runningObfuscation = false;
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
}
|
||||
|
||||
public int getStringLength() {
|
||||
|
|
|
@ -14,7 +14,7 @@ import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
|||
import the.bytecode.club.bytecodeviewer.api.BytecodeHook;
|
||||
import the.bytecode.club.bytecodeviewer.api.Plugin;
|
||||
import the.bytecode.club.bytecodeviewer.api.PluginConsole;
|
||||
import the.bytecode.club.bytecodeviewer.gui.GraphicalReflectionKit;
|
||||
import the.bytecode.club.bytecodeviewer.gui.plugins.GraphicalReflectionKit;
|
||||
|
||||
import static the.bytecode.club.bytecodeviewer.Constants.*;
|
||||
|
||||
|
@ -135,7 +135,7 @@ public class EZInjection extends Plugin {
|
|||
|
||||
@Override
|
||||
public void execute(ArrayList<ClassNode> classNodeList) {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
gui.setText("");
|
||||
|
||||
if (console)
|
||||
|
@ -307,6 +307,6 @@ public class EZInjection extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ public abstract class BackgroundSearchThread extends Thread {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
doSearch();
|
||||
finished = true;
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
package the.bytecode.club.bytecodeviewer.util;
|
||||
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
/***************************************************************************
|
||||
* 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 <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
* Used to represent whenever a file has been opened
|
||||
*
|
||||
* @author Konloch
|
||||
*/
|
||||
|
||||
public interface FileChangeNotifier {
|
||||
void openClassFile(final FileContainer container, String name, ClassNode cn);
|
||||
|
||||
void openFile(final FileContainer container, String name, byte[] contents);
|
||||
}
|
|
@ -30,12 +30,11 @@ import java.io.Reader;
|
|||
* a Java program. Any <tt>java.awt.Component</tt> can be dropped onto, but only
|
||||
* <tt>javax.swing.JComponent</tt>s will indicate the drop event with a changed
|
||||
* border.
|
||||
* <p/>
|
||||
*
|
||||
* To use this class, construct a new <tt>FileDrop</tt> by passing it the target
|
||||
* component and a <tt>Listener</tt> to receive notification when file(s) have
|
||||
* been dropped. Here is an example:
|
||||
* <p/>
|
||||
* <code><pre>
|
||||
*
|
||||
* JPanel myPanel = new JPanel();
|
||||
* new FileDrop( myPanel, new FileDrop.Listener()
|
||||
* { public void filesDropped( java.io.File[] files )
|
||||
|
@ -44,27 +43,21 @@ import java.io.Reader;
|
|||
* ...
|
||||
* } // end filesDropped
|
||||
* }); // end FileDrop.Listener
|
||||
* </pre></code>
|
||||
* <p/>
|
||||
*
|
||||
* You can specify the border that will appear when files are being dragged by
|
||||
* calling the constructor with a <tt>javax.swing.border.Border</tt>. Only
|
||||
* <tt>JComponent</tt>s will show any indication with a border.
|
||||
* <p/>
|
||||
*
|
||||
* You can turn on some debugging features by passing a <tt>PrintStream</tt>
|
||||
* object (such as <tt>System.out</tt>) into the full constructor. A
|
||||
* <tt>null</tt> value will result in no extra debugging information being
|
||||
* output.
|
||||
* <p/>
|
||||
* <p>
|
||||
* <p>
|
||||
*
|
||||
* I'm releasing this code into the Public Domain. Enjoy.
|
||||
* </p>
|
||||
* <p>
|
||||
*
|
||||
* <em>Original author: Robert Harder, rharder@usa.net</em>
|
||||
* </p>
|
||||
* <p>
|
||||
*
|
||||
* 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
|
||||
* </p>
|
||||
*
|
||||
* @author Robert Harder
|
||||
* @author rharder@users.sf.net
|
||||
|
|
|
@ -131,7 +131,7 @@ public class OpenFile implements Runnable
|
|||
}
|
||||
} else if (fn.endsWith(".apk")) {
|
||||
try {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
|
||||
File tempCopy = new File(tempDirectory + fs + MiscUtils.randomString(32) + ".apk");
|
||||
|
||||
|
@ -159,7 +159,7 @@ public class OpenFile implements Runnable
|
|||
|
||||
container.classes = JarUtils.loadClasses(output);
|
||||
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
BytecodeViewer.files.add(container);
|
||||
} catch (final Exception e) {
|
||||
new ExceptionUI(e);
|
||||
|
@ -167,7 +167,7 @@ public class OpenFile implements Runnable
|
|||
return;
|
||||
} else if (fn.endsWith(".dex")) {
|
||||
try {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
|
||||
File tempCopy = new File(tempDirectory + fs + MiscUtils.randomString(32) +
|
||||
".dex");
|
||||
|
@ -186,7 +186,7 @@ public class OpenFile implements Runnable
|
|||
|
||||
container.classes = JarUtils.loadClasses(output);
|
||||
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
BytecodeViewer.files.add(container);
|
||||
} catch (final Exception e) {
|
||||
new ExceptionUI(e);
|
||||
|
@ -208,7 +208,7 @@ public class OpenFile implements Runnable
|
|||
} catch (final Exception e) {
|
||||
new ExceptionUI(e);
|
||||
} finally {
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
|
||||
if (update)
|
||||
try {
|
||||
|
|
|
@ -6,7 +6,6 @@ import org.objectweb.asm.tree.ClassNode;
|
|||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
import the.bytecode.club.bytecodeviewer.api.ExceptionUI;
|
||||
import the.bytecode.club.bytecodeviewer.decompilers.Decompilers;
|
||||
import the.bytecode.club.bytecodeviewer.gui.MainViewerGUI;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
|
@ -91,7 +90,7 @@ public class ResourceDecompiling
|
|||
if (options[k].equals(obj))
|
||||
result = k;
|
||||
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
|
||||
File tempZip = new File(tempDirectory + fs + "temp_" + MiscUtils.getRandomizedName() + ".jar");
|
||||
if (tempZip.exists())
|
||||
|
@ -104,7 +103,7 @@ public class ResourceDecompiling
|
|||
try {
|
||||
Decompilers.procyon.decompileToZip(tempZip.getAbsolutePath(),
|
||||
MiscUtils.append(javaSucks, "-proycon.zip"));
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
|
@ -112,10 +111,10 @@ public class ResourceDecompiling
|
|||
t12.start();
|
||||
Thread t2 = new Thread(() -> {
|
||||
try {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
Decompilers.cfr.decompileToZip(tempZip.getAbsolutePath(),
|
||||
MiscUtils.append(javaSucks, "-CFR.zip"));
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
|
@ -123,10 +122,10 @@ public class ResourceDecompiling
|
|||
t2.start();
|
||||
Thread t3 = new Thread(() -> {
|
||||
try {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
Decompilers.fernflower.decompileToZip(tempZip.getAbsolutePath(),
|
||||
MiscUtils.append(javaSucks, "-fernflower.zip"));
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
|
@ -134,10 +133,10 @@ public class ResourceDecompiling
|
|||
t3.start();
|
||||
Thread t4 = new Thread(() -> {
|
||||
try {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
Decompilers.krakatau.decompileToZip(tempZip.getAbsolutePath(),
|
||||
MiscUtils.append(javaSucks, "-kraktau.zip"));
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
|
@ -148,7 +147,7 @@ public class ResourceDecompiling
|
|||
Thread t12 = new Thread(() -> {
|
||||
try {
|
||||
Decompilers.procyon.decompileToZip(tempZip.getAbsolutePath(), path);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
|
@ -159,7 +158,7 @@ public class ResourceDecompiling
|
|||
Thread t12 = new Thread(() -> {
|
||||
try {
|
||||
Decompilers.cfr.decompileToZip(tempZip.getAbsolutePath(), path);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
|
@ -170,7 +169,7 @@ public class ResourceDecompiling
|
|||
Thread t12 = new Thread(() -> {
|
||||
try {
|
||||
Decompilers.fernflower.decompileToZip(tempZip.getAbsolutePath(), path);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
|
@ -182,7 +181,7 @@ public class ResourceDecompiling
|
|||
Thread t12 = new Thread(() -> {
|
||||
try {
|
||||
Decompilers.krakatau.decompileToZip(tempZip.getAbsolutePath(), path);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
|
@ -191,7 +190,7 @@ public class ResourceDecompiling
|
|||
}
|
||||
|
||||
if (result == 5) {
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -232,7 +231,7 @@ public class ResourceDecompiling
|
|||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
File file = fc.getSelectedFile();
|
||||
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
final String path = MiscUtils.append(file, ".java"); // cheap hax cause
|
||||
// string is final
|
||||
|
||||
|
@ -315,9 +314,9 @@ public class ResourceDecompiling
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
new ExceptionUI(e);
|
||||
}
|
||||
});
|
||||
|
@ -341,9 +340,9 @@ public class ResourceDecompiling
|
|||
String contents = Decompilers.procyon.decompileClassNode(cn,
|
||||
cw.toByteArray());
|
||||
DiskWriter.replaceFile(path, contents, false);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
new ExceptionUI(
|
||||
e);
|
||||
}
|
||||
|
@ -367,9 +366,9 @@ public class ResourceDecompiling
|
|||
}
|
||||
String contents = Decompilers.cfr.decompileClassNode(cn, cw.toByteArray());
|
||||
DiskWriter.replaceFile(path, contents, false);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
new ExceptionUI(
|
||||
e);
|
||||
}
|
||||
|
@ -395,9 +394,9 @@ public class ResourceDecompiling
|
|||
String contents = Decompilers.fernflower.decompileClassNode(cn,
|
||||
cw.toByteArray());
|
||||
DiskWriter.replaceFile(path, contents, false);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
new ExceptionUI(
|
||||
e);
|
||||
}
|
||||
|
@ -423,9 +422,9 @@ public class ResourceDecompiling
|
|||
String contents = Decompilers.krakatau.decompileClassNode(cn,
|
||||
cw.toByteArray());
|
||||
DiskWriter.replaceFile(path, contents, false);
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
} catch (Exception e) {
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
new ExceptionUI(
|
||||
e);
|
||||
}
|
||||
|
@ -433,7 +432,7 @@ public class ResourceDecompiling
|
|||
t1.start();
|
||||
}
|
||||
if (result == 5) {
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package the.bytecode.club.bytecodeviewer.util;
|
||||
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
import the.bytecode.club.bytecodeviewer.gui.ExportJar;
|
||||
import the.bytecode.club.bytecodeviewer.gui.extras.ExportJar;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
|
@ -128,11 +128,11 @@ public class ResourceExporting
|
|||
|
||||
final File file2 = file;
|
||||
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
Thread t17 = new Thread(() -> {
|
||||
JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(),
|
||||
file2.getAbsolutePath());
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
});
|
||||
t17.start();
|
||||
}
|
||||
|
@ -195,14 +195,14 @@ public class ResourceExporting
|
|||
}
|
||||
|
||||
Thread t16 = new Thread(() -> {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
final String input = tempDirectory + fs + MiscUtils.getRandomizedName() + ".jar";
|
||||
JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(), input);
|
||||
|
||||
Thread t15 = new Thread(() -> {
|
||||
Dex2Jar.saveAsDex(new File(input), file2);
|
||||
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
});
|
||||
t15.start();
|
||||
});
|
||||
|
@ -307,14 +307,14 @@ public class ResourceExporting
|
|||
}
|
||||
|
||||
Thread t14 = new Thread(() -> {
|
||||
BytecodeViewer.viewer.setIcon(true);
|
||||
BytecodeViewer.viewer.updateBusyStatus(true);
|
||||
final String input = tempDirectory + fs + MiscUtils.getRandomizedName() + ".jar";
|
||||
JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(), input);
|
||||
|
||||
Thread t13 = new Thread(() -> {
|
||||
APKTool.buildAPK(new File(input), file2, finalContainer);
|
||||
|
||||
BytecodeViewer.viewer.setIcon(false);
|
||||
BytecodeViewer.viewer.updateBusyStatus(false);
|
||||
});
|
||||
t13.start();
|
||||
});
|
||||
|
|
|
@ -105,7 +105,8 @@ public class SecurityMan extends SecurityManager {
|
|||
@Override
|
||||
public void checkAccess(ThreadGroup g) {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void checkAwtEventQueueAccess() {
|
||||
}
|
||||
|
||||
|
@ -135,18 +136,20 @@ public class SecurityMan extends SecurityManager {
|
|||
@Override
|
||||
public void checkLink(String lib) {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void checkMemberAccess(Class<?> clazz, int which) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkMulticast(InetAddress maddr) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void checkMulticast(InetAddress maddr, byte ttl) {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void checkPackageAccess(String pkg) {
|
||||
}
|
||||
|
||||
|
@ -185,7 +188,8 @@ public class SecurityMan extends SecurityManager {
|
|||
@Override
|
||||
public void checkSetFactory() {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void checkSystemClipboardAccess() {
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue