[PR #7379] [MERGED] feat(android): expose selected manifest component declarations #7839

Closed
opened 2026-11-05 01:48:02 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7379
Author: @gensokyo-dev
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @gensokyo-dev

Base: main ← Head: feat/android-component-inventory


📝 Commits (3)

  • a742033 feat(android): expose selected manifest component declarations
  • 0bfd907 test(android): verify every retained manifest component
  • 98f7afd test(mcp): preserve full input guidance outside compact frame budgets

📊 Changes

33 files changed (+2697 additions, -235 deletions)

View changed files

📝 docs/android-analysis.md (+58 -2)
📝 docs/mcp-contracts.md (+2 -0)
📝 experiments/analysis-efficiency/README.md (+4 -0)
➕ experiments/analysis-efficiency/android-component-costs.py (+65 -0)
➕ experiments/analysis-efficiency/android-components.md (+222 -0)
➕ experiments/analysis-efficiency/android-components.mjs (+294 -0)
➕ experiments/analysis-efficiency/fixtures/android-components/AndroidManifest.xml (+22 -0)
➕ experiments/analysis-efficiency/fixtures/android-components/BuildDex.java (+15 -0)
➕ experiments/analysis-efficiency/fixtures/android-components/ManifestFixture.smali (+3 -0)
➕ experiments/analysis-efficiency/fixtures/android-components/README.md (+43 -0)
➕ experiments/analysis-efficiency/fixtures/android-components/manifest-oracle.py (+70 -0)
➕ experiments/analysis-efficiency/fixtures/android-components/res/values/values.xml (+4 -0)
➕ experiments/analysis-efficiency/fixtures/android-components/verify-fixture.py (+58 -0)
📝 scripts/verify/android/metadata.mjs (+4 -0)
➕ src/android/AndroidManifestComponentDetails.ts (+249 -0)
📝 src/android/AndroidManifestComponents.ts (+71 -141)
➕ src/android/AndroidManifestXml.ts (+50 -0)
📝 src/android/JadxAnalysis.ts (+7 -1)
📝 src/application/android/AndroidPackageInspection.ts (+6 -2)
📝 src/cli/androidCommands.ts (+39 -5)

...and 13 more files

📄 Description

Summary

Fixes #4448. Extend the existing static manifest inventory with declared enabled/process/URI-grant values, grouped intent-filter data and priorities, metadata names, and exact decoded-manifest locations. Add selected component pages and counts through shared CLI/MCP retained views, keeping complete Evidence accessible.

Incorporates Harsh's #7264 at 987b5aceb66c7526e47cf6d064c22029c2f48c04, with co-author credit, and fixes its historical-field review finding: newly unobserved fields remain omitted with declaration_coverage: unknown, rather than becoming false absence facts.

Contract and boundary impact

  • One domain schema owns component facts. The manifest producer shares namespace interpretation and a single nested-declaration pass; the former duplicate schemas and separate flattened-value reader are removed.
  • Complete requests and the existing default summary remain compatible. Explicit summary views support exact kind/name/action/exported-declaration filters, fields, paging and component counts. Rows preserve parent ordinals, source coverage, APK identity and provenance; explicit/default exports remain distinct.
  • Limits account for copied values and serialized projections. Unsupported data constraints/filter constructs produce partial coverage with retained-source recovery. Resource references remain declarations; metadata values remain in the complete manifest.
  • Static analysis within the existing JADX boundary. Maintainer scope decision: not applicable; no target execution, injection, mutation or protection recovery. Existing bridge version 7 is unchanged. CLI summary writes only the selected Evidence bundle; provider cleanup uses existing ownership.
  • Generated catalogs/packaged skill are regenerated ignored outputs; no binaries, dependencies or credentials are committed.

Expected effects:

  • Read existing files or captured data.
  • Launch an owned local analysis JVM; never execute an APK or attach to a target.
  • Write caller-selected Evidence output and owned temporary analysis files.

Evidence and regression coverage

Executed:

  • 111 manifest parser cases, six retained projection cases, four CLI early-validation cases and four MCP boundary cases pass. Includes historical omission, source locations, namespace aliases, unsupported data constraints, bounded copying/pages, filters, named SDK-converted schemas, retained source removal and complete/default compatibility.
  • Real JDK 21/JADX 0.7.1 metadata regression and downstream CLI/MCP method-body/direct-invoke parity pass for classes.dex and classes2.dex. Existing default-package selectors preserve raw identity and frozen metadata across source generation.
  • Public ApiDemos 6.0.18: after the review follow-up, all 355 parent rows’ identity, enabled/process/permission and grouped filter/metadata facts and the selected SMS receiver match an unfiltered independent ElementTree oracle through real stdio MCP on first/warm capture and full parent export. Original timing cohorts checked selected facts and the global count; their narrower scope is corrected explicitly in the report.
  • AAPT2-built APK: real CLI + MCP prove grouped URI data/priority, metadata, resource boolean spelling, provider grants, parent identity and every source position; independent compiled XML dump comparison passes.
  • Authentic old-runtime Evidence is queried by the new CLI with an explicitly missing engine JAR; new fields remain omitted/unknown without reopening the provider.
  • npm run check:fast, focused source/boundary tests and npm run docs:check pass. npm run format:check and npm run docs:build also pass. After rebasing onto main 620784381, all 125 focused cases, the nine docs conformance cases and fresh real ApiDemos MCP/oracle qualification pass again.

Reproduction, exact hashes, all timing/resource samples and failed attempts. Scripted whole-task text token estimates, including input schemas and proof export, fall from 118,430 to 16,881; full SDK transport estimates are separate. No actual model billing or general speed/memory improvement is claimed: final candidate two-capture time/CPU/peak sampled family RSS were 23.369 s / 36.031 s / 1,145,073,664 B, and main controls varied substantially. Heavy checks are serial and CPU/memory guarded.

Meaningful gaps: Linux x86-64/JDK21/JADX0.7.1 only; no device/emulator/runtime behavior, signature verification, other OS/JDK or actual model-usage trial. An initial all-family SDK test timed out; selecting relevant tool families preserves its assertions and passes. Test-only assumptions about source def_pos and reuse of acquisition Evidence IDs were corrected; distinct acquisitions retain distinct identities.

CI follow-up

Latest head 98f7afd88: build, type/lint, docs, Windows native build, APK-signature verification, Linux package baseline and Greptile review pass. The corrected four-case profile test explicitly passes in shard 2's log. The only review finding was fixed and resolved.

Source tests has 17 failures (nine Apple/root-identity and eight Windows native-loader cases), all independently reproduced on actual main parent 6de60993b861266e63a4e70d5c6d9a8073f7cd92. Shard 4 fails two TOML setup cases; fail-fast cancels the other seven shard jobs. Every one of the 72 failing case markers in all failed/cancelled shard logs was independently reproduced on that same pure main parent, including repeated parameterized setup cases. Main-only controls cover the matching case names and multiplicities; remaining cancelled work is unverified. Existing failures are preserved outside this Android change. Portable/required failures propagate those results.

The new selectors crossed an older full-input/output-off size assertion: 1,052,239 B versus main's 1,047,039 B. The pre-existing profile guide warns that full inputs can dominate the frame. The follow-up preserves the unchanged 1 MiB compact-input compatibility limits (compact/off outputs: 558,653 / 305,116 B), and verifies full-input schemas against each named canonical advertisement instead of imposing that compact-profile budget on an explicit full choice. No production limit is raised or full guidance discarded. Profile and Android MCP checks, exact-CI-merge profile verification, type/lint/format/docs checks pass. Global profile costs and the correction are recorded in the reproduction report.

Human readiness remains unchecked; no human review is attested. Admin bypass is used under the owner's standing authorization for these independently reproduced main failures and the human-readiness gate.

Author readiness

Human owner: @gensokyo-dev

  • 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

  • Concrete enhancement and static authority/scope are resolved.
  • One outcome, linked issue, conventional title, owning docs/contracts and applicable correctness/resource regressions.
  • Evidence preserves observations, derivations, provenance, original identities, failed attempts and unknown coverage.

🔄 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/7379 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `feat/android-component-inventory` --- ### 📝 Commits (3) - [`a742033`](https://github.com/morluto/rea/commit/a7420331b2a79ef0d918ef8caa0385498906eb7b) feat(android): expose selected manifest component declarations - [`0bfd907`](https://github.com/morluto/rea/commit/0bfd907cdff087feda2ae9e8a9238966d2a164be) test(android): verify every retained manifest component - [`98f7afd`](https://github.com/morluto/rea/commit/98f7afd882f44336cc8a3dafa34736fbf8b9df4b) test(mcp): preserve full input guidance outside compact frame budgets ### 📊 Changes **33 files changed** (+2697 additions, -235 deletions) <details> <summary>View changed files</summary> 📝 `docs/android-analysis.md` (+58 -2) 📝 `docs/mcp-contracts.md` (+2 -0) 📝 `experiments/analysis-efficiency/README.md` (+4 -0) ➕ `experiments/analysis-efficiency/android-component-costs.py` (+65 -0) ➕ `experiments/analysis-efficiency/android-components.md` (+222 -0) ➕ `experiments/analysis-efficiency/android-components.mjs` (+294 -0) ➕ `experiments/analysis-efficiency/fixtures/android-components/AndroidManifest.xml` (+22 -0) ➕ `experiments/analysis-efficiency/fixtures/android-components/BuildDex.java` (+15 -0) ➕ `experiments/analysis-efficiency/fixtures/android-components/ManifestFixture.smali` (+3 -0) ➕ `experiments/analysis-efficiency/fixtures/android-components/README.md` (+43 -0) ➕ `experiments/analysis-efficiency/fixtures/android-components/manifest-oracle.py` (+70 -0) ➕ `experiments/analysis-efficiency/fixtures/android-components/res/values/values.xml` (+4 -0) ➕ `experiments/analysis-efficiency/fixtures/android-components/verify-fixture.py` (+58 -0) 📝 `scripts/verify/android/metadata.mjs` (+4 -0) ➕ `src/android/AndroidManifestComponentDetails.ts` (+249 -0) 📝 `src/android/AndroidManifestComponents.ts` (+71 -141) ➕ `src/android/AndroidManifestXml.ts` (+50 -0) 📝 `src/android/JadxAnalysis.ts` (+7 -1) 📝 `src/application/android/AndroidPackageInspection.ts` (+6 -2) 📝 `src/cli/androidCommands.ts` (+39 -5) _...and 13 more files_ </details> ### 📄 Description ## Summary Fixes #4448. Extend the existing static manifest inventory with declared enabled/process/URI-grant values, grouped intent-filter data and priorities, metadata names, and exact decoded-manifest locations. Add selected component pages and counts through shared CLI/MCP retained views, keeping complete Evidence accessible. Incorporates Harsh's #7264 at `987b5aceb66c7526e47cf6d064c22029c2f48c04`, with co-author credit, and fixes its historical-field review finding: newly unobserved fields remain omitted with `declaration_coverage: unknown`, rather than becoming false absence facts. ## Contract and boundary impact - One domain schema owns component facts. The manifest producer shares namespace interpretation and a single nested-declaration pass; the former duplicate schemas and separate flattened-value reader are removed. - Complete requests and the existing default summary remain compatible. Explicit summary views support exact kind/name/action/exported-declaration filters, fields, paging and component counts. Rows preserve parent ordinals, source coverage, APK identity and provenance; explicit/default exports remain distinct. - Limits account for copied values and serialized projections. Unsupported data constraints/filter constructs produce partial coverage with retained-source recovery. Resource references remain declarations; metadata values remain in the complete manifest. - Static analysis within the existing JADX boundary. Maintainer scope decision: not applicable; no target execution, injection, mutation or protection recovery. Existing bridge version 7 is unchanged. CLI summary writes only the selected Evidence bundle; provider cleanup uses existing ownership. - Generated catalogs/packaged skill are regenerated ignored outputs; no binaries, dependencies or credentials are committed. Expected effects: - [x] Read existing files or captured data. - [x] Launch an owned local analysis JVM; never execute an APK or attach to a target. - [x] Write caller-selected Evidence output and owned temporary analysis files. ## Evidence and regression coverage Executed: - 111 manifest parser cases, six retained projection cases, four CLI early-validation cases and four MCP boundary cases pass. Includes historical omission, source locations, namespace aliases, unsupported data constraints, bounded copying/pages, filters, named SDK-converted schemas, retained source removal and complete/default compatibility. - Real JDK 21/JADX 0.7.1 metadata regression and downstream CLI/MCP method-body/direct-invoke parity pass for classes.dex and classes2.dex. Existing default-package selectors preserve raw identity and frozen metadata across source generation. - Public ApiDemos 6.0.18: after the review follow-up, all 355 parent rows’ identity, enabled/process/permission and grouped filter/metadata facts and the selected SMS receiver match an unfiltered independent ElementTree oracle through real stdio MCP on first/warm capture and full parent export. Original timing cohorts checked selected facts and the global count; their narrower scope is corrected explicitly in the report. - AAPT2-built APK: real CLI + MCP prove grouped URI data/priority, metadata, resource boolean spelling, provider grants, parent identity and every source position; independent compiled XML dump comparison passes. - Authentic old-runtime Evidence is queried by the new CLI with an explicitly missing engine JAR; new fields remain omitted/unknown without reopening the provider. - `npm run check:fast`, focused source/boundary tests and `npm run docs:check` pass. `npm run format:check` and `npm run docs:build` also pass. After rebasing onto main `620784381`, all 125 focused cases, the nine docs conformance cases and fresh real ApiDemos MCP/oracle qualification pass again. [Reproduction, exact hashes, all timing/resource samples and failed attempts](experiments/analysis-efficiency/android-components.md). Scripted whole-task text token estimates, including input schemas and proof export, fall from 118,430 to 16,881; full SDK transport estimates are separate. No actual model billing or general speed/memory improvement is claimed: final candidate two-capture time/CPU/peak sampled family RSS were 23.369 s / 36.031 s / 1,145,073,664 B, and main controls varied substantially. Heavy checks are serial and CPU/memory guarded. Meaningful gaps: Linux x86-64/JDK21/JADX0.7.1 only; no device/emulator/runtime behavior, signature verification, other OS/JDK or actual model-usage trial. An initial all-family SDK test timed out; selecting relevant tool families preserves its assertions and passes. Test-only assumptions about source `def_pos` and reuse of acquisition Evidence IDs were corrected; distinct acquisitions retain distinct identities. ## CI follow-up Latest head `98f7afd88`: build, type/lint, docs, Windows native build, APK-signature verification, Linux package baseline and Greptile review pass. The corrected four-case profile test explicitly passes in [shard 2's log](https://github.com/morluto/rea/actions/runs/40448460695/job/122007371177). The only review finding was fixed and resolved. [Source tests](https://github.com/morluto/rea/actions/runs/40448460695/job/122006391442) has 17 failures (nine Apple/root-identity and eight Windows native-loader cases), all independently reproduced on actual main parent [`6de60993b861266e63a4e70d5c6d9a8073f7cd92`](https://github.com/morluto/rea/commit/6de60993b861266e63a4e70d5c6d9a8073f7cd92). [Shard 4](https://github.com/morluto/rea/actions/runs/40448460695/job/122007371259) fails two TOML setup cases; fail-fast cancels the other seven shard jobs. Every one of the 72 failing case markers in all failed/cancelled shard logs was independently reproduced on that same pure main parent, including repeated parameterized setup cases. Main-only controls cover the matching case names and multiplicities; remaining cancelled work is unverified. Existing failures are preserved outside this Android change. Portable/required failures propagate those results. The new selectors crossed an older **full-input/output-off** size assertion: 1,052,239 B versus main's 1,047,039 B. The pre-existing profile guide warns that full inputs can dominate the frame. The follow-up preserves the unchanged 1 MiB compact-input compatibility limits (compact/off outputs: 558,653 / 305,116 B), and verifies full-input schemas against each named canonical advertisement instead of imposing that compact-profile budget on an explicit full choice. No production limit is raised or full guidance discarded. Profile and Android MCP checks, exact-CI-merge profile verification, type/lint/format/docs checks pass. Global profile costs and the correction are recorded in the reproduction report. Human readiness remains unchecked; no human review is attested. Admin bypass is used under the owner's standing authorization for these independently reproduced main failures and the human-readiness gate. ## Author readiness Human owner: @gensokyo-dev - [ ] 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 - [x] Concrete enhancement and static authority/scope are resolved. - [x] One outcome, linked issue, conventional title, owning docs/contracts and applicable correctness/resource regressions. - [x] Evidence preserves observations, derivations, provenance, original identities, failed attempts and unknown coverage. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-05 01:48:02 +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#7839
No description provided.