- Multi-language plugin support:
- π Native:
.so(C/C++) viadlopen - βοΈ Java/Kotlin:
.dexviaDexClassLoader
- π Native:
- π Unified entry points:
OnPluginCreate(JNIEnv*, jobject)for native pluginsOnPluginCreate(Context)for Java/Kotlin plugins
- πΌοΈ UI integration:
- Android views from C++ via JNI
- Direct XML inflation from Java/Kotlin
- π Dynamic updates:
- No recompilation needed
- Hot-plugging from external storage
- The app searches for .so files in: storage/emulated/0/Android/data/com.all1eexxx.plugix/files/plugins and copies them to internal storage.
- Loads them via dlopen
- Looks for the OnPluginCreate symbol
- Calls it with JNIEnv* and Activity context
- The app searches for .dex files in: storage/emulated/0/Android/data/com.all1eexxx.plugix/files/plugins and copies them to internal storage (for example, to codeCacheDir/plugins).
- For each .dex file, a DexClassLoader is created, specifying the path to the file, an optimized directory for the output, and the parent class loader.
- Using DexFile or the DexClassLoader, the app enumerates all classes inside the .dex file.
- For each class, it looks for a static method with the signature: OnPluginCreate(Context ctx).
- If such a method is found, it is invoked with the current Android context.
π storage/emulated/0/Android/data/com.all1eexxx.plugix/files/plugins
βββ native_module.so # C/C++ plugin
βββ java_plugin.dex # Java compiled plugin
βββ kt_plugin.dex # Kotlin compiled plugin
βββ ...β Native Plugin must export:
extern "C" void OnPluginCreate(JNIEnv* env, jobject activity);β Java/Kotlin Plugin must define:
public static void OnPluginCreate(Context ctx) {}| Type | Plugin | Description | Version |
|---|---|---|---|
| Native(C++) | CPPToast_plugin | Displays Toast from C++ | 1.0.0 |
| Native(C++) | GUI_plugin | Creates UI elements (TextView/Button) | 1.0.0 |
| Native(C++) | Resource_plugin | File type support | 1.1.0 |
| Native(C++) | RequestNotificationPermission_plugin | Handles runtime permissions | 1.1.2 |
| Native(C++) | SendNotification_plugin | System notifications | 1.1.3 |
| Native(C) | AlertDialog_plugin | Shows native AlertDialog | 1.2.0 |
| Java | JavaToast_plugin | Toast notifications in Java | 1.2.0 |
| Kotlin | KotlinToast_plugin | Toast notifications in Kotlin | 1.2.1 |
| Kotlin | KotlinCoroutines_plugin | Kotlin Coroutines in plugin | 1.2.2 |
| Native(Rust) | RustToast_plugin | Displays Toast from Rust | 1.2.2 |
- Entry Points:
- Native: Must export OnPluginCreate with JNI params
- Java/Kotlin: Static method with Context parameter
- UI Limitations:
- Native: Event handling requires JNI callbacks
- Java/Kotlin: Full Android UI capabilities
- Security:
- Plugins execute in host app's context
MIT License. Use, explore, contribute.
β Found this useful? Star the repo to support development!