Skip to content

ADFA-3827 Whitelist for MIUI's AccessController.haveAccessControlPassword disk read during startActivity transitions#1246

Merged
hal-eisen-adfa merged 1 commit intostagefrom
ADFA-3827-StrictMode-violations-permissions
Apr 25, 2026
Merged

ADFA-3827 Whitelist for MIUI's AccessController.haveAccessControlPassword disk read during startActivity transitions#1246
hal-eisen-adfa merged 1 commit intostagefrom
ADFA-3827-StrictMode-violations-permissions

Conversation

@hal-eisen-adfa
Copy link
Copy Markdown
Collaborator

@hal-eisen-adfa hal-eisen-adfa commented Apr 25, 2026

Part of fixing StrictMode violations
Xiaomi/MIUI ROM checks an access-control password file during activity transitions

@hal-eisen-adfa hal-eisen-adfa requested a review from a team April 25, 2026 01:07
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

📝 Walkthrough

Walkthrough

A new strict-mode whitelist rule is added to WhitelistEngine.kt that allows DiskReadViolation when java.io.File.exists calls appear in frames adjacent to MIUI access-control password verification methods, addressing framework-specific exception scenarios on MIUI devices.

Changes

Cohort / File(s) Summary
Strict Mode Whitelist Rule
app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistEngine.kt
Added a new DiskReadViolation whitelist rule that permits file-existence checks when they appear in call frames adjacent to MIUI access-control password checks (AccessController.haveAccessControlPassword and SecurityManagerService.haveAccessControlPassword).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • itsaky-adfa
  • alome007
  • Daniel-ADFA

Poem

🐰 A whitelist rule hops into place,
Letting disk reads have their space—
When MIUI guards stand by with care,
File checks dance without a snare! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a whitelist for MIUI's AccessController.haveAccessControlPassword disk read violations during activity transitions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description accurately relates to the changeset, which adds a StrictMode whitelist rule for MIUI's AccessController.haveAccessControlPassword disk read violations during activity transitions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 ADFA-3827-StrictMode-violations-permissions

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistEngine.kt`:
- Around line 142-144: Update the comment in WhitelistEngine.kt to avoid
implying the violation originates remotely in the system_server; instead note
that the stack shows com.miui.server.AccessController and SecurityManagerService
frames executing in-process on MIUI ROMs (e.g., "executes in-process during
activity transitions on MIUI ROMs"), so change the wording around that block
where the current comment mentions "happens in the system server and is reported
back via Binder" to the tightened phrasing; keep this as a documentation-only
change in the same comment near the handling of
AccessController/SecurityManagerService frames.
- Around line 137-153: Add a unit test in WhitelistRulesTest.kt that covers the
new rule: create a test method (follow naming like
allow_DiskRead_on_MiuiMultiLangHelperTextViewDraw, e.g.,
allow_DiskRead_on_MiuiAccessControllerHaveAccessControlPassword) that constructs
a stack trace with adjacent frames matching java.io.File.exists ->
com.miui.server.AccessController.haveAccessControlPassword ->
com.miui.server.SecurityManagerService.haveAccessControlPassword, triggers a
DiskReadViolation, and asserts the WhitelistEngine rule allows it (use the same
helper/assert utilities used by existing tests to verify the rule permits
DiskReadViolation for that frame sequence).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 933dbfc7-143a-4823-a62b-0a31ae4b0355

📥 Commits

Reviewing files that changed from the base of the PR and between 9726e17 and 92ccbc7.

📒 Files selected for processing (1)
  • app/src/main/java/com/itsaky/androidide/app/strictmode/WhitelistEngine.kt

@hal-eisen-adfa hal-eisen-adfa merged commit 65c121a into stage Apr 25, 2026
2 checks passed
@hal-eisen-adfa hal-eisen-adfa deleted the ADFA-3827-StrictMode-violations-permissions branch April 25, 2026 18:54
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.

2 participants