Skip to content

fix(magisk): denylist (package, process) remodel so root hides in the DroidGuard process - #270

Merged
Xiddoc merged 1 commit into
masterfrom
claude/beetroot-sweep-optimize-fnq7r0
Jul 1, 2026
Merged

fix(magisk): denylist (package, process) remodel so root hides in the DroidGuard process#270
Xiddoc merged 1 commit into
masterfrom
claude/beetroot-sweep-optimize-fnq7r0

Conversation

@Xiddoc

@Xiddoc Xiddoc commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #170 — the last substantive item from the original 71-issue triage, and the one deferred from PR #249 for its blast radius.

Magisk keys its denylist on (package_name, process), but magisk-config.sh copied each entry into both columns, and the default listed com.google.android.gms.unstable — the DroidGuard / Play-Integrity process of com.google.android.gms — as if it were a package. A row with package_name='com.google.android.gms.unstable' matches no installed app, so vanilla (non-Shamiko) Magisk never hid root in the attestation process — defeating the denylist's main purpose.

The fix (minimal-churn)

Kept the BEETROOT_DENYLIST_PACKAGES env-var contract stable (so the compose template and its tests are untouched):

  • Denylist entries now take a package[/process] shape (no slash ⇒ the process is the package). Default: (com.google.android.gms, com.google.android.gms/com.google.android.gms.unstable).
  • The grammar validates both halves — the SQL-injection prophylaxis is intact.
  • magisk-config.sh splits on the first / and inserts the real package into package_name and the process into process — never copying one value into both.
  • The redroid/adb denylist health check matches enrolment by the package half (so a pkg/process-only config still counts as enrolled).
  • Docs and all example configs (default, lsposed, with-frida, stealth) demonstrate the corrected form (.unstable/.persistent are GMS processes, not packages).

Testing

New tests include a guard that .unstable never appears in package_name, no-slash/slash split cases, a process-only-entry-still-enrols case, and the corrected default. Full local gate green: ruff, mypy --strict (src+tests), pytest -p no:randomly at 100% line+branch coverage (1987 passed, 6 docker-daemon skips), shellcheck/shfmt, yamllint, codespell, deptry, uv lock --check, changelog lint.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P1YsNMpGizhSDDPCBu5cut


Generated by Claude Code

… DroidGuard process (#170)

Magisk keys its denylist on (package_name, process), but magisk-config.sh
copied each entry into BOTH columns and the default listed
com.google.android.gms.unstable — the DroidGuard/Play-Integrity *process* of
com.google.android.gms — as if it were a package. A row with
package_name='com.google.android.gms.unstable' matches no installed app, so
vanilla (non-Shamiko) Magisk never hid root in the attestation process.

Minimal-churn fix (keeps the BEETROOT_DENYLIST_PACKAGES env-var contract, so
the compose template is untouched):
- denylist entries now take a `package[/process]` shape (no slash => process
  is the package); default = (com.google.android.gms,
  com.google.android.gms/com.google.android.gms.unstable)
- the grammar validates BOTH halves (SQL-injection prophylaxis intact)
- magisk-config.sh splits on the first '/' and inserts the real package into
  package_name and the process into process, never both
- the redroid/adb denylist health check matches enrolment by the package half
- docs + all example configs demonstrate the corrected form

All covered by tests (incl. a guard that .unstable never appears in
package_name); full gate green (ruff, mypy --strict src+tests, pytest 100%
line+branch (1987 passed), shellcheck/shfmt, yamllint, codespell, deptry,
uv lock, changelog lint).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1YsNMpGizhSDDPCBu5cut
@Xiddoc
Xiddoc merged commit c960791 into master Jul 1, 2026
17 checks passed
@Xiddoc
Xiddoc deleted the claude/beetroot-sweep-optimize-fnq7r0 branch July 1, 2026 08:14
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