diff --git a/pom.xml b/pom.xml index 26f54757..68fd9985 100644 --- a/pom.xml +++ b/pom.xml @@ -6,10 +6,50 @@ 2.10.16 + 1.8 ${java.version} ${java.version} UTF-8 + + + 22.0.0 + 2.5.0bcv2 + 9.2 + 0.151 + 1.9.12 + 1.4 + 1.15 + 3.1.6 + 1.21 + 2.11.0 + 3.12.0 + 1.9 + 5.2.0.Final + 47afd82034 + 30.1.1-jre + 2.8.8 + 4.2 + 3.1.6 + 1.6.6bcv + 1.0bcv + 3.4.1.3 + 3.2 + 0.5.36 + 3.1.3 + 1.7.32 + 2.5.2 + 1.29 + 1.1.4c + f681c89 + v24 + 2.7.2 + 0.3.4 + 0.2.2 + 2.1.0 + 1.0.3 + 4.9.2 + 21.2.0 @@ -31,87 +71,87 @@ org.jetbrains annotations - 21.0.1 + ${annotations.version} org.apktool apktool - 2.5.0bcv2 + ${apktool.version} org.ow2.asm asm - 9.2 + ${asm.version} org.ow2.asm asm-analysis - 9.2 + ${asm.version} org.ow2.asm asm-commons - 9.2 + ${asm.version} org.ow2.asm asm-tree - 9.2 + ${asm.version} org.ow2.asm asm-util - 9.2 + ${asm.version} org.benf cfr - 0.151 + ${cfr.version} uk.com.robust-it cloning - 1.9.12 + ${cloning.version} commons-cli commons-cli - 1.4 + ${commons-cli.version} commons-codec commons-codec - 1.15 + ${commons-codec.version} org.codehaus.janino commons-compiler - 3.1.6 + ${commons-compiler.version} org.apache.commons commons-compress - 1.21 + ${commons-compress.version} commons-io commons-io - 2.11.0 + ${commons-io.version} org.apache.commons commons-lang3 - 3.12.0 + ${commons-lang3.version} org.apache.commons commons-text - 1.9 + ${commons-text.version} org.jboss.windup.decompiler decompiler-fernflower - 5.2.0.Final + ${decompiler-fernflower.version} org.jboss.windup.decompiler.fernflower @@ -122,152 +162,152 @@ com.github.ThexXTURBOXx fernflower - 47afd82034 + ${fernflower.version} com.google.guava guava - 30.1.1-jre + ${guava.version} com.google.code.gson gson - 2.8.7 + ${gson.version} org.imgscalr imgscalr-lib - 4.2 + ${imgscalr-lib.version} org.codehaus.janino janino - 3.1.6 + ${janino.version} org.jd jd-gui - 1.6.6bcv + ${jd-gui.version} eu.bibl.banalysis byteanalysis - 1.0bcv + ${byteanalysis.version} org.tinyjee.jgraphx jgraphx - 3.4.1.3 + ${jgraphx.version} org.objenesis objenesis - 3.2 + ${objenesis.version} org.bitbucket.mstrobel procyon-core - 0.5.36 + ${procyon.version} org.bitbucket.mstrobel procyon-expressions - 0.5.36 + ${procyon.version} org.bitbucket.mstrobel procyon-reflection - 0.5.36 + ${procyon.version} org.bitbucket.mstrobel procyon-compilertools - 0.5.36 + ${procyon.version} com.fifesoft rsyntaxtextarea - 3.1.3 + ${rsyntaxtextarea.version} org.slf4j slf4j-api - 1.7.32 + ${slf4j.version} org.smali smali - 2.5.2 + ${smali.version} org.smali baksmali - 2.5.2 + ${smali.version} org.yaml snakeyaml - 1.29 + ${snakeyaml.version} xpp3 xpp3 - 1.1.4c + ${xpp3.version} com.github.skylot.jadx jadx-core - c28e8142f4 + ${jadx.version} com.github.skylot.jadx jadx-java-convert - c28e8142f4 + ${jadx.version} com.github.skylot.jadx jadx-dex-input - c28e8142f4 + ${jadx.version} com.github.skylot.jadx jadx-smali-input - c28e8142f4 + ${jadx.version} com.github.ThexXTURBOXx dex2jar - v23 + ${dex2jar.version} com.github.weisj darklaf-core - 2.7.2 + ${darklaf.version} com.github.weisj darklaf-extensions-rsyntaxarea - 0.3.4 + ${darklaf-extensions-rsta.version} com.github.gotson webp-imageio - 0.2.2 + ${webp-imageio.version} de.skuzzle semantic-version - 2.1.0 + ${semantic-version.version} org.abego.treelayout org.abego.treelayout.core - 1.0.3 + ${treelayout.version} org.antlr antlr4 - 4.9.2 + ${antlr4.version} com.ibm.icu @@ -280,12 +320,12 @@ @@ -325,6 +365,7 @@ *:* + module-info.class META-INF/*.SF META-INF/*.DSA META-INF/*.RSA @@ -340,8 +381,12 @@ the.bytecode.club.bytecodeviewer.BytecodeViewer ${project.version} + ${maven.compiler.source} + ${maven.compiler.target} + diff --git a/src/main/java/me/konloch/kontainer/io/DiskReader.java b/src/main/java/me/konloch/kontainer/io/DiskReader.java index 35a975e3..03df2662 100644 --- a/src/main/java/me/konloch/kontainer/io/DiskReader.java +++ b/src/main/java/me/konloch/kontainer/io/DiskReader.java @@ -5,6 +5,8 @@ import java.io.File; import java.io.FileReader; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Random; import the.bytecode.club.bytecodeviewer.util.EncodeUtils; @@ -17,14 +19,14 @@ import the.bytecode.club.bytecodeviewer.util.EncodeUtils; public class DiskReader { public static Random random = new Random(); - public static HashMap> map = new HashMap<>(); + public static Map> map = new HashMap<>(); /** * Used to load from file, allows caching */ - public synchronized static ArrayList loadArrayList(String fileName, - boolean cache) { - ArrayList array = new ArrayList<>(); + public synchronized static List loadArrayList(String fileName, + boolean cache) { + List array = new ArrayList<>(); if (!map.containsKey(fileName)) { try { File file = new File(fileName); @@ -75,7 +77,7 @@ public class DiskReader { public static String loadString(String fileName, int lineNumber, boolean cache) throws Exception { - ArrayList array; + List array; if (!map.containsKey(fileName)) { array = new ArrayList<>(); File file = new File(fileName); @@ -101,4 +103,4 @@ public class DiskReader { return array.get(lineNumber); } -} \ No newline at end of file +} diff --git a/src/main/java/me/konloch/kontainer/io/DiskWriter.java b/src/main/java/me/konloch/kontainer/io/DiskWriter.java index be087243..be0b33f7 100644 --- a/src/main/java/me/konloch/kontainer/io/DiskWriter.java +++ b/src/main/java/me/konloch/kontainer/io/DiskWriter.java @@ -1,6 +1,10 @@ package me.konloch.kontainer.io; -import java.io.*; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.PrintWriter; import java.util.Arrays; /** @@ -201,4 +205,4 @@ public class DiskWriter { } } -} \ No newline at end of file +} diff --git a/src/main/java/me/konloch/kontainer/io/HTTPRequest.java b/src/main/java/me/konloch/kontainer/io/HTTPRequest.java index 874b67d2..c3b1798b 100644 --- a/src/main/java/me/konloch/kontainer/io/HTTPRequest.java +++ b/src/main/java/me/konloch/kontainer/io/HTTPRequest.java @@ -142,7 +142,7 @@ public class HTTPRequest { * @throws Exception */ public String[] read() throws Exception { - ArrayList st; + List st; try { setup(); @@ -172,7 +172,7 @@ public class HTTPRequest { * @throws Exception */ public String[] read(int linesToRead) throws Exception { - ArrayList st; + List st; try { setup(); @@ -273,4 +273,4 @@ public class HTTPRequest { connection = null; } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java index be69fe71..1b84e08f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java @@ -1,17 +1,18 @@ package the.bytecode.club.bytecodeviewer; -import java.io.File; -import java.io.IOException; -import java.util.*; -import javax.swing.*; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import javax.swing.SwingUtilities; +import me.konloch.kontainer.io.DiskReader; import org.apache.commons.io.FileUtils; import org.objectweb.asm.tree.ClassNode; - -import me.konloch.kontainer.io.DiskReader; - import the.bytecode.club.bytecodeviewer.api.BCV; import the.bytecode.club.bytecodeviewer.api.ExceptionUI; import the.bytecode.club.bytecodeviewer.bootloader.Boot; @@ -19,20 +20,29 @@ import the.bytecode.club.bytecodeviewer.bootloader.BootState; import the.bytecode.club.bytecodeviewer.bootloader.InstallFatJar; import the.bytecode.club.bytecodeviewer.bootloader.UpdateCheck; import the.bytecode.club.bytecodeviewer.gui.MainViewerGUI; -import the.bytecode.club.bytecodeviewer.gui.components.*; +import the.bytecode.club.bytecodeviewer.gui.components.ExtendedJOptionPane; +import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog; import the.bytecode.club.bytecodeviewer.gui.resourcelist.ResourceListIconRenderer; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.TabbedPane; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ClassViewer; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ResourceViewer; -import the.bytecode.club.bytecodeviewer.plugin.PluginWriter; import the.bytecode.club.bytecodeviewer.obfuscators.mapping.Refactorer; -import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; +import the.bytecode.club.bytecodeviewer.plugin.PluginWriter; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.importing.ImportResource; -import the.bytecode.club.bytecodeviewer.util.*; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; +import the.bytecode.club.bytecodeviewer.util.BootCheck; +import the.bytecode.club.bytecodeviewer.util.ClassFileUtils; +import the.bytecode.club.bytecodeviewer.util.LazyNameUtil; +import the.bytecode.club.bytecodeviewer.util.MiscUtils; +import the.bytecode.club.bytecodeviewer.util.PingBack; +import the.bytecode.club.bytecodeviewer.util.SecurityMan; import static javax.swing.JOptionPane.QUESTION_MESSAGE; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.DEV_MODE; +import static the.bytecode.club.bytecodeviewer.Constants.FAT_JAR; +import static the.bytecode.club.bytecodeviewer.Constants.VERSION; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -132,7 +142,7 @@ public class BytecodeViewer public static MainViewerGUI viewer; //All of the opened resources (Files/Classes/Etc) - public static LinkedHashMap resourceContainers = new LinkedHashMap<>(); + public static Map resourceContainers = new LinkedHashMap<>(); //All of the created processes (Decompilers/etc) public static List createdProcesses = new ArrayList<>(); @@ -422,9 +432,9 @@ public class BytecodeViewer * @return the loaded classes as an array list */ @Deprecated - public static ArrayList getLoadedClasses() + public static List getLoadedClasses() { - ArrayList a = new ArrayList<>(); + List a = new ArrayList<>(); for (ResourceContainer container : resourceContainers.values()) for (ClassNode c : container.resourceClasses.values()) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/CommandLineInput.java b/src/main/java/the/bytecode/club/bytecodeviewer/CommandLineInput.java index d699b428..e7b661e8 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/CommandLineInput.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/CommandLineInput.java @@ -13,7 +13,9 @@ import the.bytecode.club.bytecodeviewer.translation.Language; import the.bytecode.club.bytecodeviewer.util.JarUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.VERSION; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java b/src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java index 1d15dcd9..72b87328 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java @@ -1,13 +1,12 @@ package the.bytecode.club.bytecodeviewer; +import java.io.File; +import java.io.IOException; import the.bytecode.club.bytecodeviewer.bootloader.BootState; import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme; import the.bytecode.club.bytecodeviewer.gui.theme.RSTATheme; import the.bytecode.club.bytecodeviewer.translation.Language; -import java.io.File; -import java.io.IOException; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * @@ -139,4 +138,4 @@ public class Configuration return new File("."); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java index 7858443f..2a18a5e3 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer; -import org.objectweb.asm.Opcodes; -import the.bytecode.club.bytecodeviewer.resources.ResourceType; - import java.io.File; import java.io.PrintStream; +import org.objectweb.asm.Opcodes; +import the.bytecode.club.bytecodeviewer.resources.ResourceType; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/GlobalHotKeys.java b/src/main/java/the/bytecode/club/bytecodeviewer/GlobalHotKeys.java index f6edead4..3bd050b2 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/GlobalHotKeys.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/GlobalHotKeys.java @@ -1,14 +1,13 @@ package the.bytecode.club.bytecodeviewer; +import java.awt.event.KeyEvent; +import java.io.File; +import javax.swing.JFileChooser; import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; import the.bytecode.club.bytecodeviewer.gui.components.RunOptions; import the.bytecode.club.bytecodeviewer.util.DialogUtils; import the.bytecode.club.bytecodeviewer.util.JarUtils; -import javax.swing.*; -import java.awt.event.KeyEvent; -import java.io.File; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Settings.java b/src/main/java/the/bytecode/club/bytecodeviewer/Settings.java index c66c97ea..35f73cd0 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Settings.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Settings.java @@ -1,18 +1,20 @@ package the.bytecode.club.bytecodeviewer; import com.google.gson.reflect.TypeToken; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JMenuItem; import me.konloch.kontainer.io.DiskReader; import me.konloch.kontainer.io.DiskWriter; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import javax.swing.*; -import java.io.File; -import java.util.ArrayList; -import java.util.List; - import static the.bytecode.club.bytecodeviewer.BytecodeViewer.gson; import static the.bytecode.club.bytecodeviewer.Configuration.maxRecentFiles; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.filesName; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.getBCVDirectory; +import static the.bytecode.club.bytecodeviewer.Constants.pluginsName; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/SettingsSerializer.java b/src/main/java/the/bytecode/club/bytecodeviewer/SettingsSerializer.java index 77fdb77a..cc2af48c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/SettingsSerializer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/SettingsSerializer.java @@ -1,7 +1,7 @@ package the.bytecode.club.bytecodeviewer; +import java.io.File; import javax.swing.JFrame; - import me.konloch.kontainer.io.DiskReader; import me.konloch.kontainer.io.DiskWriter; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; @@ -9,9 +9,8 @@ import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme; import the.bytecode.club.bytecodeviewer.gui.theme.RSTATheme; import the.bytecode.club.bytecodeviewer.translation.Language; -import java.io.File; - -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.VERSION; +import static the.bytecode.club.bytecodeviewer.Constants.settingsName; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/api/BCV.java b/src/main/java/the/bytecode/club/bytecodeviewer/api/BCV.java index ad820e9e..91fd1aee 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/api/BCV.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/api/BCV.java @@ -8,19 +8,20 @@ import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; +import javax.swing.JFrame; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.compilers.Compiler; import the.bytecode.club.bytecodeviewer.compilers.InternalCompiler; -import the.bytecode.club.bytecodeviewer.decompilers.InternalDecompiler; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; +import the.bytecode.club.bytecodeviewer.decompilers.InternalDecompiler; import the.bytecode.club.bytecodeviewer.plugin.preinstalled.EZInjection; import the.bytecode.club.bytecodeviewer.util.DialogUtils; import the.bytecode.club.bytecodeviewer.util.JarUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import javax.swing.*; - -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.DEV_MODE; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -188,7 +189,7 @@ public class BCV * * @return the loaded classes */ - public static ArrayList getLoadedClasses() { + public static List getLoadedClasses() { return the.bytecode.club.bytecodeviewer.BytecodeViewer .getLoadedClasses(); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/api/ClassNodeLoader.java b/src/main/java/the/bytecode/club/bytecodeviewer/api/ClassNodeLoader.java index f0be6f85..8492a8ea 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/api/ClassNodeLoader.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/api/ClassNodeLoader.java @@ -8,6 +8,8 @@ import java.security.cert.Certificate; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.ClassNode; @@ -35,7 +37,7 @@ import org.objectweb.asm.tree.ClassNode; public final class ClassNodeLoader extends ClassLoader { - private final HashMap classes = new HashMap<>(); + private final Map classes = new HashMap<>(); /** * Adds the provided class node to the class loader @@ -72,7 +74,7 @@ public final class ClassNodeLoader extends ClassLoader * @return All classes in this loader */ public Collection> getAllClasses() { - ArrayList> classes = new ArrayList<>(); + List> classes = new ArrayList<>(); for (String s : this.classes.keySet()) { try { classes.add(loadClass(s)); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/api/ExceptionUI.java b/src/main/java/the/bytecode/club/bytecodeviewer/api/ExceptionUI.java index 3da5fbba..088e2593 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/api/ExceptionUI.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/api/ExceptionUI.java @@ -1,22 +1,20 @@ package the.bytecode.club.bytecodeviewer.api; -import java.awt.*; +import java.awt.CardLayout; +import java.awt.Dimension; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import javax.swing.JFrame; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; - import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.components.JFrameConsole; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ComponentViewer; import the.bytecode.club.bytecodeviewer.plugin.PluginManager; import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.FAT_JAR; +import static the.bytecode.club.bytecodeviewer.Constants.VERSION; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -144,4 +142,4 @@ public class ExceptionUI extends JFrameConsole } private static final long serialVersionUID = -5230501978224926296L; -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java b/src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java index 131d9b1a..3831ff72 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/api/Plugin.java @@ -2,14 +2,10 @@ package the.bytecode.club.bytecodeviewer.api; import java.util.ArrayList; import java.util.List; - import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.plugin.strategies.JavascriptPluginLaunchStrategy; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; -import javax.script.ScriptEngine; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * @@ -99,5 +95,5 @@ public abstract class Plugin extends Thread * * @param classNodeList all of the loaded classes for easy access. */ - public abstract void execute(ArrayList classNodeList); + public abstract void execute(List classNodeList); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/Boot.java b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/Boot.java index e8285c2c..951dfe2d 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/Boot.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/Boot.java @@ -11,18 +11,22 @@ import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import me.konloch.kontainer.io.HTTPRequest; import org.apache.commons.io.FileUtils; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.Configuration; +import the.bytecode.club.bytecodeviewer.Constants; import the.bytecode.club.bytecodeviewer.bootloader.loader.AbstractLoaderFactory; import the.bytecode.club.bytecodeviewer.bootloader.loader.ClassPathLoader; import the.bytecode.club.bytecodeviewer.bootloader.loader.ILoader; import the.bytecode.club.bytecodeviewer.bootloader.resource.external.EmptyExternalResource; import the.bytecode.club.bytecodeviewer.bootloader.resource.external.ExternalResource; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.Configuration; -import the.bytecode.club.bytecodeviewer.Constants; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import the.bytecode.club.bytecodeviewer.util.ZipUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.getBCVDirectory; +import static the.bytecode.club.bytecodeviewer.Constants.krakatauVersion; +import static the.bytecode.club.bytecodeviewer.Constants.krakatauWorkingDirectory; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/InitialBootScreen.java b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/InitialBootScreen.java index 0d4c91b5..4e7e32d0 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/InitialBootScreen.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/InitialBootScreen.java @@ -11,10 +11,9 @@ import java.io.IOException; import javax.swing.JFrame; import javax.swing.JProgressBar; import javax.swing.JScrollPane; - import the.bytecode.club.bytecodeviewer.Configuration; -import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.gui.components.HTMLPane; +import the.bytecode.club.bytecodeviewer.resources.IconResources; import static the.bytecode.club.bytecodeviewer.Configuration.language; @@ -104,4 +103,4 @@ public class InitialBootScreen extends JFrame } private static final long serialVersionUID = -1098467609722393444L; -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/InstallFatJar.java b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/InstallFatJar.java index 15b01981..a133773f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/InstallFatJar.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/InstallFatJar.java @@ -1,7 +1,5 @@ package the.bytecode.club.bytecodeviewer.bootloader; -import the.bytecode.club.bytecodeviewer.bootloader.Boot; - import static the.bytecode.club.bytecodeviewer.Constants.AUTOMATIC_LIBRARY_UPDATING; /*************************************************************************** @@ -56,4 +54,4 @@ public class InstallFatJar implements Runnable e.printStackTrace(); } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/UpdateCheck.java b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/UpdateCheck.java index 95cb9858..babd9c81 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/UpdateCheck.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/UpdateCheck.java @@ -1,6 +1,15 @@ package the.bytecode.club.bytecodeviewer.bootloader; import de.skuzzle.semantic.Version; +import java.awt.Desktop; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URL; +import javax.swing.JFileChooser; import me.konloch.kontainer.io.HTTPRequest; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; @@ -9,13 +18,8 @@ import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import java.awt.*; -import java.io.*; -import java.net.URI; -import java.net.URL; - -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.VERSION; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/loader/LibraryClassLoader.java b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/loader/LibraryClassLoader.java index 82cd9734..5fd830a2 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/loader/LibraryClassLoader.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/bootloader/loader/LibraryClassLoader.java @@ -9,9 +9,9 @@ import java.util.Set; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.ClassNode; +import the.bytecode.club.bytecodeviewer.bootloader.classtree.ClassTree; import the.bytecode.club.bytecodeviewer.bootloader.resource.external.ExternalResource; import the.bytecode.club.bytecodeviewer.bootloader.resource.jar.contents.JarContents; -import the.bytecode.club.bytecodeviewer.bootloader.classtree.ClassTree; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -168,4 +168,4 @@ public class LibraryClassLoader extends ClassLoader implements ILoader> { return contents; } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java index 93bee2de..edc262fa 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/JavaCompiler.java @@ -14,7 +14,9 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.JarUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.nl; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java index d20117ae..bb1b72e9 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/KrakatauAssembler.java @@ -5,7 +5,6 @@ import java.io.File; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Objects; - import me.konloch.kontainer.io.DiskWriter; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.ArrayUtils; @@ -18,7 +17,9 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.JarUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.krakatauWorkingDirectory; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java index b058d4c9..3dd063f1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java @@ -11,7 +11,8 @@ import the.bytecode.club.bytecodeviewer.util.Enjarify; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import the.bytecode.club.bytecodeviewer.util.ZipUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -73,9 +74,9 @@ public class SmaliAssembler extends InternalCompiler Dex2Jar.dex2Jar(tempDex, tempJar); else if (BytecodeViewer.viewer.apkConversionGroup.isSelected(BytecodeViewer.viewer.apkConversionEnjarify.getModel())) Enjarify.apk2Jar(tempDex, tempJar); - + System.out.println("Temporary dex: " + tempDex.getAbsolutePath()); - + try { System.out.println("Unzipping to " + tempJarFolder.getAbsolutePath()); ZipUtils.unzipFilesToPath(tempJar.getAbsolutePath(), tempJarFolder.getAbsolutePath()); @@ -95,7 +96,7 @@ public class SmaliAssembler extends InternalCompiler found = true; } } - + System.out.println("Saved as: " + outputClass.getAbsolutePath()); return FileUtils.readFileToByteArray(outputClass); 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 ef28859b..669ff308 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/Decompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/Decompiler.java @@ -1,6 +1,16 @@ package the.bytecode.club.bytecodeviewer.decompilers; -import the.bytecode.club.bytecodeviewer.decompilers.impl.*; +import the.bytecode.club.bytecodeviewer.decompilers.impl.ASMTextifierDisassembler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.BytecodeDisassembler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.CFRDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.FernFlowerDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.JADXDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.JDGUIDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.JavapDisassembler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.KrakatauDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.KrakatauDisassembler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.ProcyonDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.SmaliDisassembler; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -62,4 +72,4 @@ public enum Decompiler { return decompiler; } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/ClassNodeDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/ClassNodeDecompiler.java index 187220a6..5fa1744a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/ClassNodeDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/ClassNodeDecompiler.java @@ -10,7 +10,7 @@ import org.objectweb.asm.tree.InnerClassNode; import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -38,9 +38,9 @@ import static the.bytecode.club.bytecodeviewer.Constants.*; public class ClassNodeDecompiler { public static PrefixedStringBuilder decompile( - PrefixedStringBuilder sb, ArrayList decompiledClasses, + PrefixedStringBuilder sb, List decompiledClasses, ClassNode cn) { - ArrayList unableToDecompile = new ArrayList<>(); + List unableToDecompile = new ArrayList<>(); decompiledClasses.add(cn.name); sb.append(getAccessString(cn.access)); sb.append(" "); @@ -173,4 +173,4 @@ public class ClassNodeDecompiler } return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java index a4707fe7..737fdd4b 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/InstructionPrinter.java @@ -10,7 +10,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; -import java.util.ListIterator; import java.util.Map; import org.apache.commons.text.StringEscapeUtils; import org.objectweb.asm.Type; @@ -70,7 +69,7 @@ public class InstructionPrinter { protected List matchedInsns; protected Map labels; private boolean firstLabel = false; - private final ArrayList info = new ArrayList<>(); + private final List info = new ArrayList<>(); public InstructionPrinter(MethodNode m, TypeAndName[] args) { this.args = args; @@ -100,7 +99,7 @@ public class InstructionPrinter { * * @return The print as an ArrayList */ - public ArrayList createPrint() { + public List createPrint() { firstLabel = false; info.clear(); for (AbstractInsnNode ain : mNode.instructions) { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/MethodNodeDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/MethodNodeDecompiler.java index 5c89a62b..982943a0 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/MethodNodeDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/bytecode/MethodNodeDecompiler.java @@ -12,7 +12,7 @@ import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.TryCatchBlockNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -246,4 +246,4 @@ public class MethodNodeDecompiler { } return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/BytecodeDisassembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/BytecodeDisassembler.java index 4fa45e78..57217f97 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/BytecodeDisassembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/BytecodeDisassembler.java @@ -1,12 +1,11 @@ package the.bytecode.club.bytecodeviewer.decompilers.impl; +import java.util.ArrayList; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.decompilers.InternalDecompiler; import the.bytecode.club.bytecodeviewer.decompilers.bytecode.ClassNodeDecompiler; import the.bytecode.club.bytecodeviewer.decompilers.bytecode.PrefixedStringBuilder; -import java.util.ArrayList; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * 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 e3a95203..9c3baa37 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 @@ -21,8 +21,11 @@ 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.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.nl; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.CFR; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.ERROR; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * 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 ee12c9c6..124f51f2 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 @@ -13,8 +13,12 @@ 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.*; +import static the.bytecode.club.bytecodeviewer.Constants.LAUNCH_DECOMPILERS_IN_NEW_PROCESS; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.nl; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.ERROR; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.FERNFLOWER; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * 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 8d78af0d..99f476f1 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 @@ -16,8 +16,11 @@ 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.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.nl; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.ERROR; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.JADX; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * 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 ac18ee47..3495789d 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 @@ -6,23 +6,24 @@ import java.io.IOException; 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; -import the.bytecode.club.bytecodeviewer.decompilers.jdgui.CommonPreferences; -import the.bytecode.club.bytecodeviewer.decompilers.jdgui.PlainTextPrinter; -import the.bytecode.club.bytecodeviewer.decompilers.jdgui.JDGUIClassFileUtil; import me.konloch.kontainer.io.DiskReader; import org.jd.core.v1.ClassFileToJavaSourceDecompiler; import org.objectweb.asm.tree.ClassNode; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Constants; +import the.bytecode.club.bytecodeviewer.api.ExceptionUI; +import the.bytecode.club.bytecodeviewer.decompilers.InternalDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.jdgui.CommonPreferences; +import the.bytecode.club.bytecodeviewer.decompilers.jdgui.DirectoryLoader; +import the.bytecode.club.bytecodeviewer.decompilers.jdgui.JDGUIClassFileUtil; +import the.bytecode.club.bytecodeviewer.decompilers.jdgui.PlainTextPrinter; 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.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.nl; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.ERROR; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.JDGUI; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -123,4 +124,4 @@ public class JDGUIDecompiler extends InternalDecompiler @Override public void decompileToZip(String sourceJar, String zipName) { } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JavapDisassembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JavapDisassembler.java index 40e38983..695829f5 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JavapDisassembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/JavapDisassembler.java @@ -1,5 +1,9 @@ package the.bytecode.club.bytecodeviewer.decompilers.impl; +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; import me.konloch.kontainer.io.DiskWriter; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; @@ -10,11 +14,6 @@ import the.bytecode.club.bytecodeviewer.gui.components.JFrameConsolePrintStream; import the.bytecode.club.bytecodeviewer.resources.ExternalResources; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import java.io.File; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; - import static the.bytecode.club.bytecodeviewer.Constants.fs; import static the.bytecode.club.bytecodeviewer.api.ExceptionUI.SEND_STACKTRACE_TO; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDecompiler.java index face4898..d4b369f6 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDecompiler.java @@ -21,7 +21,10 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.JarUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import the.bytecode.club.bytecodeviewer.util.ZipUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; + +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.krakatauWorkingDirectory; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java index 3eb0ec86..069a32f1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/KrakatauDisassembler.java @@ -20,7 +20,9 @@ import the.bytecode.club.bytecodeviewer.util.JarUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import the.bytecode.club.bytecodeviewer.util.ZipUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.krakatauWorkingDirectory; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * 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 17f8903e..fe59dd39 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 @@ -38,8 +38,11 @@ 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.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.nl; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.ERROR; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.PROCYON; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * 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 f1f78739..5bff6113 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 @@ -10,15 +10,18 @@ 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.Constants; 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.MiscUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; -import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.nl; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.DISASSEMBLER; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.ERROR; +import static the.bytecode.club.bytecodeviewer.translation.TranslatedStrings.SMALI; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/jdgui/PlainTextPrinter.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/jdgui/PlainTextPrinter.java index 534fbf7f..dc00fb85 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/jdgui/PlainTextPrinter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/jdgui/PlainTextPrinter.java @@ -3,7 +3,6 @@ package the.bytecode.club.bytecodeviewer.decompilers.jdgui; import java.io.Closeable; import java.io.IOException; import java.io.PrintStream; - import org.jd.core.v1.api.printer.Printer; public class PlainTextPrinter implements Printer, Closeable { 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 3ec36554..ef437136 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/MainViewerGUI.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/MainViewerGUI.java @@ -1,15 +1,38 @@ package the.bytecode.club.bytecodeviewer.gui; -import java.awt.*; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.KeyboardFocusManager; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.swing.*; - -import the.bytecode.club.bytecodeviewer.*; -import the.bytecode.club.bytecodeviewer.gui.components.*; +import javax.swing.BoxLayout; +import javax.swing.ButtonGroup; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.JSeparator; +import javax.swing.JSpinner; +import javax.swing.JSplitPane; +import javax.swing.SpinnerNumberModel; +import javax.swing.SwingUtilities; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.Configuration; +import the.bytecode.club.bytecodeviewer.Constants; +import the.bytecode.club.bytecodeviewer.SettingsSerializer; +import the.bytecode.club.bytecodeviewer.gui.components.AboutWindow; +import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; +import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog; +import the.bytecode.club.bytecodeviewer.gui.components.RunOptions; +import the.bytecode.club.bytecodeviewer.gui.components.SettingsDialog; +import the.bytecode.club.bytecodeviewer.gui.components.VisibleComponent; +import the.bytecode.club.bytecodeviewer.gui.components.WaitBusyIcon; import the.bytecode.club.bytecodeviewer.gui.plugins.MaliciousCodeScannerOptions; import the.bytecode.club.bytecodeviewer.gui.plugins.ReplaceStringsOptions; import the.bytecode.club.bytecodeviewer.gui.resourcelist.ResourceListPane; @@ -25,23 +48,38 @@ import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameFields; import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameMethods; import the.bytecode.club.bytecodeviewer.plugin.PluginManager; import the.bytecode.club.bytecodeviewer.plugin.PluginTemplate; -import the.bytecode.club.bytecodeviewer.plugin.preinstalled.*; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.AllatoriStringDecrypter; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ChangeClassFileVersions; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.CodeSequenceDiagram; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowAllStrings; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowMainMethods; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.StackFramesRemover; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ViewAPKAndroidPermissions; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ViewManifest; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ZKMStringDecrypter; +import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ZStringArrayDecrypter; import the.bytecode.club.bytecodeviewer.resources.ExternalResources; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.IconResources; -import the.bytecode.club.bytecodeviewer.resources.exporting.Export; -import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJCheckBoxMenuItem; -import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJRadioButtonMenuItem; -import the.bytecode.club.bytecodeviewer.util.*; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling; +import the.bytecode.club.bytecodeviewer.resources.exporting.Export; import the.bytecode.club.bytecodeviewer.translation.Language; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; +import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJCheckBoxMenuItem; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJMenu; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJMenuItem; +import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJRadioButtonMenuItem; +import the.bytecode.club.bytecodeviewer.util.DialogUtils; +import the.bytecode.club.bytecodeviewer.util.KeyEventDispatch; +import the.bytecode.club.bytecodeviewer.util.LazyNameUtil; +import the.bytecode.club.bytecodeviewer.util.MiscUtils; +import the.bytecode.club.bytecodeviewer.util.WindowClosingAdapter; +import the.bytecode.club.bytecodeviewer.util.WindowStateChangeAdapter; import static the.bytecode.club.bytecodeviewer.Configuration.useNewSettingsDialog; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.VERSION; +import static the.bytecode.club.bytecodeviewer.Constants.fs; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -72,7 +110,7 @@ public class MainViewerGUI extends JFrame public final List waitIcons = new ArrayList<>(); //main UI components - public final ArrayList uiComponents = new ArrayList<>(); + public final List uiComponents = new ArrayList<>(); public final Workspace workPane = new Workspace(); public final ResourceListPane resourcePane = new ResourceListPane(); public final SearchBoxPane searchBoxPane = new SearchBoxPane(); @@ -877,7 +915,7 @@ public class MainViewerGUI extends JFrame if (dialog.promptChoice() == 0) { LazyNameUtil.reset(); - ArrayList reopen = new ArrayList<>(); + List reopen = new ArrayList<>(); for (ResourceContainer container : BytecodeViewer.resourceContainers.values()) { 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 b5ca27f0..23857f4e 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,15 +1,14 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import java.awt.*; +import java.awt.CardLayout; import java.io.IOException; import javax.swing.JFrame; import javax.swing.JScrollPane; - import the.bytecode.club.bytecodeviewer.bootloader.InitialBootScreen; import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import static the.bytecode.club.bytecodeviewer.Configuration.*; +import static the.bytecode.club.bytecodeviewer.Configuration.language; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ButtonHoverAnimation.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ButtonHoverAnimation.java index 6f3f6b7c..a40d9342 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ButtonHoverAnimation.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ButtonHoverAnimation.java @@ -1,9 +1,9 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import javax.swing.*; -import java.awt.*; +import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import javax.swing.AbstractButton; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/DecompilerViewComponent.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/DecompilerViewComponent.java index d18cd1b6..b535d5f1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/DecompilerViewComponent.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/DecompilerViewComponent.java @@ -1,14 +1,20 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import javax.swing.ButtonGroup; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JMenu; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.JSeparator; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; +import the.bytecode.club.bytecodeviewer.gui.resourceviewer.WorkspaceRefreshEvent; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJCheckBoxMenuItem; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJRadioButtonMenuItem; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.WorkspaceRefreshEvent; -import javax.swing.*; - -import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.*; +import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.BYTECODE; +import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.BYTECODE_NON_EDITABLE; +import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.JAVA; +import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.JAVA_AND_BYTECODE; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -116,4 +122,4 @@ public class DecompilerViewComponent BYTECODE_NON_EDITABLE, JAVA_AND_BYTECODE } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ExtendedJOptionPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ExtendedJOptionPane.java index 664c86c7..3b9b0dd5 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ExtendedJOptionPane.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ExtendedJOptionPane.java @@ -1,11 +1,26 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.HeadlessException; +import javax.swing.Icon; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import javax.swing.JRootPane; +import javax.swing.JScrollPane; +import javax.swing.UIManager; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import javax.swing.*; -import java.awt.*; - -import static javax.swing.JOptionPane.*; +import static javax.swing.JOptionPane.CLOSED_OPTION; +import static javax.swing.JOptionPane.DEFAULT_OPTION; +import static javax.swing.JOptionPane.ERROR_MESSAGE; +import static javax.swing.JOptionPane.INFORMATION_MESSAGE; +import static javax.swing.JOptionPane.OK_CANCEL_OPTION; +import static javax.swing.JOptionPane.PLAIN_MESSAGE; +import static javax.swing.JOptionPane.QUESTION_MESSAGE; +import static javax.swing.JOptionPane.UNINITIALIZED_VALUE; +import static javax.swing.JOptionPane.WARNING_MESSAGE; +import static javax.swing.JOptionPane.getRootFrame; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -228,4 +243,4 @@ public class ExtendedJOptionPane { void onCreate(JDialog dialog); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/FileChooser.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/FileChooser.java index e5459669..c2e4b39b 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/FileChooser.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/FileChooser.java @@ -1,12 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import the.bytecode.club.bytecodeviewer.util.MiscUtils; - -import javax.swing.*; -import javax.swing.filechooser.FileFilter; import java.io.File; import java.util.Arrays; import java.util.HashSet; +import java.util.Set; +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileFilter; +import the.bytecode.club.bytecodeviewer.util.MiscUtils; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -41,7 +41,7 @@ public class FileChooser extends JFileChooser public FileChooser(boolean skipFileFilter, File file, String title, String description, String... extensions) { - HashSet extensionSet = new HashSet<>(Arrays.asList(extensions)); + Set extensionSet = new HashSet<>(Arrays.asList(extensions)); try { if(file.isDirectory()) 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 index 4105a88a..7ac91dac 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/HTMLPane.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/HTMLPane.java @@ -1,15 +1,19 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import java.io.IOException; import java.io.InputStream; import java.util.Scanner; -import the.bytecode.club.bytecodeviewer.bootloader.InitialBootScreen; -import the.bytecode.club.bytecodeviewer.Configuration; - -import javax.swing.*; +import javax.swing.JEditorPane; import javax.swing.text.html.HTMLEditorKit; -import java.io.IOException; +import the.bytecode.club.bytecodeviewer.Configuration; +import the.bytecode.club.bytecodeviewer.bootloader.InitialBootScreen; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.BCVDir; +import static the.bytecode.club.bytecodeviewer.Constants.FAT_JAR; +import static the.bytecode.club.bytecodeviewer.Constants.enjarifyVersion; +import static the.bytecode.club.bytecodeviewer.Constants.enjarifyWorkingDirectory; +import static the.bytecode.club.bytecodeviewer.Constants.krakatauVersion; +import static the.bytecode.club.bytecodeviewer.Constants.krakatauWorkingDirectory; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -83,4 +87,4 @@ public class HTMLPane extends JEditorPane return s.hasNext() ? s.next() : ""; } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ImageJLabel.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ImageJLabel.java index c0b6af70..9b2bb088 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ImageJLabel.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/ImageJLabel.java @@ -1,7 +1,8 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import javax.swing.*; -import java.awt.*; +import java.awt.Image; +import javax.swing.ImageIcon; +import javax.swing.JLabel; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsole.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsole.java index fe881046..4597d506 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsole.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsole.java @@ -1,12 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.io.File; +import javax.swing.JFrame; import me.konloch.kontainer.io.DiskWriter; import the.bytecode.club.bytecodeviewer.resources.IconResources; -import javax.swing.*; -import java.awt.*; -import java.io.File; - import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; /*************************************************************************** diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsolePrintStream.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsolePrintStream.java index 73d78463..0a502f77 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsolePrintStream.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsolePrintStream.java @@ -1,9 +1,8 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import the.bytecode.club.bytecodeviewer.Constants; - -import javax.swing.*; import java.io.PrintStream; +import javax.swing.SwingUtilities; +import the.bytecode.club.bytecodeviewer.Constants; import static the.bytecode.club.bytecodeviewer.Constants.nl; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsoleTabbed.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsoleTabbed.java index 8e19cdcb..d2b7893a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsoleTabbed.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JFrameConsoleTabbed.java @@ -1,10 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import javax.swing.JFrame; +import javax.swing.JTabbedPane; import the.bytecode.club.bytecodeviewer.resources.IconResources; -import javax.swing.*; -import java.awt.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JMenuItemIcon.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JMenuItemIcon.java index b43f960d..f23720d1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JMenuItemIcon.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JMenuItemIcon.java @@ -1,7 +1,10 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import javax.swing.*; -import java.awt.*; +import java.awt.Dimension; +import java.awt.Graphics; +import javax.swing.Icon; +import javax.swing.JMenuItem; +import javax.swing.UIManager; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JTextAreaOutputStream.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JTextAreaOutputStream.java index 6d227491..465dac8d 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JTextAreaOutputStream.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/JTextAreaOutputStream.java @@ -2,9 +2,9 @@ package the.bytecode.club.bytecodeviewer.gui.components; import java.io.Closeable; import java.io.IOException; -import javax.swing.*; import java.io.OutputStream; import java.io.PrintStream; +import javax.swing.JTextArea; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MaxWidthJLabel.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MaxWidthJLabel.java index e432f6e0..12713a7a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MaxWidthJLabel.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MaxWidthJLabel.java @@ -1,7 +1,7 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import javax.swing.*; -import java.awt.*; +import java.awt.Dimension; +import javax.swing.JLabel; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MethodsRenderer.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MethodsRenderer.java index 234d48aa..31b503d3 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MethodsRenderer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MethodsRenderer.java @@ -1,11 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import java.awt.Component; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.ListCellRenderer; import the.bytecode.club.bytecodeviewer.gui.util.BytecodeViewPanelUpdater; import the.bytecode.club.bytecodeviewer.util.MethodParser; -import javax.swing.*; -import java.awt.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MultipleChoiceDialog.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MultipleChoiceDialog.java index 56eeb4c9..f896c125 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MultipleChoiceDialog.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/MultipleChoiceDialog.java @@ -1,9 +1,9 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import javax.swing.JDialog; +import javax.swing.JOptionPane; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/RunOptions.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/RunOptions.java index 4fa450e7..0579d01d 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/RunOptions.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/RunOptions.java @@ -6,11 +6,10 @@ import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; - -import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.api.ASMResourceUtil; import the.bytecode.club.bytecodeviewer.plugin.PluginManager; import the.bytecode.club.bytecodeviewer.plugin.preinstalled.EZInjection; +import the.bytecode.club.bytecodeviewer.resources.IconResources; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SearchableJTextArea.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SearchableJTextArea.java index e731fc55..586ab755 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SearchableJTextArea.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SearchableJTextArea.java @@ -1,19 +1,25 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.GlobalHotKeys; -import the.bytecode.club.bytecodeviewer.resources.IconResources; -import the.bytecode.club.bytecodeviewer.gui.components.listeners.PressKeyListener; -import the.bytecode.club.bytecodeviewer.gui.components.listeners.ReleaseKeyListener; -import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJCheckBox; -import the.bytecode.club.bytecodeviewer.util.JTextAreaUtils; - -import javax.swing.*; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Font; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseWheelListener; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.GlobalHotKeys; +import the.bytecode.club.bytecodeviewer.gui.components.listeners.PressKeyListener; +import the.bytecode.club.bytecodeviewer.gui.components.listeners.ReleaseKeyListener; +import the.bytecode.club.bytecodeviewer.resources.IconResources; +import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; +import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJCheckBox; +import the.bytecode.club.bytecodeviewer.util.JTextAreaUtils; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SearchableRSyntaxTextArea.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SearchableRSyntaxTextArea.java index 7a73182d..c9c1aedc 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SearchableRSyntaxTextArea.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SearchableRSyntaxTextArea.java @@ -1,25 +1,31 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Font; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.MouseWheelListener; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.text.BadLocationException; import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; import org.fife.ui.rtextarea.RTextScrollPane; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.GlobalHotKeys; -import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.gui.components.listeners.PressKeyListener; import the.bytecode.club.bytecodeviewer.gui.components.listeners.ReleaseKeyListener; import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme; +import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJCheckBox; import the.bytecode.club.bytecodeviewer.util.JTextAreaUtils; -import javax.swing.*; -import javax.swing.text.BadLocationException; -import java.awt.*; -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.awt.event.MouseWheelListener; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SettingsDialog.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SettingsDialog.java index 2ef5f291..06008280 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SettingsDialog.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/SettingsDialog.java @@ -1,9 +1,15 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import javax.swing.*; -import java.awt.*; +import java.awt.Component; import java.util.ArrayList; import java.util.List; +import javax.swing.BoxLayout; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JScrollPane; import static the.bytecode.club.bytecodeviewer.Configuration.useNewSettingsDialog; @@ -95,4 +101,4 @@ public class SettingsDialog extends JScrollPane return menu.getText(); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java index 4c348673..e887f8c2 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java @@ -1,14 +1,13 @@ package the.bytecode.club.bytecodeviewer.gui.components; import com.github.weisj.darklaf.icons.ThemedSVGIcon; +import javax.swing.BorderFactory; +import javax.swing.JInternalFrame; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.Workspace; import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme; import the.bytecode.club.bytecodeviewer.resources.IconResources; -import javax.swing.BorderFactory; -import javax.swing.JInternalFrame; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * @@ -65,4 +64,4 @@ public abstract class VisibleComponent extends JInternalFrame } private static final long serialVersionUID = -6453413772343643526L; -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/WaitBusyIcon.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/WaitBusyIcon.java index 589632b0..b47a56cc 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/WaitBusyIcon.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/WaitBusyIcon.java @@ -1,9 +1,8 @@ package the.bytecode.club.bytecodeviewer.gui.components; +import javax.swing.Icon; import the.bytecode.club.bytecodeviewer.resources.IconResources; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/listeners/MouseClickedListener.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/listeners/MouseClickedListener.java index 16eb7ed5..1385f034 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/listeners/MouseClickedListener.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/listeners/MouseClickedListener.java @@ -1,6 +1,7 @@ package the.bytecode.club.bytecodeviewer.gui.components.listeners; -import java.awt.event.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/BuildContextMenuItem.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/BuildContextMenuItem.java index 371c4902..1900cceb 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/BuildContextMenuItem.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/BuildContextMenuItem.java @@ -1,11 +1,10 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu; +import javax.swing.JPopupMenu; +import javax.swing.tree.TreePath; import the.bytecode.club.bytecodeviewer.gui.resourcelist.ResourceTree; import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult; -import javax.swing.*; -import javax.swing.tree.TreePath; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/ContextMenu.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/ContextMenu.java index 6b8d96cf..3f3fe6c8 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/ContextMenu.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/ContextMenu.java @@ -1,16 +1,19 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.gui.resourcelist.ResourceTree; -import the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist.*; -import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult; -import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; - -import javax.swing.*; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JPopupMenu; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath; -import java.awt.event.ActionEvent; -import java.util.ArrayList; +import the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist.Collapse; +import the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist.Expand; +import the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist.New; +import the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist.Open; +import the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist.QuickEdit; +import the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist.QuickOpen; +import the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist.Remove; +import the.bytecode.club.bytecodeviewer.gui.resourcelist.ResourceTree; +import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -37,7 +40,7 @@ import java.util.ArrayList; public class ContextMenu { private static ContextMenu SINGLETON = new ContextMenu(); - private final ArrayList contextMenuItems = new ArrayList<>(); + private final List contextMenuItems = new ArrayList<>(); static { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Collapse.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Collapse.java index 39e99265..c550a889 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Collapse.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Collapse.java @@ -1,13 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist; +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import java.awt.event.ActionEvent; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Expand.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Expand.java index 1b1b6a9f..7a8c288f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Expand.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Expand.java @@ -1,13 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist; +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import java.awt.event.ActionEvent; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/New.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/New.java index 309bff2a..18cda870 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/New.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/New.java @@ -1,5 +1,11 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist; +import java.util.Enumeration; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.TreeNode; +import javax.swing.tree.TreePath; import org.apache.commons.io.FilenameUtils; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; @@ -9,12 +15,6 @@ import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.TreeNode; -import javax.swing.tree.TreePath; -import java.util.Enumeration; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * @@ -171,4 +171,4 @@ public class New extends ContextMenuItem FILE, DIRECTORY, } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Open.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Open.java index d2854807..e28843ac 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Open.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Open.java @@ -1,13 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist; +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import java.awt.event.ActionEvent; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/QuickEdit.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/QuickEdit.java index 2c5f9498..b5e12171 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/QuickEdit.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/QuickEdit.java @@ -1,13 +1,13 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist; +import javax.swing.JMenu; +import javax.swing.JMenuItem; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/QuickOpen.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/QuickOpen.java index 948d5587..732ea746 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/QuickOpen.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/QuickOpen.java @@ -1,13 +1,13 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist; +import javax.swing.JMenu; +import javax.swing.JMenuItem; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Remove.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Remove.java index caf330ed..1dce6332 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Remove.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/resourcelist/Remove.java @@ -1,13 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.resourcelist; +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import java.awt.event.ActionEvent; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/Open.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/Open.java index 7c79cfd3..140ef34a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/Open.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/Open.java @@ -1,13 +1,12 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.searchbox; +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import java.awt.event.ActionEvent; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/QuickEdit.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/QuickEdit.java index 6cf4de66..5446cef5 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/QuickEdit.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/QuickEdit.java @@ -1,13 +1,13 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.searchbox; +import javax.swing.JMenu; +import javax.swing.JMenuItem; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/QuickOpen.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/QuickOpen.java index c86b26ba..eeb7b777 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/QuickOpen.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/contextmenu/searchbox/QuickOpen.java @@ -1,13 +1,13 @@ package the.bytecode.club.bytecodeviewer.gui.contextmenu.searchbox; +import javax.swing.JMenu; +import javax.swing.JMenuItem; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuItem; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenuType; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditor.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditor.java index 7ba77848..73d63c50 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditor.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditor.java @@ -1,18 +1,26 @@ package the.bytecode.club.bytecodeviewer.gui.hexviewer; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; - import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.Rectangle; -import java.awt.event.*; -import javax.swing.*; +import java.awt.RenderingHints; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import javax.swing.JPanel; +import javax.swing.JScrollBar; +import javax.swing.SwingUtilities; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; /** diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditorHEX.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditorHEX.java index ddd3eae9..79511e5c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditorHEX.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/hexviewer/JHexEditorHEX.java @@ -1,7 +1,5 @@ package the.bytecode.club.bytecodeviewer.gui.hexviewer; -import the.bytecode.club.bytecodeviewer.Configuration; - import java.awt.Color; import java.awt.Dimension; import java.awt.FontMetrics; @@ -11,6 +9,7 @@ import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import javax.swing.JComponent; +import the.bytecode.club.bytecodeviewer.Configuration; /** * @author laullon diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/plugins/MaliciousCodeScannerOptions.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/plugins/MaliciousCodeScannerOptions.java index 9d21e0e6..5c56f5ae 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/plugins/MaliciousCodeScannerOptions.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/plugins/MaliciousCodeScannerOptions.java @@ -1,15 +1,17 @@ package the.bytecode.club.bytecodeviewer.gui.plugins; +import java.awt.Dimension; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFrame; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScanModule; import the.bytecode.club.bytecodeviewer.malwarescanner.util.MaliciousCodeOptions; import the.bytecode.club.bytecodeviewer.plugin.PluginManager; import the.bytecode.club.bytecodeviewer.plugin.preinstalled.MaliciousCodeScanner; - -import javax.swing.*; -import java.awt.*; -import java.util.ArrayList; +import the.bytecode.club.bytecodeviewer.resources.IconResources; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -54,7 +56,7 @@ public class MaliciousCodeScannerOptions extends JFrame setResizable(false); setTitle("Malicious Code Scanner Options"); getContentPane().setLayout(null); - ArrayList checkBoxes = new ArrayList<>(); + List checkBoxes = new ArrayList<>(); int y = 7; for(MalwareScanModule module : MalwareScanModule.values()) @@ -80,4 +82,4 @@ public class MaliciousCodeScannerOptions extends JFrame } private static final long serialVersionUID = -2662514582647810868L; -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/plugins/ReplaceStringsOptions.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/plugins/ReplaceStringsOptions.java index c01c7762..fcd9367c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/plugins/ReplaceStringsOptions.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/plugins/ReplaceStringsOptions.java @@ -6,11 +6,10 @@ import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; - import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.plugin.PluginManager; import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ReplaceStrings; +import the.bytecode.club.bytecodeviewer.resources.IconResources; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceListIconRenderer.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceListIconRenderer.java index c88e21f1..bc5a1dac 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceListIconRenderer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceListIconRenderer.java @@ -1,16 +1,18 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist; +import java.awt.Component; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.swing.ImageIcon; +import javax.swing.JTree; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.TreeNode; import org.apache.commons.io.FilenameUtils; import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.resources.ResourceType; -import javax.swing.*; -import javax.swing.tree.DefaultTreeCellRenderer; -import javax.swing.tree.TreeNode; -import java.awt.*; -import java.util.ArrayList; -import java.util.HashMap; - /** * @author http://stackoverflow.com/questions/14968005 * @author Konloch @@ -19,7 +21,7 @@ import java.util.HashMap; public class ResourceListIconRenderer extends DefaultTreeCellRenderer { //TODO the icon cache needs to be cleared on treenode removal - public static HashMap iconCache = new HashMap<>(); + public static Map iconCache = new HashMap<>(); //called every time there is a pane update @Override @@ -76,8 +78,8 @@ public class ResourceListIconRenderer extends DefaultTreeCellRenderer //folders if (node.getChildCount() > 0) { - ArrayList nodes = new ArrayList<>(); - ArrayList totalNodes = new ArrayList<>(); + List nodes = new ArrayList<>(); + List totalNodes = new ArrayList<>(); nodes.add(node); totalNodes.add(node); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceListPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceListPane.java index 64690ae8..574b1dca 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceListPane.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceListPane.java @@ -12,22 +12,27 @@ import java.awt.event.MouseEvent; import java.io.File; import java.util.Enumeration; import java.util.Map.Entry; -import javax.swing.*; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.JTextField; +import javax.swing.JTree; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; - import me.konloch.kontainer.io.DiskWriter; import org.apache.commons.io.FilenameUtils; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenu; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.importing.Import; -import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJCheckBox; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJTextField; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedVisibleComponent; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.util.FileDrop; import the.bytecode.club.bytecodeviewer.util.LazyNameUtil; import the.bytecode.club.bytecodeviewer.util.MiscUtils; @@ -501,4 +506,4 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File }); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceTree.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceTree.java index e461824d..0150ab88 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceTree.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceTree.java @@ -1,12 +1,14 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import javax.swing.JTree; +import javax.swing.tree.DefaultMutableTreeNode; import the.bytecode.club.bytecodeviewer.gui.util.StringMetricsUtil; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import javax.swing.tree.DefaultMutableTreeNode; -import java.awt.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceTreeNode.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceTreeNode.java index c30b2e50..cac6be9a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceTreeNode.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/ResourceTreeNode.java @@ -1,8 +1,8 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist; +import java.util.Comparator; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.MutableTreeNode; -import java.util.Comparator; import javax.swing.tree.TreeNode; /*************************************************************************** diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/SearchKeyAdapter.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/SearchKeyAdapter.java index ae4aceff..114261b2 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/SearchKeyAdapter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcelist/SearchKeyAdapter.java @@ -1,12 +1,11 @@ package the.bytecode.club.bytecodeviewer.gui.resourcelist; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; - -import javax.swing.tree.TreeNode; -import javax.swing.tree.TreePath; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.Enumeration; +import javax.swing.tree.TreeNode; +import javax.swing.tree.TreePath; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/PerformSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/PerformSearch.java index 0b663e2a..9790ff3c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/PerformSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/PerformSearch.java @@ -1,17 +1,14 @@ package the.bytecode.club.bytecodeviewer.gui.resourcesearch; -import org.objectweb.asm.tree.ClassNode; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.searching.BackgroundSearchThread; -import the.bytecode.club.bytecodeviewer.searching.RegexInsnFinder; -import the.bytecode.club.bytecodeviewer.searching.impl.LDCSearch; -import the.bytecode.club.bytecodeviewer.searching.impl.RegexSearch; -import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; - -import javax.swing.tree.TreePath; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; +import javax.swing.tree.TreePath; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; +import the.bytecode.club.bytecodeviewer.searching.BackgroundSearchThread; +import the.bytecode.club.bytecodeviewer.searching.RegexInsnFinder; +import the.bytecode.club.bytecodeviewer.searching.impl.RegexSearch; +import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchBoxPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchBoxPane.java index 83bf4d44..b816e0af 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchBoxPane.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourcesearch/SearchBoxPane.java @@ -6,10 +6,16 @@ import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Objects; -import javax.swing.*; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.JTree; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; - import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.contextmenu.ContextMenu; @@ -17,7 +23,11 @@ import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ResourceViewer import the.bytecode.club.bytecodeviewer.searching.BackgroundSearchThread; import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import the.bytecode.club.bytecodeviewer.translation.components.*; +import the.bytecode.club.bytecodeviewer.translation.components.TranslatedDefaultMutableTreeNode; +import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJButton; +import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJCheckBox; +import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJLabel; +import the.bytecode.club.bytecodeviewer.translation.components.TranslatedVisibleComponent; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -242,4 +252,4 @@ public class SearchBoxPane extends TranslatedVisibleComponent } private static final long serialVersionUID = -1098524689236993932L; -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/BytecodeViewPanel.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/BytecodeViewPanel.java index 65d73c24..9315fe9b 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/BytecodeViewPanel.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/BytecodeViewPanel.java @@ -1,5 +1,9 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer; +import java.awt.BorderLayout; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.compilers.Compiler; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; @@ -10,9 +14,6 @@ import the.bytecode.club.bytecodeviewer.gui.util.BytecodeViewPanelUpdater; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.JarUtils; -import javax.swing.*; -import java.awt.*; - import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** 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 3f4aef6f..2f62b63b 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 @@ -1,5 +1,14 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; +import java.util.List; +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.JMenu; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.JSeparator; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.SettingsSerializer; import the.bytecode.club.bytecodeviewer.bootloader.BootState; @@ -9,14 +18,10 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJMenu; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJRadioButtonMenuItem; -import javax.swing.*; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Enumeration; -import java.util.List; - -import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.*; +import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.BYTECODE; +import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.BYTECODE_NON_EDITABLE; +import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.JAVA; +import static the.bytecode.club.bytecodeviewer.gui.components.DecompilerViewComponent.DecompilerComponentType.JAVA_AND_BYTECODE; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabExitButton.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabExitButton.java index 6dc964ee..7b8889ab 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabExitButton.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabExitButton.java @@ -1,10 +1,15 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer; -import javax.swing.*; -import javax.swing.plaf.basic.BasicButtonUI; -import java.awt.*; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.plaf.basic.BasicButtonUI; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabRemovalEvent.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabRemovalEvent.java index a7575594..64664c48 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabRemovalEvent.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabRemovalEvent.java @@ -1,14 +1,10 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ClassViewer; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.FileViewer; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ResourceViewer; -import the.bytecode.club.bytecodeviewer.resources.Resource; - -import java.awt.*; +import java.awt.Component; import java.awt.event.ContainerEvent; import java.awt.event.ContainerListener; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ResourceViewer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabbedPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabbedPane.java index d7d305e4..d205aa7f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabbedPane.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/TabbedPane.java @@ -8,8 +8,14 @@ import java.awt.event.InputEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import javax.swing.*; - +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.gui.components.ButtonHoverAnimation; import the.bytecode.club.bytecodeviewer.gui.components.MaxWidthJLabel; @@ -252,4 +258,4 @@ public class TabbedPane extends JPanel private static final long serialVersionUID = -4774885688297538774L; -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/Workspace.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/Workspace.java index 4dc13eff..21e9f23e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/Workspace.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/Workspace.java @@ -1,21 +1,28 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.HashSet; -import javax.swing.*; - +import java.util.Set; +import javax.swing.JButton; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JTabbedPane; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ClassViewer; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.FileViewer; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ResourceViewer; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJButton; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedVisibleComponent; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import static the.bytecode.club.bytecodeviewer.Constants.BLOCK_TAB_MENU; @@ -50,7 +57,7 @@ public class Workspace extends TranslatedVisibleComponent public final JTabbedPane tabs; public final JPanel buttonPanel; public final JButton refreshClass; - public final HashSet openedTabs = new HashSet<>(); + public final Set openedTabs = new HashSet<>(); public Workspace() { @@ -253,4 +260,4 @@ public class Workspace extends TranslatedVisibleComponent } private static final long serialVersionUID = 6542337997679487946L; -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/WorkspaceRefresh.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/WorkspaceRefresh.java index 0ae729c7..68f5efb4 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/WorkspaceRefresh.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/WorkspaceRefresh.java @@ -1,12 +1,9 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ClassViewer; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.FileViewer; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ResourceViewer; - -import javax.swing.*; import java.awt.event.ActionEvent; +import javax.swing.JButton; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ResourceViewer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/WorkspaceRefreshEvent.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/WorkspaceRefreshEvent.java index 837752e8..aa198539 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/WorkspaceRefreshEvent.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/WorkspaceRefreshEvent.java @@ -1,9 +1,8 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; - import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ClassViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ClassViewer.java index a7aa3777..010af702 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ClassViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ClassViewer.java @@ -1,9 +1,5 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer; -import the.bytecode.club.bytecodeviewer.api.ASMUtil; -import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.BytecodeViewPanel; - import java.awt.BorderLayout; import java.awt.Container; import java.awt.Point; @@ -18,14 +14,15 @@ import javax.swing.JSplitPane; import javax.swing.JViewport; import javax.swing.SwingUtilities; import javax.swing.text.BadLocationException; - import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.SettingsSerializer; +import the.bytecode.club.bytecodeviewer.api.ASMUtil; +import the.bytecode.club.bytecodeviewer.decompilers.Decompiler; +import the.bytecode.club.bytecodeviewer.gui.resourceviewer.BytecodeViewPanel; import the.bytecode.club.bytecodeviewer.resources.Resource; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; -import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.MethodParser; import static the.bytecode.club.bytecodeviewer.util.MethodParser.Method; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ComponentViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ComponentViewer.java index 66a6f820..767774a0 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ComponentViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ComponentViewer.java @@ -1,11 +1,11 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer; +import java.awt.BorderLayout; +import java.awt.Component; +import javax.swing.JButton; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.resources.Resource; -import javax.swing.*; -import java.awt.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/FileViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/FileViewer.java index 73b67d33..8bafe48a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/FileViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/FileViewer.java @@ -7,7 +7,6 @@ import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; - import org.apache.commons.io.FilenameUtils; import org.imgscalr.Scalr; import the.bytecode.club.bytecodeviewer.BytecodeViewer; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ResourceViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ResourceViewer.java index 01a63f9d..e5701ddb 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ResourceViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/ResourceViewer.java @@ -1,7 +1,7 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer; -import javax.swing.*; - +import javax.swing.JButton; +import javax.swing.JPanel; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.TabbedPane; import the.bytecode.club.bytecodeviewer.resources.Resource; @@ -74,4 +74,4 @@ public abstract class ResourceViewer extends JPanel } private static final long serialVersionUID = -2965538493489119191L; -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/synchronizedscroll/MethodData.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/synchronizedscroll/MethodData.java index bc477f3a..50e49751 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/synchronizedscroll/MethodData.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/resourceviewer/viewer/synchronizedscroll/MethodData.java @@ -1,8 +1,7 @@ package the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.synchronizedscroll; -import org.objectweb.asm.Type; - import java.util.Arrays; +import org.objectweb.asm.Type; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/theme/LAFTheme.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/theme/LAFTheme.java index 601c5545..ac23509d 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/theme/LAFTheme.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/theme/LAFTheme.java @@ -1,16 +1,24 @@ package the.bytecode.club.bytecodeviewer.gui.theme; import com.github.weisj.darklaf.LafManager; -import com.github.weisj.darklaf.theme.*; +import com.github.weisj.darklaf.theme.DarculaTheme; +import com.github.weisj.darklaf.theme.HighContrastDarkTheme; +import com.github.weisj.darklaf.theme.HighContrastLightTheme; +import com.github.weisj.darklaf.theme.IntelliJTheme; +import com.github.weisj.darklaf.theme.OneDarkTheme; +import com.github.weisj.darklaf.theme.SolarizedDarkTheme; +import com.github.weisj.darklaf.theme.SolarizedLightTheme; +import java.awt.Dialog; +import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.components.SettingsDialog; import the.bytecode.club.bytecodeviewer.gui.components.VisibleComponent; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; -import java.awt.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/BytecodeViewPanelUpdater.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/BytecodeViewPanelUpdater.java index ba67d649..f19694b1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/BytecodeViewPanelUpdater.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/BytecodeViewPanelUpdater.java @@ -1,18 +1,19 @@ package the.bytecode.club.bytecodeviewer.gui.util; import java.awt.BorderLayout; -import java.awt.Font; -import java.awt.event.InputEvent; import java.util.Objects; import java.util.regex.Matcher; -import javax.swing.*; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JPanel; +import javax.swing.JViewport; +import javax.swing.SwingUtilities; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; import org.fife.ui.rsyntaxtextarea.SyntaxConstants; -import org.fife.ui.rtextarea.RTextScrollPane; import org.objectweb.asm.ClassWriter; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; @@ -373,4 +374,4 @@ public class BytecodeViewPanelUpdater implements Runnable String editable = isPanelEditable ? " - " + EDITABLE : ""; bytecodeViewPanel.textArea.getTitleHeader().setText(decompiler.getDecompilerName() + editable); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/DelayTabbedPaneThread.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/DelayTabbedPaneThread.java index afddeb61..a43fe76a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/DelayTabbedPaneThread.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/DelayTabbedPaneThread.java @@ -1,9 +1,8 @@ package the.bytecode.club.bytecodeviewer.gui.util; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.TabbedPane; - import java.awt.Color; import javax.swing.SwingUtilities; +import the.bytecode.club.bytecodeviewer.gui.resourceviewer.TabbedPane; /** * @author Konloch diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/StringMetricsUtil.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/StringMetricsUtil.java index 9f3177ef..ab78fe91 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/StringMetricsUtil.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/StringMetricsUtil.java @@ -1,6 +1,7 @@ package the.bytecode.club.bytecodeviewer.gui.util; -import java.awt.*; +import java.awt.Font; +import java.awt.Graphics2D; import java.awt.font.FontRenderContext; import java.awt.geom.Rectangle2D; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareCodeScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareCodeScanner.java index bcfac4cc..e2be9c29 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareCodeScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareCodeScanner.java @@ -1,6 +1,11 @@ package the.bytecode.club.bytecodeviewer.malwarescanner; -import org.objectweb.asm.tree.*; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.LdcInsnNode; +import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.decompilers.bytecode.InstructionPrinter; import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareScan.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareScan.java index fcc12d43..e764a04c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareScan.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareScan.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.malwarescanner; +import java.util.List; +import java.util.Set; import org.objectweb.asm.tree.ClassNode; -import java.util.ArrayList; -import java.util.HashSet; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * @@ -34,11 +33,11 @@ import java.util.HashSet; */ public class MalwareScan { - public final ArrayList classNodeList; + public final List classNodeList; public final StringBuilder sb; - public final HashSet scanOptions; + public final Set scanOptions; - public MalwareScan(ArrayList classNodeList, StringBuilder sb, HashSet scanOptions) + public MalwareScan(List classNodeList, StringBuilder sb, Set scanOptions) { this.classNodeList = classNodeList; this.sb = sb; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareScanModule.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareScanModule.java index 6adadcd3..1c0068f1 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareScanModule.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/MalwareScanModule.java @@ -2,7 +2,13 @@ package the.bytecode.club.bytecodeviewer.malwarescanner; import org.apache.commons.text.WordUtils; import org.objectweb.asm.tree.ClassNode; -import the.bytecode.club.bytecodeviewer.malwarescanner.impl.*; +import the.bytecode.club.bytecodeviewer.malwarescanner.impl.AWTRobotScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.impl.JavaIOScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.impl.JavaNetScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.impl.JavaRuntimeScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.impl.NullSecurityManagerScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.impl.ReflectionScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.impl.URLScanner; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/AWTRobotScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/AWTRobotScanner.java index e46c563b..4391d798 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/AWTRobotScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/AWTRobotScanner.java @@ -1,6 +1,10 @@ package the.bytecode.club.bytecodeviewer.malwarescanner.impl; -import org.objectweb.asm.tree.*; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareCodeScanner; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; @@ -59,4 +63,4 @@ public class AWTRobotScanner extends MalwareCodeScanner foundMethod(scan, instructionToString(instruction) + " at " + methodToString(cn, method) + nl); } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaIOScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaIOScanner.java index f1106d49..4cf9250e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaIOScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaIOScanner.java @@ -1,8 +1,12 @@ package the.bytecode.club.bytecodeviewer.malwarescanner.impl; -import org.objectweb.asm.tree.*; -import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareCodeScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; import static the.bytecode.club.bytecodeviewer.Constants.nl; @@ -47,4 +51,4 @@ public class JavaIOScanner extends MalwareCodeScanner foundMethod(scan, instructionToString(instruction) + " at " + methodToString(cn, method) + nl); } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaNetScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaNetScanner.java index 2dd10b05..79614d89 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaNetScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaNetScanner.java @@ -1,8 +1,12 @@ package the.bytecode.club.bytecodeviewer.malwarescanner.impl; -import org.objectweb.asm.tree.*; -import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareCodeScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; import static the.bytecode.club.bytecodeviewer.Constants.nl; @@ -48,4 +52,4 @@ public class JavaNetScanner extends MalwareCodeScanner foundMethod(scan, instructionToString(instruction) + " at " + methodToString(cn, method) + nl); } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaRuntimeScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaRuntimeScanner.java index 2fad7cf4..d8c6caab 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaRuntimeScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/JavaRuntimeScanner.java @@ -1,8 +1,12 @@ package the.bytecode.club.bytecodeviewer.malwarescanner.impl; -import org.objectweb.asm.tree.*; -import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareCodeScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; import static the.bytecode.club.bytecodeviewer.Constants.nl; @@ -59,4 +63,4 @@ public class JavaRuntimeScanner extends MalwareCodeScanner foundMethod(scan, instructionToString(instruction) + " at " + methodToString(cn, method) + nl); } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/NullSecurityManagerScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/NullSecurityManagerScanner.java index 96becaf4..d6a7e0f9 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/NullSecurityManagerScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/NullSecurityManagerScanner.java @@ -2,7 +2,11 @@ package the.bytecode.club.bytecodeviewer.malwarescanner.impl; import com.strobel.assembler.ir.OpCode; import org.objectweb.asm.Opcodes; -import org.objectweb.asm.tree.*; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareCodeScanner; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; @@ -70,4 +74,4 @@ public class NullSecurityManagerScanner extends MalwareCodeScanner lastInstruction = 0; super.scanningClass(scan, cn); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/ReflectionScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/ReflectionScanner.java index 0711588f..33e1482a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/ReflectionScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/ReflectionScanner.java @@ -1,8 +1,12 @@ package the.bytecode.club.bytecodeviewer.malwarescanner.impl; -import org.objectweb.asm.tree.*; -import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareCodeScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; import static the.bytecode.club.bytecodeviewer.Constants.nl; @@ -50,4 +54,4 @@ public class ReflectionScanner extends MalwareCodeScanner foundMethod(scan, instructionToString(instruction) + " at " + methodToString(cn, method) + nl); } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/URLScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/URLScanner.java index c98da2d1..647a6984 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/URLScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/impl/URLScanner.java @@ -1,11 +1,13 @@ package the.bytecode.club.bytecodeviewer.malwarescanner.impl; -import org.objectweb.asm.tree.*; -import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; -import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareCodeScanner; -import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; - import java.util.regex.Pattern; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodNode; +import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareCodeScanner; +import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScan; +import the.bytecode.club.bytecodeviewer.malwarescanner.util.SearchableString; import static the.bytecode.club.bytecodeviewer.Constants.nl; @@ -64,4 +66,4 @@ public class URLScanner extends MalwareCodeScanner @Override public void scanMethodInstruction(MalwareScan scan, ClassNode cn, MethodNode method, AbstractInsnNode instruction) { } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/util/MaliciousCodeOptions.java b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/util/MaliciousCodeOptions.java index eec2e5ca..3ecc7fe4 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/util/MaliciousCodeOptions.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/malwarescanner/util/MaliciousCodeOptions.java @@ -1,9 +1,8 @@ package the.bytecode.club.bytecodeviewer.malwarescanner.util; +import javax.swing.JCheckBox; import the.bytecode.club.bytecodeviewer.malwarescanner.MalwareScanModule; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/obfuscators/JavaObfuscator.java b/src/main/java/the/bytecode/club/bytecodeviewer/obfuscators/JavaObfuscator.java index 99c51f21..31ba7c03 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/obfuscators/JavaObfuscator.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/obfuscators/JavaObfuscator.java @@ -1,6 +1,7 @@ package the.bytecode.club.bytecodeviewer.obfuscators; import java.util.ArrayList; +import java.util.List; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.util.MiscUtils; @@ -52,7 +53,7 @@ public abstract class JavaObfuscator extends Thread { public static int MAX_STRING_LENGTH = 25; public static int MIN_STRING_LENGTH = 5; - private final ArrayList names = new ArrayList<>(); + private final List names = new ArrayList<>(); protected String generateUniqueName(int length) { boolean found = false; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java index 24174ccd..5c450e04 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginManager.java @@ -1,8 +1,11 @@ package the.bytecode.club.bytecodeviewer.plugin; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; import javax.swing.filechooser.FileFilter; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; @@ -11,7 +14,12 @@ import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.api.PluginConsole; import the.bytecode.club.bytecodeviewer.gui.components.JFrameConsoleTabbed; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ComponentViewer; -import the.bytecode.club.bytecodeviewer.plugin.strategies.*; +import the.bytecode.club.bytecodeviewer.plugin.strategies.CompiledJavaPluginLaunchStrategy; +import the.bytecode.club.bytecodeviewer.plugin.strategies.GroovyPluginLaunchStrategy; +import the.bytecode.club.bytecodeviewer.plugin.strategies.JavaPluginLaunchStrategy; +import the.bytecode.club.bytecodeviewer.plugin.strategies.JavascriptPluginLaunchStrategy; +import the.bytecode.club.bytecodeviewer.plugin.strategies.PythonPluginLaunchStrategy; +import the.bytecode.club.bytecodeviewer.plugin.strategies.RubyPluginLaunchStrategy; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.MiscUtils; @@ -56,7 +64,7 @@ public final class PluginManager private static Plugin activePlugin; private static JFrameConsoleTabbed activeTabbedConsole; private static JFrameConsoleTabbed activeTabbedException; - private static HashMap exceptionTabs = new HashMap<>(); + private static final Map exceptionTabs = new HashMap<>(); private static int consoleCount = 0; private static int exceptionCount = 0; private static int errorCounter = 1; @@ -230,4 +238,4 @@ public final class PluginManager return TranslatedStrings.SELECT_EXTERNAL_PLUGIN_DESCRIPTION.toString(); } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginTemplate.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginTemplate.java index 97d815af..783cde2b 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginTemplate.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginTemplate.java @@ -1,11 +1,10 @@ package the.bytecode.club.bytecodeviewer.plugin; +import java.io.IOException; import org.apache.commons.io.FilenameUtils; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.resources.IconResources; -import java.io.IOException; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java index c2f982c0..daa82df2 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java @@ -1,14 +1,26 @@ package the.bytecode.club.bytecodeviewer.plugin; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.io.File; +import java.io.IOException; +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; import me.konloch.kontainer.io.DiskReader; import me.konloch.kontainer.io.DiskWriter; import org.apache.commons.compress.utils.FileNameUtils; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ComponentViewer; -import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; import the.bytecode.club.bytecodeviewer.gui.components.SearchableRSyntaxTextArea; +import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ComponentViewer; +import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJMenu; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJMenuItem; @@ -16,12 +28,6 @@ import the.bytecode.club.bytecodeviewer.util.DialogUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; import the.bytecode.club.bytecodeviewer.util.SyntaxLanguage; -import javax.swing.*; -import javax.swing.border.LineBorder; -import java.awt.*; -import java.io.File; -import java.io.IOException; - import static the.bytecode.club.bytecodeviewer.Constants.fs; import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; import static the.bytecode.club.bytecodeviewer.Settings.addRecentPlugin; @@ -254,4 +260,4 @@ public class PluginWriter extends JFrame savePath = file; setPluginName(file.getName()); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/AllatoriStringDecrypter.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/AllatoriStringDecrypter.java index d8f1899a..1dcd5b2d 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/AllatoriStringDecrypter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/AllatoriStringDecrypter.java @@ -1,19 +1,29 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; -import java.awt.*; +import java.awt.Dimension; import java.io.IOException; import java.lang.reflect.Method; -import java.util.ArrayList; - -import org.objectweb.asm.tree.*; +import java.util.List; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JTextField; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.InvokeDynamicInsnNode; +import org.objectweb.asm.tree.LdcInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Constants; -import the.bytecode.club.bytecodeviewer.resources.IconResources; -import the.bytecode.club.bytecodeviewer.api.*; +import the.bytecode.club.bytecodeviewer.api.ASMUtil; +import the.bytecode.club.bytecodeviewer.api.BCV; +import the.bytecode.club.bytecodeviewer.api.Plugin; +import the.bytecode.club.bytecodeviewer.api.PluginConsole; import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog; import the.bytecode.club.bytecodeviewer.plugin.PluginManager; - -import javax.swing.*; +import the.bytecode.club.bytecodeviewer.resources.IconResources; import static the.bytecode.club.bytecodeviewer.Constants.nl; @@ -51,7 +61,7 @@ public class AllatoriStringDecrypter extends Plugin public AllatoriStringDecrypter(String className) {this.className = className;} @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { PluginConsole frame = new PluginConsole("Allatori String Decrypter"); @@ -274,7 +284,7 @@ public class AllatoriStringDecrypter extends Plugin public static class AllatoriStringDecrypterOptions extends Plugin { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { new AllatoriStringDecrypterOptionsFrame().setVisible(true); } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ChangeClassFileVersions.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ChangeClassFileVersions.java index ebc97058..86bccc19 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ChangeClassFileVersions.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ChangeClassFileVersions.java @@ -1,12 +1,9 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; +import java.util.List; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.Plugin; -import the.bytecode.club.bytecodeviewer.api.PluginConsole; - -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; /** * As long as there are no new opcodes or API changes you can use this plugin to downgrade compiled code @@ -21,7 +18,7 @@ import java.util.ArrayList; public class ChangeClassFileVersions extends Plugin { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { //prompt dialog for version number // TODO: include a little diagram of what JDK is which number @@ -39,4 +36,4 @@ public class ChangeClassFileVersions extends Plugin //alert the changes to the user BytecodeViewer.showMessage("Set all of the class versions to " + newVersion); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/CodeSequenceDiagram.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/CodeSequenceDiagram.java index d33c9ed4..0f8afaf6 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/CodeSequenceDiagram.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/CodeSequenceDiagram.java @@ -5,7 +5,7 @@ import com.mxgraph.view.mxGraph; import java.awt.Font; import java.awt.font.FontRenderContext; import java.awt.geom.AffineTransform; -import java.util.ArrayList; +import java.util.List; import javax.swing.JFrame; import javax.swing.UIManager; import org.objectweb.asm.tree.AbstractInsnNode; @@ -13,9 +13,9 @@ import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.plugin.PluginManager; +import the.bytecode.club.bytecodeviewer.resources.IconResources; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; /*************************************************************************** @@ -50,7 +50,7 @@ public class CodeSequenceDiagram extends Plugin } @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { if (!BytecodeViewer.isActiveResourceClass()) { @@ -116,4 +116,4 @@ public class CodeSequenceDiagram extends Plugin frame.getContentPane().add(graphComponent); frame.setVisible(true); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/EZInjection.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/EZInjection.java index 9bc99fd4..9b8bce85 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/EZInjection.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/EZInjection.java @@ -4,6 +4,7 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.List; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldNode; @@ -17,7 +18,7 @@ import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.api.PluginConsole; import the.bytecode.club.bytecodeviewer.gui.plugins.GraphicalReflectionKit; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -49,7 +50,7 @@ import static the.bytecode.club.bytecodeviewer.Constants.*; public class EZInjection extends Plugin { - public static ArrayList hookArray = new ArrayList<>(); + public static List hookArray = new ArrayList<>(); private static final String version = "1.0"; private final boolean accessModifiers; private final boolean injectHooks; @@ -137,7 +138,7 @@ public class EZInjection extends Plugin } @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { if(console) new PluginConsole("EZ Injection v" + version); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/MaliciousCodeScanner.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/MaliciousCodeScanner.java index 54e7b69d..4e4b901f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/MaliciousCodeScanner.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/MaliciousCodeScanner.java @@ -1,9 +1,8 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; -import java.util.ArrayList; import java.util.HashSet; import java.util.List; - +import java.util.Set; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.api.PluginConsole; @@ -49,12 +48,12 @@ public class MaliciousCodeScanner extends Plugin } @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { PluginConsole frame = new PluginConsole("Malicious Code Scanner"); StringBuilder sb = new StringBuilder(); - HashSet scanOptions = new HashSet<>(); + Set scanOptions = new HashSet<>(); for(MaliciousCodeOptions option : options) if(option.getCheckBox().isSelected()) @@ -69,4 +68,4 @@ public class MaliciousCodeScanner extends Plugin frame.appendText(sb.toString()); frame.setVisible(true); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ReplaceStrings.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ReplaceStrings.java index d40e4175..5fce5ce8 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ReplaceStrings.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ReplaceStrings.java @@ -1,6 +1,6 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; -import java.util.ArrayList; +import java.util.List; import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldNode; @@ -51,7 +51,7 @@ public class ReplaceStrings extends Plugin } @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { frame = new PluginConsole("Replace Strings"); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ShowAllStrings.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ShowAllStrings.java index cc1f2cc4..49c7708e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ShowAllStrings.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ShowAllStrings.java @@ -1,19 +1,16 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; -import java.util.ArrayList; +import java.util.List; import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldNode; import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.LdcInsnNode; import org.objectweb.asm.tree.MethodNode; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.api.PluginConsole; -import javax.swing.*; - -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -42,7 +39,7 @@ import static the.bytecode.club.bytecodeviewer.Constants.*; public class ShowAllStrings extends Plugin { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { PluginConsole frame = new PluginConsole("Show All Strings"); StringBuilder sb = new StringBuilder(); @@ -101,4 +98,4 @@ public class ShowAllStrings extends Plugin frame.setText(sb.toString()); frame.setVisible(true); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ShowMainMethods.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ShowMainMethods.java index e8f2c327..de4a58c6 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ShowMainMethods.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ShowMainMethods.java @@ -1,6 +1,6 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; -import java.util.ArrayList; +import java.util.List; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.MethodNode; @@ -37,7 +37,7 @@ public class ShowMainMethods extends Plugin private static final int PUBLIC_STATIC = Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC; @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { PluginConsole frame = new PluginConsole("Show Main Methods"); StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/StackFramesRemover.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/StackFramesRemover.java index 4fb807ef..b69d4cf2 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/StackFramesRemover.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/StackFramesRemover.java @@ -1,6 +1,6 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; -import java.util.ArrayList; +import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.ClassNode; @@ -12,7 +12,7 @@ import the.bytecode.club.bytecodeviewer.api.PluginConsole; public class StackFramesRemover extends Plugin { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { AtomicInteger counter = new AtomicInteger(); PluginConsole frame = new PluginConsole("StackFrames Remover"); @@ -34,4 +34,4 @@ public class StackFramesRemover extends Plugin frame.appendText(String.format("Removed %s stackframes.", counter)); frame.setVisible(true); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ViewAPKAndroidPermissions.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ViewAPKAndroidPermissions.java index f22f9ecd..ed7aca4a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ViewAPKAndroidPermissions.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ViewAPKAndroidPermissions.java @@ -1,13 +1,11 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; +import java.nio.charset.StandardCharsets; +import java.util.List; import org.objectweb.asm.tree.ClassNode; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.api.PluginConsole; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; - /** * @author Konloch * @since 07/11/2021 @@ -15,7 +13,7 @@ import java.util.ArrayList; public class ViewAPKAndroidPermissions extends Plugin { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { PluginConsole frame = new PluginConsole("Android Permissions"); frame.setVisible(true); @@ -48,4 +46,4 @@ public class ViewAPKAndroidPermissions extends Plugin else frame.appendText("Enable Settings>Decode APK Resources!"); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ViewManifest.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ViewManifest.java index 2c34fca3..cba60f8e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ViewManifest.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ViewManifest.java @@ -1,13 +1,11 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; +import java.nio.charset.StandardCharsets; +import java.util.List; import org.objectweb.asm.tree.ClassNode; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.api.PluginConsole; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; - /** * @author Konloch * @since 07/11/2021 @@ -15,7 +13,7 @@ import java.util.ArrayList; public class ViewManifest extends Plugin { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { PluginConsole frame = new PluginConsole("View Manifest"); frame.setVisible(true); @@ -45,4 +43,4 @@ public class ViewManifest extends Plugin if(frame.getTextArea().getText().isEmpty()) frame.appendText("Manifest not found!"); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZKMStringDecrypter.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZKMStringDecrypter.java index 59f320ce..e218c82c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZKMStringDecrypter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZKMStringDecrypter.java @@ -1,6 +1,6 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; -import java.util.ArrayList; +import java.util.List; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.Plugin; @@ -32,8 +32,8 @@ import the.bytecode.club.bytecodeviewer.api.Plugin; public class ZKMStringDecrypter extends Plugin { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { BytecodeViewer.showMessage("This is a planned feature."); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZStringArrayDecrypter.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZStringArrayDecrypter.java index e33b1819..790aaa1b 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZStringArrayDecrypter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZStringArrayDecrypter.java @@ -2,9 +2,8 @@ package the.bytecode.club.bytecodeviewer.plugin.preinstalled; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.ArrayList; +import java.util.List; import java.util.Objects; - import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.BCV; @@ -12,7 +11,7 @@ import the.bytecode.club.bytecodeviewer.api.Plugin; import the.bytecode.club.bytecodeviewer.api.PluginConsole; import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -42,7 +41,7 @@ import static the.bytecode.club.bytecodeviewer.Constants.*; public class ZStringArrayDecrypter extends Plugin { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { PluginConsole gui = new PluginConsole("ZStringArray Decrypter"); StringBuilder out = new StringBuilder(); @@ -95,4 +94,4 @@ public class ZStringArrayDecrypter extends Plugin gui.setVisible(true); } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java index 373f5930..dbc390c5 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/strategies/JavascriptPluginLaunchStrategy.java @@ -1,16 +1,20 @@ package the.bytecode.club.bytecodeviewer.plugin.strategies; +import java.io.File; +import java.io.FileReader; +import java.io.Reader; +import java.util.List; +import javax.script.Bindings; +import javax.script.Invocable; +import javax.script.ScriptContext; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; 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 javax.script.*; -import java.io.File; -import java.io.FileReader; -import java.io.Reader; -import java.util.ArrayList; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * @@ -69,7 +73,7 @@ public class JavascriptPluginLaunchStrategy implements PluginLaunchStrategy return new Plugin() { @Override - public void execute(ArrayList classNodeList) + public void execute(List classNodeList) { try { @@ -86,4 +90,4 @@ public class JavascriptPluginLaunchStrategy implements PluginLaunchStrategy } }; } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ExternalResources.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ExternalResources.java index 83c56e7c..21f9a2e0 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ExternalResources.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ExternalResources.java @@ -1,6 +1,10 @@ package the.bytecode.club.bytecodeviewer.resources; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.SettingsSerializer; @@ -8,14 +12,12 @@ import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; import the.bytecode.club.bytecodeviewer.util.DialogUtils; import the.bytecode.club.bytecodeviewer.util.JRTExtractor; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.RT_JAR; +import static the.bytecode.club.bytecodeviewer.Constants.RT_JAR_DUMPED; +import static the.bytecode.club.bytecodeviewer.Constants.libsDirectory; +import static the.bytecode.club.bytecodeviewer.Constants.nl; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/IconResources.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/IconResources.java index f40d9d03..7e2a89a6 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/IconResources.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/IconResources.java @@ -1,6 +1,8 @@ package the.bytecode.club.bytecodeviewer.resources; -import java.awt.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -11,8 +13,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; import javax.imageio.ImageIO; -import javax.swing.*; - +import javax.swing.Icon; +import javax.swing.ImageIcon; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; import org.imgscalr.Scalr; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainer.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainer.java index ceb25585..21cabe57 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainer.java @@ -2,8 +2,7 @@ package the.bytecode.club.bytecodeviewer.resources; import java.io.File; import java.util.LinkedHashMap; - -import org.apache.commons.compress.compressors.FileNameUtil; +import java.util.Map; import org.apache.commons.io.FilenameUtils; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.api.ASMUtil; @@ -42,9 +41,9 @@ public class ResourceContainer public File APKToolContents; public ResourceTreeNode treeNode; - public LinkedHashMap resourceFiles = new LinkedHashMap<>(); - public LinkedHashMap resourceClassBytes = new LinkedHashMap<>(); - public LinkedHashMap resourceClasses = new LinkedHashMap<>(); + public Map resourceFiles = new LinkedHashMap<>(); + public Map resourceClassBytes = new LinkedHashMap<>(); + public Map resourceClasses = new LinkedHashMap<>(); public ResourceContainer(File f) { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainerImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainerImporter.java index ae14a3dc..f9f0fe60 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainerImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainerImporter.java @@ -1,5 +1,11 @@ package the.bytecode.club.bytecodeviewer.resources; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Enumeration; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipFile; import org.apache.commons.io.FilenameUtils; @@ -7,11 +13,6 @@ import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.api.ASMUtil; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import java.io.*; -import java.util.Enumeration; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceDecompiling.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceDecompiling.java index a26f10b4..eabf38f2 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceDecompiling.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceDecompiling.java @@ -1,5 +1,10 @@ package the.bytecode.club.bytecodeviewer.resources; +import java.io.File; +import java.util.Objects; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; import me.konloch.kontainer.io.DiskWriter; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.ClassNode; @@ -12,10 +17,6 @@ import the.bytecode.club.bytecodeviewer.util.DialogUtils; import the.bytecode.club.bytecodeviewer.util.JarUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -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; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceType.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceType.java index 0a7ce879..bb66f36c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceType.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceType.java @@ -1,7 +1,8 @@ package the.bytecode.club.bytecodeviewer.resources; -import javax.swing.*; import java.util.HashMap; +import java.util.Map; +import javax.swing.ImageIcon; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -47,9 +48,9 @@ public enum ResourceType SH_FILE(IconResources.shIcon, "sh", "bash"), ; - public static final HashMap extensionMap = new HashMap<>(); - public static final HashMap imageExtensionMap = new HashMap<>(); - public static final HashMap supportedBCVExtensionMap = new HashMap<>(); + public static final Map extensionMap = new HashMap<>(); + public static final Map imageExtensionMap = new HashMap<>(); + public static final Map supportedBCVExtensionMap = new HashMap<>(); private final ImageIcon icon; private final String[] extensions; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/APKExport.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/APKExport.java index 47fb8647..edb9ccca 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/APKExport.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/APKExport.java @@ -1,18 +1,20 @@ package the.bytecode.club.bytecodeviewer.resources.exporting.impl; +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.swing.JFileChooser; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.exporting.Exporter; -import the.bytecode.club.bytecodeviewer.util.*; - -import javax.swing.*; -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +import the.bytecode.club.bytecodeviewer.util.APKTool; +import the.bytecode.club.bytecodeviewer.util.DialogUtils; +import the.bytecode.club.bytecodeviewer.util.JarUtils; +import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.fs; import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/DexExport.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/DexExport.java index 7dfd3259..c4e55dcd 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/DexExport.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/DexExport.java @@ -1,5 +1,7 @@ package the.bytecode.club.bytecodeviewer.resources.exporting.impl; +import java.io.File; +import javax.swing.JFileChooser; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; @@ -9,9 +11,6 @@ import the.bytecode.club.bytecodeviewer.util.DialogUtils; import the.bytecode.club.bytecodeviewer.util.JarUtils; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import javax.swing.*; -import java.io.File; - import static the.bytecode.club.bytecodeviewer.Constants.fs; import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/RunnableJarExporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/RunnableJarExporter.java index 572170c4..501f49ac 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/RunnableJarExporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/RunnableJarExporter.java @@ -1,5 +1,7 @@ package the.bytecode.club.bytecodeviewer.resources.exporting.impl; +import java.io.File; +import javax.swing.JFileChooser; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.components.ExportJar; @@ -7,9 +9,6 @@ import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; import the.bytecode.club.bytecodeviewer.resources.exporting.Exporter; import the.bytecode.club.bytecodeviewer.util.DialogUtils; -import javax.swing.*; -import java.io.File; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/ZipExport.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/ZipExport.java index 8b07dc5d..d4a2dbb7 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/ZipExport.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/exporting/impl/ZipExport.java @@ -1,5 +1,7 @@ package the.bytecode.club.bytecodeviewer.resources.exporting.impl; +import java.io.File; +import javax.swing.JFileChooser; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; @@ -7,9 +9,6 @@ import the.bytecode.club.bytecodeviewer.resources.exporting.Exporter; import the.bytecode.club.bytecodeviewer.util.DialogUtils; import the.bytecode.club.bytecodeviewer.util.JarUtils; -import javax.swing.*; -import java.io.File; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/Import.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/Import.java index 1d5ff0f4..27bd4986 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/Import.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/Import.java @@ -1,8 +1,13 @@ package the.bytecode.club.bytecodeviewer.resources.importing; -import the.bytecode.club.bytecodeviewer.resources.importing.impl.*; - import java.util.HashMap; +import the.bytecode.club.bytecodeviewer.resources.importing.impl.APKResourceImporter; +import the.bytecode.club.bytecodeviewer.resources.importing.impl.ClassResourceImporter; +import the.bytecode.club.bytecodeviewer.resources.importing.impl.DEXResourceImporter; +import the.bytecode.club.bytecodeviewer.resources.importing.impl.DirectoryResourceImporter; +import the.bytecode.club.bytecodeviewer.resources.importing.impl.FileResourceImporter; +import the.bytecode.club.bytecodeviewer.resources.importing.impl.XAPKResourceImporter; +import the.bytecode.club.bytecodeviewer.resources.importing.impl.ZipResourceImporter; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/ImportResource.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/ImportResource.java index 87b192c5..ca2f3d78 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/ImportResource.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/ImportResource.java @@ -1,12 +1,10 @@ package the.bytecode.club.bytecodeviewer.resources.importing; +import java.io.File; import org.apache.commons.io.FilenameUtils; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Settings; -import javax.swing.*; -import java.io.File; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java index 6e12e8db..415191fc 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java @@ -1,14 +1,16 @@ package the.bytecode.club.bytecodeviewer.resources.importing.impl; +import java.io.File; import org.apache.commons.io.FileUtils; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainerImporter; import the.bytecode.club.bytecodeviewer.resources.importing.Importer; -import the.bytecode.club.bytecodeviewer.util.*; - -import java.io.File; -import java.util.Objects; +import the.bytecode.club.bytecodeviewer.util.APKTool; +import the.bytecode.club.bytecodeviewer.util.Dex2Jar; +import the.bytecode.club.bytecodeviewer.util.Enjarify; +import the.bytecode.club.bytecodeviewer.util.JarUtils; +import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.fs; import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; @@ -37,6 +39,7 @@ import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; */ public class APKResourceImporter implements Importer { + @Override public void open(File file) throws Exception { @@ -45,7 +48,7 @@ public class APKResourceImporter implements Importer ResourceContainer container = new ResourceContainer(tempCopy, file.getName()); - //APK Resource Decoding Here + // APK Resource Decoding Here if (BytecodeViewer.viewer.decodeAPKResources.isSelected()) { File decodedResources = new File(tempDirectory + fs + MiscUtils.randomString(32) + ".apk"); @@ -53,7 +56,7 @@ public class APKResourceImporter implements Importer container.resourceFiles = JarUtils.loadResources(decodedResources); } - Objects.requireNonNull(container.resourceFiles).putAll(JarUtils.loadResources(tempCopy)); //copy and rename + container.resourceFiles.putAll(JarUtils.loadResources(tempCopy)); // copy and rename // to prevent unicode filenames String name = MiscUtils.getRandomizedName() + ".jar"; @@ -64,10 +67,11 @@ public class APKResourceImporter implements Importer else if (BytecodeViewer.viewer.apkConversionGroup.isSelected(BytecodeViewer.viewer.apkConversionEnjarify.getModel())) Enjarify.apk2Jar(tempCopy, output); - //create a new resource importer and copy the contents from it + // create a new resource importer and copy the contents from it container.copy(new ResourceContainerImporter( new ResourceContainer(output)).importAsZip().getContainer()); BytecodeViewer.addResourceContainer(container); } + } diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ClassResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ClassResourceImporter.java index 57cd1295..15f2306a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ClassResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ClassResourceImporter.java @@ -1,15 +1,14 @@ package the.bytecode.club.bytecodeviewer.resources.importing.impl; -import org.apache.commons.io.FilenameUtils; -import org.objectweb.asm.tree.ClassNode; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.resources.importing.Importer; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; -import the.bytecode.club.bytecodeviewer.util.JarUtils; -import the.bytecode.club.bytecodeviewer.util.MiscUtils; - import java.io.File; import java.io.FileInputStream; +import org.apache.commons.io.FilenameUtils; +import org.objectweb.asm.tree.ClassNode; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; +import the.bytecode.club.bytecodeviewer.resources.importing.Importer; +import the.bytecode.club.bytecodeviewer.util.JarUtils; +import the.bytecode.club.bytecodeviewer.util.MiscUtils; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DEXResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DEXResourceImporter.java index f8392bb1..1d5b77ff 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DEXResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DEXResourceImporter.java @@ -1,13 +1,14 @@ package the.bytecode.club.bytecodeviewer.resources.importing.impl; +import java.io.File; import org.apache.commons.io.FileUtils; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainerImporter; import the.bytecode.club.bytecodeviewer.resources.importing.Importer; -import the.bytecode.club.bytecodeviewer.util.*; - -import java.io.File; +import the.bytecode.club.bytecodeviewer.util.Dex2Jar; +import the.bytecode.club.bytecodeviewer.util.Enjarify; +import the.bytecode.club.bytecodeviewer.util.MiscUtils; import static the.bytecode.club.bytecodeviewer.Constants.fs; import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DirectoryResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DirectoryResourceImporter.java index bb9ff166..3c2f1a90 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DirectoryResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/DirectoryResourceImporter.java @@ -1,19 +1,20 @@ package the.bytecode.club.bytecodeviewer.resources.importing.impl; -import org.apache.commons.io.FilenameUtils; -import org.objectweb.asm.tree.ClassNode; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.resources.importing.ImportResource; -import the.bytecode.club.bytecodeviewer.resources.importing.Importer; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; -import the.bytecode.club.bytecodeviewer.util.JarUtils; -import the.bytecode.club.bytecodeviewer.util.MiscUtils; - import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.io.FilenameUtils; +import org.objectweb.asm.tree.ClassNode; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; +import the.bytecode.club.bytecodeviewer.resources.importing.ImportResource; +import the.bytecode.club.bytecodeviewer.resources.importing.Importer; +import the.bytecode.club.bytecodeviewer.util.JarUtils; +import the.bytecode.club.bytecodeviewer.util.MiscUtils; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -43,11 +44,11 @@ public class DirectoryResourceImporter implements Importer public void open(File file) throws Exception { ResourceContainer container = new ResourceContainer(file); - LinkedHashMap allDirectoryFiles = new LinkedHashMap<>(); - LinkedHashMap allDirectoryClasses = new LinkedHashMap<>(); + Map allDirectoryFiles = new LinkedHashMap<>(); + Map allDirectoryClasses = new LinkedHashMap<>(); boolean finished = false; - ArrayList totalFiles = new ArrayList<>(); + List totalFiles = new ArrayList<>(); totalFiles.add(file); String dir = file.getAbsolutePath(); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/FileResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/FileResourceImporter.java index 3c216984..006b9453 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/FileResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/FileResourceImporter.java @@ -1,11 +1,10 @@ package the.bytecode.club.bytecodeviewer.resources.importing.impl; +import java.io.File; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.resources.importing.Importer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainerImporter; - -import java.io.File; +import the.bytecode.club.bytecodeviewer.resources.importing.Importer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/XAPKResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/XAPKResourceImporter.java index 6e150c6b..109c6e98 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/XAPKResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/XAPKResourceImporter.java @@ -1,20 +1,23 @@ package the.bytecode.club.bytecodeviewer.resources.importing.impl; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Enumeration; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; import me.konloch.kontainer.io.DiskWriter; import org.apache.commons.io.IOUtils; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.importing.Import; import the.bytecode.club.bytecodeviewer.resources.importing.Importer; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.util.MiscUtils; -import java.io.*; -import java.util.Enumeration; -import java.util.LinkedHashMap; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - import static the.bytecode.club.bytecodeviewer.Constants.fs; import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; @@ -48,7 +51,7 @@ public class XAPKResourceImporter implements Importer public void open(File file) throws Exception { ResourceContainer container = new ResourceContainer(file); - LinkedHashMap allDirectoryFiles = new LinkedHashMap<>(); + Map allDirectoryFiles = new LinkedHashMap<>(); Configuration.silenceExceptionGUI++; //turn exceptions off try (ZipFile zipFile = new ZipFile(file)) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ZipResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ZipResourceImporter.java index 5d34cd6d..d9c11eb4 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ZipResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/ZipResourceImporter.java @@ -1,11 +1,10 @@ package the.bytecode.club.bytecodeviewer.resources.importing.impl; +import java.io.File; import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.resources.importing.Importer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainerImporter; - -import java.io.File; +import the.bytecode.club.bytecodeviewer.resources.importing.Importer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/LDCSearchTreeNodeResult.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/LDCSearchTreeNodeResult.java index d57bdd8e..67f36d16 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/LDCSearchTreeNodeResult.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/LDCSearchTreeNodeResult.java @@ -1,12 +1,11 @@ package the.bytecode.club.bytecodeviewer.searching; +import javax.swing.tree.DefaultMutableTreeNode; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldNode; import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; -import javax.swing.tree.DefaultMutableTreeNode; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/SearchPanel.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/SearchPanel.java index 00eed3fb..28cd030e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/SearchPanel.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/SearchPanel.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.searching; +import javax.swing.JPanel; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/FieldCallSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/FieldCallSearch.java index 5ab3c0d6..74a59e02 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/FieldCallSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/FieldCallSearch.java @@ -1,7 +1,6 @@ package the.bytecode.club.bytecodeviewer.searching.impl; import java.util.Iterator; - import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldInsnNode; @@ -91,4 +90,4 @@ public class FieldCallSearch extends MethodCallSearch } } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java index 7c9cdd34..42e7b62e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/LDCSearch.java @@ -4,7 +4,6 @@ import java.awt.GridLayout; import java.util.Iterator; import javax.swing.JPanel; import javax.swing.JTextField; - import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.FieldNode; @@ -12,12 +11,12 @@ import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.LdcInsnNode; import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.searching.EnterKeyEvent; import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult; import the.bytecode.club.bytecodeviewer.searching.SearchPanel; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJLabel; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -132,4 +131,4 @@ public class LDCSearch implements SearchPanel } } } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java index 17bfacfb..81286178 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/MethodCallSearch.java @@ -1,24 +1,22 @@ package the.bytecode.club.bytecodeviewer.searching.impl; import eu.bibl.banalysis.asm.desc.OpcodeInfo; - -import java.awt.*; +import java.awt.GridLayout; import java.util.Iterator; import javax.swing.JPanel; import javax.swing.JTextField; -import org.objectweb.asm.Type; import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.searching.EnterKeyEvent; import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult; import the.bytecode.club.bytecodeviewer.searching.SearchPanel; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJLabel; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -147,4 +145,4 @@ public class MethodCallSearch implements SearchPanel "" )); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java index 5c3e8042..389ef5d7 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/searching/impl/RegexSearch.java @@ -5,19 +5,17 @@ import java.util.Iterator; import java.util.regex.Pattern; import javax.swing.JPanel; import javax.swing.JTextField; - -import eu.bibl.banalysis.asm.desc.OpcodeInfo; import org.objectweb.asm.Type; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.MethodNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.searching.EnterKeyEvent; import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult; import the.bytecode.club.bytecodeviewer.searching.RegexInsnFinder; import the.bytecode.club.bytecodeviewer.searching.SearchPanel; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJLabel; -import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import static the.bytecode.club.bytecodeviewer.searching.RegexInsnFinder.processRegex; @@ -108,4 +106,4 @@ public class RegexSearch implements SearchPanel } } } -} \ No newline at end of file +} 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 6e37157a..62d96a73 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/Language.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/Language.java @@ -1,15 +1,20 @@ package the.bytecode.club.bytecodeviewer.translation; import com.google.gson.reflect.TypeToken; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; import org.apache.commons.collections4.map.LinkedMap; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Constants; import the.bytecode.club.bytecodeviewer.api.BCV; import the.bytecode.club.bytecodeviewer.resources.IconResources; -import java.io.IOException; -import java.util.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * @@ -79,7 +84,7 @@ public enum Language VIETNAMESE("/translations/vietnamese.json", "Tiếng Việt", "English", "vi"), ; - private static final LinkedHashMap languageCodeLookup; + private static final Map languageCodeLookup; static { @@ -92,8 +97,8 @@ public enum Language private final String resourcePath; private final String readableName; private final String htmlIdentifier; - private final LinkedHashSet languageCode; - private HashMap translationMap; + private final Set languageCode; + private Map translationMap; Language(String resourcePath, String readableName, String htmlIdentifier, String... languageCodes) { @@ -107,7 +112,7 @@ public enum Language { printMissingLanguageKeys(); - HashMap translationMap = getTranslation(); + Map translationMap = getTranslation(); for(TranslatedComponents translatedComponents : TranslatedComponents.values()) { @@ -143,7 +148,7 @@ public enum Language } } - public HashMap getTranslation() throws IOException + public Map getTranslation() throws IOException { if(translationMap == null) { @@ -171,7 +176,7 @@ public enum Language IconResources.loadResourceAsString(resourcePath), new TypeToken>(){}.getType()); - HashSet existingKeys = new HashSet<>(); + Set existingKeys = new HashSet<>(); for(TranslatedComponents t : TranslatedComponents.values()) existingKeys.add(t.name()); @@ -185,7 +190,7 @@ public enum Language return resourcePath; } - public HashSet getLanguageCode() + public Set getLanguageCode() { return languageCode; } @@ -200,7 +205,7 @@ public enum Language return "translations/html/" + identifier + "." + htmlIdentifier + ".html"; } - public static LinkedHashMap getLanguageCodeLookup() + public static Map 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 index dc47421e..da7aaddd 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/TranslatedStrings.java @@ -1,9 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation; -import the.bytecode.club.bytecodeviewer.api.BCV; - import java.io.IOException; import java.util.HashSet; +import java.util.Set; +import the.bytecode.club.bytecodeviewer.api.BCV; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -122,7 +122,7 @@ public enum TranslatedStrings DRAG_CLASS_JAR, ; - public static final HashSet nameSet = new HashSet<>(); + public static final Set nameSet = new HashSet<>(); static { @@ -176,4 +176,4 @@ public enum TranslatedStrings { return text; } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedDefaultMutableTreeNode.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedDefaultMutableTreeNode.java index 7ffb3ce7..b35c3d42 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedDefaultMutableTreeNode.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedDefaultMutableTreeNode.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; -import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; -import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; - import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; +import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; +import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJButton.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJButton.java index ff875d97..f01dd1aa 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJButton.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJButton.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; +import javax.swing.JButton; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBox.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBox.java index 1550787d..b04bb11e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBox.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBox.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; +import javax.swing.JCheckBox; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBoxMenuItem.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBoxMenuItem.java index 0be77507..40e149de 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBoxMenuItem.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJCheckBoxMenuItem.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; +import javax.swing.JCheckBoxMenuItem; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJLabel.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJLabel.java index 04f44ac9..ac17284a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJLabel.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJLabel.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; +import javax.swing.JLabel; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenu.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenu.java index e0a78a86..66d26b6c 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenu.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenu.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; +import javax.swing.JMenu; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * @@ -50,4 +49,4 @@ public class TranslatedJMenu extends JMenu { return super.isEnabled() && getMenuComponentCount() > 0; } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenuItem.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenuItem.java index 4beda6f3..b38fde11 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenuItem.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJMenuItem.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; +import javax.swing.JMenuItem; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJRadioButtonMenuItem.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJRadioButtonMenuItem.java index 72361a54..4683cf29 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJRadioButtonMenuItem.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJRadioButtonMenuItem.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; +import javax.swing.JRadioButtonMenuItem; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJTextField.java b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJTextField.java index 41353b3e..6f16c4b7 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJTextField.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/translation/components/TranslatedJTextField.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.translation.components; +import javax.swing.JTextField; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponentReference; import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents; -import javax.swing.*; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/APKTool.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/APKTool.java index fa9aa616..96084dd4 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/APKTool.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/APKTool.java @@ -5,7 +5,8 @@ import org.apache.commons.io.FileUtils; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; +import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/BootCheck.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/BootCheck.java index f2764a82..d7c5000e 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/BootCheck.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/BootCheck.java @@ -1,16 +1,15 @@ package the.bytecode.club.bytecodeviewer.util; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JOptionPane; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.CommandLineInput; import the.bytecode.club.bytecodeviewer.bootloader.Boot; import the.bytecode.club.bytecodeviewer.bootloader.loader.ILoader; import the.bytecode.club.bytecodeviewer.bootloader.resource.external.EmptyExternalResource; import the.bytecode.club.bytecodeviewer.bootloader.resource.external.ExternalResource; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.CommandLineInput; - -import javax.swing.*; -import java.io.File; -import java.util.ArrayList; -import java.util.List; import static the.bytecode.club.bytecodeviewer.Constants.nl; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/DialogUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/DialogUtils.java index a594ca6e..7292cbc7 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/DialogUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/DialogUtils.java @@ -1,17 +1,17 @@ package the.bytecode.club.bytecodeviewer.util; +import java.io.File; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileFilter; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; import the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; -import javax.swing.*; -import javax.swing.filechooser.FileFilter; -import java.io.File; -import java.util.Arrays; -import java.util.HashSet; - import static the.bytecode.club.bytecodeviewer.gui.components.FileChooser.EVERYTHING; /*************************************************************************** @@ -90,7 +90,7 @@ public class DialogUtils */ public static File fileChooser(String title, String description, File directory, FileFilter filter, OnOpenEvent onOpen, String... extensions) { - HashSet extensionSet = new HashSet<>(Arrays.asList(extensions)); + Set extensionSet = new HashSet<>(Arrays.asList(extensions)); final JFileChooser fc = new FileChooser(true, directory, diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/Enjarify.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/Enjarify.java index fcb60118..fef2b65a 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/Enjarify.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/Enjarify.java @@ -2,7 +2,6 @@ package the.bytecode.club.bytecodeviewer.util; import java.io.File; import java.util.concurrent.atomic.AtomicBoolean; - import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.resources.ExternalResources; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/JTextAreaUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/JTextAreaUtils.java index 6779de54..69f19457 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/JTextAreaUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/JTextAreaUtils.java @@ -1,12 +1,11 @@ package the.bytecode.club.bytecodeviewer.util; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; - -import javax.swing.*; +import java.awt.Color; +import javax.swing.JTextArea; import javax.swing.text.DefaultHighlighter; import javax.swing.text.Document; import javax.swing.text.Highlighter; -import java.awt.*; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java index 633fae68..fb105234 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java @@ -5,7 +5,12 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Enumeration; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; import java.util.jar.JarOutputStream; import java.util.zip.ZipEntry; @@ -21,7 +26,7 @@ import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.api.ASMUtil; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; -import static the.bytecode.club.bytecodeviewer.Constants.*; +import static the.bytecode.club.bytecodeviewer.Constants.fs; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -65,7 +70,7 @@ public class JarUtils public static void importArchiveA(final File jarFile) throws IOException { ResourceContainer container = new ResourceContainer(jarFile); - LinkedHashMap files = new LinkedHashMap<>(); + Map files = new LinkedHashMap<>(); try (FileInputStream fis = new FileInputStream(jarFile); ZipInputStream jis = new ZipInputStream(fis)) { @@ -119,7 +124,7 @@ public class JarUtils // should also rebuild the archive byte offsets ResourceContainer container = new ResourceContainer(jarFile); - LinkedHashMap files = new LinkedHashMap<>(); + Map files = new LinkedHashMap<>(); try (ZipFile zipFile = new ZipFile(jarFile)) { Enumeration entries = zipFile.getEntries(); @@ -155,9 +160,9 @@ public class JarUtils BytecodeViewer.addResourceContainer(container); } - public static ArrayList loadClasses(final File jarFile) throws IOException + public static List loadClasses(final File jarFile) throws IOException { - ArrayList classes = new ArrayList<>(); + List classes = new ArrayList<>(); try (FileInputStream fis = new FileInputStream(jarFile); ZipInputStream jis = new ZipInputStream(fis)) { ZipEntry entry; @@ -195,11 +200,11 @@ public class JarUtils * @param zipFile the input zip file * @throws IOException */ - public static LinkedHashMap loadResources(final File zipFile) throws IOException { + public static Map loadResources(final File zipFile) throws IOException { if (!zipFile.exists()) - return null; //just ignore + return new LinkedHashMap<>(); // just ignore (don't return null for null-safety!) - LinkedHashMap files = new LinkedHashMap<>(); + Map files = new LinkedHashMap<>(); try (ZipInputStream jis = new ZipInputStream(new FileInputStream(zipFile))) { ZipEntry entry; @@ -245,7 +250,7 @@ public class JarUtils * @param path the exact path of the output jar file * @param manifest the manifest contents */ - public static void saveAsJar(ArrayList nodeList, String path, + public static void saveAsJar(List nodeList, String path, String manifest) { try (FileOutputStream fos = new FileOutputStream(path); JarOutputStream out = new JarOutputStream(fos)) { @@ -291,7 +296,7 @@ public class JarUtils try (FileOutputStream fos = new FileOutputStream(path); JarOutputStream out = new JarOutputStream(fos)) { - ArrayList noDupe = new ArrayList<>(); + List noDupe = new ArrayList<>(); for (ClassNode cn : nodeList) { ClassWriter cw = new ClassWriter(0); @@ -322,7 +327,7 @@ public class JarUtils * @param nodeList The loaded ClassNodes * @param dir the exact jar output path */ - public static void saveAsJarClassesOnlyToDir(ArrayList nodeList, String dir) { + public static void saveAsJarClassesOnlyToDir(List nodeList, String dir) { try { for (ClassNode cn : nodeList) { ClassWriter cw = new ClassWriter(0); @@ -345,10 +350,10 @@ public class JarUtils * @param nodeList The loaded ClassNodes * @param path the exact jar output path */ - public static void saveAsJar(ArrayList nodeList, String path) { + public static void saveAsJar(List nodeList, String path) { try (FileOutputStream fos = new FileOutputStream(path); JarOutputStream out = new JarOutputStream(fos)) { - ArrayList noDupe = new ArrayList<>(); + List noDupe = new ArrayList<>(); for (ClassNode cn : nodeList) { ClassWriter cw = new ClassWriter(0); cn.accept(cw); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/KeyEventDispatch.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/KeyEventDispatch.java index be85887f..e8edeb5d 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/KeyEventDispatch.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/KeyEventDispatch.java @@ -1,11 +1,10 @@ package the.bytecode.club.bytecodeviewer.util; +import java.awt.KeyEventDispatcher; +import java.awt.event.KeyEvent; import the.bytecode.club.bytecodeviewer.GlobalHotKeys; import the.bytecode.club.bytecodeviewer.gui.components.SearchableRSyntaxTextArea; -import java.awt.*; -import java.awt.event.KeyEvent; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/LazyNameUtil.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/LazyNameUtil.java index ddb71ce0..3331ebc4 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/LazyNameUtil.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/LazyNameUtil.java @@ -1,6 +1,7 @@ package the.bytecode.club.bytecodeviewer.util; import java.util.HashMap; +import java.util.Map; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; @@ -30,7 +31,7 @@ import org.apache.commons.lang3.StringUtils; public class LazyNameUtil { public static boolean SAME_NAME_JAR_WORKSPACE = false; - private static final HashMap nameMap = new HashMap<>(); + private static final Map nameMap = new HashMap<>(); public static void reset() { nameMap.clear(); @@ -74,4 +75,4 @@ public class LazyNameUtil else nameMap.put(name, seqAndCount.decrCount()); } -} \ No newline at end of file +} diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/MiscUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/MiscUtils.java index 3fb628c1..3f688ea9 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/MiscUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/MiscUtils.java @@ -1,5 +1,24 @@ package the.bytecode.club.bytecodeviewer.util; +import java.awt.image.BufferedImage; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Field; +import java.nio.charset.CharsetEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import javax.imageio.ImageIO; +import javax.swing.SwingUtilities; import org.apache.commons.lang3.StringUtils; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; @@ -7,16 +26,6 @@ import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.resources.ResourceContainer; import the.bytecode.club.bytecodeviewer.translation.Language; -import javax.imageio.ImageIO; -import javax.swing.*; -import java.awt.image.BufferedImage; -import java.io.*; -import java.lang.reflect.Field; -import java.nio.charset.CharsetEncoder; -import java.nio.charset.StandardCharsets; -import java.util.*; -import java.util.List; - import static the.bytecode.club.bytecodeviewer.BytecodeViewer.gson; /*************************************************************************** @@ -49,7 +58,7 @@ public class MiscUtils private static final String AB = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; private static final String AN = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; private static final Random rnd = new Random(); - private static final HashSet createdRandomizedNames = new HashSet<>(); + private static final Set createdRandomizedNames = new HashSet<>(); /** * Returns a random string without numbers @@ -181,7 +190,7 @@ public class MiscUtils return path; } - public static int fileContainersHash(ArrayList resourceContainers) { + public static int fileContainersHash(List resourceContainers) { StringBuilder block = new StringBuilder(); for (ResourceContainer container : resourceContainers) { block.append(container.name); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/PingBack.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/PingBack.java index 4c58915d..fe99733f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/PingBack.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/PingBack.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.util; +import java.net.URL; import me.konloch.kontainer.io.HTTPRequest; import the.bytecode.club.bytecodeviewer.Configuration; -import java.net.URL; - /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java index 44c76941..88f0e3d7 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java @@ -1,19 +1,23 @@ package the.bytecode.club.bytecodeviewer.util; -import the.bytecode.club.bytecodeviewer.BytecodeViewer; -import the.bytecode.club.bytecodeviewer.Configuration; -import the.bytecode.club.bytecodeviewer.Constants; -import the.bytecode.club.bytecodeviewer.compilers.impl.JavaCompiler; -import the.bytecode.club.bytecodeviewer.compilers.impl.KrakatauAssembler; -import the.bytecode.club.bytecodeviewer.decompilers.impl.*; -import the.bytecode.club.bytecodeviewer.resources.ExternalResources; - import java.io.File; import java.io.FileDescriptor; import java.io.IOException; import java.net.InetAddress; import java.security.Permission; import java.util.concurrent.atomic.AtomicInteger; +import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.Configuration; +import the.bytecode.club.bytecodeviewer.Constants; +import the.bytecode.club.bytecodeviewer.compilers.impl.JavaCompiler; +import the.bytecode.club.bytecodeviewer.compilers.impl.KrakatauAssembler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.CFRDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.FernFlowerDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.JDGUIDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.KrakatauDecompiler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.KrakatauDisassembler; +import the.bytecode.club.bytecodeviewer.decompilers.impl.ProcyonDecompiler; +import the.bytecode.club.bytecodeviewer.resources.ExternalResources; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/WindowClosingAdapter.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/WindowClosingAdapter.java index a6332aa2..c985ae52 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/WindowClosingAdapter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/WindowClosingAdapter.java @@ -1,9 +1,8 @@ package the.bytecode.club.bytecodeviewer.util; -import the.bytecode.club.bytecodeviewer.Configuration; - import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import the.bytecode.club.bytecodeviewer.Configuration; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/WindowStateChangeAdapter.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/WindowStateChangeAdapter.java index 1e3fc293..052ab90f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/WindowStateChangeAdapter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/WindowStateChangeAdapter.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.util; -import the.bytecode.club.bytecodeviewer.gui.MainViewerGUI; - -import java.awt.*; +import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import the.bytecode.club.bytecodeviewer.gui.MainViewerGUI; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *