Skip to content

fix(android): reject invalid manifest XML before parsing - #2844

Open
OskarEichler wants to merge 2 commits into
react-native-community:mainfrom
OskarEichler:codex/cli-strict-manifest-validation
Open

fix(android): reject invalid manifest XML before parsing#2844
OskarEichler wants to merge 2 commits into
react-native-community:mainfrom
OskarEichler:codex/cli-strict-manifest-validation

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 28, 2026

Copy link
Copy Markdown

Summary

XMLValidator.validate() returns either true or an error object. The previous truthiness check accepted the error object, so malformed manifests could be parsed as if validation succeeded. Require an actual true result.

The existing multi-activity fixture also contained an unmatched </queries> tag. This PR corrects that fixture and adds a dedicated malformed-manifest regression.

Compatibility

Malformed manifests now return null instead of occasionally yielding a launcher from partially parsed XML. Valid manifests retain their existing behavior. No dependency or SDK version changes.

Verification

  • yarn build
  • yarn test packages/cli-config-android/src/config/__tests__/getMainActivity.test.ts --runInBand (6 tests passed)
  • Focused ESLint on the implementation and test
  • Focused Prettier check on the TypeScript files
  • git diff --check

Type: fix

@OskarEichler
OskarEichler marked this pull request as ready for review August 30, 2026 09:46
@OskarEichler
OskarEichler requested a review from thymikee as a code owner August 30, 2026 09:46
@OskarEichler

Copy link
Copy Markdown
Author

Resolved the draft blocker: I removed the stray unmatched </queries> from the shared multi-activity fixture and added an explicit malformed-manifest regression. The focused suite now passes all 6 tests, and the full package build plus focused lint/format checks are clean. I’ve marked the PR ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant