Shizuku Documentation

repository·master·Indexed 26 days ago

https://github.com/thedjchi/shizuku

An 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.

Tokens
514
Snippets
0
Records
4
Agent score
40%

What's inside Shizuku

  1. Overview of Shizuku

    master
    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.
  2. Developer Guide: Using the Shizuku API

    master

    For detailed API documentation and a demo project, refer to the Shizuku-API repository.

    Implementation Best Practices

    1. Permission Checking: Shizuku has different permissions in root mode versus ADB mode. Use ShizukuService#getUid to determine if Shizuku is running as root or ADB, and ShizukuService#checkPermission to verify if the server has sufficient permissions for your required task.
    2. Android 8 and below: If you need to use Shizuku in a Service or BroadcastReceiver that is not started by an Activity, you must trigger the send binder by starting a transparent activity.
    3. API Stability: Prefer using ShizukuBinderWrapper instead of calling transactRemote directly. This ensures better compatibility as API calls may change across different Android versions.
  3. Build the Shizuku App

    master

    To build the application from source, follow these steps:

    1. Clone the repository with submodules:
      git clone --recurse-submodules
    2. Run the Gradle task to assemble the manager:
      ./gradlew :manager:assembleDebug
      # OR
      ./gradlew :manager:assembleRelease

    Debugging the Server: Running :manager:assembleDebug generates a debuggable server. You can attach a debugger to shizuku_server. In Android Studio, ensure Run/Debug configurations > Always install with package manager is checked so the server uses your latest code.

  4. System Requirements for Shizuku

    master

    Shizuku 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.