{"id":13441147,"url":"https://github.com/RikkaApps/Riru","last_synced_at":"2025-03-20T11:35:31.719Z","repository":{"id":38185275,"uuid":"145406928","full_name":"RikkaApps/Riru","owner":"RikkaApps","description":"Inject into zygote process","archived":true,"fork":false,"pushed_at":"2023-12-24T09:16:43.000Z","size":1315,"stargazers_count":4856,"open_issues_count":1,"forks_count":569,"subscribers_count":191,"default_branch":"master","last_synced_at":"2024-09-27T02:40:59.746Z","etag":null,"topics":["android","riru"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RikkaApps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-08-20T11:10:27.000Z","updated_at":"2024-09-26T22:02:41.000Z","dependencies_parsed_at":"2024-01-13T18:24:04.062Z","dependency_job_id":"3a7f12ca-be63-455c-837b-cd767003d013","html_url":"https://github.com/RikkaApps/Riru","commit_stats":null,"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RikkaApps%2FRiru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RikkaApps%2FRiru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RikkaApps%2FRiru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RikkaApps%2FRiru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RikkaApps","download_url":"https://codeload.github.com/RikkaApps/Riru/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221752326,"owners_count":16874962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","riru"],"created_at":"2024-07-31T03:01:30.449Z","updated_at":"2024-10-28T00:31:59.787Z","avatar_url":"https://github.com/RikkaApps.png","language":"C++","funding_links":[],"categories":["HarmonyOS","C++"],"sub_categories":["Windows Manager"],"readme":"# Deprecated\n\nAll Riru users and Riru modules should migrate to Zygisk.\n\n# Riru\n\nRiru only does one thing, inject into zygote in order to allow modules to run their codes in apps or the system server.\n\n\u003e The name, Riru, comes from a character. (https://www.pixiv.net/member_illust.php?mode=medium\u0026illust_id=74128856)\n\n## Requirements\n\nAndroid 6.0+ devices rooted with [Magisk](https://github.com/topjohnwu/Magisk)\n\n## Guide\n\n### Install\n\n* From Magisk Manager\n\n  1. Search \"Riru\" in Magisk Manager\n  2. Install the module named \"Riru\"\n\n  \u003e The Magisk version requirement is enforced by Magisk Manager. You can check [Magisk's module installer script](https://github.com/topjohnwu/Magisk/blob/master/scripts/module_installer.sh).\n\n* Manually\n\n  1. Download the zip from the [GitHub release](https://github.com/RikkaApps/Riru/releases)\n  2. Install in Magisk Manager (Modules - Install from storage - Select downloaded zip)\n\n### Common problems\n\n* Third-party ROMs have incorrect SELinux rule\n\n  \u003chttps://github.com/RikkaApps/Riru/wiki/Explanation-about-incorrect-SELinux-rules-from-third-party-ROMs-cause-Riru-not-working\u003e\n\n* Have low quality module that changes `ro.dalvik.vm.native.bridge` installed\n\n  **If you are using other modules that change `ro.dalvik.vm.native.bridge`, Riru will not work.** (Riru will automatically set it back)\n\n  A typical example is, some \"optimize\" modules change this property. Since changing this property is meaningless for \"optimization\", their quality is very questionable. In fact, changing properties for optimization is a joke.\n\n## How Riru works?\n\n* How to inject into the zygote process?\n\n  Before v22.0, we use the method of replacing a system library (libmemtrack) that will be loaded by zygote. However, it seems to cause some weird problems. Maybe because libmemtrack is used by something else.\n\n  Then we found a super easy way, the \"native bridge\" (`ro.dalvik.vm.native.bridge`). The specific \"so\" file will be automatically \"dlopen-ed\" and \"dlclose-ed\" by the system. This way is from [here](https://github.com/canyie/NbInjection).\n\n* How to know if we are in an app process or a system server process?\n\n  Some JNI functions (`com.android.internal.os.Zygote#nativeForkAndSpecialize` \u0026 `com.android.internal.os.Zygote#nativeForkSystemServer`) is to fork the app process or the system server process.\n  So we need to replace these functions with ours. This part is simple, hook `jniRegisterNativeMethods` since all Java native methods in `libandroid_runtime.so` is registered through this function.\n  Then we can call the original `jniRegisterNativeMethods` again to replace them.\n  \n## How does Hide works?\n\nFrom v22.0, Riru provides a hidden mechanism (idea from [Haruue Icymoon](https://github.com/haruue)), make the memory of Riru and module to anonymous memory to hide from \"`/proc/maps` string scanning\".\n\n## Build\n\nGradle tasks:\n\n* `:riru:assembleDebug/Release`\n   \n   Generate Magisk module zip to `out`.\n\n* `:riru:pushDebug/Release`\n   \n   Push the zip with adb to `/data/local/tmp`.\n\n* `:riru:flashDebug/Release`\n   \n   Flash the zip with `adb shell su -c magisk --install-module`.\n\n* `:riru:flashAndRebootDebug/Release`\n\n   Flash the zip and reboot the device.\n\n## Module template\n\nhttps://github.com/RikkaApps/Riru-ModuleTemplate\n\n## Module API changes\n\nhttps://github.com/RikkaApps/Riru-ModuleTemplate/blob/master/README.md#api-changes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRikkaApps%2FRiru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRikkaApps%2FRiru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRikkaApps%2FRiru/lists"}