Skip to content

Validate module --auto-install on a physical rooted device (MagiskSU two-parse model + cleanup) #39

Description

@Xiddoc

Summary

PR #37 (#7) shipped beetroot module <name> <zip> --auto-install for adb-adopted rooted devices with the full CI-level contract pinned by mocked, argv-exact tests (push → su -c 'magisk --install-module …' → cleanup rm, sha256 fail-closed, per-module reporting, hostile-filename injection tests). What it could not include — the development environment has no Android device or Docker daemon — is a run against a real MagiskSU.

This issue tracks that one-time smoke validation on a physical rooted phone (or any real adb target with Magisk) before the feature is treated as release-grade.

Why this is worth a real-device pass

The security fix in PR #37 rests on a specific model of two device-side shell parses: adb shell flattens argv into one line (parse 1: device shell), then MagiskSU re-joins everything after -c and executes it via an inner sh -c (parse 2). The fix (synthesized beetroot-module-<i>.zip temp names + dual-level shlex.quote) was hand-traced and review-approved against that model, but the model itself is exactly the kind of thing that varies across su implementations/versions — and mocked tests structurally cannot catch a wrong model, only a wrong implementation of it.

Checklist

  • Happy path: a real module zip installs via --auto-install; module visible in magisk --list after reboot.
  • Spaced local filename (My Module.zip) installs (synthesized remote name sidesteps both parses).
  • Hostile local filename (e.g. $(true).zip — benign payload) installs normally, nothing executed, name never reaches a device shell.
  • sha256 mismatch refused before any push.
  • One bad zip in a multi-module batch: failed row + remaining modules still install; exit 1.
  • Cleanup: no beetroot-module-*.zip left in /data/local/tmp after success AND after an install failure.
  • Fold any divergence found back into the mocked tests (adjust the model, then the strings the tests pin).

Refs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions