2021-06-26 15:10:02 +00:00
|
|
|
package the.bytecode.club.bytecodeviewer.resources;
|
2021-06-21 14:55:18 +00:00
|
|
|
|
|
|
|
import me.konloch.kontainer.io.DiskWriter;
|
|
|
|
import org.objectweb.asm.ClassWriter;
|
|
|
|
import org.objectweb.asm.tree.ClassNode;
|
|
|
|
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
2021-06-26 15:03:11 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.Configuration;
|
2021-06-21 14:55:18 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.api.ExceptionUI;
|
2021-06-26 01:13:46 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.decompilers.Decompiler;
|
2021-06-26 15:03:11 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.gui.components.FileChooser;
|
2021-07-06 22:57:42 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ClassViewer;
|
2021-07-01 21:54:10 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.util.DialogueUtils;
|
2021-06-26 15:03:11 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.util.JarUtils;
|
|
|
|
import the.bytecode.club.bytecodeviewer.util.MiscUtils;
|
2021-06-21 14:55:18 +00:00
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
import java.io.File;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import static the.bytecode.club.bytecodeviewer.Constants.fs;
|
|
|
|
import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Konloch
|
|
|
|
* @since 6/21/2021
|
|
|
|
*/
|
|
|
|
public class ResourceDecompiling
|
|
|
|
{
|
|
|
|
public static void decompileSaveAll()
|
|
|
|
{
|
2021-06-26 15:03:11 +00:00
|
|
|
if (BytecodeViewer.getLoadedClasses().isEmpty())
|
|
|
|
{
|
2021-06-21 14:55:18 +00:00
|
|
|
BytecodeViewer.showMessage("First open a class, jar, zip, apk or dex file.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-06-27 21:15:39 +00:00
|
|
|
Thread decompileThread = new Thread(() ->
|
2021-06-26 15:03:11 +00:00
|
|
|
{
|
2021-07-03 19:29:31 +00:00
|
|
|
if (BytecodeViewer.autoCompileSuccessful())
|
2021-06-21 14:55:18 +00:00
|
|
|
return;
|
2021-06-26 15:03:11 +00:00
|
|
|
|
2021-07-01 21:54:10 +00:00
|
|
|
JFileChooser fc = new FileChooser(Configuration.getLastDirectory(),
|
2021-06-26 15:03:11 +00:00
|
|
|
"Select Zip Export",
|
|
|
|
"Zip Archives",
|
|
|
|
"zip");
|
|
|
|
|
2021-06-21 14:55:18 +00:00
|
|
|
int returnVal = fc.showSaveDialog(BytecodeViewer.viewer);
|
2021-06-26 15:03:11 +00:00
|
|
|
if (returnVal == JFileChooser.APPROVE_OPTION)
|
|
|
|
{
|
2021-06-26 15:56:39 +00:00
|
|
|
Configuration.lastDirectory = fc.getSelectedFile().getAbsolutePath();
|
2021-06-21 14:55:18 +00:00
|
|
|
File file = fc.getSelectedFile();
|
2021-06-26 15:03:11 +00:00
|
|
|
|
|
|
|
//auto appened zip
|
2021-06-21 14:55:18 +00:00
|
|
|
if (!file.getAbsolutePath().endsWith(".zip"))
|
|
|
|
file = new File(file.getAbsolutePath() + ".zip");
|
|
|
|
|
2021-07-01 21:54:10 +00:00
|
|
|
if (!DialogueUtils.canOverwriteFile(file))
|
|
|
|
return;
|
2021-06-21 14:55:18 +00:00
|
|
|
|
|
|
|
final File javaSucks = file;
|
|
|
|
final String path = MiscUtils.append(file, ".zip"); // cheap hax cause string is final
|
|
|
|
|
2021-06-26 15:03:11 +00:00
|
|
|
JOptionPane pane = new JOptionPane("What decompiler will you use?");
|
2021-06-21 14:55:18 +00:00
|
|
|
Object[] options = new String[]{"All", "Procyon", "CFR",
|
|
|
|
"Fernflower", "Krakatau", "Cancel"};
|
|
|
|
pane.setOptions(options);
|
|
|
|
JDialog dialog = pane.createDialog(BytecodeViewer.viewer,
|
|
|
|
"Bytecode Viewer - Select Decompiler");
|
|
|
|
dialog.setVisible(true);
|
|
|
|
Object obj = pane.getValue();
|
|
|
|
int result = -1;
|
|
|
|
for (int k = 0; k < options.length; k++)
|
|
|
|
if (options[k].equals(obj))
|
|
|
|
result = k;
|
|
|
|
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(true);
|
2021-06-21 14:55:18 +00:00
|
|
|
|
|
|
|
File tempZip = new File(tempDirectory + fs + "temp_" + MiscUtils.getRandomizedName() + ".jar");
|
|
|
|
if (tempZip.exists())
|
|
|
|
tempZip.delete();
|
|
|
|
|
|
|
|
JarUtils.saveAsJarClassesOnly(BytecodeViewer.getLoadedClasses(), tempZip.getAbsolutePath());
|
|
|
|
|
|
|
|
if (result == 0) {
|
|
|
|
Thread t12 = new Thread(() -> {
|
|
|
|
try {
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.PROCYON_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(),
|
2021-06-21 14:55:18 +00:00
|
|
|
MiscUtils.append(javaSucks, "-proycon.zip"));
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t12.start();
|
|
|
|
Thread t2 = new Thread(() -> {
|
|
|
|
try {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(true);
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.CFR_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(),
|
2021-06-21 14:55:18 +00:00
|
|
|
MiscUtils.append(javaSucks, "-CFR.zip"));
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t2.start();
|
|
|
|
Thread t3 = new Thread(() -> {
|
|
|
|
try {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(true);
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.FERNFLOWER_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(),
|
2021-06-21 14:55:18 +00:00
|
|
|
MiscUtils.append(javaSucks, "-fernflower.zip"));
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t3.start();
|
|
|
|
Thread t4 = new Thread(() -> {
|
|
|
|
try {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(true);
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.KRAKATAU_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(),
|
2021-06-21 14:55:18 +00:00
|
|
|
MiscUtils.append(javaSucks, "-kraktau.zip"));
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t4.start();
|
|
|
|
}
|
|
|
|
if (result == 1) {
|
|
|
|
Thread t12 = new Thread(() -> {
|
|
|
|
try {
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.PROCYON_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(), path);
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t12.start();
|
|
|
|
}
|
|
|
|
if (result == 2) {
|
|
|
|
Thread t12 = new Thread(() -> {
|
|
|
|
try {
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.CFR_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(), path);
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t12.start();
|
|
|
|
}
|
|
|
|
if (result == 3) {
|
|
|
|
Thread t12 = new Thread(() -> {
|
|
|
|
try {
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.FERNFLOWER_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(), path);
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t12.start();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result == 4) {
|
|
|
|
Thread t12 = new Thread(() -> {
|
|
|
|
try {
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.KRAKATAU_DECOMPILER.getDecompiler().decompileToZip(tempZip.getAbsolutePath(), path);
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t12.start();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result == 5) {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-01 09:48:10 +00:00
|
|
|
}, "Decompile Thread");
|
2021-06-27 21:15:39 +00:00
|
|
|
decompileThread.start();
|
2021-06-21 14:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void decompileSaveOpenedOnly()
|
|
|
|
{
|
2021-07-06 22:57:42 +00:00
|
|
|
if (BytecodeViewer.getLoadedClasses().isEmpty())
|
|
|
|
{
|
2021-06-21 14:55:18 +00:00
|
|
|
BytecodeViewer.showMessage("First open a class, jar, zip, apk or dex file.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-07-06 22:57:42 +00:00
|
|
|
if (BytecodeViewer.viewer.workPane.getCurrentViewer() == null || !(BytecodeViewer.viewer.workPane.getCurrentViewer() instanceof ClassViewer))
|
|
|
|
{
|
|
|
|
BytecodeViewer.showMessage("First open a class file.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Thread decompileThread = new Thread(() ->
|
|
|
|
{
|
2021-07-03 19:29:31 +00:00
|
|
|
if (BytecodeViewer.autoCompileSuccessful())
|
2021-06-21 14:55:18 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
final String s = BytecodeViewer.viewer.workPane.getCurrentViewer().cn.name;
|
|
|
|
|
|
|
|
if (s == null)
|
|
|
|
return;
|
|
|
|
|
2021-07-01 21:54:10 +00:00
|
|
|
JFileChooser fc = new FileChooser(Configuration.getLastDirectory(),
|
2021-06-26 15:03:11 +00:00
|
|
|
"Select Java Files",
|
|
|
|
"Java Source Files",
|
|
|
|
"java");
|
|
|
|
|
2021-06-21 14:55:18 +00:00
|
|
|
int returnVal = fc.showSaveDialog(BytecodeViewer.viewer);
|
2021-06-26 15:03:11 +00:00
|
|
|
if (returnVal == JFileChooser.APPROVE_OPTION)
|
|
|
|
{
|
2021-06-26 15:56:39 +00:00
|
|
|
Configuration.lastDirectory = fc.getSelectedFile().getAbsolutePath();
|
2021-06-21 14:55:18 +00:00
|
|
|
File file = fc.getSelectedFile();
|
|
|
|
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(true);
|
|
|
|
final String path = MiscUtils.append(file, ".java");
|
2021-06-21 14:55:18 +00:00
|
|
|
|
2021-07-01 21:54:10 +00:00
|
|
|
if (!DialogueUtils.canOverwriteFile(path))
|
|
|
|
return;
|
2021-06-21 14:55:18 +00:00
|
|
|
|
|
|
|
JOptionPane pane = new JOptionPane(
|
|
|
|
"What decompiler will you use?");
|
|
|
|
Object[] options = new String[]{"All", "Procyon", "CFR",
|
|
|
|
"Fernflower", "Krakatau", "Cancel"};
|
|
|
|
pane.setOptions(options);
|
|
|
|
JDialog dialog = pane.createDialog(BytecodeViewer.viewer,
|
|
|
|
"Bytecode Viewer - Select Decompiler");
|
|
|
|
dialog.setVisible(true);
|
|
|
|
Object obj = pane.getValue();
|
|
|
|
int result = -1;
|
|
|
|
for (int k = 0; k < options.length; k++)
|
|
|
|
if (options[k].equals(obj))
|
|
|
|
result = k;
|
|
|
|
|
|
|
|
if (result == 0) {
|
|
|
|
Thread t1 = new Thread(() -> {
|
|
|
|
try {
|
|
|
|
ClassNode cn = BytecodeViewer.getClassNode(s);
|
|
|
|
final ClassWriter cw = new ClassWriter(0);
|
|
|
|
try {
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
try {
|
|
|
|
Thread.sleep(200);
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (InterruptedException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
DiskWriter.replaceFile(MiscUtils.append(file, "-proycon.java"),
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.PROCYON_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()), false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
DiskWriter.replaceFile(MiscUtils.append(file, "-CFR.java"),
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.CFR_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()), false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
DiskWriter.replaceFile(MiscUtils.append(file, "-fernflower.java"),
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.FERNFLOWER_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()), false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
DiskWriter.replaceFile(MiscUtils.append(file, "-kraktau.java"),
|
2021-07-04 05:59:42 +00:00
|
|
|
Decompiler.KRAKATAU_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray()), false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
new ExceptionUI(e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t1.start();
|
|
|
|
}
|
|
|
|
if (result == 1) {
|
|
|
|
Thread t1 = new Thread(() -> {
|
|
|
|
try {
|
|
|
|
ClassNode cn = BytecodeViewer.getClassNode(s);
|
|
|
|
final ClassWriter cw = new ClassWriter(0);
|
|
|
|
try {
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
try {
|
|
|
|
Thread.sleep(200);
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (InterruptedException ignored) {
|
|
|
|
}
|
|
|
|
}
|
2021-07-04 05:59:42 +00:00
|
|
|
String contents = Decompiler.PROCYON_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray());
|
2021-06-21 14:55:18 +00:00
|
|
|
DiskWriter.replaceFile(path, contents, false);
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
new ExceptionUI(
|
|
|
|
e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t1.start();
|
|
|
|
}
|
|
|
|
if (result == 2) {
|
|
|
|
Thread t1 = new Thread(() -> {
|
|
|
|
try {
|
|
|
|
ClassNode cn = BytecodeViewer.getClassNode(s);
|
|
|
|
final ClassWriter cw = new ClassWriter(0);
|
|
|
|
try {
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
try {
|
|
|
|
Thread.sleep(200);
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (InterruptedException ignored) {
|
|
|
|
}
|
|
|
|
}
|
2021-07-04 05:59:42 +00:00
|
|
|
String contents = Decompiler.CFR_DECOMPILER.getDecompiler().decompileClassNode(cn, cw.toByteArray());
|
2021-06-21 14:55:18 +00:00
|
|
|
DiskWriter.replaceFile(path, contents, false);
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
new ExceptionUI(
|
|
|
|
e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t1.start();
|
|
|
|
}
|
|
|
|
if (result == 3) {
|
|
|
|
Thread t1 = new Thread(() -> {
|
|
|
|
try {
|
|
|
|
ClassNode cn = BytecodeViewer.getClassNode(s);
|
|
|
|
final ClassWriter cw = new ClassWriter(0);
|
|
|
|
try {
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
try {
|
|
|
|
Thread.sleep(200);
|
|
|
|
if (cn != null)
|
|
|
|
cn.accept(cw);
|
|
|
|
} catch (InterruptedException ignored) {
|
|
|
|
}
|
|
|
|
}
|
2021-07-04 05:59:42 +00:00
|
|
|
String contents = Decompiler.FERNFLOWER_DECOMPILER.getDecompiler().decompileClassNode(cn,
|
2021-06-21 14:55:18 +00:00
|
|
|
cw.toByteArray());
|
|
|
|
DiskWriter.replaceFile(path, contents, false);
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
new ExceptionUI(
|
|
|
|
e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t1.start();
|
|
|
|
}
|
|
|
|
if (result == 4) {
|
|
|
|
Thread t1 = new Thread(() -> {
|
|
|
|
try {
|
|
|
|
ClassNode cn = BytecodeViewer.getClassNode(s);
|
|
|
|
final ClassWriter cw = new ClassWriter(0);
|
|
|
|
try {
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
try {
|
|
|
|
Thread.sleep(200);
|
|
|
|
Objects.requireNonNull(cn).accept(cw);
|
|
|
|
} catch (InterruptedException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-04 05:59:42 +00:00
|
|
|
String contents = Decompiler.KRAKATAU_DECOMPILER.getDecompiler().decompileClassNode(cn,
|
2021-06-21 14:55:18 +00:00
|
|
|
cw.toByteArray());
|
|
|
|
DiskWriter.replaceFile(path, contents, false);
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
} catch (Exception e) {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
new ExceptionUI(
|
|
|
|
e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
t1.start();
|
|
|
|
}
|
|
|
|
if (result == 5) {
|
2021-07-06 22:57:42 +00:00
|
|
|
BytecodeViewer.updateBusyStatus(false);
|
2021-06-21 14:55:18 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-01 09:48:10 +00:00
|
|
|
}, "Decompile Thread");
|
2021-06-27 21:15:39 +00:00
|
|
|
decompileThread.start();
|
2021-06-21 14:55:18 +00:00
|
|
|
}
|
|
|
|
}
|