From d6be70dfb2a9158c1f651dd9269f862af4bbd3ef Mon Sep 17 00:00:00 2001 From: Konloch Date: Tue, 6 Jul 2021 19:51:10 -0700 Subject: [PATCH] Better Error Handling --- .../the/bytecode/club/bootloader/Boot.java | 10 +++---- .../club/bytecodeviewer/BytecodeViewer.java | 14 +++++++--- .../club/bytecodeviewer/CommandLineInput.java | 20 +++++++------- .../club/bytecodeviewer/Constants.java | 2 +- .../club/bytecodeviewer/Resources.java | 2 +- .../bytecodeviewer/SettingsSerializer.java | 2 +- .../bytecodeviewer/api/BytecodeViewer.java | 6 ++--- .../club/bytecodeviewer/api/Plugin.java | 2 +- .../compilers/impl/JavaCompiler.java | 2 +- .../compilers/impl/KrakatauAssembler.java | 2 +- .../compilers/impl/SmaliAssembler.java | 6 ++--- .../bytecode/InstructionPrinter.java | 2 +- .../decompilers/impl/CFRDecompiler.java | 6 ++--- .../impl/FernFlowerDecompiler.java | 2 +- .../decompilers/impl/JADXDecompiler.java | 3 ++- .../decompilers/impl/JDGUIDecompiler.java | 3 ++- .../decompilers/impl/KrakatauDecompiler.java | 2 +- .../impl/KrakatauDisassembler.java | 2 +- .../decompilers/impl/ProcyonDecompiler.java | 4 +-- .../decompilers/impl/SmaliDisassembler.java | 3 ++- .../ResourceViewProcessing.java | 2 +- .../bytecodeviewer/plugin/PluginTemplate.java | 3 ++- .../bytecodeviewer/plugin/PluginWriter.java | 2 +- .../preinstalled/AllatoriStringDecrypter.java | 2 +- .../CompiledJavaPluginLaunchStrategy.java | 3 ++- .../JavascriptPluginLaunchStrategy.java | 3 ++- .../resources/ResourceDecompiling.java | 26 +++++++++---------- .../resources/importing/ImportResource.java | 2 +- .../importing/impl/APKResourceImporter.java | 2 +- .../importing/impl/ClassResourceImporter.java | 2 +- .../importing/impl/DEXResourceImporter.java | 2 +- .../importing/impl/ZipResourceImporter.java | 5 ++-- .../searching/RegexInsnFinder.java | 11 ++++---- .../club/bytecodeviewer/util/APKTool.java | 4 +-- .../club/bytecodeviewer/util/Dex2Jar.java | 5 ++-- .../bytecodeviewer/util/DialogueUtils.java | 2 +- .../club/bytecodeviewer/util/Enjarify.java | 2 +- .../club/bytecodeviewer/util/FileDrop.java | 8 +++--- .../bytecodeviewer/util/JTextAreaUtils.java | 6 +++-- .../club/bytecodeviewer/util/JarUtils.java | 14 +++++----- .../club/bytecodeviewer/util/MiscUtils.java | 2 +- .../bytecodeviewer/util/VersionChecker.java | 6 ++--- 42 files changed, 115 insertions(+), 94 deletions(-) diff --git a/src/main/java/the/bytecode/club/bootloader/Boot.java b/src/main/java/the/bytecode/club/bootloader/Boot.java index 4c23a18a..a3645cc2 100644 --- a/src/main/java/the/bytecode/club/bootloader/Boot.java +++ b/src/main/java/the/bytecode/club/bootloader/Boot.java @@ -60,7 +60,7 @@ public class Boot { try { screen = new InitialBootScreen(); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } } @@ -335,7 +335,7 @@ public class Boot { System.out.println("Succesfully extracted Krakatau"); } catch (Exception e) { setState("Bytecode Viewer Boot Screen - ERROR, please contact @Konloch with your stacktrace."); - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } @@ -371,7 +371,7 @@ public class Boot { System.out.println("Succesfully extracted Enjarify"); } catch (Exception e) { setState("Bytecode Viewer Boot Screen - ERROR, please contact @Konloch with your stacktrace."); - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } @@ -485,7 +485,7 @@ public class Boot { BytecodeViewer.showMessage("ERROR: There was an issue unzipping enjarify (possibly corrupt). Restart " + "BCV." + nl + "If the error persists contact @Konloch."); - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); Objects.requireNonNull(enjarifyZip).delete(); } } @@ -530,7 +530,7 @@ public class Boot { BytecodeViewer.showMessage("ERROR: There was an issue unzipping Krakatau decompiler (possibly " + "corrupt). Restart BCV." + nl + "If the error persists contact @Konloch."); - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); Objects.requireNonNull(krakatauZip).delete(); } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java index 1c976ff8..473c42af 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java @@ -199,7 +199,7 @@ public class BytecodeViewer } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } @@ -492,7 +492,7 @@ public class BytecodeViewer try { PluginManager.runPlugin(file); } catch (Throwable e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } addRecentPlugin(file); } @@ -542,7 +542,15 @@ public class BytecodeViewer */ public static void handleException(Throwable t) { - new ExceptionUI(t); + BytecodeViewer.handleException(t); + } + + /** + * Handle the exception by creating a new window for bug reporting + */ + public static void handleException(Throwable t, String author) + { + BytecodeViewer.handleException(t, author); } /** diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/CommandLineInput.java b/src/main/java/the/bytecode/club/bytecodeviewer/CommandLineInput.java index 40e96ac8..9d62ed00 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/CommandLineInput.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/CommandLineInput.java @@ -162,7 +162,7 @@ public class CommandLineInput { return CLI; } } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } return OPEN_FILE; @@ -208,7 +208,7 @@ public class CommandLineInput { String contents = Decompiler.PROCYON_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } else if (decompiler.equalsIgnoreCase("cfr")) { @@ -226,7 +226,7 @@ public class CommandLineInput { String contents = Decompiler.CFR_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } else if (decompiler.equalsIgnoreCase("fernflower")) { @@ -244,7 +244,7 @@ public class CommandLineInput { String contents = Decompiler.FERNFLOWER_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } else if (decompiler.equalsIgnoreCase("krakatau")) { @@ -262,7 +262,7 @@ public class CommandLineInput { String contents = Decompiler.KRAKATAU_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } else if (decompiler.equalsIgnoreCase("krakatau-bytecode")) { @@ -281,7 +281,7 @@ public class CommandLineInput { String contents = Decompiler.KRAKATAU_DISASSEMBLER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } else if (decompiler.equalsIgnoreCase("jd-gui")) { @@ -300,7 +300,7 @@ public class CommandLineInput { String contents = Decompiler.JD_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } else if (decompiler.equalsIgnoreCase("smali")) { @@ -319,7 +319,7 @@ public class CommandLineInput { String contents = Decompiler.SMALI_DISASSEMBLER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } else if (decompiler.equalsIgnoreCase("jadx")) { @@ -338,7 +338,7 @@ public class CommandLineInput { String contents = Decompiler.JADX_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } @@ -349,7 +349,7 @@ public class CommandLineInput { Configuration.canExit = true; System.exit(0); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java index c6ac9339..97762cf2 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java @@ -83,7 +83,7 @@ public class Constants // Hide file by running attrib system command (on Windows) Runtime.getRuntime().exec("attrib +H " + f.getAbsolutePath()); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } BytecodeViewer.sm.setBlocking(); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Resources.java b/src/main/java/the/bytecode/club/bytecodeviewer/Resources.java index 508dfd74..9729de35 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Resources.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Resources.java @@ -129,7 +129,7 @@ public class Resources { image = ImageIO.read(bis); bis.close(); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } return image; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/SettingsSerializer.java b/src/main/java/the/bytecode/club/bytecodeviewer/SettingsSerializer.java index af5ee8eb..0ec6235c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/SettingsSerializer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/SettingsSerializer.java @@ -315,7 +315,7 @@ public class SettingsSerializer DiskWriter.writeNewLine(settingsName, Configuration.language.name(), false); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/api/BytecodeViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/api/BytecodeViewer.java index 0815675c..34396482 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/api/BytecodeViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/api/BytecodeViewer.java @@ -81,7 +81,7 @@ public class BytecodeViewer { try { return cl.loadClass(cn.name); } catch (Exception classLoadException) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(classLoadException); + the.bytecode.club.bytecodeviewer.BytecodeViewer.handleException(classLoadException); } return null; @@ -115,7 +115,7 @@ public class BytecodeViewer { try { ret.add(cl.loadClass(className)); } catch (Exception classLoadException) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(classLoadException); + the.bytecode.club.bytecodeviewer.BytecodeViewer.handleException(classLoadException); } } @@ -123,7 +123,7 @@ public class BytecodeViewer { return ret; } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + the.bytecode.club.bytecodeviewer.BytecodeViewer.handleException(e); } return null; } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java b/src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java index 0b5745d9..18362296 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java @@ -42,7 +42,7 @@ public abstract class Plugin extends Thread execute(BytecodeViewer.getLoadedClasses()); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { finished = true; BytecodeViewer.updateBusyStatus(false); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java index e189af2d..eb514f1a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java @@ -152,7 +152,7 @@ public class JavaCompiler extends InternalCompiler return org.apache.commons.io.FileUtils.readFileToByteArray(clazz); } catch (IOException e) { e.printStackTrace(); - //new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + //BytecodeViewer.handleException(e); } return null; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java index b3bbf22d..a1f5695b 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java @@ -118,7 +118,7 @@ public class KrakatauAssembler extends InternalCompiler return b; } catch (Exception e) { e.printStackTrace(); - //new the.bytecode.club.bytecodeviewer.api.ExceptionUI(log.toString()); + //BytecodeViewer.handleException(log.toString()); } finally { BytecodeViewer.sm.setBlocking(); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java index 119a5e4c..a9addc42 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java @@ -57,7 +57,7 @@ public class SmaliAssembler extends InternalCompiler DiskWriter.replaceFile(tempSmali.getAbsolutePath(), contents, false); } catch (final Exception e) { e.printStackTrace(); - //new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + //BytecodeViewer.handleException(e); } try { @@ -67,7 +67,7 @@ public class SmaliAssembler extends InternalCompiler }); } catch (Exception e) { e.printStackTrace(); - //new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + //BytecodeViewer.handleException(e); } @@ -104,7 +104,7 @@ public class SmaliAssembler extends InternalCompiler } catch (java.lang.NullPointerException ignored) { } } catch (Exception e) { e.printStackTrace(); - //new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + //BytecodeViewer.handleException(e); } finally { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java index f3f27ca7..39e7946e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java @@ -390,7 +390,7 @@ public class InstructionPrinter { } bw.close(); } catch (IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/CFRDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/CFRDecompiler.java index 150c7e4d..3673cc00 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/CFRDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/CFRDecompiler.java @@ -102,7 +102,7 @@ public class CFRDecompiler extends InternalDecompiler fos.close(); } catch (final IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } String fuckery = fuckery(fileStart); @@ -118,7 +118,7 @@ public class CFRDecompiler extends InternalDecompiler BytecodeViewer.createdProcesses.add(p); p.waitFor(); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { BytecodeViewer.sm.setBlocking(); } @@ -314,7 +314,7 @@ public class CFRDecompiler extends InternalDecompiler try { zip(fuck, new File(zipName)); } catch (IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } fuck.delete(); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java index f7421a1d..0edd9033 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java @@ -96,7 +96,7 @@ public class FernFlowerDecompiler extends InternalDecompiler BytecodeViewer.createdProcesses.add(p); p.waitFor(); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { BytecodeViewer.sm.setBlocking(); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JADXDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JADXDecompiler.java index 51872f62..eabb2560 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JADXDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JADXDecompiler.java @@ -11,6 +11,7 @@ import java.util.Objects; import java.util.Random; import me.konloch.kontainer.io.DiskReader; 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.InternalDecompiler; import the.bytecode.club.bytecodeviewer.util.MiscUtils; @@ -54,7 +55,7 @@ public class JADXDecompiler extends InternalDecompiler fos.write(b); fos.close(); } catch (final IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } File fuckery = new File(fuckery(fileStart)); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JDGUIDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JDGUIDecompiler.java index b6d179a2..9d6ab8b1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JDGUIDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JDGUIDecompiler.java @@ -7,6 +7,7 @@ import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.ExceptionUI; import the.bytecode.club.bytecodeviewer.decompilers.InternalDecompiler; import the.bytecode.club.bytecodeviewer.decompilers.jdgui.DirectoryLoader; @@ -74,7 +75,7 @@ public class JDGUIDecompiler extends InternalDecompiler fos.write(b); fos.close(); } catch (final IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDecompiler.java index 278030d7..0ece9497 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDecompiler.java @@ -282,7 +282,7 @@ public class KrakatauDecompiler extends InternalDecompiler ZipUtils.zipFolder(tempDirectory.getAbsolutePath(), zipName, ran); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { BytecodeViewer.sm.setBlocking(); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java index 307dfe9d..400e3f38 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java @@ -218,7 +218,7 @@ public class KrakatauDisassembler extends InternalDecompiler ZipUtils.zipFolder(tempDirectory.getAbsolutePath(), zipName, ran); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { BytecodeViewer.sm.setBlocking(); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/ProcyonDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/ProcyonDecompiler.java index 48975954..019d54aa 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/ProcyonDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/ProcyonDecompiler.java @@ -101,7 +101,7 @@ public class ProcyonDecompiler extends InternalDecompiler fos.close(); } catch (final IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } DecompilerSettings settings = getDecompilerSettings(); @@ -140,7 +140,7 @@ public class ProcyonDecompiler extends InternalDecompiler try { doSaveJarDecompiled(new File(sourceJar), new File(zipName)); } catch (StackOverflowError | Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/SmaliDisassembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/SmaliDisassembler.java index 2e2fb17e..7f0654d0 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/SmaliDisassembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/SmaliDisassembler.java @@ -9,6 +9,7 @@ import java.util.Objects; import me.konloch.kontainer.io.DiskReader; import org.apache.commons.io.FileUtils; 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.InternalDecompiler; import the.bytecode.club.bytecodeviewer.util.Dex2Jar; @@ -62,7 +63,7 @@ public class SmaliDisassembler extends InternalDecompiler fos.close(); } catch (final IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } //ZipUtils.zipFile(tempClass, tempZip); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/ResourceViewProcessing.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/ResourceViewProcessing.java index f164f47d..36340913 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/ResourceViewProcessing.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/ResourceViewProcessing.java @@ -133,7 +133,7 @@ public class ResourceViewProcessing extends PaneUpdaterThread } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginTemplate.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginTemplate.java index da2a2232..88f238f1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginTemplate.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginTemplate.java @@ -1,6 +1,7 @@ package the.bytecode.club.bytecodeviewer.plugin; import org.apache.commons.io.FilenameUtils; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Resources; import the.bytecode.club.bytecodeviewer.api.ExceptionUI; @@ -47,7 +48,7 @@ public enum PluginTemplate } catch (IOException e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } return null; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java index 40447473..0f7dcecb 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java @@ -104,7 +104,7 @@ public class PluginWriter extends JFrame } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } catch (Throwable t) { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/AllatoriStringDecrypter.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/AllatoriStringDecrypter.java index ddff5cd2..88921df7 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/AllatoriStringDecrypter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/AllatoriStringDecrypter.java @@ -84,7 +84,7 @@ public class AllatoriStringDecrypter extends Plugin } catch (Exception e) { - new ExceptionUI(e, "github.com/Szperak"); + BytecodeViewer.handleException(e, "github.com/Szperak"); } finally { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java index da2d1a9a..70ee4edb 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/CompiledJavaPluginLaunchStrategy.java @@ -10,6 +10,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import org.objectweb.asm.ClassReader; import org.objectweb.asm.tree.ClassNode; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.plugin.PluginLaunchStrategy; import the.bytecode.club.bytecodeviewer.util.JarUtils; @@ -103,7 +104,7 @@ public class CompiledJavaPluginLaunchStrategy implements PluginLaunchStrategy { } } } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { jis.closeEntry(); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java index 04bec472..104d227f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java @@ -1,6 +1,7 @@ package the.bytecode.club.bytecodeviewer.plugin.strategies; import org.objectweb.asm.tree.ClassNode; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.plugin.PluginLaunchStrategy; @@ -65,7 +66,7 @@ public class JavascriptPluginLaunchStrategy implements PluginLaunchStrategy } catch (NoSuchMethodException | ScriptException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } }; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceDecompiling.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceDecompiling.java index 3a1d1061..7a352dda 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceDecompiling.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceDecompiling.java @@ -85,7 +85,7 @@ public class ResourceDecompiling MiscUtils.append(javaSucks, "-proycon.zip")); BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t12.start(); @@ -96,7 +96,7 @@ public class ResourceDecompiling MiscUtils.append(javaSucks, "-CFR.zip")); BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t2.start(); @@ -107,7 +107,7 @@ public class ResourceDecompiling MiscUtils.append(javaSucks, "-fernflower.zip")); BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t3.start(); @@ -118,7 +118,7 @@ public class ResourceDecompiling MiscUtils.append(javaSucks, "-kraktau.zip")); BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t4.start(); @@ -129,7 +129,7 @@ public class ResourceDecompiling Decompiler.PROCYON_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(), path); BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t12.start(); @@ -140,7 +140,7 @@ public class ResourceDecompiling Decompiler.CFR_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(), path); BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t12.start(); @@ -151,7 +151,7 @@ public class ResourceDecompiling Decompiler.FERNFLOWER_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(), path); BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t12.start(); @@ -163,7 +163,7 @@ public class ResourceDecompiling Decompiler.KRAKATAU_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(), path); BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t12.start(); @@ -276,7 +276,7 @@ public class ResourceDecompiling BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { BytecodeViewer.updateBusyStatus(false); - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }); t1.start(); @@ -301,7 +301,7 @@ public class ResourceDecompiling BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { BytecodeViewer.updateBusyStatus(false); - new ExceptionUI( + BytecodeViewer.handleException( e); } }); @@ -327,7 +327,7 @@ public class ResourceDecompiling BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { BytecodeViewer.updateBusyStatus(false); - new ExceptionUI( + BytecodeViewer.handleException( e); } }); @@ -355,7 +355,7 @@ public class ResourceDecompiling BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { BytecodeViewer.updateBusyStatus(false); - new ExceptionUI( + BytecodeViewer.handleException( e); } }); @@ -383,7 +383,7 @@ public class ResourceDecompiling BytecodeViewer.updateBusyStatus(false); } catch (Exception e) { BytecodeViewer.updateBusyStatus(false); - new ExceptionUI( + BytecodeViewer.handleException( e); } }); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/ImportResource.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/ImportResource.java index 3329f07c..20c5281c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/ImportResource.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/ImportResource.java @@ -95,7 +95,7 @@ public class ImportResource implements Runnable } catch (final Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java index 8edee3cc..0a01e22b 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java @@ -53,7 +53,7 @@ public class APKResourceImporter implements Importer BytecodeViewer.updateBusyStatus(false); BytecodeViewer.files.add(container); } catch (final Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } return true; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ClassResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ClassResourceImporter.java index 3d3c2791..41216625 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ClassResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ClassResourceImporter.java @@ -40,7 +40,7 @@ public class ClassResourceImporter implements Importer } catch (final Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); return false; } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DEXResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DEXResourceImporter.java index 492357b7..09e57f82 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DEXResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DEXResourceImporter.java @@ -42,7 +42,7 @@ public class DEXResourceImporter implements Importer BytecodeViewer.updateBusyStatus(false); BytecodeViewer.files.add(container); } catch (final Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } return true; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ZipResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ZipResourceImporter.java index 74ecc4eb..70c99cc8 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ZipResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ZipResourceImporter.java @@ -1,5 +1,6 @@ package the.bytecode.club.bytecodeviewer.resources.importing.impl; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.ExceptionUI; import the.bytecode.club.bytecodeviewer.resources.importing.Importer; import the.bytecode.club.bytecodeviewer.util.JarUtils; @@ -30,13 +31,13 @@ public class ZipResourceImporter implements Importer } catch (final Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); return false; } } catch (final Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); return false; } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/RegexInsnFinder.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/RegexInsnFinder.java index f8d289d0..dfca79f8 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/RegexInsnFinder.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/RegexInsnFinder.java @@ -18,6 +18,7 @@ import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MultiANewArrayInsnNode; import org.objectweb.asm.tree.TypeInsnNode; import org.objectweb.asm.tree.VarInsnNode; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -245,7 +246,7 @@ public class RegexInsnFinder { "Unknown opcode encountered: " + ain.getOpcode()); } catch (final UnexpectedException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } offsets[i] = insnStringBuilder.length(); @@ -273,7 +274,7 @@ public class RegexInsnFinder { "Unknown opcode encountered: " + ain.getOpcode()); } catch (final UnexpectedException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } String insnString = getInsString(ain); @@ -385,7 +386,7 @@ public class RegexInsnFinder { results.add(makeResult(regexMatcher.start(), regexMatcher.end())); } } catch (final PatternSyntaxException ex) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(ex); + BytecodeViewer.handleException(ex); } return results; } @@ -411,7 +412,7 @@ public class RegexInsnFinder { return result; } } catch (final PatternSyntaxException ex) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(ex); + BytecodeViewer.handleException(ex); } return new AbstractInsnNode[0][0]; } @@ -438,7 +439,7 @@ public class RegexInsnFinder { results.add(result); } } catch (final PatternSyntaxException ex) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(ex); + BytecodeViewer.handleException(ex); } return results; } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/APKTool.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/APKTool.java index 9d85778d..f53d6192 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/APKTool.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/APKTool.java @@ -48,7 +48,7 @@ public class APKTool { container.APKToolContents = dir; tempAPKPath.delete(); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } @@ -74,7 +74,7 @@ public class APKTool { BytecodeViewer.sm.setBlocking(); tempAPKPath.delete(); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java index ba6024aa..ee753226 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java @@ -1,6 +1,7 @@ package the.bytecode.club.bytecodeviewer.util; import com.googlecode.d2j.dex.Dex2jar; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; import java.io.File; import java.io.IOException; @@ -45,7 +46,7 @@ public class Dex2Jar { } catch (com.googlecode.d2j.DexException e) { e.printStackTrace(); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } @@ -96,7 +97,7 @@ public class Dex2Jar { if (delete) input.delete(); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/DialogueUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/DialogueUtils.java index ae9e88f3..9738a536 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/DialogueUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/DialogueUtils.java @@ -73,7 +73,7 @@ public class DialogueUtils Configuration.lastDirectory = file.getAbsolutePath(); return file; } catch (Exception e1) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e1); + BytecodeViewer.handleException(e1); } return null; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/Enjarify.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/Enjarify.java index 0ffda8e2..7befca10 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/Enjarify.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/Enjarify.java @@ -69,7 +69,7 @@ public class Enjarify { MiscUtils.printProcess(process); } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { BytecodeViewer.sm.setBlocking(); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/FileDrop.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/FileDrop.java index 0b773375..b187503c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/FileDrop.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/FileDrop.java @@ -1,5 +1,7 @@ package the.bytecode.club.bytecodeviewer.util; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; + import java.awt.datatransfer.DataFlavor; import java.io.BufferedReader; import java.io.File; @@ -367,13 +369,13 @@ public class FileDrop { } // end try catch (final java.io.IOException io) { log(out, "FileDrop: IOException - abort:"); - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(io); + BytecodeViewer.handleException(io); evt.rejectDrop(); } // end catch IOException catch (final java.awt.datatransfer.UnsupportedFlavorException ufe) { log(out, "FileDrop: UnsupportedFlavorException - abort:"); - new the.bytecode.club.bytecodeviewer.api.ExceptionUI( + BytecodeViewer.handleException( ufe); evt.rejectDrop(); } // end catch: UnsupportedFlavorException @@ -480,7 +482,7 @@ public class FileDrop { dt.addDropTargetListener(dropListener); } // end try catch (final java.util.TooManyListenersException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); log(out, "FileDrop: Drop will not work due to previous error. Do you have another listener attached?"); } // end catch diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/JTextAreaUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/JTextAreaUtils.java index 41b4ee6a..ee47e7c8 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/JTextAreaUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/JTextAreaUtils.java @@ -1,5 +1,7 @@ package the.bytecode.club.bytecodeviewer.util; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; + import javax.swing.*; import javax.swing.text.DefaultHighlighter; import javax.swing.text.Document; @@ -127,7 +129,7 @@ public class JTextAreaUtils } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } @@ -164,7 +166,7 @@ public class JTextAreaUtils } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java index f4624395..5b66570f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java @@ -94,7 +94,7 @@ public class JarUtils } catch (java.io.EOFException | ZipException e) { //ignore cause apache unzip } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { jis.closeEntry(); } @@ -177,7 +177,7 @@ public class JarUtils } } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { jis.closeEntry(); } @@ -210,7 +210,7 @@ public class JarUtils jis.closeEntry(); } } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } finally { jis.closeEntry(); } @@ -289,7 +289,7 @@ public class JarUtils out.close(); } catch (IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } @@ -327,7 +327,7 @@ public class JarUtils } catch (IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } @@ -351,7 +351,7 @@ public class JarUtils DiskWriter.replaceFile(name, cw.toByteArray(), false); } } catch (Exception e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } @@ -395,7 +395,7 @@ public class JarUtils noDupe.clear(); out.close(); } catch (IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } } } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/MiscUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/MiscUtils.java index 13fb2c28..05f350a5 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/MiscUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/MiscUtils.java @@ -215,7 +215,7 @@ public class MiscUtils try { return ImageIO.read(new ByteArrayInputStream(contents)); } catch (IOException e) { - new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); + BytecodeViewer.handleException(e); } return defaultImage; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/VersionChecker.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/VersionChecker.java index 98a0db55..3c9d9320 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/VersionChecker.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/VersionChecker.java @@ -85,7 +85,7 @@ public class VersionChecker implements Runnable try { fc.setCurrentDirectory(new File(".").getAbsoluteFile()); //set the current working directory } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } int returnVal = fc.showSaveDialog(BytecodeViewer.viewer); @@ -190,11 +190,11 @@ public class VersionChecker implements Runnable BytecodeViewer.showMessage("Unable to download, the zip file has not been uploaded yet, " + "please try again in about 10 minutes."); } catch (Exception ex) { - new ExceptionUI(ex); + BytecodeViewer.handleException(ex); } } catch (Exception e) { - new ExceptionUI(e); + BytecodeViewer.handleException(e); } }, "Downloader");