gitmyhub

RePlugin

Java ★ 7.3k updated 9mo ago

RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework

An Android plugin framework that lets you add new screens and features to an app at runtime without publishing an app store update, using a single system hook for maximum stability across devices.

JavaAndroidsetup: hardcomplexity 4/5

RePlugin is an Android plug-in framework created by Qihoo 360, a Chinese internet security company. It solves a specific problem in Android development: normally, to add new screens, background services, or features to an Android app, you need to declare them in advance in a configuration file and ship a new version of the app through the app store. RePlugin lets you load and run those components as separate plug-ins at runtime, without the user needing to update the main app.

The framework was first released in 2014 and has been used inside 360's own products, including 360 Mobile Safe, which has hundreds of millions of users. By the time of the documentation, 360 apps were running over 100 plug-ins, with plug-ins accounting for 83 percent of the app's functionality. The crash rate from using the framework is reported at 0.01 percent, which is very low.

The design philosophy is minimal invasiveness. Most plug-in frameworks for Android require intercepting many internal system calls, which is fragile and breaks across different Android device manufacturers. RePlugin uses only a single hook, which is a way of intercepting one part of the system, specifically the class loader that loads code. This makes it more stable across the wide variety of Android devices sold in China and elsewhere.

Plug-ins can be bundled with the app at build time or downloaded later from a server. Once loaded, they behave like fully installed apps: they can have their own screens, background services, data providers, broadcast receivers, custom themes, and database bindings. Communication between plug-ins and the main app is supported through standard Android patterns.

The project documentation is primarily in Chinese, with an English README available. It supports Android 2.3 and above. Note that the dependency hosting moved away from JCenter, which shut down, to a 360-hosted Maven repository.

Where it fits