Better Error Handling
This commit is contained in:
parent
deb23d3dd3
commit
d6be70dfb2
42 changed files with 115 additions and 94 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -390,7 +390,7 @@ public class InstructionPrinter {
|
|||
}
|
||||
bw.close();
|
||||
} catch (IOException e) {
|
||||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
BytecodeViewer.handleException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -133,7 +133,7 @@ public class ResourceViewProcessing extends PaneUpdaterThread
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||
BytecodeViewer.handleException(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -104,7 +104,7 @@ public class PluginWriter extends JFrame
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
new ExceptionUI(e);
|
||||
BytecodeViewer.handleException(e);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -95,7 +95,7 @@ public class ImportResource implements Runnable
|
|||
}
|
||||
catch (final Exception e)
|
||||
{
|
||||
new ExceptionUI(e);
|
||||
BytecodeViewer.handleException(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class ClassResourceImporter implements Importer
|
|||
}
|
||||
catch (final Exception e)
|
||||
{
|
||||
new ExceptionUI(e);
|
||||
BytecodeViewer.handleException(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue