Skip to content

feat(android): project declared component process and access flags - #7264

Closed
harshjohiya wants to merge 5 commits into
morluto:mainfrom
harshjohiya:fix/android-manifest-component-attributes-4448
Closed

harshjohiya wants to merge 5 commits into
morluto:mainfrom
harshjohiya:fix/android-manifest-component-attributes-4448

Conversation

@harshjohiya

@harshjohiya harshjohiya commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a bounded, declaration-only projection of three remaining Android manifest component attributes: android:enabled, android:process, and provider android:grantUriPermissions.

Related: #4448 (partial contribution; this does not close the full issue).

Problem and expected behavior

The component inventory currently exposes exported state, permissions, intent actions, and provider authorities, but omits these three declared attributes. Analysts otherwise need to inspect raw manifest XML. The new fields preserve exact process spellings and represent missing or nonliteral boolean declarations as null rather than inferring runtime state.

Change and scope

  • Extend the existing bounded manifest parser with enabled, process, and grant_uri_permissions fields.
  • Keep projection literal and namespace-aware; do not infer application defaults, merged manifests, resource values, or effective runtime state.
  • Limit copied process declarations to a shared 1 MiB budget, recording partial coverage when exhausted.
  • Add nullable schema defaults for historical Evidence without these fields.
  • Document the new declarations, uncertainty, and limits.
  • Add regression cases for literals, nonliteral declarations, namespace isolation, budget exhaustion, and older result shapes.

No provider, runtime target action, CLI parameter, or authority expansion. The remaining #4448 requests (intent-filter structure, metadata locations, class-name alias handling) are outside this PR.

Contract and boundary impact

  • Semantic owner: decoded Android manifest component parser; result schema is the consumer.
  • Contribution scope: existing static Android inspection, no new capability requiring advance maintainer approval.
  • CLI/MCP output: additive nullable component fields.
  • Compatibility: previously serialized component objects parse with null defaults for the new fields.
  • Evidence/provenance: exact declarations; missing or unsupported values remain unknown, with limitations.
  • Provider/target effects: none beyond existing read-only APK inspection.
  • Generated package/catalog: no authored tool contract or generated artifact change.
  • Expected effects: documentation/usability and reading existing APK metadata only.

Evidence and validation

  • Source-derived: the existing parser omitted these attributes and the output schema was strict.
  • Added focused regression tests under tests/boundary/android/androidManifestComponents.test.ts, including a follow-up cumulative-budget regression prompted by Greptile review (commit 987b5ac).
  • Verified source diff and the newly pushed cumulative-budget test against the intended four-file scope. The test's 512 declarations are individually 2,050 UTF-8 bytes; the 512th crosses the 1 MiB shared cap.
  • Not executed: npm ci, Vitest, typecheck, npm run check:fast, and real JADX/APK verification. The execution environment could not resolve github.com for a local checkout; upstream CI workflows currently report action_required (no test-job results). The tests have been added but are not claimed to pass.
  • Before review/merge, run npm ci && npm run test:focused -- tests/boundary/android/androidManifestComponents.test.ts, npm run check:fast, and a representative real inspect-android-package workflow.

Compatibility, safety, and release

No new process execution, network access, code injection, or target mutation. Static declared attributes are not treated as runtime facts. No breaking schema changes are intended.

Author readiness

Human owner: @harshjohiya

  • 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 no new provider is introduced.
  • The PR has one focused outcome and follows the conventional title style.
  • Related issue is linked as a partial contribution.
  • Focused and real-provider checks pass.
  • Owning documentation and output schema have been updated.
  • The human owner has reviewed the final diff, test evidence, and all validation gaps.

@greptile-apps

greptile-apps Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge, with no outstanding findings.

Summary

Adds declared enabled, process, and provider grant_uri_permissions fields, with null defaults for older Evidence. Process declarations share a 1 MiB copy budget.

  • Android component records include declared enabled, process, and URI-grant values.

Reviews (2) · Last reviewed commit: "test(android): enforce cumulative proces..." · Reviewed by Greptile

@harshjohiya
harshjohiya marked this pull request as ready for review October 26, 2026 19:05
Copilot AI balanced review requested due to automatic review settings October 26, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

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 ✅ Completed 2026-10-26T19:11:53.722415Z 987b5ac Draft marked ready
ℹ️ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 987b5aceb6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +121 to +123
enabled: z.boolean().nullable().default(null),
process: z.string().nullable().default(null),
grant_uri_permissions: z.boolean().nullable().default(null),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve unknown coverage for legacy component fields

When inspect_android_package Evidence produced after the component inventory was introduced but before this change is loaded, each item lacks these keys while retaining components.status: "complete" and no limitation; these defaults turn that unobserved coverage into null. Such an APK may actually declare any of these attributes, so replay now presents a complete inventory in which a historical unknown is indistinguishable from an absent declaration. Detect the omitted legacy shape at the inventory boundary and report partial/unavailable facet coverage (or preserve the declaration) instead of silently defaulting it.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

CI status clarification: the CI and PR title workflow runs currently show action_required with zero jobs executed, so these are not failing test results. This appears to be GitHub's required approval for workflows from an external fork. Could a maintainer with write access review the diff and approve those workflow runs when appropriate? The separate PR readiness check did execute and reports that all three human Author readiness declarations remain unchecked; the human owner must review and complete those personally. Automated reviewer feedback was addressed in 987b5ac, but no passing repository test run is claimed.

@morluto

morluto commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thank you for contributing to this! The enabled, process, and grant_uri_permissions manifest component fields have already landed on main in #7379 (7e8f7f6101, which also closed #4448). Closing this PR as already landed.

@morluto morluto closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants