-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e31cb2b
commit 4cb57b6
Showing
30 changed files
with
584 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/.vscode | ||
ADB GUI.jar | ||
LICENSE | ||
/ADB GUI.jar | ||
/out | ||
/bin | ||
/adb gui.xml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<launch4jConfig> | ||
<dontWrapJar>false</dontWrapJar> | ||
<headerType>gui</headerType> | ||
<jar>C:\Users\Bebo Khouja\Downloads\ADB GUI\out\artifacts\ADB_GUI_jar\ADB GUI.jar</jar> | ||
<outfile>C:\Users\Bebo Khouja\Downloads\ADB GUI\ADB GUI.exe</outfile> | ||
<errTitle>Please install a minimum version of Java 17.0.2 or later.</errTitle> | ||
<cmdLine></cmdLine> | ||
<chdir>.</chdir> | ||
<priority>normal</priority> | ||
<downloadUrl>https://java.com/download</downloadUrl> | ||
<supportUrl></supportUrl> | ||
<stayAlive>false</stayAlive> | ||
<restartOnCrash>false</restartOnCrash> | ||
<manifest></manifest> | ||
<icon>C:\Users\Bebo Khouja\Downloads\ADB GUI\src\resources\appicon.png</icon> | ||
<jre> | ||
<path>%JAVA_HOME%;%PATH%</path> | ||
<requiresJdk>false</requiresJdk> | ||
<requires64Bit>false</requires64Bit> | ||
<minVersion>17.0.2</minVersion> | ||
<maxVersion></maxVersion> | ||
</jre> | ||
<messages> | ||
<startupErr>An error occurred while starting the application.</startupErr> | ||
<jreNotFoundErr>This application requires a Java Runtime Environment.</jreNotFoundErr> | ||
<jreVersionErr>This application requires Java 17.0.2 or later.</jreVersionErr> | ||
<launcherErr>The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.</launcherErr> | ||
<instanceAlreadyExistsMsg>An application instance is already running.</instanceAlreadyExistsMsg> | ||
</messages> | ||
</launch4jConfig> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.mokkachocolata.enums; | ||
|
||
/** | ||
* The {@code Languages} enum holds the currently supported languages. <br> | ||
* <strong>Currently supported languages</strong> <br> | ||
* English, Indonesia | ||
* @since 1.5.0 | ||
* @author Bebo Khouja | ||
*/ | ||
public enum Languages {; | ||
/** | ||
* Language for American English. | ||
* @since 1.5.0 | ||
*/ | ||
public static final int EN_US = 0; | ||
/** | ||
* Language for Bahasa Indonesia. | ||
* @since 1.5.0 | ||
*/ | ||
public static final int ID_ID = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/com/mokkachocolata/project/adbgui/ExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.mokkachocolata.project.adbgui; | ||
|
||
import com.mokkachocolata.exception.JarNotFoundException; | ||
import com.mokkachocolata.util.AddonLoader; | ||
import io.sentry.Sentry; | ||
import org.apache.log4j.ConsoleAppender; | ||
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; | ||
|
||
public class ExceptionHandler implements Thread.UncaughtExceptionHandler { | ||
private final Logger logger = LogManager.getLogger(ExceptionHandler.class); | ||
private static int getVersion() { | ||
String version = System.getProperty("java.version"); | ||
if(version.startsWith("1.")) { | ||
version = version.substring(2, 3); | ||
} else { | ||
int dot = version.indexOf("."); | ||
if(dot != -1) { version = version.substring(0, dot); } | ||
} return Integer.parseInt(version); | ||
} | ||
|
||
public void uncaughtException(Thread thread, Throwable exception) { | ||
ConsoleAppender consoleAppender = new ConsoleAppender(); | ||
consoleAppender.setThreshold(Level.FATAL); | ||
|
||
Sentry.captureException(exception); | ||
logger.error("Reported exception thrown at thread " + thread.getName() + '!'); | ||
exception.printStackTrace(); | ||
try { | ||
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); | ||
} | ||
} | ||
} |
Oops, something went wrong.