Skip to content

Shizuku & Background Installation

DurchEins edited this page Nov 15, 2026 · 2 revisions

Shizuku & Silent Background Installations in ApkUp

This document explains how to set up and how Shizuku and the background installation service work in ApkUp — explained in plain, everyday language in Part 1, followed by a deep-dive technical reference for power users and developers in Part 2.


📑 Table of Contents

  1. 🟢 Part 1: Explained Simply for Everyone (Plain Language)
  2. 💻 Part 2: Technical Documentation for Experts & Power Users
  3. ❓ Part 3: Comprehensive Frequently Asked Questions (FAQ) & Common Issues
  4. 🔗 Part 4: Official Links & Further Resources

🟢 Part 1: Explained Simply for Everyone (Plain Language)

1.1 Why does Android normally ask for confirmation on every update?

For security reasons, Android does not allow regular apps to silently install other apps in the background. If you start 10 updates in an app without special system permissions, Android pops up a confirmation dialog 10 times in a row ("Do you want to update this app? [Cancel] [Update]"). You have to tap every single dialog manually.

⬆️ Back to Table of Contents


1.2 What is Shizuku and how does it benefit me?

Shizuku is a free, open-source companion app for Android. It uses an official built-in Android system feature (Wireless Debugging) to grant trusted apps like ApkUp the exact same installation privileges that normally only the pre-installed Google Play Store has.

Your benefits with Shizuku in ApkUp:

  • ⚡ One tap on "Update All" is enough: All available updates are downloaded and installed completely automatically in the background, without you having to tap a single confirmation popup!
  • 🛡️ No Root required: Your smartphone stays completely unmodified.

⬆️ Back to Table of Contents


1.3 Step-by-Step Guide: Setting up Shizuku without Root

On Android 11 and newer, you can set up Shizuku directly on your phone without a PC (see also the official Shizuku user guide):

  1. Step 1 – Download Shizuku:
    Install the official Shizuku app for free from the Google Play Store or via GitHub.
  2. Step 2 – Enable Developer Options:
    Open Android Settings ➔ About phone. Tap the "Build number" at the bottom 7 times quickly in a row until you see the message: "You are now a developer!".
  3. Step 3 – Pair Wireless Debugging (one-time setup):
    • Connect your phone to a Wi-Fi network.
    • Open the Shizuku app and tap "Pairing" under "Start via Wireless debugging".
    • Tap the "Developer options" button.
    • Scroll down to "Wireless debugging", toggle it on, and tap directly on the text "Wireless debugging" to open its sub-menu.
    • Select "Pair device with pairing code" and enter the displayed 6-digit code into the Shizuku notification at the top of your screen.
  4. Step 4 – Start Shizuku:
    Go back to the Shizuku app and tap "Start". After 2–3 seconds, Shizuku will show "Shizuku is running" at the top. (After that, you can even turn Wi-Fi off again — Shizuku will keep running!)

⬆️ Back to Table of Contents


1.4 Enabling Shizuku in ApkUp (The 3-Point Status Check)

Open ApkUp and navigate to the Setup ➔ Installation & Permissions tab. There you will see a clear status indicator with three checkpoints:

Status Checkpoint Meaning What to do if inactive?
1. Shizuku installed Checks whether the Shizuku app is installed on your phone. Install Shizuku from the Google Play Store.
2. Service running (Binder) Checks whether Shizuku has been started in the background. Open the Shizuku app and tap "Start".
3. Permission granted Checks whether ApkUp is allowed to access Shizuku. Toggle the switch in ApkUp and tap "Allow all the time" in the popup.

Once all three checkpoints light up green, all installations in ApkUp run completely silently and automatically!

⬆️ Back to Table of Contents


1.5 What happens if my screen turns off or I leave the app?

Since version v1.32, ApkUp includes a dedicated background download service (Foreground Download Service):

  • When you start a large update or tap "Update All", you can immediately minimize ApkUp, use other apps, or lock your screen.
  • In your notification shade, you can always see which app is currently downloading, complete with a percentage progress bar and a "Cancel" button.
  • With Shizuku: Apps finish installing silently even while your screen is turned off.
  • Without Shizuku: As soon as the background download finishes, ApkUp sends you a notification ("Ready to install") that you simply tap once to confirm.

⬆️ Back to Table of Contents


💻 Part 2: Technical Documentation for Experts & Power Users

2.1 Architecture of the Dual-Path Installation Pipeline

To guarantee maximum reliability for both single and batch updates, ApkUp uses a Dual-Path Strategy with Automatic Fallback. All installation jobs are processed sequentially through a synchronized queue (Mutex lock):

