JavaP Disassembler Update

This commit is contained in:
Konloch 2024-10-02 18:50:46 -06:00
parent a094e52add
commit e029c73ca4

AI 샘플 코드 생성 중입니다

Loading...

View File

@ -31,8 +31,6 @@ import the.bytecode.club.bytecodeviewer.util.ExceptionUtils;
import the.bytecode.club.bytecodeviewer.util.TempFile; import the.bytecode.club.bytecodeviewer.util.TempFile;
import java.io.File; import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.URL; import java.net.URL;
@ -69,7 +67,7 @@ public class JavapDisassembler extends AbstractDecompiler
private synchronized String disassembleJavaP(ClassNode cn, byte[] bytes) private synchronized String disassembleJavaP(ClassNode cn, byte[] bytes)
{ {
TempFile tempFile = null; TempFile tempFile = null;
String exception = "This decompiler didn't throw an exception - this is probably a BCV logical bug"; String exception;
JFrameConsolePrintStream sysOutBuffer; JFrameConsolePrintStream sysOutBuffer;
@ -115,26 +113,29 @@ public class JavapDisassembler extends AbstractDecompiler
} }
catch (IllegalAccessException e) catch (IllegalAccessException e)
{ {
//TODO fallback using CLI (External Process API)
return TranslatedStrings.ILLEGAL_ACCESS_ERROR.toString(); return TranslatedStrings.ILLEGAL_ACCESS_ERROR.toString();
} }
catch (Throwable e) catch (Throwable e)
{ {
exception = NL + NL + ExceptionUtils.exceptionToString(e); exception = ExceptionUtils.exceptionToString(e);
} }
finally finally
{ {
BytecodeViewer.sm.silenceExec(false); BytecodeViewer.sm.silenceExec(false);
if(tempFile != null) if(tempFile != null)
tempFile.delete(); tempFile.cleanup();
} }
return "JavaP " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + NL + NL return getDecompilerName() + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + NL + NL
+ TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + NL + NL + exception; + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + NL + NL + exception;
} }
@Override @Override
public void decompileToZip(String sourceJar, String zipName) public void decompileToZip(String sourceJar, String zipName)
{ {
decompileToZipFallBack(sourceJar, zipName);
} }
} }