lauriewired / jadxecute Goto Github PK
View Code? Open in Web Editor NEWJADX-gui scripting plugin for dynamic decompiler manipulation
JADX-gui scripting plugin for dynamic decompiler manipulation
Describe your idea: By making the JADXexecute window modeless it will be possible to interact with the parent window (JADX-GUI).
diff --git a/jadx-with-jadxecute/gradlew b/jadx-with-jadxecute/gradlew
old mode 100644
new mode 100755
diff --git a/jadx-with-jadxecute/jadx-gui/src/main/java/jadx/gui/plugins/jadxecute/JadxecuteDialog.java b/jadx-with-jadxecute/jadx-gui/src/main/java/jadx/gui/plugins/jadxecute/JadxecuteDialog.java
index a0c5584..6819c2d 100644
--- a/jadx-with-jadxecute/jadx-gui/src/main/java/jadx/gui/plugins/jadxecute/JadxecuteDialog.java
+++ b/jadx-with-jadxecute/jadx-gui/src/main/java/jadx/gui/plugins/jadxecute/JadxecuteDialog.java
@@ -29,6 +29,7 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.Font;
import javax.swing.JFileChooser;
import javax.swing.JList;
@@ -46,9 +47,13 @@ public class JadxecuteDialog extends JDialog {
private final transient JadxSettings settings;
private final transient MainWindow mainWindow;
+ private static final int DEFAULT_FONT_SIZE = 12;
+
public JadxecuteDialog(MainWindow mainWindow) {
+ super(mainWindow, "JADXexecute", true);
this.mainWindow = mainWindow;
this.settings = mainWindow.getSettings();
+
initUI();
}
@@ -56,16 +61,18 @@ public class JadxecuteDialog extends JDialog {
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout());
mainPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
-
+
// Input and output code areas
JLabel codeInputDescription = new JLabel("Java Input");
- codeInputDescription.setPreferredSize(new Dimension(80, 16));
+ codeInputDescription.setFont(new Font(null, Font.BOLD, DEFAULT_FONT_SIZE));
+ codeInputDescription.setPreferredSize(new Dimension(100, 16));
RSyntaxTextArea codeInputArea = new RSyntaxTextArea(getDefaultCodeInputText());
codeInputArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
JScrollPane codeInputScrollPanel = new JScrollPane(codeInputArea);
- codeInputScrollPanel.setPreferredSize(new Dimension(550, 200));
+ codeInputScrollPanel.setPreferredSize(new Dimension(600, 200));
JLabel consoleOutputDescription = new JLabel("Console Output");
+ consoleOutputDescription.setFont(new Font(null, Font.BOLD, DEFAULT_FONT_SIZE));
consoleOutputDescription.setPreferredSize(new Dimension(80, 16));
consoleOutputDescription.setBorder(new EmptyBorder(10, 0, 10, 0));
JTextArea consoleOutputArea = new JTextArea(" ");
@@ -85,11 +92,14 @@ public class JadxecuteDialog extends JDialog {
bottomPan.setLayout(new BorderLayout());
JPanel buttonPane = new JPanel();
JLabel statusLabel = new JLabel("Status: Ready");
- statusLabel.setPreferredSize(new Dimension(80, 16));
+ statusLabel.setPreferredSize(new Dimension(100, 16));
JButton run = new JButton("Run");
JButton close = new JButton("Close");
close.addActionListener(event -> close());
+
+ // run code
run.addActionListener(event -> runUserCode(codeInputArea, consoleOutputArea, statusLabel, run));
+
buttonPane.add(run);
buttonPane.add(close);
bottomPan.add(statusLabel, BorderLayout.WEST);
@@ -137,7 +147,8 @@ public class JadxecuteDialog extends JDialog {
codeExamplesPanel.setLayout(new BorderLayout());
codeExamplesPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
JLabel scriptSelection = new JLabel("Select Template:");
-
+ scriptSelection.setFont(new Font(null, Font.BOLD, DEFAULT_FONT_SIZE));
+
JScrollPane exampleScrollPane = initCodeExamplesListeners(codeInputArea);
JPanel southExamplesPanel = new JPanel();
southExamplesPanel.setLayout(new BorderLayout());
@@ -145,7 +156,7 @@ public class JadxecuteDialog extends JDialog {
southExamplesPanel.add(exampleScrollPane, BorderLayout.CENTER);
codeExamplesPanel.add(filePanel, BorderLayout.NORTH);
codeExamplesPanel.add(southExamplesPanel, BorderLayout.CENTER);
- codeExamplesPanel.setPreferredSize(new Dimension(200, 400));
+ codeExamplesPanel.setPreferredSize(new Dimension(300, 400));
return codeExamplesPanel;
}
@@ -156,12 +167,14 @@ public class JadxecuteDialog extends JDialog {
setTitle("JADXecute");
pack();
- if (!mainWindow.getSettings().loadWindowPos(this)) {
- setSize(800, 500);
- }
- setLocationRelativeTo(null);
+
+ // set modal size
+ setSize(1024, 768);
+
+ setLocationRelativeTo(mainPanel);
+ this.setModal(false);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
- setModalityType(ModalityType.APPLICATION_MODAL);
+ // setModalityType(ModalityType.APPLICATION_MODAL);
UiUtils.addEscapeShortCutToDispose(this);
}
@@ -190,6 +203,7 @@ public class JadxecuteDialog extends JDialog {
filePanel.setBorder(new EmptyBorder(10, 0, 10, 0));
JLabel fileLabel = new JLabel("Input Java File: ");
+ fileLabel.setFont(new Font(null, Font.BOLD, DEFAULT_FONT_SIZE));
JTextField fileField = new JTextField(20);
JButton fileButton = new JButton("Browse");
fileButton.addActionListener(e -> {
Can you submit a PR and merge the code?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.