flowchart TD
    Start["Installation Job (Single APK / Split Bundle)"] --> Mutex["Sequential Session Synchronization"]
    Mutex --> CheckPref{"Shizuku Mode Enabled?"}
    
    CheckPref -- "Yes" --> CheckBinder{"Shizuku Binder & Permission Ready?"}
    CheckPref -- "No" --> NativePath["Standard Android PackageInstaller API"]
    
    CheckBinder -- "Ready" --> ShizukuExec["Privileged PackageManager Shell Transaction"]
    CheckBinder -- "Not Ready / Denied" --> FallbackNotice["Notice + Automatic Fallback"]
    
    ShizukuExec --> ShizukuSuccess{"Exit Code == 0 & 'Success'?"}
    ShizukuSuccess -- "Yes" --> Cleanup["Clean Temporary Files & Report Success"]
    ShizukuSuccess -- "No (Error)" --> FallbackNotice
    
    FallbackNotice --> NativePath
    NativePath --> BALCheck{"App in Foreground?"}
    BALCheck -- "Yes" --> DirectDialog["Open System Installer Dialog Immediately"]
    BALCheck -- "No (Background / Lock Screen)" --> HeadsUpNotif["Send High-Priority Install Notification"]
    DirectDialog --> Cleanup
    HeadsUpNotif --> Cleanup
Loading

⬆️ Back to Table of Contents


2.2 IPC Communication via Android Binder

Communication with the privileged Shizuku server (running under system identity UID 2000 / shell or UID 0 / root) is performed via Android's Inter-Process Communication (Binder IPC):

  • Package Verification: Queries the Android PackageManager to verify whether moe.shizuku.privileged.api is registered on the device.
  • Liveness Check: Synchronously verifies the remote Binder descriptor (pingBinder()) prior to every transaction.
  • Reactive State Events: System listeners for Binder receipt, Binder death, and permission changes update the UI in real time whenever the Shizuku service starts or stops in the background.

⬆️ Back to Table of Contents


2.3 PackageManager Shell Pipeline & Play Store Attribution (com.android.vending)

When installing via Shizuku, ApkUp executes a multi-stage transaction against the Android system package manager (pm):

  1. Isolated Staging & GZIP Verification: All downloaded package artifacts (single APK, extracted .apkm splits, or compressed Google Play splits) are staged in the private app cache and automatically decompressed if a GZIP magic header (0x1f8b) is detected.
  2. Session Creation with Play Store Origin:
    pm install-create -r -i com.android.vending
    • -r: Replaces the existing application while preserving all user data (INSTALL_REPLACE_EXISTING).
    • -i com.android.vending: Sets the official installation origin (installerPackageName) to the Google Play Store. This ensures full compatibility with apps that verify at runtime whether they were installed from an official store source.
  3. Streaming Package Data via Standard Input (stdin): For each APK split file, binary data is piped directly through a file descriptor stream into the pm process:
    pm install-write -S <byte_size> <session_id> <split_name.apk> -
    Piping directly over stdin cleanly avoids SELinux file access restrictions on private application directories.
  4. Atomic Commit & Rollback Protection:
    pm install-commit <session_id>
    If any sub-step fails, the session is cleanly aborted via pm install-abandon <session_id> and temporary staging files are purged.

⬆️ Back to Table of Contents


2.4 Foreground Service & Android 14+ BAL Resilience

To prevent the Android OS from terminating active downloads when the screen is off or memory pressure is high, ApkUp executes active transfers inside a protected Android Foreground Service (foregroundServiceType="dataSync"):

  • Lifecycle Management: The service stays active strictly as long as downloads or installations remain in the queue and stops itself immediately afterward.
  • Protection Against Background Activity Launch (BAL) Restrictions on Android 10–16: When Shizuku is not used and a download finishes while ApkUp is in the background, modern Android blocks unsolicited system dialogs from popping up. ApkUp detects this state automatically and dispatches an interactive high-priority notification so the user can launch the Android installer dialog with a single tap at their convenience.

⬆️ Back to Table of Contents


❓ Part 3: Comprehensive Frequently Asked Questions (FAQ) & Common Issues

3.1 Do I need Root access on my phone to use Shizuku?

No! Starting with Android 11, Shizuku works completely without Root using Android's built-in Wireless Debugging feature. However, if your device is rooted (e.g., via Magisk, KernelSU, or APatch), Shizuku can optionally be started directly via Root — which is even faster and requires no pairing code.


