explaingit

5ec1cff/injectrc

Analysis updated 2026-06-24

65C++Audience · developerComplexity · 4/5Setup · hard

TLDR

Tool that injects extra init rc scripts into a running Android 11+ phone without rebooting, by attaching to the dynamically linked init process.

Mindmap

mindmap
  root((injectrc))
    Inputs
      rc script file
      Running init process
    Outputs
      Live-applied init commands
      Started services
    Use Cases
      Test init changes fast
      Android rooting tinkering
      Custom service launch
    Tech Stack
      C++
      Android NDK
      Python
      adb
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Apply changes to Android init rc scripts without rebooting the device

USE CASE 2

Iterate on a custom init service during ROM development

USE CASE 3

Test a new SELinux or permission policy live on a running phone

What is it built with?

C++AndroidNDKPythonadb

How does it compare?

5ec1cff/injectrc2dom/keypadadiao1973/librobotbagfix
Stars658931
LanguageC++C++C++
Setup difficultyhardhardhard
Complexity4/54/54/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires Android NDK to build, root access on a device running Android 11 or newer, and only works because init is dynamically linked.

In plain English

InjectRC is a small tool that pushes extra startup commands into the Android init process while the phone is already running. The init process is the very first program that Android starts when it boots, and it reads instructions from files called rc scripts to decide what services to launch and what permissions to set. Normally you would have to change those scripts and reboot the phone for the new commands to take effect. This project lets you feed a fresh rc script into init on a live device. The README notes one important limit: it only works on Android versions 11 and above, because the tool relies on init being a dynamically linked program, which earlier versions did not use. If you have an older Android, this will not run for you. To use it, you run the compiled binary on the phone and point it at the rc script you want injected. The command looks like this: ./injectrc followed by the path to the rc file. Building the tool yourself needs the Android NDK, which is the official toolchain for compiling C and C++ code that runs on Android, and Python 3 for the build script. There are two build commands, one that produces an output binary in a local folder, and another that uses adb to push the result straight onto a connected device under /data/local/tmp.

Copy-paste prompts

Prompt 1
Build injectrc with the Android NDK and push the binary to /data/local/tmp via adb
Prompt 2
Walk me through how injectrc attaches to the running init process and replays an rc script
Prompt 3
Write an rc script I can feed to injectrc that starts a one-shot service and verify it via getprop
Prompt 4
Explain why injectrc requires Android 11+ and what would need to change to back-port to Android 10

Frequently asked questions

What is injectrc?

Tool that injects extra init rc scripts into a running Android 11+ phone without rebooting, by attaching to the dynamically linked init process.

What language is injectrc written in?

Mainly C++. The stack also includes C++, Android, NDK.

How hard is injectrc to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is injectrc for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.