Skip to content

Fix system-patched Shizuku startup without wireless debugging - #171

Merged
0cwa merged 3 commits into
mainfrom
fix/shizuku-init-autostart
Nov 8, 2026
Merged

0cwa merged 3 commits into
mainfrom
fix/shizuku-init-autostart

Conversation

@0cwa

@0cwa 0cwa commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Why

ModOS already had an opt-in Shizuku adapter, but its rootless boot path had concrete startup defects: no explicit init-to-shell SELinux transition, a forking native starter whose parent immediately exits under init, and incomplete native libraries for the preinstalled manager. Shizuku's own boot receiver could also enable USB/wireless debugging.

Changes

  • Run the official, digest-locked Shizuku v13.6.0 server in the foreground under init, using shell UID/GID 2000, the explicit u:r:shell:s0 domain, ADB supplementary groups, and a ten-second restart interval.
  • Install all three native libraries from the locked APK (libadb.so, librish.so, libshizuku.so) for both rootless and Magisk modes.
  • Add a rootless-only sysconfig default override for the official boot receiver, preserving the original APK signature and ordinary per-client approval.
  • Document migration from an existing installation: keep Shizuku's own Start on boot setting off in rootless mode. A saved explicit enabled state overrides Android's component default; the init service starts independently.
  • Make the post-boot check verify effective receiver state, init state, enforcing SELinux, actual server domain/UID, Binder response, and wireless-debugging state. Unknown or malformed evidence cannot pass. All commands remain read-only and USB-scoped.
  • Include the adapter's checked SHA-256 in Shizuku-enabled build fingerprints, add the missing multi-device workflow toggle, and run the Shizuku regression suites in CI.

The option remains default-off. Separate rootless and Magisk builds are supported; the existing rejection of ROOT_MODE=both remains because those outputs share one product image.

Enable the no-debugging boot service

In the existing [build] section:

ROOT_MODE = "rootless"
'ADDITIONALS[SHIZUKU]' = true

Manual GrapheneOS single-device/multi-device and LineageOS workflows also accept shizuku: true with root-mode: rootless.

Validation

Passed locally:

  • 12 Shizuku adapter tests, including executing the generated launcher and checking that app_process retains the launcher's PID.
  • 8 post-boot checker test methods with failure/unknown subcases and an explicit read-only USB command whitelist.
  • ROM contract, module selection, workflow contract, typed config, config schema, root-mode-both, scheduled definition, and LineageOS workflow routing suites.
  • Changed shell syntax, Python parsing, staged secrets scan, and git diff --check.
  • Downloaded the actual locked upstream APK, verified SHA-256 6e273ab0e991c4e79bc8b1bbb9b9dd739ccac1a8712a541a214078886b7b790f, and parsed the complete native payload for all four ABIs. ARM64 ELF dependencies are system libraries.

No complete OTA build or physical-device boot was performed here. The README specifies cold-boot/reboot testing with USB and wireless debugging disabled, client approval checks, and subsequent optional USB diagnostics. Host tests establish source/build behavior, not target-device runtime acceptance.

Upstream basis

Final integration review (2026-11-08)

Resolved conflicts with current main while retaining both Shizuku and diagnostic adapter-digest tests, and incorporated #169's Lineage-only BCR policy. Independent adapter/upstream-policy review and post-boot/identity review found no blocking defect.

The combined tree passes 12 Python suites and 10 shell suites, including Shizuku, diagnostics/device audit, original-vold/source safeguards, configuration, ROM/module selection, schedules, workflows, root modes, Magisk verification, and source care-map policy. Uploaded blobs and the complete tree match the locally reviewed tree f5b48b9df6ad40435dd94d69fefa64ec4aec1029.

Final repository CI 42531829359 passed for head c8e7d456e40debe750cb7b8025b7267cfd7425a0. Merged after independent review, current-main integration, and the complete repository test job.

Shizuku remains default-off. Physical cold-boot, debugging-disabled startup, actual SELinux/Binder behavior, and normal client approval acceptance remain explicitly outstanding.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6a8ca40e-1598-4ba8-929f-ddcbe209d949
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Resolve ROM fingerprint test conflicts while retaining diagnostic, BCR and Shizuku digest coverage. Preserve the Lineage-only BCR policy and default-off Shizuku behavior.

Independent adapter, upstream policy and post-boot audit review found no blocking defect. Twelve Python suites and ten shell suites pass on the combined tree, including Shizuku launcher/checker tests and shared build contracts. Physical-device startup acceptance remains documented and outstanding.

Uploaded tree matches locally reviewed tree f5b48b9.
Resolve GitHub's ambiguous merge-base conflict after #169 landed. Local git merge-tree produces the already reviewed and CI-passing tree f5b48b9; this commit changes ancestry only.
@0cwa
0cwa merged commit b431d8b into main Nov 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant