Fix Plugin templates
This commit is contained in:
parent
ab6cf8d196
commit
a6f65ecfcf
2 changed files with 23 additions and 25 deletions
|
@ -93,7 +93,7 @@ public abstract class Plugin extends Thread
|
||||||
* On plugin start each resource container is iterated through,
|
* On plugin start each resource container is iterated through,
|
||||||
* then this is called with the resource container classes
|
* 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);
|
public abstract void execute(List<ClassNode> classNodeList);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,45 +1,43 @@
|
||||||
import the.bytecode.club.bytecodeviewer.api.*;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
|
||||||
import org.objectweb.asm.tree.ClassNode;
|
import org.objectweb.asm.tree.ClassNode;
|
||||||
|
import the.bytecode.club.bytecodeviewer.api.*;
|
||||||
|
|
||||||
|
public class Template extends Plugin {
|
||||||
|
|
||||||
public class Template extends Plugin
|
|
||||||
{
|
|
||||||
PluginConsole gui;
|
PluginConsole gui;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function
|
* Main function
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute(ArrayList<ClassNode> classNodeList)
|
public void execute(List<ClassNode> classNodeList) {
|
||||||
{
|
// Create console
|
||||||
//create console
|
|
||||||
gui = new PluginConsole("Java Template");
|
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());
|
out("Class Nodes: " + classNodeList.size());
|
||||||
|
|
||||||
//iterate through each class node
|
// Iterate through each class node
|
||||||
for(ClassNode cn : classNodeList)
|
for (ClassNode cn : classNodeList)
|
||||||
process(cn);
|
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
|
* Process each class node
|
||||||
*/
|
*/
|
||||||
public void process(ClassNode cn)
|
public void process(ClassNode cn) {
|
||||||
{
|
|
||||||
out("Node: " + cn.name + ".class");
|
out("Node: " + cn.name + ".class");
|
||||||
//TODO developer plugin code goes here
|
// TODO developer plugin code goes here
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print to console
|
* Print to console
|
||||||
*/
|
*/
|
||||||
public void out(String text)
|
public void out(String text) {
|
||||||
{
|
|
||||||
gui.appendText(text);
|
gui.appendText(text);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue