[PR #4665] [MERGED] Fix permissions count issue for pkg=null in ADB analysis and add test cases #6353

Closed
opened 2026-10-31 01:13:48 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4665
Author: @Tapraj-Pathak
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @morluto

Base: main ← Head: fix-adb-permissions


📝 Commits (2)

  • 3d431b7 Fix permissions count issue for pkg=null in ADB analysis and add test cases
  • 2f7ff0c fix(adb): handle null package permission counts

📊 Changes

3 files changed (+47 additions, -2 deletions)

View changed files

📝 src/adb/AdbProvider.test.ts (+22 -0)
📝 src/adb/AdbShellOutput.test.ts (+18 -0)
📝 src/adb/AdbShellOutput.ts (+7 -2)

📄 Description

Summary

Return null for requested_permissions_count when ADB reports pkg=null for a package. Add a regression test for this case.

Problem and expected behavior

When dumpsys package reports pkg=null, the requested-permissions count should be unknown (null), not presented as a count. Available version information can still provide complete coverage.

Change and scope

The ADB package projection now returns null for the permission count when parsed package details indicate pkg=null. This is a focused fix to the existing ADB output behavior.

Contribution scope fit: ordinary bug fix within existing boundaries; no maintainer scope decision required.

Contract and boundary impact

  • Semantic owner and earliest changed stage: ADB package output projection.
  • Contribution scope fit and linked maintainer decision: Existing ADB analysis behavior; not applicable.
  • CLI and MCP/tool-catalog contract: No contract or catalog changes intended.
  • Provider, bridge, target-format, or platform compatibility: ADB package output only.
  • Evidence, artifact, provenance, or reconstruction contract: No changes intended.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): No changes intended.
  • Generated metadata, package, or installation impact: None expected.

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 or updated: Added a regression test for pkg=null, expecting requested_permissions_count: null and coverage: "complete".
  • Base reproduction or other evidence: The test fixture includes version metadata alongside pkg=null.
  • User-visible CLI/MCP output: Not captured.
  • Remaining proof gaps: The test has not executed yet; dependencies are missing in this checkout. Real-device ADB behavior has not been verified.

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

  • npm run test:local -- src/adb/AdbProvider.test.ts — could not run: the vitest package is missing.

Compatibility, safety, and release

  • Breaking changes or migration steps: None expected.
  • Real Hopper/Ghidra, browser, or OS coverage: Not applicable; no real-device ADB verification performed.
  • Package or release metadata impact: None expected.
  • Security, privacy, process, or containment review: No changes to these behaviors intended.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

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/4665 **Author:** [@Tapraj-Pathak](https://github.com/Tapraj-Pathak) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix-adb-permissions` --- ### 📝 Commits (2) - [`3d431b7`](https://github.com/morluto/rea/commit/3d431b7999fd9292bc0bfb02a3abe761745740cd) Fix permissions count issue for `pkg=null` in ADB analysis and add test cases - [`2f7ff0c`](https://github.com/morluto/rea/commit/2f7ff0cccd423fc1ec35d1129602d15d52b9ff0b) fix(adb): handle null package permission counts ### 📊 Changes **3 files changed** (+47 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/adb/AdbProvider.test.ts` (+22 -0) 📝 `src/adb/AdbShellOutput.test.ts` (+18 -0) 📝 `src/adb/AdbShellOutput.ts` (+7 -2) </details> ### 📄 Description ## Summary Return `null` for `requested_permissions_count` when ADB reports `pkg=null` for a package. Add a regression test for this case. ## Problem and expected behavior When `dumpsys package` reports `pkg=null`, the requested-permissions count should be unknown (`null`), not presented as a count. Available version information can still provide complete coverage. ## Change and scope The ADB package projection now returns `null` for the permission count when parsed package details indicate `pkg=null`. This is a focused fix to the existing ADB output behavior. Contribution scope fit: ordinary bug fix within existing boundaries; no maintainer scope decision required. ## Contract and boundary impact - Semantic owner and earliest changed stage: ADB package output projection. - Contribution scope fit and linked maintainer decision: Existing ADB analysis behavior; not applicable. - CLI and MCP/tool-catalog contract: No contract or catalog changes intended. - Provider, bridge, target-format, or platform compatibility: ADB package output only. - Evidence, artifact, provenance, or reconstruction contract: No changes intended. - Target selection, authority, upstream behavior, and cleanup details (if applicable): No changes intended. - Generated metadata, package, or installation impact: None expected. 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 or updated: Added a regression test for `pkg=null`, expecting `requested_permissions_count: null` and `coverage: "complete"`. - Base reproduction or other evidence: The test fixture includes version metadata alongside `pkg=null`. - User-visible CLI/MCP output: Not captured. - Remaining proof gaps: The test has not executed yet; dependencies are missing in this checkout. Real-device ADB behavior has not been verified. 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 - `npm run test:local -- src/adb/AdbProvider.test.ts` — could not run: the `vitest` package is missing. ## Compatibility, safety, and release - Breaking changes or migration steps: None expected. - Real Hopper/Ghidra, browser, or OS coverage: Not applicable; no real-device ADB verification performed. - Package or release metadata impact: None expected. - Security, privacy, process, or containment review: No changes to these behaviors intended. ## Author readiness Human owner: <!-- @GitHub-handle --> - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:13:48 +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#6353
No description provided.