Skip to content

Commit

Permalink
Changed code, minor grammar improvements, removed stuff.
Browse files Browse the repository at this point in the history
BeboKhouja committed Jun 9, 2024
1 parent 2f12e7e commit 7b70db0
Showing 7 changed files with 36 additions and 206 deletions.
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# How to contribute
Thank you for contributing to ADB GUI. If you have any quesions please ask me in my [Discord Server](https://discord.gg/y6AcUNTKxX).
Thank you for contributing to ADB GUI. If you have any questions, please ask me in my [Discord Server](https://discord.gg/y6AcUNTKxX).

In this guide I will learn you how to contribute.
In this guide, I will learn you how to contribute.

# Getting Started
Please do try to follow the committing style if you wanted to contribute, it makes the repository much more clean and consistent.
Please try to follow the committing style if you want to contribute, it makes the repository much more clean and consistent.
- Do not squash commits
- Explain what the commit does or what did you do in the commit message with less than 50 characters
- Use the commit description if you can't fit what you did in the commit message
- Use one of these prefixes in your commit messages:
- `fix` When you fixed a bug or maybe a flaw within the codebase
- `feat` When you added something within the codebase (can be anything)
- `tweak` When you do a little tweak in the codebase, like a tiny UI change
- `chore` When you do fix something, but it doesn't affect the app in terms of functionality
- `refactor` When you refactored the code, like cleaning up the code
- `fix` When you fixed a bug or a flaw within the codebase.
- `feature` When you added something within the codebase (can be anything).
- `tweak` When you do a little tweak in the codebase, like a tiny UI change.
- `minor` When you fix something, but it doesn't affect the app in terms of functionality.
- `refactor` When you refactored the code, like cleaning up the code.

# Documentation
If you are writing a documentation for ADB GUI make sure that it's formatted correctly, friendly and understandable.
If you are writing a documentation for ADB GUI, make sure that it's formatted correctly, friendly and understandable.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ADB GUI
ADB GUI is a free and open source Java based application that adds a GUI based ADB (Android Debug Bridge).
ADB GUI is a free and open source Java-based program that adds a GUI-based ADB (Android Debug Bridge).

# Getting Started
1. Install Java 17.0.2 or later.
@@ -10,18 +10,17 @@ Ubuntu:
sudo apt-get install openjdk-17-jre
```
### Windows
1. To get started download the jar that is included in this application.
1. To get started, download the .jar that's included in this application.
2. Download ADB from the official Android Developers website: https://developer.android.com/studio/releases/platform-tools#downloads
3. Put it on the root folder "C:\adb"
4. Put an environment variable in PATH called "C:\adb"
3. Put it on the folder "C:\adb".
4. Put an environment variable in PATH called "C:\adb".
5. Restart your computer.
6. You are done! Use ADB GUI to have fun!
6. You are done!

### Ubuntu
1. To get started download the jar that is included in this application.
1. To get started, download the .jar that's included in this application.
2. Download ADB from the official Android Developers website: https://developer.android.com/studio/releases/platform-tools#downloads or run `sudo apt-get install adb`
3. You are done! Use ADB GUI to have fun!
3. You are done!
# Features
1. Buttons to execute ADB commands.
2. Top bar.
3. Can execute custom commands instead of using buttons. In top bar.
2. Top bar.
19 changes: 8 additions & 11 deletions src/com/mokkachocolata/project/adbgui/ExceptionHandler.java
Original file line number Diff line number Diff line change
@@ -7,9 +7,6 @@
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

import java.net.URISyntaxException;

@@ -36,14 +33,14 @@ public void uncaughtException(Thread thread, Throwable exception) {
if (new AddonLoader().getModsFolder().exists()) {
logger.info("The details as explained below is shown.\nJava version " + getVersion() + "\nMods path: " + new AddonLoader().getModsFolder().toPath());
}
} catch (JarNotFoundException ignored) {
} catch (URISyntaxException ignored) {
}
MessageBox message = new MessageBox(new Shell(), SWT.OK);
message.setMessage("An error has occurred. The application will now terminate.");
int chosen = message.open();
if (chosen == SWT.OK) {
System.exit(0);
} catch (JarNotFoundException | URISyntaxException ignored) {
}
System.exit(-1);
// MessageBox message = new MessageBox(new Shell(), SWT.OK);
// message.setMessage("An error has occurred. The application will now terminate.");
// int chosen = message.open();
// if (chosen == SWT.OK) {
// System.exit(0);
// }
}
}
36 changes: 9 additions & 27 deletions src/com/mokkachocolata/project/adbgui/MainFrame.java
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@

// Project imports

import com.mokkachocolata.util.ExecuteCommand;
import com.mokkachocolata.util.Link;
import com.mokkachocolata.util.Localization;
import io.sentry.Sentry;
@@ -35,11 +34,10 @@ public class MainFrame extends JFrame implements ActionListener, MenuListener, K
//Vars
final JTabbedPane tabbedPane = new JTabbedPane();
JMenuBar menubar1;
JMenu filemenu1,advancedmenu1,helpmenu1;
JMenuItem exitmenu1,aboutmenu1,executecommandmenu2,discordmenu3,githubmenu3,languagemenu1;
JMenu filemenu1,helpmenu1;
JMenuItem exitmenu1,aboutmenu1,discordmenu3,githubmenu3,languagemenu1;
JButton button1,button2,button3,button4;
JLabel text1;
final ExecuteCommand CommandBar = new ExecuteCommand();

// ImageIcon logo = new ImageIcon(".//res//appicon.png")
final JList<Object> list = new JList<>();
@@ -54,7 +52,7 @@ public class MainFrame extends JFrame implements ActionListener, MenuListener, K
public void init() throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {
//Window config
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
setTitle(localization.getLocalizedText("WINDOW_TITLE"));
setTitle(localization.getLocalizedText("WINDOW_TITLE") + " " + App.version);
setIconImage(Toolkit.getDefaultToolkit().
getImage(this.getClass().getResource("/resources/appicon.png")));
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
@@ -65,18 +63,16 @@ public void init() throws UnsupportedLookAndFeelException, ClassNotFoundExceptio
panel.setMaximumSize(new Dimension(100, 100));
menubar1 = new JMenuBar();
filemenu1 = new JMenu("File");
advancedmenu1 = new JMenu("Advanced");
helpmenu1 = new JMenu("Help");
exitmenu1 = new JMenuItem("Exit");
aboutmenu1 = new JMenuItem("About");
executecommandmenu2 = new JMenuItem("Execute command");
discordmenu3 = new JMenuItem("Discord Server");
githubmenu3 = new JMenuItem("GitHub Repository");
button1 = new JButton("Reboot device");
button2 = new JButton("Reboot to recovery");
button1 = new JButton("Restart device");
button2 = new JButton("Restart to recovery");
languagemenu1 = new JMenuItem(localization.getLocalizedText("LANGUAGE_CHANGE_OPTION"));
button3 = new JButton(localization.getLocalizedText("REBOOT_DEVICE_SIDELOAD"));
button4 = new JButton("Reconnect device");
button4 = new JButton("Kill server");
text1 = new JLabel(localization.getLocalizedText("ENABLE_DEBUGGING_WARNING"));
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler());
list.setModel(model);
@@ -92,37 +88,32 @@ public void init() throws UnsupportedLookAndFeelException, ClassNotFoundExceptio
add(wrapper);
this.setJMenuBar(menubar1);
menubar1.add(filemenu1);
menubar1.add(advancedmenu1);
menubar1.add(helpmenu1);
advancedmenu1.setMnemonic(KeyEvent.VK_A);
filemenu1.setMnemonic(KeyEvent.VK_F);
aboutmenu1.setMnemonic(KeyEvent.VK_A);
exitmenu1.setMnemonic(KeyEvent.VK_E);
executecommandmenu2.setMnemonic(KeyEvent.VK_E);
helpmenu1.setMnemonic(KeyEvent.VK_H);
discordmenu3.setMnemonic(KeyEvent.VK_D);
githubmenu3.setMnemonic(KeyEvent.VK_G);
filemenu1.add(aboutmenu1);
filemenu1.add(exitmenu1);
advancedmenu1.add(executecommandmenu2);
helpmenu1.add(discordmenu3);
helpmenu1.add(githubmenu3);
labelPanel.add(text1);
panel2.add(button1);
panel2.add(button2);
panel2.add(button3);
panel2.add(button4);
button1.setToolTipText("This option reboots the device normally. Usage: 'adb reboot'");
button2.setToolTipText("This option reboots the device into recovery. Usage: 'adb reboot recovery'");
button3.setToolTipText("This option reboots the device into recovery then starts sideload mode. Usage: 'adb reboot sideload'");
button1.setToolTipText("This option restarts the device normally. Usage: 'adb reboot'");
button2.setToolTipText("This option restarts the device into recovery. Usage: 'adb reboot recovery'");
button3.setToolTipText("This option restarts the device into recovery, then starts sideload mode. Usage: 'adb reboot sideload'");
button4.setToolTipText("This option kills the ADB server. Usage: 'adb kill-server'");
this.pack();
setSize(500, 350);
setVisible(true);
//Event add
aboutmenu1.addActionListener(this);
exitmenu1.addActionListener(this);
executecommandmenu2.addActionListener(this);
discordmenu3.addActionListener(this);
githubmenu3.addActionListener(this);
button1.addActionListener(this);
@@ -196,22 +187,13 @@ public void actionPerformed(ActionEvent arg0) {
}
if (arg0.getSource() == exitmenu1) {
System.exit(0);
}

if (arg0.getSource() == executecommandmenu2) {
CommandBar.setVisible(true);
}
if (arg0.getSource() == discordmenu3) {
link.OpenLink("https://discord.gg/y6AcUNTKxX");
}

if (arg0.getSource() == githubmenu3) {
link.OpenLink("https://github.com/BeboKhouja/ADB-GUI");
try {
throw new IllegalAccessException();
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}

78 changes: 0 additions & 78 deletions src/com/mokkachocolata/util/ExecuteCommand.form

This file was deleted.

70 changes: 0 additions & 70 deletions src/com/mokkachocolata/util/ExecuteCommand.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/resources/localizedtexts.json
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
{"language":"id_id", "key":"REBOOT_DEVICE_SIDELOAD", "string":"Mulai ulang perangkat ke sideload"},
{"language":"id_id", "key":"WINDOW_TITLE", "string":"GUI ADB"},
{"language":"en_us", "key":"ENABLE_DEBUGGING_WARNING", "string":"Make sure USB Debugging is enabled in Android Developer Settings."},
{"language":"en_us", "key":"REBOOT_DEVICE", "string":"Reboot device"},
{"language":"en_us", "key":"REBOOT_DEVICE_SIDELOAD", "string":"Reboot to sideload"},
{"language":"en_us", "key":"REBOOT_DEVICE", "string":"Restart device"},
{"language":"en_us", "key":"REBOOT_DEVICE_SIDELOAD", "string":"Restart to sideload"},
{"language":"en_us", "key":"WINDOW_TITLE", "string":"ADB GUI"}
]

0 comments on commit 7b70db0

Please sign in to comment.