diff --git a/src/main/java/the/bytecode/club/bootloader/Boot.java b/src/main/java/the/bytecode/club/bootloader/Boot.java index a3645cc2..6a5ac996 100644 --- a/src/main/java/the/bytecode/club/bootloader/Boot.java +++ b/src/main/java/the/bytecode/club/bootloader/Boot.java @@ -56,18 +56,12 @@ public class Boot { private static final List libsFileList = new ArrayList<>(); private static final List urlList = new ArrayList<>(); - static { - try { - screen = new InitialBootScreen(); - } catch (Exception e) { - BytecodeViewer.handleException(e); - } - } - public static void boot(String[] args, boolean CLI) throws Exception { bootstrap(); ILoader loader = findLoader(); + screen = new InitialBootScreen(); + if (!CLI) SwingUtilities.invokeLater(() -> screen.setVisible(true)); diff --git a/src/main/java/the/bytecode/club/bootloader/InitialBootScreen.java b/src/main/java/the/bytecode/club/bootloader/InitialBootScreen.java index 1207a778..0a5958b0 100644 --- a/src/main/java/the/bytecode/club/bootloader/InitialBootScreen.java +++ b/src/main/java/the/bytecode/club/bootloader/InitialBootScreen.java @@ -16,6 +16,9 @@ import javax.swing.text.html.HTMLEditorKit; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.Resources; +import the.bytecode.club.bytecodeviewer.gui.components.HTMLPane; + +import static the.bytecode.club.bytecodeviewer.Configuration.language; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -40,12 +43,12 @@ import the.bytecode.club.bytecodeviewer.Resources; * @author Bibl (don't ban me pls) * @created 19 Jul 2015 04:12:21 */ -public class InitialBootScreen extends JFrame { - private static final long serialVersionUID = -1098467609722393444L; - +public class InitialBootScreen extends JFrame +{ private final JProgressBar progressBar = new JProgressBar(); - public InitialBootScreen() throws IOException { + public InitialBootScreen() throws IOException + { setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override @@ -56,24 +59,14 @@ public class InitialBootScreen extends JFrame { }); this.setIconImages(Resources.iconList); - int i = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight(); - if (i >= 840) - setSize(new Dimension(600, 800)); - else if (i >= 640) - setSize(new Dimension(500, 600)); - else if (i >= 440) - setSize(new Dimension(400, 400)); - else - setSize(Toolkit.getDefaultToolkit().getScreenSize()); + setSize(getSafeSize()); setTitle("Bytecode Viewer Boot Screen - Starting Up"); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{0, 0}; - gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0}; + gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE}; - gridBagLayout.rowWeights = new double[]{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; + gridBagLayout.rowWeights = new double[]{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; getContentPane().setLayout(gridBagLayout); JScrollPane scrollPane = new JScrollPane(); @@ -84,14 +77,8 @@ public class InitialBootScreen extends JFrame { gbc_scrollPane.gridx = 0; gbc_scrollPane.gridy = 0; getContentPane().add(scrollPane, gbc_scrollPane); - - JEditorPane editorPane = new JEditorPane(); - editorPane.setEditorKit(new HTMLEditorKit()); - - editorPane.setText(convertStreamToString(InitialBootScreen.class.getClassLoader().getResourceAsStream("intro" - + ".html"))); - - scrollPane.setViewportView(editorPane); + + scrollPane.setViewportView(HTMLPane.fromResource(language.getHTMLPath("intro"))); GridBagConstraints gbc_progressBar = new GridBagConstraints(); gbc_progressBar.fill = GridBagConstraints.HORIZONTAL; @@ -100,17 +87,23 @@ public class InitialBootScreen extends JFrame { getContentPane().add(progressBar, gbc_progressBar); this.setLocationRelativeTo(null); } - - static String convertStreamToString(java.io.InputStream is) throws IOException { - @SuppressWarnings("resource") - java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A"); - String string = s.hasNext() ? s.next() : ""; - is.close(); - s.close(); - return string; + + public static Dimension getSafeSize() + { + int i = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight(); + if (i >= 840) + return new Dimension(600, 800); + else if (i >= 640) + return new Dimension(500, 600); + else if (i >= 440) + return new Dimension(400, 400); + else + return Toolkit.getDefaultToolkit().getScreenSize(); } public JProgressBar getProgressBar() { return progressBar; } + + private static final long serialVersionUID = -1098467609722393444L; } \ No newline at end of file diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/GlobalHotKeys.java b/src/main/java/the/bytecode/club/bytecodeviewer/GlobalHotKeys.java index 8f9f084b..8fbd3f17 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/GlobalHotKeys.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/GlobalHotKeys.java @@ -22,7 +22,7 @@ public class GlobalHotKeys */ public static void keyPressed(KeyEvent e) { - if (System.currentTimeMillis() - Configuration.lastHotKeyExecuted <= (4000)) + if (System.currentTimeMillis() - Configuration.lastHotKeyExecuted <= (600)) return; //CTRL + O 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 3673cc00..f9ae7aab 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 @@ -20,9 +20,11 @@ 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.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.*; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -143,8 +145,9 @@ public class CFRDecompiler extends InternalDecompiler if (file.exists()) return findFile(Objects.requireNonNull(file.listFiles())); - return "CFR error! " + ExceptionUI.SEND_STACKTRACE_TO + - nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler." + nl + nl + exception; + return CFR + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + + nl + nl + exception; } Random r = new Random(); @@ -171,10 +174,10 @@ public class CFRDecompiler extends InternalDecompiler e.printStackTrace(new PrintWriter(sw)); e.printStackTrace(); - String exception = - "Bytecode Viewer Version: " + VERSION + nl + nl + sw; - return "CFR error! " + ExceptionUI.SEND_STACKTRACE_TO + - nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler." + + String exception = "Bytecode Viewer Version: " + VERSION + nl + nl + sw; + + return CFR + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + nl + nl + exception; } @@ -183,7 +186,7 @@ public class CFRDecompiler extends InternalDecompiler } return "CFR error!" + - nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler."; + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR; } public String[] generateMainMethod(String filePath, String outputPath) { 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 45eadc1d..85b15ede 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 @@ -12,9 +12,11 @@ import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Resources; import the.bytecode.club.bytecodeviewer.api.ExceptionUI; import the.bytecode.club.bytecodeviewer.decompilers.InternalDecompiler; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.*; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -130,9 +132,10 @@ public class FernFlowerDecompiler extends InternalDecompiler exception += nl + nl + sw; } } - return "FernFlower error! " + ExceptionUI.SEND_STACKTRACE_TO - + nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler." - + nl + nl + exception; + + return FERNFLOWER + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + + nl + nl + exception; } private String[] generateMainMethod(String className, String folder) { 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 eabb2560..a89406d4 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 @@ -14,9 +14,11 @@ 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.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.*; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -86,9 +88,9 @@ public class JADXDecompiler extends InternalDecompiler if(exception.isEmpty()) exception = "Decompiled source file not found!"; - return "JADX error! " + ExceptionUI.SEND_STACKTRACE_TO - + nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler." - + nl + nl + exception; + return JADX + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + + nl + nl + exception; } Random r = new Random(); @@ -116,15 +118,16 @@ public class JADXDecompiler extends InternalDecompiler e.printStackTrace(); String exception = "Bytecode Viewer Version: " + VERSION + nl + nl + sw; - return "JADX error! " + ExceptionUI.SEND_STACKTRACE_TO + - nl + nl + "Suggested Fix: Click refresh class, " + - "if it fails again try another decompiler." + nl + nl + exception; + return JADX + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + + nl + nl + exception; } return s; } } - return "JADX error!" + nl + nl + "Suggested Fix: Click refresh class, if it " - + "fails again try another decompiler."; + + return "JADX error!" + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR; } @Override 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 9d6ab8b1..d5215fa0 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 @@ -18,9 +18,11 @@ import me.konloch.kontainer.io.DiskReader; import org.jd.core.v1.ClassFileToJavaSourceDecompiler; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.Constants; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.*; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -118,9 +120,9 @@ public class JDGUIDecompiler extends InternalDecompiler "Bytecode Viewer Version: " + VERSION + nl + nl + sw; } - return "JD-GUI error! " + ExceptionUI.SEND_STACKTRACE_TO - + nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler." - + nl + nl + exception; + return JDGUI + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + + nl + nl + exception; } @Override 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 019d54aa..cc7e7bd7 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 @@ -34,10 +34,12 @@ 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.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.EncodeUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.*; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -115,9 +117,8 @@ public class ProcyonDecompiler extends InternalDecompiler decompilationOptions.setFullDecompilation(true); TypeDefinition resolvedType; - if (type == null || ((resolvedType = type.resolve()) == null)) { + if (type == null || ((resolvedType = type.resolve()) == null)) throw new Exception("Unable to resolve type."); - } StringWriter stringwriter = new StringWriter(); settings.getLanguage().decompileType(resolvedType, new PlainTextOutput(stringwriter), decompilationOptions); @@ -130,9 +131,10 @@ public class ProcyonDecompiler extends InternalDecompiler exception = "Bytecode Viewer Version: " + VERSION + nl + nl + sw; } - return "Procyon error! " + ExceptionUI.SEND_STACKTRACE_TO - + nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler." - + nl + nl + exception; + + return PROCYON + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + + nl + nl + exception; } @Override 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 7f0654d0..38490d75 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 @@ -12,11 +12,13 @@ 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.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.Dex2Jar; import the.bytecode.club.bytecodeviewer.util.FileContainer; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.*; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -115,10 +117,10 @@ public class SmaliDisassembler extends InternalDecompiler exception += "Bytecode Viewer Version: " + VERSION + nl + nl + sw; } - - return "Smali Disassembler error! " + ExceptionUI.SEND_STACKTRACE_TO - + nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler." - + nl + nl + exception; + + return SMALI + " " + DISASSEMBLER + " " + ERROR + "! " + ExceptionUI.SEND_STACKTRACE_TO + + nl + nl + TranslatedStrings.SUGGESTED_FIX_DECOMPILER_ERROR + + nl + nl + exception; } @Override diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/MainViewerGUI.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/MainViewerGUI.java index c4244bc4..ff2f0719 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/MainViewerGUI.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/MainViewerGUI.java @@ -62,7 +62,6 @@ import static the.bytecode.club.bytecodeviewer.Constants.*; */ public class MainViewerGUI extends JFrame { - public AboutWindow aboutWindow = new AboutWindow(); public boolean isMaximized; public final List waitIcons = new ArrayList<>(); @@ -156,7 +155,7 @@ public class MainViewerGUI extends JFrame public JCheckBoxMenuItem debugHelpers = new TranslatedJCheckBoxMenuItem("Debug Helpers", Translation.DEBUG_HELPERS); //FernFlower settings - public final JMenu fernFlowerSettingsSecondaryMenu = new JMenu("FernFlower"); + public final JMenu fernFlowerSettingsSecondaryMenu = new TranslatedJMenu("FernFlower", Translation.FERNFLOWER); public JCheckBoxMenuItem rbr = new JCheckBoxMenuItem("Hide bridge methods"); public JCheckBoxMenuItem rsy = new JCheckBoxMenuItem("Hide synthetic class members"); public JCheckBoxMenuItem din = new JCheckBoxMenuItem("Decompile inner classes"); @@ -178,7 +177,7 @@ public class MainViewerGUI extends JFrame public JCheckBoxMenuItem ren = new JCheckBoxMenuItem("Rename ambiguous classes and class elements"); //Proycon - public final JMenu procyonSettingsSecondaryMenu = new JMenu("Procyon"); + public final JMenu procyonSettingsSecondaryMenu = new TranslatedJMenu("Procyon", Translation.PROCYON); public final JCheckBoxMenuItem alwaysGenerateExceptionVars = new JCheckBoxMenuItem("Always Generate Exception Variable For Catch Blocks"); public final JCheckBoxMenuItem excludeNestedTypes = new JCheckBoxMenuItem("Exclude Nested Types"); public final JCheckBoxMenuItem showDebugLineNumbers = new JCheckBoxMenuItem("Show Debug Line Numbers"); @@ -195,7 +194,7 @@ public class MainViewerGUI extends JFrame public final JCheckBoxMenuItem unicodeOutputEnabled = new JCheckBoxMenuItem("Unicode Output Enabled"); //CFR - public final JMenu cfrSettingsSecondaryMenu = new JMenu("CFR"); + public final JMenu cfrSettingsSecondaryMenu = new TranslatedJMenu("CFR", Translation.CFR); public final JCheckBoxMenuItem decodeEnumSwitch = new JCheckBoxMenuItem("Decode Enum Switch"); public final JCheckBoxMenuItem sugarEnums = new JCheckBoxMenuItem("SugarEnums"); public final JCheckBoxMenuItem decodeStringSwitch = new JCheckBoxMenuItem("Decode String Switch"); @@ -342,7 +341,7 @@ public class MainViewerGUI extends JFrame saveAsZip.addActionListener(arg0 -> Export.ZIP.getExporter().promptForExport()); decompileSaveAll.addActionListener(arg0 -> ResourceDecompiling.decompileSaveAll()); decompileSaveOpened.addActionListener(arg0 -> ResourceDecompiling.decompileSaveOpenedOnly()); - about.addActionListener(arg0 -> aboutWindow.setVisible(true)); + about.addActionListener(arg0 -> new AboutWindow().setVisible(true)); exit.addActionListener(arg0 -> askBeforeExiting()); } @@ -382,8 +381,8 @@ public class MainViewerGUI extends JFrame settingsMainMenu.add(setOptionalLibrary); settingsMainMenu.add(setJavac); settingsMainMenu.add(new JSeparator()); - fontSpinner.setPreferredSize(new Dimension(42, 20)); - fontSpinner.setSize(new Dimension(42, 20)); + fontSpinner.setPreferredSize(new Dimension(60, 24)); + fontSpinner.setMinimumSize(new Dimension(60, 24)); fontSpinner.setModel(new SpinnerNumberModel(12, 1, null, 1)); fontSize.add(fontSpinner); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/AboutWindow.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/AboutWindow.java index ee9ab5d9..3f1065ba 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/AboutWindow.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/AboutWindow.java @@ -1,13 +1,14 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import java.awt.CardLayout; -import java.awt.Color; -import java.awt.Font; -import java.awt.Toolkit; +import java.awt.*; +import java.io.IOException; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTextArea; + +import the.bytecode.club.bootloader.InitialBootScreen; import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.Resources; import static the.bytecode.club.bytecodeviewer.Configuration.*; @@ -32,80 +33,34 @@ import static the.bytecode.club.bytecodeviewer.Constants.*; ***************************************************************************/ /** - * The about frame. + * The about frame * * @author Konloch */ public class AboutWindow extends JFrame { - JTextArea textArea = new JTextArea(); - public AboutWindow() { this.setIconImages(Resources.iconList); - setSize(Toolkit.getDefaultToolkit().getScreenSize()); - setType(Type.UTILITY); + setSize(InitialBootScreen.getSafeSize()); setTitle("Bytecode Viewer - About - https://bytecodeviewer.com | https://the.bytecode.club"); getContentPane().setLayout(new CardLayout(0, 0)); + JScrollPane scrollPane = new JScrollPane(); - getContentPane().add(scrollPane, "name_845520934713596"); - textArea.setWrapStyleWord(true); - textArea.setEnabled(false); - textArea.setDisabledTextColor(Color.BLACK); - scrollPane.setViewportView(textArea); - this.setResizable(false); + getContentPane().add(scrollPane); + + try + { + scrollPane.setViewportView(HTMLPane.fromResource(language.getHTMLPath("intro"))); + } + catch (IOException e) + { + e.printStackTrace(); + } + this.setLocationRelativeTo(null); } - @Override - public void setVisible(boolean b) - { - super.setVisible(b); - textArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, (int) BytecodeViewer.viewer.fontSpinner.getValue())); - textArea.setText("Bytecode Viewer " + VERSION + " is an open source program developed and " + - "maintained by Konloch (konloch@gmail.com) 100% free and open sourced licensed under GPL v3 " + - "CopyLeft" + nl + nl + - "Settings:" + nl + - " Preview Copy: " + PREVIEW_COPY + nl + - " Fat Jar: " + FAT_JAR + nl + - " Java: " + java + nl + - " Javac: " + javac + nl + - " BCV Dir: " + getBCVDirectory() + nl + - " Python 2.7 (or PyPy): " + python + nl + - " Python 3.X (or PyPy): " + python3 + nl + - " RT.jar:" + rt + nl + - " Optional Lib: " + library + nl + - " BCV Krakatau: v" + krakatauVersion + nl + - " Krakatau Dir: " + krakatauWorkingDirectory + nl + - " BCV Enjarify: v" + enjarifyVersion + nl + - " Enjarify Dir: " + enjarifyWorkingDirectory + nl + nl + - "Command Line Input:" + nl + - " -help Displays the help menu" + nl + - " -list Displays the available decompilers" + nl + - " -decompiler Selects the decompiler, procyon by default" + nl + - " -i Selects the input file (Jar, Class, APK, ZIP, DEX all work " + - "automatically)" + nl + - " -o Selects the output file (Java or Java-Bytecode)" + nl + - " -t Must either be the fully qualified classname or \"all\" to decompile" + - " all as zip" + nl + - " -nowait Doesn't wait for the user to read the CLI messages" + nl + nl + - "Keybinds:" + nl + - " CTRL + O: Open/add new jar/class/apk" + nl + - " CTLR + N: Reset the workspace" + nl + - " CTRL + W: Closes the currently opened tab" + nl + - " CTRL + T: Compile" + nl + - " CTRL + S: Save classes as zip" + nl + - " CTRL + R: Run (EZ-Inject) - dynamically load the classes and invoke a main class" + - "\r\n\r\nCode from various projects has been used, including but not limited to:\r\n J-RET by " + - "WaterWolf\r\n JHexPane by Sam Koivu\r\n RSynaxPane by Robert Futrell\r\n Commons IO by " + - "Apache\r\n ASM by OW2\r\n FernFlower by Stiver\r\n Procyon by Mstrobel\r\n CFR by Lee " + - "Benfield\r\n CFIDE by Bibl\r\n Smali by JesusFreke\r\n Dex2Jar by pxb1..?\r\n Krakatau by " + - "Storyyeller\r\n JD-GUI + JD-Core by The Java-Decompiler Team\r\n Enjarify by " + - "Storyyeller\r\n\r\nIf you're interested in Java Reverse Engineering, join The Bytecode Club - " + - "https://the.bytecode.club"); - - } - private static final long serialVersionUID = -8230501978224923296L; } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/HTMLPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/HTMLPane.java new file mode 100644 index 00000000..8b048117 --- /dev/null +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/HTMLPane.java @@ -0,0 +1,61 @@ +package the.bytecode.club.bytecodeviewer.gui.components; + +import the.bytecode.club.bootloader.InitialBootScreen; +import the.bytecode.club.bytecodeviewer.Configuration; + +import javax.swing.*; +import javax.swing.text.html.HTMLEditorKit; +import java.io.IOException; + +import static the.bytecode.club.bytecodeviewer.Constants.*; + +/** + * @author Konloch + * @since 7/7/2021 + */ +public class HTMLPane extends JEditorPane +{ + private HTMLPane() + { + setEditorKit(new HTMLEditorKit()); + setEditable(false); + } + + public static HTMLPane fromResource(String resourcePath) throws IOException + { + return fromString(convertStreamToString(InitialBootScreen.class.getClassLoader().getResourceAsStream(resourcePath))); + } + + public static HTMLPane fromString(String text) + { + HTMLPane pane = new HTMLPane(); + + text = text.replace("{previewCopy}", String.valueOf(PREVIEW_COPY)); + text = text.replace("{fatJar}", String.valueOf(FAT_JAR)); + text = text.replace("{java}", Configuration.java); + text = text.replace("{javac}", Configuration.javac); + text = text.replace("{bcvDir}", BCVDir.getAbsolutePath()); + text = text.replace("{python}", Configuration.python); + text = text.replace("{python3}", Configuration.python3); + text = text.replace("{rt}", Configuration.rt); + text = text.replace("{lib}", Configuration.library); + text = text.replace("{krakatauVersion}", krakatauVersion); + text = text.replace("{krakatauDir}", krakatauWorkingDirectory); + text = text.replace("{enjarifyVersion}", enjarifyVersion); + text = text.replace("{enjarifyDir}", enjarifyWorkingDirectory); + + pane.setText(text); + pane.setCaretPosition(0); + + return pane; + } + + public static String convertStreamToString(java.io.InputStream is) throws IOException + { + java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A"); + String string = s.hasNext() ? s.next() : ""; + is.close(); + s.close(); + return string; + } +} \ No newline at end of file diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/ResourceViewPanel.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/ResourceViewPanel.java index 03bfa714..cb930192 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/ResourceViewPanel.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/ResourceViewPanel.java @@ -8,6 +8,7 @@ import the.bytecode.club.bytecodeviewer.gui.components.SearchableRSyntaxTextArea import the.bytecode.club.bytecodeviewer.gui.components.SystemConsole; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ClassViewer; import the.bytecode.club.bytecodeviewer.gui.util.PaneUpdaterThread; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.JarUtils; import javax.swing.*; @@ -77,6 +78,7 @@ public class ResourceViewPanel SystemConsole errConsole = new SystemConsole("Java Compile Issues"); errConsole.setText("Error compiling class: " + viewer.cn.name + nl + "Keep in mind most decompilers cannot produce compilable classes" + + nl + nl + TranslatedStrings.SUGGESTED_FIX_COMPILER_ERROR + nl + nl); try diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/Language.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/Language.java index 3b79abc8..4715787a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/Language.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/Language.java @@ -39,17 +39,17 @@ import java.util.HashSet; */ public enum Language { - ARABIC("/translations/arabic.json", "عربى", "ab"), - ENGLISH("/translations/english.json", "English", "en"), - FRENCH("/translations/french.json", "Français", "fr"), - GERMAN("/translations/german.json", "Deutsch", "de"), - //HINDI("/translations/hindi.json", "हिंदी", "hi"), - JAPANESE("/translations/japanese.json", "日本語", "ja"), - MALAY("/translations/malay.json", "Bahasa Melayu", "ms"), - MANDARIN("/translations/mandarin.json", "普通话", "zh_cn", "zh"), - PORTUGUESE("/translations/portuguese.json", "Português", "pt"), - RUSSIAN("/translations/russian.json", "русский", "ru"), - SPANISH("/translations/spanish.json", "Español", "es"), + ARABIC("/translations/arabic.json", "عربى", "English", "ab"), + ENGLISH("/translations/english.json", "English", "English", "en"), + FRENCH("/translations/french.json", "Français", "English", "fr"), + GERMAN("/translations/german.json", "Deutsch", "German", "de"), + //HINDI("/translations/hindi.json", "हिंदी", "English", "hi"), + JAPANESE("/translations/japanese.json", "日本語", "English", "ja"), + MALAY("/translations/malay.json", "Bahasa Melayu", "English", "ms"), + MANDARIN("/translations/mandarin.json", "普通话", "Mandarin", "zh_cn", "zh"), + PORTUGUESE("/translations/portuguese.json", "Português", "English", "pt"), + RUSSIAN("/translations/russian.json", "русский", "English", "ru"), + SPANISH("/translations/spanish.json", "Español", "English", "es"), ; private static final HashedMap languageCodeLookup; @@ -64,13 +64,15 @@ public enum Language private final String resourcePath; private final String readableName; + private final String htmlIdentifier; private final HashSet languageCode; - Language(String resourcePath, String readableName, String... languageCodes) + Language(String resourcePath, String readableName, String htmlIdentifier, String... languageCodes) { this.resourcePath = resourcePath; - this.languageCode = new HashSet<>(Arrays.asList(languageCodes)); this.readableName = readableName; + this.htmlIdentifier = htmlIdentifier.toLowerCase(); + this.languageCode = new HashSet<>(Arrays.asList(languageCodes)); } public void loadLanguage() throws IOException @@ -92,9 +94,16 @@ public enum Language //update translation text value text.value = translationMap.get(text.key); + //translate constant strings + try { + TranslatedStrings str = TranslatedStrings.valueOf(text.key); + str.setText(text.value); + } catch (IllegalArgumentException e) { } + //check if translation key has been assigned to a component, //on fail print an error alerting the devs - if(translation.getTranslatedComponent().runOnUpdate.isEmpty()) + if(translation.getTranslatedComponent().runOnUpdate.isEmpty() + && TranslatedStrings.nameSet.contains(translation.name())) { System.err.println("Translation Reference " + translation.name() + " is missing component attachment, skipping..."); continue; @@ -126,7 +135,7 @@ public enum Language existingKeys.add(t.name()); for(String key : translationMap.keySet()) - if(!existingKeys.contains(key) && !key.startsWith("TODO")) + if(!existingKeys.contains(key)) System.err.println(key + ","); } @@ -145,6 +154,11 @@ public enum Language return readableName; } + public String getHTMLPath(String identifier) + { + return "translations/html/" + identifier + "." + htmlIdentifier + ".html"; + } + public static HashedMap getLanguageCodeLookup() { return languageCodeLookup; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java new file mode 100644 index 00000000..1c2ea99f --- /dev/null +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java @@ -0,0 +1,60 @@ +package the.bytecode.club.bytecodeviewer.translation; + +import java.util.HashMap; +import java.util.HashSet; + +/** + * Constant-like strings not associated with any specific JComponent + * + * @author Konloch + * @since 7/6/2021 + */ + +public enum TranslatedStrings +{ + JAVA("Java"), + PROCYON("Procyon"), + CFR("CFR"), + FERNFLOWER("FernFlower"), + KRAKATAU("Krakatau"), + JDGUI("JD-GUI"), + JADX("JADX"), + SMALI("Smali"), + SMALI_DEX("Smali/DEX"), + HEXCODE("Hexcode"), + BYTECODE("Bytecode"), + ASM_TEXTIFY("ASM Textify"), + ERROR("Error"), + DISASSEMBLER("Disassembler"), + SUGGESTED_FIX_DECOMPILER_ERROR("Suggested Fix: Click refresh class, if it fails again try another decompiler."), + SUGGESTED_FIX_COMPILER_ERROR("Suggested Fix: Try View>Pane>Krakatau>Bytecode and enable Editable."), + ; + + public static final HashSet nameSet = new HashSet<>(); + + static + { + for(TranslatedStrings s : values()) + nameSet.add(s.name()); + } + + private String text; + + TranslatedStrings(String text) {this.text = text;} + + public void setText(String text) + { + this.text = text; + } + + public String getText() + { + return text; + } + + @Override + public String toString() + { + return getText(); + } +} \ No newline at end of file diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/Translation.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/Translation.java index 7fdb0278..72fa4e1a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/Translation.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/Translation.java @@ -114,14 +114,19 @@ public enum Translation DEX_TO_JAR, ENJARIFY, PROCYON, - CRF, + CFR, FERNFLOWER, KRAKATAU, JDGUI, JADX, SMALI_DEX, + SMALI, + DISASSEMBLER, + ERROR, + SUGGESTED_FIX_DECOMPILER_ERROR, + SUGGESTED_FIX_COMPILER_ERROR, PROCYON_DECOMPILER, - CRF_DECOMPILER, + CFR_DECOMPILER, FERNFLOWER_DECOMPILER, JADX_DECOMPILER, JD_DECOMPILER, diff --git a/src/main/resources/translations/arabic.json b/src/main/resources/translations/arabic.json index f5a1acc5..ac643325 100644 --- a/src/main/resources/translations/arabic.json +++ b/src/main/resources/translations/arabic.json @@ -58,7 +58,7 @@ "SET_JAVAC_EXECUTABLE": "تعيين Javac للتنفيذ", "JAVA": "جافا", "PROCYON": "بروسيون", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "نبات السرخس", "KRAKATAU": "كراكاتاو", "JDGUI": "JD-GUI", @@ -83,7 +83,7 @@ "ALLATORI_STRING_DECRYPTER": "Allatori سلسلة ديكريبتر", "ZSTRINGARRAY_DECRYPTER": "ZStringArray ديكريبتر", "PROCYON_DECOMPILER": "Procyon Decompiler", - "CRF_DECOMPILER": "CFR Decompiler", + "CFR_DECOMPILER": "CFR Decompiler", "FERNFLOWER_DECOMPILER": "FernFlower Decompiler", "JADX_DECOMPILER": "JADX Decompiler", "JD_DECOMPILER": "JD-GUI Decompiler", diff --git a/src/main/resources/translations/english.json b/src/main/resources/translations/english.json index 18c49d7f..94f27f7c 100644 --- a/src/main/resources/translations/english.json +++ b/src/main/resources/translations/english.json @@ -66,11 +66,12 @@ "JAVA": "Java", "PROCYON": "Procyon", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "FernFlower", "KRAKATAU": "Krakatau", "JDGUI": "JD-GUI", "JADX": "JADX", + "SMALI": "Smali", "SMALI_DEX": "Smali/Dex", "HEXCODE": "Hexcode", "BYTECODE": "Bytecode", @@ -96,11 +97,16 @@ "PROCYON_DECOMPILER": "Procyon Decompiler", - "CRF_DECOMPILER": "CFR Decompiler", + "CFR_DECOMPILER": "CFR Decompiler", "FERNFLOWER_DECOMPILER": "FernFlower Decompiler", "JADX_DECOMPILER": "JADX Decompiler", "JD_DECOMPILER": "JD-GUI Decompiler", "BYTECODE_DISASSEMBLER": "Bytecode Disassembler", + "DISASSEMBLER": "Disassembler", + + "ERROR": "Error", + "SUGGESTED_FIX_DECOMPILER_ERROR": "Suggested Fix: Click refresh class, if it fails again try another decompiler.", + "SUGGESTED_FIX_COMPILER_ERROR": "Suggested Fix: Try View>Pane>Krakatau>Bytecode and enable Editable.", "FILES": "Files", "QUICK_FILE_SEARCH_NO_FILE_EXTENSION": "Quick file search (no file extension)", diff --git a/src/main/resources/translations/french.json b/src/main/resources/translations/french.json index a97f8c44..49451261 100644 --- a/src/main/resources/translations/french.json +++ b/src/main/resources/translations/french.json @@ -58,7 +58,7 @@ "SET_JAVAC_EXECUTABLE": "Définir l'exécutable Javac", "JAVA": "Java", "PROCYON": "Procyon", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "FougèreFleur", "KRAKATAU": "Krakatau", "JDGUI": "JD-GUI", @@ -83,7 +83,7 @@ "ALLATORI_STRING_DECRYPTER": "Décrypteur de chaînes Allatori", "ZSTRINGARRAY_DECRYPTER": "Décrypteur ZStringArray", "PROCYON_DECOMPILER": "Décompilateur Procyon", - "CRF_DECOMPILER": "Décompilateur CFR", + "CFR_DECOMPILER": "Décompilateur CFR", "FERNFLOWER_DECOMPILER": "Décompilateur FernFlower", "JADX_DECOMPILER": "Décompilateur JADX", "JD_DECOMPILER": "Décompilateur JD-GUI", diff --git a/src/main/resources/translations/german.json b/src/main/resources/translations/german.json index 932f1d51..9e8b92f6 100644 --- a/src/main/resources/translations/german.json +++ b/src/main/resources/translations/german.json @@ -86,7 +86,7 @@ "TODO5": "Diese existieren nur als Key/Value-Paare", "PROCYON_DECOMPILER": "Procyon-Dekompilierer", - "CRF_DECOMPILER": "CFR-Dekompilierer", + "CFR_DECOMPILER": "CFR-Dekompilierer", "FERNFLOWER_DECOMPILER": "FernFlower-Dekompilierer", "JADX_DECOMPILER": "JADX-Dekompilierer", "JD_DECOMPILER": "JD-GUI-Dekompilierer", diff --git a/src/main/resources/translations/hindi.json b/src/main/resources/translations/hindi.json index 827ed2b7..01ed8444 100644 --- a/src/main/resources/translations/hindi.json +++ b/src/main/resources/translations/hindi.json @@ -58,7 +58,7 @@ "SET_JAVAC_EXECUTABLE": "जावैक निष्पादन योग्य सेट करें", "JAVA": "जावा", "PROCYON": "प्रोसिओन", - "CRF": "सीएफआर", + "CFR": "सीएफआर", "FERNFLOWER": "फर्नफ्लावर", "KRAKATAU": "Krakatau", "JDGUI": "जद-जीयूआई", @@ -83,7 +83,7 @@ "ALLATORI_STRING_DECRYPTER": "एलाटोरी स्ट्रिंग डिक्रिप्टर", "ZSTRINGARRAY_DECRYPTER": "ZStringArray डिक्रिप्टर", "PROCYON_DECOMPILER": "प्रोसीओन डीकंपाइलर", - "CRF_DECOMPILER": "सीएफआर डीकंपाइलर", + "CFR_DECOMPILER": "सीएफआर डीकंपाइलर", "FERNFLOWER_DECOMPILER": "फर्नाफ्लावर डीकंपेलर", "JADX_DECOMPILER": "JADX डीकंपेलर", "JD_DECOMPILER": "जद-जीयूआई डीकंपेलर", diff --git a/src/main/resources/intro.html b/src/main/resources/translations/html/intro.english.html similarity index 73% rename from src/main/resources/intro.html rename to src/main/resources/translations/html/intro.english.html index c035abf0..a7f806e0 100644 --- a/src/main/resources/intro.html +++ b/src/main/resources/translations/html/intro.english.html @@ -1,9 +1,29 @@ -Bytecode Viewer (BCV) was designed to be extremely user and beginner friendly, because of this almost everything -is accessible through an interface, settings, tools, etc. This means if you give BCV a try you should get the gist of it -can do, however for those who don't want to run BCV until they're convinced they should use it, below is a complete list -of features BCV has, and what they do. + +

About

-

Command Line Interface (CLI):

+Bytecode Viewer (BCV) was designed to be extremely user and beginner friendly, because of this almost everything +is accessible through an interface, settings, tools, etc. + +

To start drag your Jar/APK/Class file into the resource list. + +

Settings

+
    +
  • Preview Copy: {previewCopy}
  • +
  • Fat Jar: {farJar}
  • +
  • Java: {java}
  • +
  • Javac: {javac}
  • +
  • BCV Dir: {bcvDir}
  • +
  • Python 2.7 (or PyPy): {python}
  • +
  • Python 3.X (or PyPy): {python3}
  • +
  • RT.jar: {rt}
  • +
  • Optional Lib: {lib}
  • +
  • BCV Krakatau: v{krakatauVersion}
  • +
  • Krakatau Dir: {krakatauDir}
  • +
  • BCV Enjarify: v{enjarifyVersion}
  • +
  • Enjarify Dir: {enjarifyDir}
  • +
+ +

Command Line Interface (CLI)

  • -help Displays the help menu
  • -list Displays the available decompilers
  • @@ -14,7 +34,7 @@ of features BCV has, and what they do.
  • -nowait Doesn't wait for the user to read the CLI messages
-

File:

+

File

  • Add (Ctrl + O) - If you add a jar/zip BCV will unzip it, if you add an APK or DEX file, BCV will run dex2jar then run the jar input process. @@ -37,7 +57,7 @@ of features BCV has, and what they do.
  • Exit - Closes BCV.
-

View Panes:

+

View Panes

  • Editable - Defines if that viewing pane will be editable.
  • None - Nothing will be displayed.
  • @@ -52,7 +72,7 @@ of features BCV has, and what they do.
  • Hexcode - Shows the classfile in a hex viewer. Not Editable.
-

Settings:

+

Settings

  • Compile On Save - If selected whenever you do one of the File>Save * functions it will try to compile before it saves. @@ -74,7 +94,7 @@ of features BCV has, and what they do.
  • Set JRE RT Library - Set the JRE RT library for Krakatau decompiler.
-

Plugins:

+

Plugins

  • Open Plugin - Open a .java plugin created for BCV.
  • Recent Plugins - Last 25 plugins you've opened with BCV.
  • @@ -82,20 +102,36 @@ of features BCV has, and what they do.
  • Malicious Code Scanner - Allows you to define what to search for, and outputs what it found.
  • Show Main Methods - Detects and outputs all of the public static void main(String[]) functions.
  • Show All Strings - Grabs then outputs all of the strings in every classfile.
  • -
  • Replace Strings - Allows you to do a simple permanent .replace on the classfile strings, very useful for URL - swapping. -
  • +
  • Replace Strings - Allows you to do a simple permanent .replace on the classfile strings, very useful for URL swapping.
  • Allatori String Decrypter - Decrypts the Allatori obfuscated/encrypted strings.
  • ZKM String Decrypter - Decrypts the ZKM obfuscated/encrypted strings.
  • ZStringArray String Decrypter - Decrypts the ZStringArray obfuscated/encrypted strings.
-

Notes:

+

Code from various projects has been used, including but not limited to

+
    +
  • J-RET by WaterWolf
  • +
  • JHexPane by Sam Koivu
  • +
  • RSynaxPane by Robert Futrell
  • +
  • Commons IO by Apache
  • +
  • ASM by OW2
  • +
  • FernFlower by Stiver
  • +
  • Procyon by Mstrobel
  • +
  • CFR by Lee Benfield
  • +
  • CFIDE by Bibl
  • +
  • Smali by JesusFreke
  • +
  • Dex2Jar by pxb1988
  • +
  • Krakatau by Storyyeller
  • +
  • JD-GUI + JD-Core by The Java-Decompiler Team
  • +
  • Enjarify by Storyyeller
  • +
+ +

Notes

  • If BCV fails to boot simply append -clean as an argument to clean the lib directory.
  • Relax and take notes, while I take tokes of the marijuana smoke.
  • BCV was created out of love for Java Reverse engineering.
  • -
  • Bytecode Viewer's Homepage is http://bytecodeviewer.com
  • +
  • Bytecode Viewer's Homepage is https://bytecodeviewer.com
\ No newline at end of file diff --git a/src/main/resources/translations/html/intro.german.html b/src/main/resources/translations/html/intro.german.html new file mode 100644 index 00000000..5fb5d011 --- /dev/null +++ b/src/main/resources/translations/html/intro.german.html @@ -0,0 +1,137 @@ + +

Über uns

+ +Der Bytecode Viewer (BCV) wurde so konzipiert, dass er extrem benutzer- und einsteigerfreundlich ist, deshalb ist fast alles +ist über eine Schnittstelle zugänglich, Einstellungen, Werkzeuge, etc. + +

Zum Starten ziehen Sie Ihre Jar/APK/Class-Datei in die Ressourcenliste. + +

Einstellungen

+
    +
  • Preview Copy: {previewCopy}
  • +
  • Fat Jar: {farJar}
  • +
  • Java: {java}
  • +
  • Javac: {javac}
  • +
  • BCV Dir: {bcvDir}
  • +
  • Python 2.7 (oder PyPy): {python}
  • +
  • Python 3.X (oder PyPy): {python3}
  • +
  • RT.jar: {rt}
  • +
  • Optional Lib: {lib}
  • +
  • BCV Krakatau: v{krakatauVersion}
  • +
  • Krakatau Dir: {krakatauDir}
  • +
  • BCV Enjarify: v{enjarifyVersion}
  • +
  • Enjarify Dir: {enjarifyDir}
  • +
+ +

Befehlszeilenschnittstelle (CLI)

+
    +
  • -help Zeigt das Hilfemenü an
  • +
  • -list Zeigt die verfügbaren Dekompilierer an
  • +
  • -decompiler [decompiler] Wählt den Decompiler aus, standardmäßig procyon
  • +
  • -i [input file] Wählt die Eingabedatei aus (Jar, Class, APK, ZIP, DEX funktionieren alle automatisch)
  • +
  • -o [Ausgabedatei] Wählt die Ausgabedatei aus (Java oder Java-Bytecode)
  • +
  • -t [target classname] Muss entweder der voll qualifizierte Klassenname sein oder "all", um alle als zip zu dekompilieren
  • +
  • -nowait Wartet nicht auf den Benutzer, um die CLI-Meldungen zu lesen
  • +
+ +

Datei

+
    +
  • Hinzufügen (Strg + O) - Wenn Sie ein jar/zip hinzufügen, wird BCV es entpacken, wenn Sie eine APK- oder DEX-Datei hinzufügen, wird BCV dex2jar + und führt dann den Jar-Eingabeprozess aus. +
  • +
  • Neue Datei öffnen (Strg + L) - Öffnet die zuletzt geöffnete Datei erneut.
  • +
  • Neuer Arbeitsbereich (Strg + N) - Es löscht die geöffneten Jars/Ressourcen.
  • +
  • Ausführen (Strg + R) - Führt die Klassendateien, die Sie in BCV geladen haben, in einer sicheren, sandboxed JVM-Instanz aus, die Sie + vollständig debuggen können. +
  • +
  • Kompilieren (Strg + T) - Versucht, alle bearbeitbaren Bereiche, die Sie ausgewählt haben, zu kompilieren, wenn es sich um Java handelt, wird es mit + Ranino. Krakatau und *Smali verwenden ihre eigenen Assembler. +
  • +
  • Save As Jar - Exportiert die Klassendateien und geladenen Ressourcen als lauffähige Jar-Datei.
  • +
  • Speichern als DEX - Führen Sie jar2dex aus und exportieren Sie die Klassendateien als DEX.
  • +
  • Dateien speichern unter - Speichert alle Klassendateien und Ressourcen als Zip-Datei.
  • +
  • Java-Datei speichern unter - Speichert die aktuell geöffnete dekompilierte Klassendatei.
  • +
  • Java-Dateien speichern unter - Alle dekompilierten Klassendateien als Zip-Datei speichern.
  • +
  • Aktuelle Dateien - Die letzten 25 Dateien/Verzeichnisse, die Sie mit BCV geöffnet haben.
  • +
  • About - Ein kleines Informationsfenster über BCV.
  • +
  • Beenden - Schließt BCV.
  • +
+ +

Ansichtsfenster

+
    +
  • Bearbeitbar - Legt fest, ob dieses Ansichtsfenster bearbeitet werden kann.
  • +
  • Keine - Es wird nichts angezeigt.
  • +
  • Procyon - Dekompiliert mit Procyon Decompiler.
  • +
  • CFR - Dekompiliert mit dem CFR-Decompiler.
  • +
  • FernFlower - Dekompiliert mit dem FernFlower-Decompiler.
  • +
  • JD-GUI - Dekompiliert mit dem JD-GUI-Decompiler.
  • +
  • Krakatau Java - Dekompiliert mit dem Krakatau Decompiler.
  • +
  • Krakatau Bytecode - Disassembliert mit Krakatau Disassembler.
  • +
  • Smali - Disassembliert mit Smali.
  • +
  • Bytecode - Dekompiliert den Bytecode mit CFIDE. Nicht editierbar.
  • +
  • Hexcode - Zeigt die Klassendatei in einem Hex-Viewer an. Nicht editierbar.
  • +
+ +

Einstellungen

+
    +
  • Kompilieren beim Speichern - Wenn diese Option ausgewählt ist, wird jedes Mal, wenn Sie eine der Funktionen Datei>Speichern * ausführen, versucht, die Datei zu kompilieren, bevor sie + speichert. +
  • +
  • Beim Aktualisieren kompilieren - Wenn diese Option ausgewählt ist, wird bei jedem Aktualisieren kompiliert, bevor die Ressource/Klasse neu geladen wird. +
  • +
  • Aktualisierungsprüfung - Wenn ausgewählt, wird https://github.com/Konloch/bytecode-viewer abgefragt, um sicherzustellen, dass Sie die neueste Version haben. + Version haben. +
  • +
  • Auffrischen bei Ansichtsänderung - Wenn diese Option ausgewählt ist, werden bei jeder Änderung einer Option in den Ansichtsfenstern die + aktuell geöffneten Ressourcen/Klasse aktualisiert. +
  • +
  • APK-Ressourcen dekodieren - Wenn diese Option ausgewählt ist, wird beim Hinzufügen einer APK zuerst APKTool.jar ausgeführt, um die Ressourcen zu dekodieren. + Ressourcen zu dekodieren. +
  • +
  • Set Python 2.7 Executable - Setzen Sie das Python 2.7 Executable, wenn Sie möchten, dass Krakatau Decompiler/Disassembler/Assembler + funktionieren soll. +
  • +
  • Set JRE RT Library - Stellen Sie die JRE RT Library für Krakatau Decompiler ein.
  • +
+ +

Plugins

+
    +
  • Plugin öffnen - Öffnen Sie ein für BCV erstelltes .java-Plugin.
  • +
  • Recent Plugins - Die letzten 25 Plugins, die Sie mit BCV geöffnet haben.
  • +
  • Codefolgediagramm - Erstellt ein grobes Codefolgediagramm für die aktuell geöffnete Klassendatei.
  • +
  • Scanner für bösartigen Code - Ermöglicht es Ihnen, zu definieren, wonach gesucht werden soll, und gibt aus, was gefunden wurde.
  • +
  • Hauptmethoden anzeigen - Erkennt und gibt alle öffentlichen statischen void main(String[]) Funktionen aus.
  • +
  • Alle Zeichenketten anzeigen - Erkennt alle Zeichenketten in jeder Klassendatei und gibt sie aus.
  • +
  • Strings ersetzen - Ermöglicht ein einfaches, permanentes Ersetzen der Strings in der Klassendatei, sehr nützlich für URL-Swapping.
  • +
  • Allatori String Decrypter - Entschlüsselt die mit Allatori verdeckten/verschlüsselten Strings.
  • +
  • ZKM String Decrypter - Entschlüsselt die ZKM-verschleierten/verschlüsselten Strings.
  • +
  • ZStringArray String Decrypter - Entschlüsselt die ZStringArray-verschleierten/verschlüsselten Strings.
  • +
+ +

Es wurde Code aus verschiedenen Projekten verwendet, einschließlich, aber nicht beschränkt auf

+
    +
  • J-RET von WaterWolf
  • +
  • JHexPane von Sam Koivu
  • +
  • RSynaxPane von Robert Futrell
  • +
  • Commons IO von Apache
  • +
  • ASM von OW2
  • +
  • FernFlower von Stiver
  • +
  • Procyon von Mstrobel
  • +
  • CFR von Lee Benfield
  • +
  • CFIDE von Bibl
  • +
  • Smali von JesusFreke
  • +
  • Dex2Jar von pxb1988
  • +
  • Krakatau von Storyyeller
  • +
  • JD-GUI + JD-Core von The Java-Decompiler Team
  • +
  • Enjarify von Storyyeller
  • +
+ +

Hinweise

+
    +
  • Wenn BCV nicht bootet, fügen Sie einfach -clean als Argument an, um das lib-Verzeichnis zu bereinigen.
  • +
  • Ruhen Sie sich aus und machen Sie sich Notizen, während ich einen Schluck Marihuanarauch nehme.
  • +
  • BCV wurde aus Liebe zum Java Reverse Engineering entwickelt.
  • +
  • Die Homepage von Bytecode Viewer ist https://bytecodeviewer.com
  • +
+ + \ No newline at end of file diff --git a/src/main/resources/translations/html/intro.mandarin.html b/src/main/resources/translations/html/intro.mandarin.html new file mode 100644 index 00000000..d81c1f4e --- /dev/null +++ b/src/main/resources/translations/html/intro.mandarin.html @@ -0,0 +1,135 @@ + +

关于

+ +Bytecode Viewer (BCV)被设计成对用户和初学者非常友好,因此,几乎所有的东西都可以通过一个界面访问。 +都可以通过一个界面、设置、工具等进行访问。 + +

开始时,将你的Jar/APK/Class文件拖到资源列表中。 + +

设置

+
    +
  • 预览副本。{previewCopy}
  • +
  • Fat Jar。{farJar}
  • +
  • Java。{java}
  • +
  • Javac: {javac}
  • +
  • BCV Dir: {bcvDir}
  • +
  • Python 2.7 (或 PyPy): {python}
  • +
  • Python 3.X (or PyPy): {python3}
  • +
  • RT.jar。{rt}
  • +
  • 可选的 Lib。{lib}
  • +
  • BCV Krakatau: v{krakatauVersion}
  • +
  • Krakatau Dir: {krakatauDir}
  • +
  • BCV Enjarify: v{enjarifyVersion}
  • +
  • Enjarify Dir: {enjarifyDir}
  • +
+ +

命令行界面(CLI)

+
    +
  • -help 显示帮助菜单
  • +
  • -list 显示可用的反编译器
  • +
  • -decompiler [decompiler] 选择反编译器,默认为procyon
  • +
  • -i [输入文件] 选择输入文件(Jar、Class、APK、ZIP、DEX都能自动工作)
  • +
  • -o [输出文件] 选择输出文件(Java或Java-Bytecode)
  • +
  • -t [目标类名] 必须是完全合格的类名,或者是 "全部",以便将所有的文件反编译为zip
  • +
  • -nowait 不等待用户阅读CLI信息
  • +
+ +

文件

+
    +
  • 添加 (Ctrl + O) - 如果你添加一个jar/zip,BCV将解压它,如果你添加一个APK或DEX文件,BCV将运行dex2jar + 然后运行jar的输入过程。 +
  • +
  • 重新打开最近的文件(Ctrl + L)--重新打开你最近打开的文件。 +
  • 新工作区(Ctrl + N)--它清除了已打开的 jars/资源。 +
  • 运行(Ctrl + R)--在一个安全的沙盒JVM实例中运行你已加载到BCV的类文件,你可以 + 完全调试。 +
  • +
  • 编译 (Ctrl + T) - 尝试编译你选择的所有可编辑面板,如果是Java,它将用 + 拉尼诺。Krakatau和*Smali使用他们自己的汇编程序。 +
  • +
  • Save As Jar - 将类文件和加载的资源导出为一个可运行的 Jar 文件。 +
  • Save As DEX - 运行 jar2dex 并将类文件导出为 DEX。 +
  • Save Files As - 将所有的 Classfiles 和资源保存为一个 zip 文件。 +
  • Save Java File As - 保存当前打开的反编译Classfile。 +
  • Save Java Files As - 将所有反编译的Classsfiles保存为一个zip文件。 +
  • 最近的文件 - 你用BCV打开的最后25个文件/目录。 +
  • About - 关于BCV的一个小信息窗口。 +
  • 退出 - 关闭BCV.
  • +
+ +

查看面板

+
    +
  • Editable - 定义该观察窗格是否可编辑。
  • +
  • None - 将不显示任何东西。
  • +
  • Procyon - 使用Procyon反编译器进行反编译。
  • +
  • CFR - 用CFR反编译器反编译。
  • +
  • FernFlower - 使用FernFlower反编译器进行反编译。
  • +
  • JD-GUI - 使用JD-GUI反编译器进行反编译.
  • +
  • Krakatau Java - 使用Krakatau反编译器进行反编译。
  • +
  • Krakatau Bytecode - 用Krakatau反汇编器进行反汇编。
  • +
  • Smali - 使用Smali进行反汇编。
  • +
  • Bytecode - 通过CFIDE对字节码进行反编译。不可编辑。
  • +
  • Hexcode - 在一个十六进制浏览器中显示类文件。不可编辑。
  • +
+ +

设置

+
    +
  • 保存时编译 - 如果选择了这个选项,每当你执行文件>保存*功能时,它将在保存前尝试编译。 + 保存。 +
  • +
  • 刷新时编译 - 如果选择了这个选项,每当你按下刷新键,它将在重新加载资源/类之前进行编译。
  • +
  • 更新检查 - 如果选择了这个选项,它会查询 https://github.com/Konloch/bytecode-viewer 以确保你得到最新的 + 版本。 +
  • +
  • 在视图改变时刷新 - 如果选择了这个选项,每当你在视图面板中改变一个选项时,它将刷新当前打开的资源/类。 + 当前打开的资源/类。 +
  • +
  • 解码APK资源 - 如果选择了这个选项,当你添加一个APK时,它将首先运行APKTool.jar来解码资源。 + 资源。 +
  • +
  • 设置Python 2.7可执行文件 - 如果你希望Krakatau反编译器/反汇编器/反汇编器工作,请设置Python 2.7可执行文件。 + 工作。 +
  • +
  • Set JRE RT Library - 为Krakatau反编译器设置JRE RT库。 +
+ +

插件

+
    +
  • 打开插件 - 打开一个为BCV创建的.java插件。
  • +
  • 最近的插件 - 你用BCV打开的最后25个插件。
  • +
  • 代码序列图 - 为当前打开的类文件建立一个粗糙的代码序列图。
  • +
  • 恶意代码扫描器 - 允许你定义要搜索的内容,并输出它所发现的内容。
  • +
  • 显示主要方法 - 检测并输出所有的公共静态void main(String[])函数。
  • +
  • 显示所有字符串 - 抓取并输出每个类文件中的所有字符串。
  • +
  • 替换字符串 - 允许你对classfile中的字符串做一个简单的永久.替换,对于URL交换非常有用。
  • +
  • Allatori字符串解密器 - 解密Allatori混淆/加密的字符串。
  • +
  • ZKM字符串解密器 - 解密ZKM混淆/加密的字符串。
  • +
  • ZStringArray字符串解密器--解密被混淆/加密的ZStringArray字符串。
  • +
+ +

使用了不同项目的代码,包括但不限于

+
    +
  • WaterWolf的J-RET
  • +
  • Sam Koivu的JHexPane
  • +
  • Robert Futrell的RSynaxPane
  • +
  • Commons IO by Apache
  • +
  • ASM by OW2
  • +
  • FernFlower by Stiver
  • +
  • Procyon,作者:Mstrobel
  • +
  • CFR by Lee Benfield
  • +
  • CFIDE by Bibl
  • +
  • Smali by JesusFreke
  • +
  • Dex2Jar by pxb1988
  • +
  • Krakatau by Storyyeller
  • +
  • JD-GUI + JD-Core by The Java-Decompiler Team
  • +
  • Enjarify by Storyyeller
  • +
+ +

注意事项

+
    +
  • 如果 BCV 无法启动,只需添加 -clean 作为参数来清理 lib 目录。 +
  • 在我吸食大麻烟的时候,请放松并做笔记。 +
  • BCV 是出于对 Java 反向工程的热爱而创建的。 +
  • Bytecode Viewer的主页是https://bytecodeviewer.com
  • +
+ \ No newline at end of file diff --git a/src/main/resources/translations/japanese.json b/src/main/resources/translations/japanese.json index 9effd8ed..4340f6fa 100644 --- a/src/main/resources/translations/japanese.json +++ b/src/main/resources/translations/japanese.json @@ -58,7 +58,7 @@ "SET_JAVAC_EXECUTABLE": "Javac実行可能ファイルを設定する", "JAVA": "Java", "PROCYON": "プロキオン", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "FernFlower", "KRAKATAU": "クラカタウ", "JDGUI": "JD-GUI", @@ -83,7 +83,7 @@ "ALLATORI_STRING_DECRYPTER": "Allatori String Decrypter", "ZSTRINGARRAY_DECRYPTER": "ZStringArray Decrypter", "PROCYON_DECOMPILER": "プロキオン逆コンパイラ", - "CRF_DECOMPILER": "CFRデコンパイラー", + "CFR_DECOMPILER": "CFRデコンパイラー", "FERNFLOWER_DECOMPILER": "FernFlowerデコンパイラー", "JADX_DECOMPILER": "JADXデコンパイラー", "JD_DECOMPILER": "JD-GUIデコンパイラ", diff --git a/src/main/resources/translations/malay.json b/src/main/resources/translations/malay.json index 19407956..ab22c1ef 100644 --- a/src/main/resources/translations/malay.json +++ b/src/main/resources/translations/malay.json @@ -58,7 +58,7 @@ "SET_JAVAC_EXECUTABLE": "Tetapkan Javac Boleh Dilaksanakan", "JAVA": "Jawa", "PROCYON": "Procyon", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "FernFlower", "KRAKATAU": "Krakatau", "JDGUI": "JD-GUI", @@ -83,7 +83,7 @@ "ALLATORI_STRING_DECRYPTER": "Allatori String Decrypter", "ZSTRINGARRAY_DECRYPTER": "ZStringArray Decrypter", "PROCYON_DECOMPILER": "Procyon Decompiler", - "CRF_DECOMPILER": "Pengurai CFR", + "CFR_DECOMPILER": "Pengurai CFR", "FERNFLOWER_DECOMPILER": "Pengurai FernFlower", "JADX_DECOMPILER": "Pengurai JADX", "JD_DECOMPILER": "Pengurai JD-GUI", diff --git a/src/main/resources/translations/mandarin.json b/src/main/resources/translations/mandarin.json index 72274cfa..5a4e5830 100644 --- a/src/main/resources/translations/mandarin.json +++ b/src/main/resources/translations/mandarin.json @@ -68,7 +68,7 @@ "TODO3": "These only exist as key/value map pairs", "JAVA": "Java", "PROCYON": "Procyon", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "FernFlower", "KRAKATAU": "Krakatau", "JDGUI": "JD-GUI", @@ -100,7 +100,7 @@ "TODO5": "These only exist as key/value map pairs", "PROCYON_DECOMPILER": "Procyon Decompiler", - "CRF_DECOMPILER": "CFR Decompiler", + "CFR_DECOMPILER": "CFR Decompiler", "FERNFLOWER_DECOMPILER": "FernFlower Decompiler", "JADX_DECOMPILER": "JADX Decompiler", "JD_DECOMPILER": "JD-GUI Decompiler", diff --git a/src/main/resources/translations/portuguese.json b/src/main/resources/translations/portuguese.json index c68d6f46..51e119c6 100644 --- a/src/main/resources/translations/portuguese.json +++ b/src/main/resources/translations/portuguese.json @@ -58,7 +58,7 @@ "SET_JAVAC_EXECUTABLE": "Definir executável Javac", "JAVA": "Java", "PROCYON": "Procyon", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "FernFlower", "KRAKATAU": "Krakatau", "JDGUI": "JD-GUI", @@ -83,7 +83,7 @@ "ALLATORI_STRING_DECRYPTER": "Allatori String Decrypter", "ZSTRINGARRAY_DECRYPTER": "ZStringArray Decrypter", "PROCYON_DECOMPILER": "Procyon Decompiler", - "CRF_DECOMPILER": "CFR Decompiler", + "CFR_DECOMPILER": "CFR Decompiler", "FERNFLOWER_DECOMPILER": "FernFlower Decompiler", "JADX_DECOMPILER": "JADX Decompiler", "JD_DECOMPILER": "JD-GUI Decompiler", diff --git a/src/main/resources/translations/russian.json b/src/main/resources/translations/russian.json index d11060fa..488c429f 100644 --- a/src/main/resources/translations/russian.json +++ b/src/main/resources/translations/russian.json @@ -58,7 +58,7 @@ "SET_JAVAC_EXECUTABLE": "Установить исполняемый файл Javac", "JAVA": "Ява", "PROCYON": "Процион", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "ПапоротникЦветок", "KRAKATAU": "Кракатау", "JDGUI": "JD-GUI", @@ -83,7 +83,7 @@ "ALLATORI_STRING_DECRYPTER": "Расшифровщик строк Аллатори", "ZSTRINGARRAY_DECRYPTER": "Расшифровщик ZStringArray", "PROCYON_DECOMPILER": "Декомпилятор Procyon", - "CRF_DECOMPILER": "CFR Декомпилятор", + "CFR_DECOMPILER": "CFR Декомпилятор", "FERNFLOWER_DECOMPILER": "Декомпилятор FernFlower", "JADX_DECOMPILER": "Декомпилятор JADX", "JD_DECOMPILER": "Декомпилятор JD-GUI", diff --git a/src/main/resources/translations/spanish.json b/src/main/resources/translations/spanish.json index bf2f8f96..608648ba 100644 --- a/src/main/resources/translations/spanish.json +++ b/src/main/resources/translations/spanish.json @@ -58,7 +58,7 @@ "SET_JAVAC_EXECUTABLE": "Establecer ejecutable de Javac", "JAVA": "Java", "PROCYON": "Procyon", - "CRF": "CFR", + "CFR": "CFR", "FERNFLOWER": "HelechoFlor", "KRAKATAU": "Krakatau", "JDGUI": "JD-GUI", @@ -83,7 +83,7 @@ "ALLATORI_STRING_DECRYPTER": "Descifrador de cadenas Allatori", "ZSTRINGARRAY_DECRYPTER": "Descifrador ZStringArray", "PROCYON_DECOMPILER": "Descompilador Procyon", - "CRF_DECOMPILER": "Descompilador CFR", + "CFR_DECOMPILER": "Descompilador CFR", "FERNFLOWER_DECOMPILER": "Descompilador FernFlower", "JADX_DECOMPILER": "Descompilador JADX", "JD_DECOMPILER": "Descompilador JD-GUI",