Skip to content

Commit 199b881

Browse files
committed
feat: more ui
1 parent c93c3ba commit 199b881

3 files changed

Lines changed: 72 additions & 6 deletions

File tree

dev.skidfuscator.client.standalone/src/main/java/dev/skidfuscator/obfuscator/SkidfuscatorMain.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ public class SkidfuscatorMain {
2424
public static void main(String[] args) {
2525

2626
if (args.length == 0) {
27+
// MacOS menu bar
28+
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Skidfuscator");
29+
System.setProperty("apple.laf.useScreenMenuBar", "true");
2730
SwingUtilities.invokeLater(() -> {
2831
try {
2932
FlatDarkPurpleIJTheme.setup();

dev.skidfuscator.client.standalone/src/main/java/dev/skidfuscator/obfuscator/gui/ConfigPanel.java

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import javax.swing.border.EtchedBorder;
2020
import javax.swing.event.DocumentEvent;
2121
import javax.swing.event.DocumentListener;
22+
import javax.swing.text.BadLocationException;
23+
import javax.swing.text.DefaultHighlighter;
2224

2325
public class ConfigPanel extends JPanel {
2426
private final JTextField inputField;
@@ -33,24 +35,74 @@ public ConfigPanel() {
3335

3436
// Create compound border with titled border and empty border for padding
3537
setBorder(BorderFactory.createCompoundBorder(
36-
// Outer titled border
3738
BorderFactory.createTitledBorder(
38-
BorderFactory.createEtchedBorder(EtchedBorder.RAISED), // Rounded line border with increased arc
39+
BorderFactory.createEtchedBorder(EtchedBorder.RAISED),
3940
"Configuration",
4041
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
4142
javax.swing.border.TitledBorder.DEFAULT_POSITION,
4243
new Font("Segoe UI", Font.BOLD, 16)
4344
),
44-
// Inner empty border for padding
4545
BorderFactory.createEmptyBorder(20, 0, 10, 0)
4646
));
47+
// Add description panel at the top
48+
JTextArea descriptionArea = new JTextArea(
49+
"Configure your obfuscation settings below:\n\n" +
50+
"• Input JAR: Select the Java archive (.jar) file you want to obfuscate\n" +
51+
"• Output JAR: Choose where to save the obfuscated file (.jar, .apk, or .dex)\n" +
52+
"• Libraries: (Optional) Directory containing dependency JARs needed by your application\n" +
53+
"• Runtime: JDK runtime libraries required for compilation (auto-downloaded)\n" +
54+
"• Debug Mode: Enable additional logging and debugging information\n\n"
55+
);
56+
descriptionArea.setEditable(false);
57+
descriptionArea.setFont(new Font("Segoe UI", Font.PLAIN, 12));
58+
descriptionArea.setLineWrap(true);
59+
descriptionArea.setWrapStyleWord(true);
60+
descriptionArea.setBackground(null);
61+
descriptionArea.setBorder(null);
4762

48-
// Load configuration
49-
config = SkidfuscatorConfig.load();
63+
// Create indicator panel
64+
JPanel indicatorPanel = new JPanel();
65+
indicatorPanel.setLayout(new BoxLayout(indicatorPanel, BoxLayout.Y_AXIS));
66+
indicatorPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
67+
68+
// Add indicators with colored symbols
69+
JLabel validLabel = new JLabel("✓ Green checkmarks indicate valid configurations");
70+
validLabel.setFont(new Font("Segoe UI", Font.PLAIN, 12));
71+
validLabel.setForeground(new Color(0x2ECC40));
72+
73+
JLabel errorLabel = new JLabel("✗ Red X marks indicate issues that need to be resolved");
74+
errorLabel.setFont(new Font("Segoe UI", Font.PLAIN, 12));
75+
errorLabel.setForeground(new Color(0xFF4136));
76+
77+
JLabel optionalLabel = new JLabel("● Orange dots indicate optional fields");
78+
optionalLabel.setFont(new Font("Segoe UI", Font.PLAIN, 12));
79+
optionalLabel.setForeground(new Color(0xFF851B));
80+
81+
indicatorPanel.add(validLabel);
82+
indicatorPanel.add(Box.createVerticalStrut(5));
83+
indicatorPanel.add(errorLabel);
84+
indicatorPanel.add(Box.createVerticalStrut(5));
85+
indicatorPanel.add(optionalLabel);
5086

87+
// Add components to panel
5188
GridBagConstraints gbc = new GridBagConstraints();
5289
gbc.fill = GridBagConstraints.HORIZONTAL;
53-
gbc.insets = new Insets(5, 5, 5, 5);
90+
gbc.insets = new Insets(0, 5, 0, 5);
91+
gbc.gridx = 0;
92+
gbc.gridy = 20;
93+
gbc.gridwidth = 3;
94+
add(descriptionArea, gbc);
95+
96+
gbc.gridy = -1;
97+
gbc.insets = new Insets(0, 5, 20, 5);
98+
add(indicatorPanel, gbc);
99+
100+
// Reset gridwidth for other components
101+
gbc.gridwidth = 1;
102+
gbc.gridy++;
103+
104+
// Load configuration
105+
config = SkidfuscatorConfig.load();
54106

55107
// Input file
56108
gbc.gridx = 0; gbc.gridy = 0;

dev.skidfuscator.client.standalone/src/main/java/dev/skidfuscator/obfuscator/gui/MainFrame.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,19 @@ public MainFrame() {
3030
setTitle("Skidfuscator");
3131
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
3232
setPreferredSize(new Dimension(900, 700));
33+
setResizable(false);
3334
setLayout(new BorderLayout(15, 5));
3435

36+
// Set application icon
37+
try {
38+
InputStream iconStream = getClass().getResourceAsStream("/images/logo.png");
39+
if (iconStream != null) {
40+
setIconImage(ImageIO.read(iconStream));
41+
}
42+
} catch (Exception e) {
43+
e.printStackTrace();
44+
}
45+
3546
// Create a panel for the left side that will contain both tabbed pane and button
3647
JPanel leftPanel = new JPanel(new BorderLayout());
3748
leftPanel.setPreferredSize(new Dimension(180, getHeight()));

0 commit comments

Comments
 (0)