gitmyhub

DroidPlugin

Java ★ 7.0k updated 2y ago

A plugin framework on android,Run any third-party apk without installation, modification or repackage

DroidPlugin is an Android framework that lets a host app load and run other Android apps as plugins at runtime, without installing them on the device or modifying their code.

JavaAndroidsetup: hardcomplexity 4/5

DroidPlugin is an Android framework that lets a host app run other Android apps (APKs) without installing them on the device, without modifying their code, and without repacking them. Normally, to run an Android app, the operating system must install it first. DroidPlugin intercepts Android's own system calls at the Java layer so the host app can load and run a foreign APK as if it were a plugin, while the rest of the device sees nothing new installed.

The framework handles the Android component system on behalf of the plugin. Services, activities, broadcast receivers, and content providers inside the plugin do not need to be declared in the host app's manifest. The plugin gets its own isolated resources and its own process management, so idle plugin processes are shut down to save memory. From the plugin's point of view, it runs normally; it can even interact with other plugins loaded by the same host.

Integrating DroidPlugin into a host app takes a small amount of code. You either set the framework's Application class in your manifest, or you add two method calls to your own Application class. After that, you call the plugin manager to install, upgrade, or uninstall APK files by their file path, much like a miniature package manager running inside your app.

The README is honest about limitations. Notifications that use custom layouts or drawable resources from the plugin do not work correctly. The plugin's components cannot be discovered by other apps on the device through Intent filters, so the plugin is invisible to the outside system. Apps that include native (C or C++) code cannot be loaded as plugins because the framework does not hook into the native layer.

DroidPlugin was originally developed at Qihoo 360 and is used in the 360 App Store.

Where it fits