Updated Java Template

This commit is contained in:
Konloch 2022-02-13 13:47:05 -06:00
parent 5c40cfa957
commit 74fb0f191c

View file

@ -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<ClassNode> 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);
}
}
}