Command lint report¶
Produced by lint-commands.py over this repository's markdown. Every rule corresponds to a failure measured on a real device — see the script header for the transcripts.
Counts move. The su -c repairs are owned by another worker; re-run before quoting any number here.
| Files scanned | 827 |
| ERROR | 0 |
| WARN | 976 |
| Suppressed counter-examples | 179 |
By rule¶
| Rule | Tier | Hits | Files | Why it is wrong |
|---|---|---|---|---|
SU-DASH-C |
ERROR | 0 | 0 | UNQUOTED su -c. adb shell does not preserve quoting, so the local shell strips the quotes and the line reaches the device as separate argv words: adb shell su -c 'a; b' runs only a, and flags after the command are eaten by su -- su -c magisk -v prints su's version. This is broken on EVERY device and every su implementation, which is why it is an ERROR. |
SU-CONVENTION |
WARN | 383 | 145 | Quoting is correct here, so this is a portability warning rather than a defect. su -c 'cmd' is right on a Magisk su (measured working for su -c 'pm install' on this repo's Redmi M2101K6P, Android 11 / API 30) and fatal on AOSP su (every userdebug build and every AVD), which takes su <uid> <cmd> and answers su: invalid uid/gid '-c' -- a message that reads as NOT ROOTED. Neither form is universally correct. Say which device the line assumes, or probe both. |
SU-DASH-C-BARE |
WARN | 432 | 146 | A device-side su -c. Correct on a Magisk phone, fatal on an AVD or any AOSP userdebug build, where su takes su <uid> <cmd>. If the sheet does not say which device it assumes, the reader will run it on the wrong one. |
ADB-SHELL-NESTED-QUOTES |
ERROR | 0 | 0 | adb shell sh -c '...' with the outer command NOT double-quoted. The host shell strips the single quotes, adb re-joins the remaining argv with spaces, and the device shell re-splits. Measured: adb shell sh -c 'echo A; echo B' prints a blank line then B — the first command is SWALLOWED, with no error and exit 0. |
MSYS-PATHCONV |
WARN | 122 | 78 | An unquoted absolute DEVICE path after adb shell. On Git Bash / MSYS2 the path is rewritten to a HOST path before adb sees it, and the error names a Windows directory, so it reads as an adb or device problem. Measured: adb shell ls -la /sdcard/ returns ls: C:/Program: No such file or directory. Every Android top-level path tested was rewritten EXCEPT /proc, which MSYS treats as a virtual mount — so the failure is intermittent across a sheet and looks arbitrary. Harmless on Linux and macOS; this repository is written on Git Bash. |
EXEC-SHELL-COMMAND-NOT-A-SHELL |
ERROR | 0 | 0 | UiAutomation.executeShellCommand is NOT a shell: it splits on whitespace and execs. Measured — echo "one two" returns the quote characters, and getprop \| wc -l returns nothing AT ALL with no error. It also runs as uid 2000, so a probe routed through it has measured the shell while looking like an in-process measurement. |
ADB-IN-READ-LOOP |
WARN | 0 | 0 | adb shell inherits stdin, so inside a while read loop fed by a pipe it consumes the loop's input. Measured: a three-row loop printed ONE row and exited 0, reading exactly like a device with nothing on it. |
PIPEFAIL-SIGPIPE |
WARN | 34 | 6 | set -o pipefail plus an early-exit consumer (head, grep -q) reports failure ON SUCCESS: the consumer closes the pipe, the writer dies of SIGPIPE, and pipefail promotes 141 to the pipeline's status. Measured 141 for both yes \| head -3 and seq 1 100000 \| grep -q 5. It cost this repository an hour once and printed "not a JNI library" directly below a list of JNI exports another time. |
XML-COMMENT-DOUBLE-HYPHEN |
WARN | 5 | 5 | -- inside an XML comment is not well-formed XML and aapt2 rejects the file. Five real .xml files in this repository hit it, every one because a command-line flag (--es, --uri, --brief) or an em dash was written inside a comment. Tiered WARN after adjudication, not ERROR: all five hits in the current markdown are documentation header comments at the top of an xml fence (<!-- path/to/file.xml -- what it is -->), which break a build only if the reader copies the header into the file too. The rule is cheap and the class is real, so it stays — at the tier the evidence supports. |
Correct forms¶
| Rule | Ship this instead |
|---|---|
SU-DASH-C |
adb shell "su -c 'a; b'" # or, on an AVD: adb shell "su 0 sh -c 'a; b'" |
SU-CONVENTION |
adb shell "su 0 <cmd>" on an AVD; keepsu -cfor a Magisk phone |
SU-DASH-C-BARE |
su 0 <cmd> |
ADB-SHELL-NESTED-QUOTES |
adb shell "sh -c 'echo A; echo B'" |
MSYS-PATHCONV |
adb shell 'ls -la /sdcard/' # quote it; MSYS_NO_PATHCONV=1 also works |
EXEC-SHELL-COMMAND-NOT-A-SHELL |
executeShellCommand("sh -c 'getprop \| wc -l'") |
ADB-IN-READ-LOOP |
adb shell <cmd> < /dev/null |
PIPEFAIL-SIGPIPE |
grep -c (reads all input), or a shellcaseglob, or drop pipefail |
XML-COMMENT-DOUBLE-HYPHEN |
write the flag without its leading hyphens, or use an en dash |
Files with the most findings¶
Line numbers are deliberately omitted — see render_md in the script. Re-run without --summary-only for them.
| File | Findings |
|---|---|
73-Labs/references/lab-index-by-requirement.md |
58 |
62-Magisk/README.md |
47 |
09-Android-App-Internals/labs/lab-02-tracing-the-install-flow.md |
30 |
62-Magisk/labs/lab-01-root-a-device.md |
28 |
62-Magisk/cheatsheet.md |
27 |
60-ADB/README.md |
22 |
44-NetworkSecurityConfig/README.md |
20 |
62-Magisk/labs/lab-03-denylist-investigation.md |
20 |
36-CertificatePinning/labs/lab-02-defeat-a-two-layer-pin.md |
16 |
33-Storage/labs/lab-04-ctf-the-plaintext-copy.md |
15 |
33-Storage/labs/lab-02-filesystem-diff-across-a-session.md |
13 |
43-WebView/labs/lab-01-exploit-a-javascript-bridge.md |
13 |
53-Frida/README.md |
13 |
43-WebView/labs/lab-04-ctf-the-deputy-in-the-browser.md |
12 |
53-Frida/labs/lab-01-first-contact.md |
12 |
62-Magisk/labs/lab-02-write-a-module.md |
12 |
17-Libraries/README.md |
11 |
33-Storage/cheatsheet.md |
11 |
47-Authentication/README.md |
11 |
53-Frida/cheatsheet.md |
11 |
01-Computer-Science-Basics/README.md |
10 |
20-Security-Architecture/labs/lab-02-vbmeta-and-verified-boot.md |
10 |
35-SSL/labs/lab-01-end-to-end-interception.md |
10 |
30-Activities/labs/lab-04-tapjacking-consent.md |
9 |
49-KeyStore/README.md |
9 |
00-Introduction/README.md |
7 |
02-Linux-Basics/README.md |
7 |
09-Android-App-Internals/README.md |
7 |
21-App-Sandbox/README.md |
7 |
34-Cryptography/labs/lab-01-break-the-vault.md |
7 |
213 file(s) carry at least one finding.