fix(adb): count requested permissions that the device marks restricted (#2359)

Android 10 and 11 print restricted entries of the requested-permissions
list as "NAME: restricted=true". The parser took the first such line as
the end of the list, so the count stopped there while coverage still
read complete.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jin
2026-10-13 14:52:48 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 55e21a2eec
commit 15463bdbe6
2 changed files with 33 additions and 1 deletions
+5 -1
View File
@@ -236,7 +236,11 @@ export const parseDumpsysPackageOutput = (
inPermissions = true;
continue;
}
if (inPermissions && /^\s{2,}[A-Za-z0-9._]+$/.test(line)) {
// Android 10 and 11 mark restricted entries as "NAME: restricted=true".
if (
inPermissions &&
/^\s{2,}[A-Za-z0-9._]+(?:: restricted=true)?$/u.test(line)
) {
permissions += 1;
continue;
}