ExampleMod is a BGFX native mod template using Java, JNI and C++.
- Java plugin integration
- Native
.soloading - JNI bridge
- ARM64 native code
- Hooking utilities
- Memory utilities
- Signature support
ExampleMod/
app/src/main/java/
└── com/example/bgfx/mod/
├── ExampleMod.java
├── NativeClient.java
└── LibraryLoader.java
app/src/main/jni/
├── Main.cpp
├── Utils.h
├── Sigs.h
└── obfuscate.h
app/src/main/jniLibs/
└── arm64-v8a/
└── libMyMod.so
plugins/
├── ExampleMod.dex
└── ExampleMod.json
ExampleMod.java is the plugin entry point.
It loads the native library:
LibraryLoader.load(context, "libMyMod.so");Native code is located in:
jni/Main.cpp
The output library:
libMyMod.so
contains native mod code.
Java communicates with C++ using:
NativeClient.javaIncluded libraries:
- Dobby
- And64InlineHook
- KittyMemory
- Logger
Build:
./gradlew assembleReleaseNative output:
libMyMod.so
Example plugin folder:
plugins/
├── ExampleMod.dex
└── ExampleMod.json
JSON:
{
"name": "ExampleMod",
"main": "com.example.bgfx.client.ExampleClient"
}Target:
arm64-v8a
- Native library must match device architecture.
- JNI names must match between Java and C++.
- Rebuild after changing native code.
Free to modify and create your own BGFX mods.