A sample Java plugin for the BGFX Plugin System.
This project demonstrates how to create a BGFX plugin with:
- Custom Android UI
- Floating overlay button
- Movable menus
- Script execution through
ScriptManager
Every plugin must extend:
com.executor.plugin.PluginExample:
public class ExamplePlugin extends Plugin {
@Override
public void onLoad(PluginContext ctx) {
Context context = ctx.getContext();
}
}The onLoad() method is called automatically when BGFX loads the
plugin.
Plugins receive a PluginContext.
@Override
public void onLoad(PluginContext ctx){
Context context = ctx.getContext();
}The Android context can be used to create:
- Views
- Buttons
- Dialogs
- Overlay windows
- Custom menus
Build the project:
./gradlew assembleReleaseAfter building, extract the generated dex file.
Example:
app/build/bin/classes.dex
After getting classes.dex:
- Rename it to your plugin name.
Example:
ExamplePlugin.dex
- Open the dex using:
- MT Manager
- NP Manager
- Any dex editor
- Remove:
<!-- -->
com.executor
from the dex.
The final dex should only contain your plugin code.
Example:
com/example/bgfx/plugin/ExamplePlugin.class
Create:
ExamplePlugin.json
Content:
{
"name": "ExamplePlugin",
"main": "com.example.bgfx.plugin.ExamplePlugin"
}The main value must match your plugin class.
Place files here:
/sdcard/BGFX/plugins/
Example:
/sdcard/BGFX/plugins/
├── Example.dex
└── Example.json
This project uses:
bgfxwrapper.jar
Provided APIs:
com.executor.plugin.Plugin
com.executor.plugin.PluginContext
com.executor.bgfxui.ScriptManager
com.executor.helpers.Welp- Class name must match the JSON main path
- Dex name must match plugin name
- Remove
com.executorclasses before distributing - Plugins can create Android interfaces
- Plugins can execute BGFX Lua scripts
Free to modify and create your own BGFX plugins.