From 74fb0f191ca295dc889456bf0720377bd074e601 Mon Sep 17 00:00:00 2001 From: Konloch Date: Sun, 13 Feb 2022 13:47:05 -0600 Subject: [PATCH] Updated Java Template --- .../resources/templates/Template_Plugin.java | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/main/resources/templates/Template_Plugin.java b/src/main/resources/templates/Template_Plugin.java index 2a99b101..4c7cdc98 100644 --- a/src/main/resources/templates/Template_Plugin.java +++ b/src/main/resources/templates/Template_Plugin.java @@ -2,42 +2,50 @@ import java.util.List; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.api.*; +/** + ** [Plugin Description Goes Here] + ** + ** @author [Your Name Goes Here] + **/ + public class Template extends Plugin { PluginConsole gui; /** - * Main function + * Execute function - this gets executed when the plugin is ran */ @Override public void execute(List classNodeList) { - // Create console + // Create & show the console gui = new PluginConsole("Java Template"); - gui.setVisible(true); // Show the console - - // Debug text - out("Class Nodes: " + classNodeList.size()); + gui.setVisible(true); + + // Print out to the console + print("Class Nodes: " + classNodeList.size()); // Iterate through each class node for (ClassNode cn : classNodeList) - process(cn); - - BCV.hideFrame(gui, 10000); // Hides the console after 10 seconds + processClassNode(cn); + + // Hide the console after 10 seconds + BCV.hideFrame(gui, 10000); } /** * Process each class node */ - public void process(ClassNode cn) { - out("Node: " + cn.name + ".class"); - // TODO developer plugin code goes here + public void processClassNode(ClassNode cn) { + print("Node: " + cn.name + ".class"); + + //TODO developer plugin code goes here } /** * Print to console */ - public void out(String text) { + public void print(String text) { gui.appendText(text); } -} +} \ No newline at end of file