Skip to content

Add object-oriented AndroidManifest parser#1360

Merged
lihenggui merged 2 commits into
mainfrom
refactor/oop-manifest-parser
Nov 5, 2025
Merged

Add object-oriented AndroidManifest parser#1360
lihenggui merged 2 commits into
mainfrom
refactor/oop-manifest-parser

Conversation

@lihenggui

Copy link
Copy Markdown
Owner

Create a new manifest parsing system that builds a complete object-oriented representation of AndroidManifest.xml in a single pass.

New Features:

  • Complete domain models for all manifest elements (activities, services, receivers, providers, intent-filters, permissions, meta-data)
  • Single-pass XML parsing using existing AssetManager reflection approach
  • Type-safe object model with kotlinx.serialization support
  • Comprehensive unit tests with >30 test cases

Benefits:

  • Eliminates redundant manifest parsing
  • Provides query-friendly object structure for frontend filtering
  • Integrates intent-filter data with component information
  • Non-invasive addition that coexists with existing ApkParser

This parser is designed to support feature-level analysis of intent-filters for detecting share components, deep-link handlers, and other app capabilities.

Change-Id: I4e5608fd9b0a9794cd4a6346d197fd886fa35035

Create a new manifest parsing system that builds a complete object-oriented
representation of AndroidManifest.xml in a single pass.

New Features:
- Complete domain models for all manifest elements (activities, services,
  receivers, providers, intent-filters, permissions, meta-data)
- Single-pass XML parsing using existing AssetManager reflection approach
- Type-safe object model with kotlinx.serialization support
- Comprehensive unit tests with >30 test cases

Benefits:
- Eliminates redundant manifest parsing
- Provides query-friendly object structure for frontend filtering
- Integrates intent-filter data with component information
- Non-invasive addition that coexists with existing ApkParser

This parser is designed to support feature-level analysis of intent-filters
for detecting share components, deep-link handlers, and other app capabilities.

Change-Id: I4e5608fd9b0a9794cd4a6346d197fd886fa35035
Make I/O operations properly suspend to avoid blocking the UI thread:
- Mark getParserForManifest() as suspend function
- Add dispatcher parameter with Dispatchers.IO default
- Wrap file loading in withContext(dispatcher)
- Pass dispatcher to nested suspend calls

This follows the same coroutine pattern as ApkParser for consistency
and ensures manifest parsing won't accidentally block the UI thread.

Change-Id: Ic88940a7939c1e37af35493345a390c30ddea177
@lihenggui lihenggui merged commit de88f76 into main Nov 5, 2025
4 checks passed
@lihenggui lihenggui deleted the refactor/oop-manifest-parser branch November 5, 2025 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant