Skip to content

core: refresh Shizuku status before checking installation eligibility#434

Merged
rainxchzed merged 1 commit into
mainfrom
fix-shizuku-status-stale
Apr 20, 2026
Merged

core: refresh Shizuku status before checking installation eligibility#434
rainxchzed merged 1 commit into
mainfrom
fix-shizuku-status-stale

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented Apr 20, 2026

  • Update shouldUseShizuku to call shizukuServiceManager.refreshStatus() before checking the current status value.
  • Ensures the installer does not rely on a stale binder status cache when routing installation attempts.
  • Maintains the requirement that both the user preference must be set to InstallerType.SHIZUKU and the service status must be READY.

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of Shizuku-based installation by refreshing system status before permission checks and installation operations, ensuring up-to-date status information is used instead of cached values.

- Update `shouldUseShizuku` to call `shizukuServiceManager.refreshStatus()` before checking the current status value.
- Ensures the installer does not rely on a stale binder status cache when routing installation attempts.
- Maintains the requirement that both the user preference must be set to `InstallerType.SHIZUKU` and the service status must be `READY`.
@rainxchzed rainxchzed merged commit be9cd77 into main Apr 20, 2026
1 check was pending
@rainxchzed rainxchzed deleted the fix-shizuku-status-stale branch April 20, 2026 07:53
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2d7c91f3-a9bf-4552-8d36-2bc3016b5890

📥 Commits

Reviewing files that changed from the base of the PR and between f9f8768 and 571ce18.

📒 Files selected for processing (1)
  • core/data/src/androidMain/kotlin/zed/rainxch/core/data/services/shizuku/ShizukuInstallerWrapper.kt

Walkthrough

A modification to the Shizuku installer's status checking logic that adds a refreshStatus() call to the shouldUseShizuku() method. This ensures that Shizuku routing conditions in ensurePermissionsOrThrow() and install() evaluate against current status rather than cached values, while preserving the preference gate and READY state requirement.

Changes

Cohort / File(s) Summary
Shizuku Status Refresh Logic
core/data/src/androidMain/kotlin/zed/rainxch/core/data/services/shizuku/ShizukuInstallerWrapper.kt
Refactored shouldUseShizuku() to call shizukuServiceManager.refreshStatus() before evaluating Shizuku readiness conditions, ensuring callers use current status in routing decisions for installation and permission handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through Shizuku's gate,
Refreshing status, oh so great!
No stale cache can block the way,
Fresh status checks save the day! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-shizuku-status-stale

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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