diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/cli/CommandLineInput.java b/src/main/java/the/bytecode/club/bytecodeviewer/cli/CommandLineInput.java index de454b03..6aa20a79 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/cli/CommandLineInput.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/cli/CommandLineInput.java @@ -462,7 +462,7 @@ public class CommandLineInput { ClassNode cn = BytecodeViewer.blindlySearchForClassNode(target); final ClassWriter cw = accept(cn); - String contents = Decompiler.ASMIFIER_DISASSEMBLER.getDecompiler().decompileClassNode(cn, cw.toByteArray()); + String contents = Decompiler.ASMIFIER_CODE_GEN.getDecompiler().decompileClassNode(cn, cw.toByteArray()); DiskWriter.replaceFile(output.getAbsolutePath(), contents, false); } catch (Exception e) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/Decompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/Decompiler.java index ed04880c..094e0255 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/Decompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/Decompiler.java @@ -45,7 +45,7 @@ public enum Decompiler JADX_DECOMPILER(new JADXDecompiler()), //java decompiler ASM_DISASSEMBLER(new ASMDisassembler()), //bytecode disassembler - ASMIFIER_DISASSEMBLER(new ASMifierGenerator()), //bytecode disassembler / code gen + ASMIFIER_CODE_GEN(new ASMifierGenerator()), //bytecode disassembler / code gen JAVAP_DISASSEMBLER(new JavapDisassembler()); //bytecode disassembler private final AbstractDecompiler decompiler; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/DecompilerSelectionPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/DecompilerSelectionPane.java index 037e9d8b..c331ffdc 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/DecompilerSelectionPane.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/DecompilerSelectionPane.java @@ -47,23 +47,23 @@ public class DecompilerSelectionPane private final JRadioButtonMenuItem none = new TranslatedJRadioButtonMenuItem("None", TranslatedComponents.NONE); private final JRadioButtonMenuItem hexcodeViewer = new TranslatedJRadioButtonMenuItem("Hexcode", TranslatedComponents.HEXCODE); //decompilers + private final DecompilerViewComponent fernFlowerDecompiler = new DecompilerViewComponent("FernFlower", JAVA, Decompiler.FERNFLOWER_DECOMPILER); private final DecompilerViewComponent procyonDecompiler = new DecompilerViewComponent("Procyon", JAVA, Decompiler.PROCYON_DECOMPILER); private final DecompilerViewComponent CFRDecompiler = new DecompilerViewComponent("CFR", JAVA, Decompiler.CFR_DECOMPILER); private final DecompilerViewComponent JADXDecompiler = new DecompilerViewComponent("JADX", JAVA, Decompiler.JADX_DECOMPILER); private final DecompilerViewComponent JDCoreDecompiler = new DecompilerViewComponent("JD-GUI", JAVA, Decompiler.JD_DECOMPILER); - private final DecompilerViewComponent fernFlowerDecompiler = new DecompilerViewComponent("FernFlower", JAVA, Decompiler.FERNFLOWER_DECOMPILER); //disassemblers + private final DecompilerViewComponent bytecodeViewer = new DecompilerViewComponent("Bytecode", BYTECODE_NON_EDITABLE, Decompiler.BYTECODE_DISASSEMBLER); + private final DecompilerViewComponent javapDisassembler = new DecompilerViewComponent("Javap", BYTECODE_NON_EDITABLE, Decompiler.JAVAP_DISASSEMBLER); + private final DecompilerViewComponent asmDisassembler = new DecompilerViewComponent("ASM Disassembler", BYTECODE_NON_EDITABLE, Decompiler.ASM_DISASSEMBLER); private final DecompilerViewComponent krakatauDecompiler = new DecompilerViewComponent("Krakatau", JAVA_AND_BYTECODE, Decompiler.KRAKATAU_DECOMPILER, Decompiler.KRAKATAU_DISASSEMBLER); private final DecompilerViewComponent smaliDisassembler = new DecompilerViewComponent("Smali", BYTECODE, Decompiler.SMALI_DISASSEMBLER); - private final DecompilerViewComponent bytecodeViewer = new DecompilerViewComponent("Bytecode", BYTECODE_NON_EDITABLE, Decompiler.BYTECODE_DISASSEMBLER); - private final DecompilerViewComponent asmifier = new DecompilerViewComponent("ASMifier", JAVA_NON_EDITABLE, Decompiler.ASMIFIER_DISASSEMBLER); - private final DecompilerViewComponent javapDisassembler = new DecompilerViewComponent("Javap", BYTECODE_NON_EDITABLE, Decompiler.JAVAP_DISASSEMBLER); //code-gen - private final DecompilerViewComponent asmDisassembler = new DecompilerViewComponent("ASM Disassembler", BYTECODE_NON_EDITABLE, Decompiler.ASM_DISASSEMBLER); + private final DecompilerViewComponent asmifierCodeGen = new DecompilerViewComponent("ASMifier", JAVA_NON_EDITABLE, Decompiler.ASMIFIER_CODE_GEN); //TODO when adding new decompilers insert the DecompilerViewComponent object into here // also in the group, then finally the build menu - public List components = new ArrayList<>(Arrays.asList(procyonDecompiler, CFRDecompiler, JADXDecompiler, JDCoreDecompiler, fernFlowerDecompiler, krakatauDecompiler, smaliDisassembler, bytecodeViewer, asmDisassembler, asmifier, javapDisassembler)); + public List components = new ArrayList<>(Arrays.asList(procyonDecompiler, CFRDecompiler, JADXDecompiler, JDCoreDecompiler, fernFlowerDecompiler, krakatauDecompiler, smaliDisassembler, bytecodeViewer, asmDisassembler, asmifierCodeGen, javapDisassembler)); public DecompilerSelectionPane(int paneID) { @@ -162,7 +162,7 @@ public class DecompilerSelectionPane menu.add(bytecodeViewer.getMenu()); menu.add(javapDisassembler.getMenu()); menu.add(asmDisassembler.getMenu()); - menu.add(asmifier.getMenu()); + menu.add(asmifierCodeGen.getMenu()); menu.add(new JSeparator()); menu.add(hexcodeViewer); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java index 92b73472..56a5e380 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/classcontainer/ClassFileContainer.java @@ -83,7 +83,7 @@ public class ClassFileContainer && !getDecompiler().equals(Decompiler.JAVAP_DISASSEMBLER.getDecompilerName()) && !getDecompiler().equals(Decompiler.SMALI_DISASSEMBLER.getDecompilerName()) && !getDecompiler().equals(Decompiler.ASM_DISASSEMBLER.getDecompilerName()) - && !getDecompiler().equals(Decompiler.ASMIFIER_DISASSEMBLER.getDecompilerName()); + && !getDecompiler().equals(Decompiler.ASMIFIER_CODE_GEN.getDecompilerName()); } public String getName()