[GH-ISSUE #5426] [Bug] inspect_adb_package reports user_id null on Android 16 because dumpsys prints appId instead of userId #3291

Closed
opened 2026-10-31 00:38:50 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @cyberpunk47 on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5426

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Process capture or runtime observation

Observed behavior

On Android 16 (SDK 36), inspect-adb-package returns user_id: null for installed packages. The same dumpsys package output declares the id as appId=…. Earlier builds print userId=…, and that is the only key the parser reads, so the declared value is dropped and reported as unknown.

This is the same pattern as #2996: the output layout changed, and REA reports a value the device did declare as absent.

Reproduction

Stock SDK 36 emulator:

rea inspect-adb-package emulator-5554 com.android.settings --json
adb -s emulator-5554 shell "dumpsys package com.android.settings | grep -E 'appId=|userId='"

Expected behavior

user_id reports the id the device declares, from userId= on older builds or appId= on newer ones. It stays null only when neither line is present.

Impact and scope

  • Affects: inspect_adb_package (CLI and MCP) on Android 16 builds; user_id is always null there.
  • Not affected: other fields of the same result. On the same device I compared list-adb-packages, list-adb-processes, list-adb-features, list-adb-services, inspect-adb-display, inspect-adb-window, read-adb-setting, list-adb-directory and pull-adb-package (SHA-256) against raw adb, and they matched.
  • Separate from #3943 (installer "null" string).

REA version

6.7.0 (main @ c23e16162)

Runtime and platform

Node.js 24.14, Fedora Linux x64; adb 37.0.0

Target and artifact context

  • Android emulator, SDK 36 (stock Google image)
  • Physical device on LineageOS 23 (Android 16, SDK 36)
    Same result on both.

Interface

CLI

Earliest failure stage

Capture or observation

Relevant output or evidence

REA:

{ "package_name": "com.android.settings", "version_name": "16", "version_code": "36", "user_id": null, "coverage": "complete" }

dumpsys package com.android.settings | grep -E 'appId=|userId=' (no userId= line at all):

    appId=1000      (Package [com.android.settings] section)
    appId=1000      (Shared users: android.uid.system section)

Analysis or suspected cause

parseDumpsysPackageOutput in src/adb/AdbShellOutput.ts assigns userId only for the key userId. The appId line matches the same key=value pattern but is ignored. The existing fixture "keeps permission counts unknown when package state is not established" (src/adb/AdbProvider.test.ts) already uses appId=10234, but it does not assert user_id.

Additional context

Not covered by #4654 (requested-permission count when pkg=null) or #3943 (installer "null" string). The #4654 reproduction also uses appId=10234, but it does not check user_id.

A PR with the fix and regression tests follows and references this issue.

Originally created by @cyberpunk47 on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5426 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Process capture or runtime observation ### Observed behavior On Android 16 (SDK 36), `inspect-adb-package` returns `user_id: null` for installed packages. The same `dumpsys package` output declares the id as `appId=…`. Earlier builds print `userId=…`, and that is the only key the parser reads, so the declared value is dropped and reported as unknown. This is the same pattern as #2996: the output layout changed, and REA reports a value the device did declare as absent. ### Reproduction Stock SDK 36 emulator: ```bash rea inspect-adb-package emulator-5554 com.android.settings --json adb -s emulator-5554 shell "dumpsys package com.android.settings | grep -E 'appId=|userId='" ``` ### Expected behavior `user_id` reports the id the device declares, from `userId=` on older builds or `appId=` on newer ones. It stays `null` only when neither line is present. ### Impact and scope - Affects: `inspect_adb_package` (CLI and MCP) on Android 16 builds; `user_id` is always null there. - Not affected: other fields of the same result. On the same device I compared `list-adb-packages`, `list-adb-processes`, `list-adb-features`, `list-adb-services`, `inspect-adb-display`, `inspect-adb-window`, `read-adb-setting`, `list-adb-directory` and `pull-adb-package` (SHA-256) against raw adb, and they matched. - Separate from #3943 (installer `"null"` string). ### REA version 6.7.0 (main @ c23e16162) ### Runtime and platform Node.js 24.14, Fedora Linux x64; adb 37.0.0 ### Target and artifact context - Android emulator, SDK 36 (stock Google image) - Physical device on LineageOS 23 (Android 16, SDK 36) Same result on both. ### Interface CLI ### Earliest failure stage Capture or observation ### Relevant output or evidence REA: ```json { "package_name": "com.android.settings", "version_name": "16", "version_code": "36", "user_id": null, "coverage": "complete" } ``` `dumpsys package com.android.settings | grep -E 'appId=|userId='` (no `userId=` line at all): ``` appId=1000 (Package [com.android.settings] section) appId=1000 (Shared users: android.uid.system section) ``` ### Analysis or suspected cause `parseDumpsysPackageOutput` in `src/adb/AdbShellOutput.ts` assigns `userId` only for the key `userId`. The `appId` line matches the same `key=value` pattern but is ignored. The existing fixture "keeps permission counts unknown when package state is not established" (`src/adb/AdbProvider.test.ts`) already uses `appId=10234`, but it does not assert `user_id`. ### Additional context Not covered by #4654 (requested-permission count when `pkg=null`) or #3943 (installer `"null"` string). The #4654 reproduction also uses `appId=10234`, but it does not check `user_id`. A PR with the fix and regression tests follows and references this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3291
No description provided.