Fix Plugin templates

This commit is contained in:
Nico Mexis 2022-01-07 20:16:17 +01:00
parent ab6cf8d196
commit a6f65ecfcf
No known key found for this signature in database
GPG key ID: 27D6E17CE092AB78
2 changed files with 23 additions and 25 deletions

View file

@ -93,7 +93,7 @@ public abstract class Plugin extends Thread
* On plugin start each resource container is iterated through,
* then this is called with the resource container classes
*
* @param classNodeList all of the loaded classes for easy access.
* @param classNodeList all the loaded classes for easy access.
*/
public abstract void execute(List<ClassNode> classNodeList);
}

View file

@ -1,45 +1,43 @@
import the.bytecode.club.bytecodeviewer.api.*;
import java.util.ArrayList;
import java.util.List;
import org.objectweb.asm.tree.ClassNode;
import the.bytecode.club.bytecodeviewer.api.*;
public class Template extends Plugin {
public class Template extends Plugin
{
PluginConsole gui;
/**
* Main function
*/
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
//create console
public void execute(List<ClassNode> classNodeList) {
// Create console
gui = new PluginConsole("Java Template");
gui.setVisible(true); //show the console
gui.setVisible(true); // Show the console
//debug text
// Debug text
out("Class Nodes: " + classNodeList.size());
//iterate through each class node
for(ClassNode cn : classNodeList)
// Iterate through each class node
for (ClassNode cn : classNodeList)
process(cn);
BCV.hideFrame(gui, 10000); //hides the console after 10 seconds
BCV.hideFrame(gui, 10000); // Hides the console after 10 seconds
}
/**
* Process each class node
*/
public void process(ClassNode cn)
{
public void process(ClassNode cn) {
out("Node: " + cn.name + ".class");
//TODO developer plugin code goes here
// TODO developer plugin code goes here
}
/**
* Print to console
*/
public void out(String text)
{
public void out(String text) {
gui.appendText(text);
}
}