github.com/rikkaapps/riru

Inject into zygote process

Open this visualization on its own page →

Contributors

19

Lines of Code

2,032

From

2018-08-20

To

2022-02-02

About rikkaapps/riru

Riru is a deprecated injection framework for rooted Android devices running Magisk that allows modules to execute code within app processes and the system server. The project achieves this by injecting code into the zygote process, which is responsible for forking all Android applications. It primarily targets Android 6.0 and later devices and was designed to facilitate the development of system-level modifications through a modular architecture.

The framework uses an elegant injection mechanism leveraging Android's native bridge property to automatically load a shared library during zygote initialization, avoiding the need to replace system libraries. Once loaded, it hooks the JNI registration functions responsible for process forking to identify whether code is executing in an app process or system server context. The project also includes a hiding mechanism to mask the memory footprints of Riru and its modules from scanning tools by converting them to anonymous memory.

As of now, Riru is officially deprecated and users are directed to migrate to Zygisk, a successor framework. The project provides installation options through Magisk Manager or manual installation via zip files, along with comprehensive build tools using Gradle for development and testing. Related resources include a module template repository and documentation on API changes for developers creating Riru-based modules.

Share this video