3.2 Will Shizuku void my warranty or break banking apps?

No, your warranty remains 100% intact and all banking apps continue to work normally. Because Shizuku neither unlocks the bootloader nor modifies system partitions (Root), Google's security checks (Play Integrity / SafetyNet) and Samsung Knox remain completely untouched.


3.3 Why do I have to restart Shizuku after rebooting my phone?

If your phone is not rooted, Android terminates all debugging services whenever the device is completely powered off or restarted for security reasons.

  • You do not have to repeat the 6-digit pairing process!
  • After rebooting your phone, simply open the Shizuku app and tap "Start" once (takes about 3 seconds).

3.4 Issue: "Wireless debugging" is grayed out and cannot be turned on!

Cause: Android only allows enabling Wireless debugging while your smartphone is connected to a Wi-Fi network.

  • Solution: Connect your phone briefly to your home Wi-Fi (or a mobile hotspot) and start Shizuku. As soon as Shizuku says "Shizuku is running", you can turn Wi-Fi off again — the service will stay active!

3.5 Issue: Shizuku searches endlessly for the pairing service or the code input never appears!

This behavior occurs most frequently on smartphones from Xiaomi (MIUI / HyperOS), Oppo/Realme, and Samsung:

  1. Notification Style (Xiaomi): Go to Android Settings ➔ Notifications & Control center ➔ Notification shade and switch it from "MIUI" to "Android" (Classic). Otherwise, the text box for entering the pairing code inside the notification cannot be expanded.
  2. USB Debugging (Security settings): On Xiaomi devices, open Developer options and enable "USB debugging (Security settings)" in addition to standard USB debugging.
  3. Notification Permission: Make sure you have granted the Shizuku app permission to display notifications.

3.6 Issue: Shizuku stops by itself in the background after a while (Xiaomi, Samsung, OnePlus)!

If Shizuku stops after a few hours on its own, this is caused by aggressive OEM battery-saving policies or Android 12/13's Phantom Process Killer:

  • Solution 1 (Battery Optimization): Long-press the Shizuku app icon ➔ App info ➔ Battery and select "Unrestricted".
  • Solution 2 (Developer Options on Android 13+): In Developer options, enable the toggle "Disable child process restrictions".
  • You can also find manufacturer-specific instructions on DontKillMyApp.com.

3.7 What happens if Shizuku stops while ApkUp is downloading an update?

ApkUp will not crash and your downloaded update will not be lost! If ApkUp detects that the Shizuku service is unresponsive at the moment of installation, the app automatically and seamlessly falls back to the standard Android package installer and shows the regular Android confirmation prompt.


3.8 Does "Update All" also work without Shizuku?

Yes, of course. Even without Shizuku, tapping "Update All" downloads all updates in the background. The only difference is that without Shizuku, you briefly tap "Update" in the Android system dialog for each downloaded app.


3.9 Why does my phone recognize apps installed via Shizuku as "Installed from Google Play Store"?

This is an intentional feature of ApkUp! When ApkUp installs an app via Shizuku, it passes the parameter -i com.android.vending (the official package identifier of the Google Play Store) to Android. Some apps otherwise refuse to run or display warnings if they detect they were updated outside the Play Store. Thanks to this attribution, all updated apps behave as if they came directly from the official store.


3.10 How does the optional Root Installer (su) work alongside Shizuku?

Starting with v1.43.0+, rooted devices (Magisk, KernelSU, or APatch) can optionally enable Root Installer (su) under Setup ➔ Installation & Automation:

  • Smart Fallback or Standalone: When both Shizuku and Root are enabled, ApkUp uses Shizuku first and seamlessly falls back to su if Shizuku was not restarted after a reboot. If Shizuku is disabled, ApkUp uses su directly for silent foreground and autonomous background updates (while excluding uninstalled Watchlist apps from unattended background installs).
  • Pre-Install Integrity Verification & Origin Preservation: Before opening a pm install-create session, RootInstaller verifies all staged base and split APKs via ApkIntegrityVerifier (fail-closed) and preserves the existing installer package origin (-i).
  • Interactive Root Check Bottom Sheet: Tapping the Root Installer (su) row opens the dedicated RootSetupBottomSheet where you can verify superuser availability live at any time. For security, importing a configuration backup resets useRootInstaller to false until you re-enable it on the device.
  • Completely Optional: On non-rooted phones, keep this option turned off and continue using Shizuku or the normal Android installer.

⬆️ Back to Table of Contents


🔗 Part 4: Official Links & Further Resources

⬆️ Back to Table of Contents

Clone this wiki locally