[PR #5427] [CLOSED] fix(adb): read the package id from appId on Android 16 #6925

Closed
opened 2026-11-01 21:44:06 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5427
Author: @cyberpunk47
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: fix/adb-package-appid


📝 Commits (1)

  • c06e10a fix(adb): read the package id from appId on Android 16

📊 Changes

3 files changed (+38 additions, -1 deletions)

View changed files

📝 src/adb/AdbProvider.test.ts (+20 -0)
📝 src/adb/AdbShellOutput.test.ts (+16 -0)
📝 src/adb/AdbShellOutput.ts (+2 -1)

📄 Description

Summary

Fixes #5426

On Android 16, dumpsys package prints the package id as appId= instead of userId=, so inspect_adb_package reported user_id: null. The parser now accepts either key. The first declaration still wins, so a later Shared users: section cannot replace the package's own value.

Problem and expected behavior

  • Before (Android 16, com.android.settings): user_id: null, while dumpsys declares appId=1000.
  • After: user_id: 1000.

Violated invariant (AGENTS.md): "Unresolved identity or applicability must remain unknown rather than be treated as absent, foreign, or aligned."

Change and scope

  • src/adb/AdbShellOutput.ts (parseDumpsysPackageOutput): reads userId or appId into the same field. Nothing else changes.
  • Not included:
    • no result schema change;
    • no change to the installer "null" handling, which #3943 covers;
    • no scoping of the parser to the Package [...] block, so behavior for other sections is unchanged.

Contribution scope: not applicable (routine fix within existing boundaries).

Contract and boundary impact

  • Semantic owner and earliest changed stage: ADB shell output parsing (parseDumpsysPackageOutput)
  • Contribution scope fit and linked maintainer decision: routine evidence-correctness fix; not applicable
  • CLI and MCP/tool-catalog contract: none
  • Provider, bridge, target-format, or platform compatibility: Android 16 user_id is now reported; userId= builds unchanged
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): read-only dumpsys only
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added:
    • src/adb/AdbShellOutput.test.ts:
      • an appId= line is read;
      • a later shared-user appId=1000 does not replace the package's own id.
    • src/adb/AdbProvider.test.ts: Android 16-shaped dumpsys package output projects user_id.
  • Base reproduction: with only the test changes applied to the base revision, all 3 new tests fail.
  • Device checks: SDK 36 emulator and LineageOS 23 (Android 16). Both declare appId=, and REA reported user_id: null before the fix.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npx vitest run src/adb: 6 files, 185 tests passed
  • npm run typecheck: passed
  • oxlint on changed files: no new diagnostics. The existing complexity warning on parseDumpsysPackageOutput (35 → 36; warning only) remains.
  • oxfmt --check on changed files: clean

Compatibility, safety, and release

  • Breaking changes or migration steps: none
  • Real Hopper/Ghidra, browser, or OS coverage: Android SDK 36 emulator and device
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: parsing only; no new device commands

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5427 **Author:** [@cyberpunk47](https://github.com/cyberpunk47) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/adb-package-appid` --- ### 📝 Commits (1) - [`c06e10a`](https://github.com/morluto/rea/commit/c06e10a2e187a30a73438ddc4f033fede311a85f) fix(adb): read the package id from appId on Android 16 ### 📊 Changes **3 files changed** (+38 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/adb/AdbProvider.test.ts` (+20 -0) 📝 `src/adb/AdbShellOutput.test.ts` (+16 -0) 📝 `src/adb/AdbShellOutput.ts` (+2 -1) </details> ### 📄 Description ## Summary Fixes #5426 On Android 16, `dumpsys package` prints the package id as `appId=` instead of `userId=`, so `inspect_adb_package` reported `user_id: null`. The parser now accepts either key. The first declaration still wins, so a later `Shared users:` section cannot replace the package's own value. ## Problem and expected behavior - Before (Android 16, `com.android.settings`): `user_id: null`, while `dumpsys` declares `appId=1000`. - After: `user_id: 1000`. Violated invariant (AGENTS.md): "Unresolved identity or applicability must remain unknown rather than be treated as absent, foreign, or aligned." ## Change and scope - `src/adb/AdbShellOutput.ts` (`parseDumpsysPackageOutput`): reads `userId` or `appId` into the same field. Nothing else changes. - Not included: - no result schema change; - no change to the installer `"null"` handling, which #3943 covers; - no scoping of the parser to the `Package [...]` block, so behavior for other sections is unchanged. Contribution scope: not applicable (routine fix within existing boundaries). ## Contract and boundary impact - Semantic owner and earliest changed stage: ADB shell output parsing (`parseDumpsysPackageOutput`) - Contribution scope fit and linked maintainer decision: routine evidence-correctness fix; not applicable - CLI and MCP/tool-catalog contract: none - Provider, bridge, target-format, or platform compatibility: Android 16 `user_id` is now reported; `userId=` builds unchanged - Evidence, artifact, provenance, or reconstruction contract: none - Target selection, authority, upstream behavior, and cleanup details (if applicable): read-only `dumpsys` only - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added: - `src/adb/AdbShellOutput.test.ts`: - an `appId=` line is read; - a later shared-user `appId=1000` does not replace the package's own id. - `src/adb/AdbProvider.test.ts`: Android 16-shaped `dumpsys package` output projects `user_id`. - Base reproduction: with only the test changes applied to the base revision, all 3 new tests fail. - Device checks: SDK 36 emulator and LineageOS 23 (Android 16). Both declare `appId=`, and REA reported `user_id: null` before the fix. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npx vitest run src/adb`: 6 files, 185 tests passed - `npm run typecheck`: passed - `oxlint` on changed files: no new diagnostics. The existing complexity warning on `parseDumpsysPackageOutput` (35 → 36; warning only) remains. - `oxfmt --check` on changed files: clean ## Compatibility, safety, and release - Breaking changes or migration steps: none - Real Hopper/Ghidra, browser, or OS coverage: Android SDK 36 emulator and device - Package or release metadata impact: none - Security, privacy, process, or containment review: parsing only; no new device commands ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:44:06 +00:00
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#6925
No description provided.