Skip to content

Fix permissions count issue for pkg=null in ADB analysis and add test cases - #4665

Merged
morluto merged 2 commits into
morluto:mainfrom
Tapraj-Pathak:fix-adb-permissions
Oct 17, 2026
Merged

morluto merged 2 commits into
morluto:mainfrom
Tapraj-Pathak:fix-adb-permissions

Conversation

@Tapraj-Pathak

@Tapraj-Pathak Tapraj-Pathak commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T03:18:21.595942Z 3d431b7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous defects are fixed and no new blocking issue was found.

Summary

The parser now returns null for the requested-permissions count when ADB reports pkg=null, while preserving available version details.

  • ADB package results leave the permissions count unknown when pkg=null.

Reviews (2) · Last reviewed commit: "fix(adb): handle null package permission..." · Reviewed by Greptile

Comment thread src/adb/AdbProvider.ts Resolved
Comment thread src/adb/AdbProvider.test.ts Resolved
Recognize pkg=null as unknown permission data and keep the provider projection aligned with the parser. Add regression coverage for the parser and provider.

Co-authored-by: Copilot <[email protected]>
@Tapraj-Pathak Tapraj-Pathak reopened this Oct 17, 2026
@morluto
morluto merged commit 509d4c8 into morluto:main Oct 17, 2026
1 check passed
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Thanks for handling the pkg=null case, @Tapraj-Pathak. Returning an unknown permission count instead of a number keeps the ADB result honest while leaving independently available version facts usable. Welcome to REA.

@morluto morluto added the area: tests Test suite and verification label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants