Shizuku Documentation
repository·master·Indexed 26 days ago
https://github.com/thedjchi/shizukuAn Android utility providing a bridge for third-party apps to access restricted system APIs via ADB or root privileges. This version includes a watchdog service, TCP mode, and improved boot startup reliability. Supports Android 7+ with modes for Root, Wireless Debugging (Android 11+), and PC.
What's inside Shizuku
- Shizuku is an Android application that enables other applications to access system-level APIs that typically require ADB or root privileges. This specific repository is a fork of the original Shizuku project and includes additional features like a watchdog service, TCP mode, and improved boot startup reliability.
Developer Guide: Using the Shizuku API
masterFor detailed API documentation and a demo project, refer to the Shizuku-API repository.
Implementation Best Practices
- Permission Checking: Shizuku has different permissions in root mode versus ADB mode. Use
ShizukuService#getUidto determine if Shizuku is running as root or ADB, andShizukuService#checkPermissionto verify if the server has sufficient permissions for your required task. - Android 8 and below: If you need to use Shizuku in a
ServiceorBroadcastReceiverthat is not started by anActivity, you must trigger the send binder by starting a transparent activity. - API Stability: Prefer using
ShizukuBinderWrapperinstead of callingtransactRemotedirectly. This ensures better compatibility as API calls may change across different Android versions.
- Permission Checking: Shizuku has different permissions in root mode versus ADB mode. Use
Build the Shizuku App
masterTo build the application from source, follow these steps:
- Clone the repository with submodules:
git clone --recurse-submodules - Run the Gradle task to assemble the manager:
./gradlew :manager:assembleDebug # OR ./gradlew :manager:assembleRelease
Debugging the Server: Running
:manager:assembleDebuggenerates a debuggable server. You can attach a debugger toshizuku_server. In Android Studio, ensureRun/Debug configurations > Always install with package manageris checked so the server uses your latest code.- Clone the repository with submodules:
System Requirements for Shizuku
masterShizuku requires Android 7+. The available modes depend on your device state:
- Root mode: Requires a rooted device.
- Wireless Debugging mode: Works on Android 11+ and all Android TVs.
- PC mode: Works on all devices.
- Start on boot: Only available when using Wireless Debugging or Root mode.