Skip to content

Commit 0fcddcd

Browse files
committed
Plugin work. -Bibl
1 parent c60bfd6 commit 0fcddcd

25 files changed

+559
-356
lines changed

src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import the.bytecode.club.bytecodeviewer.gui.SystemErrConsole;
4040
import the.bytecode.club.bytecodeviewer.gui.WorkPane;
4141
import the.bytecode.club.bytecodeviewer.obfuscators.mapping.Refactorer;
42+
import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
4243

4344
/**
4445
* A lightweight Java Reverse Engineering suite, developed by Konloch -
@@ -662,18 +663,18 @@ public void run() {
662663

663664
/**
664665
* Starts the specified plugin
665-
* @param plugin the file of the plugin
666+
* @param file the file of the plugin
666667
*/
667-
public static void startPlugin(File plugin) {
668-
if (!plugin.exists())
668+
public static void startPlugin(File file) {
669+
if (!file.exists())
669670
return;
670671

671672
try {
672-
PluginManager.runPlugin(plugin);
673-
} catch (Exception e) {
673+
PluginManager.runPlugin(file);
674+
} catch (Throwable e) {
674675
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
675676
}
676-
addRecentPlugin(plugin);
677+
addRecentPlugin(file);
677678
}
678679

679680
/**
@@ -786,6 +787,7 @@ public static void resetRecentFilesMenu() {
786787
if (!s.isEmpty()) {
787788
JMenuItem m = new JMenuItem(s);
788789
m.addActionListener(new ActionListener() {
790+
@Override
789791
public void actionPerformed(ActionEvent e) {
790792
JMenuItem m = (JMenuItem) e.getSource();
791793
openFiles(new File[] { new File(m.getText()) }, true);
@@ -798,6 +800,7 @@ public void actionPerformed(ActionEvent e) {
798800
if (!s.isEmpty()) {
799801
JMenuItem m = new JMenuItem(s);
800802
m.addActionListener(new ActionListener() {
803+
@Override
801804
public void actionPerformed(ActionEvent e) {
802805
JMenuItem m = (JMenuItem) e.getSource();
803806
startPlugin(new File(m.getText()));

src/the/bytecode/club/bytecodeviewer/MiscUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,8 @@ public static int getClassNumber(String start, String ext) {
7979
}
8080
return i;
8181
}
82+
83+
public static String extension(String name) {
84+
return name.substring(name.lastIndexOf('.') + 1);
85+
}
8286
}

src/the/bytecode/club/bytecodeviewer/PluginManager.java

Lines changed: 0 additions & 155 deletions
This file was deleted.

src/the/bytecode/club/bytecodeviewer/api/BytecodeViewer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import the.bytecode.club.bytecodeviewer.JarUtils;
1515
import the.bytecode.club.bytecodeviewer.decompilers.Decompiler;
16-
import the.bytecode.club.bytecodeviewer.plugins.EZInjection;
16+
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.EZInjection;
1717

1818
/**
1919
* The official API for BCV, this was designed for plugin authors and

src/the/bytecode/club/bytecodeviewer/api/ExceptionUI.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
package the.bytecode.club.bytecodeviewer.api;
22

3-
import javax.swing.JFrame;
4-
import javax.swing.JScrollPane;
5-
6-
import java.awt.Dimension;
73
import java.awt.CardLayout;
4+
import java.awt.Color;
5+
import java.awt.Dimension;
6+
import java.io.PrintWriter;
7+
import java.io.StringWriter;
88

9+
import javax.swing.JFrame;
10+
import javax.swing.JScrollPane;
911
import javax.swing.JTextArea;
1012

1113
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
1214
import the.bytecode.club.bytecodeviewer.Resources;
1315

14-
import java.awt.Color;
15-
import java.io.PrintWriter;
16-
import java.io.StringWriter;
17-
1816
/**
1917
* A simple class designed to show exceptions in the UI.
2018
*
@@ -30,7 +28,7 @@ public class ExceptionUI extends JFrame {
3028
* @param e
3129
* The exception to be shown
3230
*/
33-
public ExceptionUI(Exception e) {
31+
public ExceptionUI(Throwable e) {
3432
setup(e, "@Konloch - konloch@gmail.com");
3533
}
3634

@@ -48,7 +46,7 @@ public ExceptionUI(String e) {
4846
* @param author
4947
* the author of the plugin throwing this exception.
5048
*/
51-
public ExceptionUI(Exception e, String author) {
49+
public ExceptionUI(Throwable e, String author) {
5250
setup(e, author);
5351
}
5452

@@ -62,7 +60,7 @@ public ExceptionUI(String e, String author) {
6260
setup(e, author);
6361
}
6462

65-
private void setup(Exception e, String author) {
63+
private void setup(Throwable e, String author) {
6664

6765
this.setIconImages(Resources.iconList);
6866
setSize(new Dimension(600, 400));

0 commit comments

Comments
 (0)