Support activity-alias in Android launcher activity detection#187251
Open
mboetger wants to merge 4 commits into
Open
Support activity-alias in Android launcher activity detection#187251mboetger wants to merge 4 commits into
mboetger wants to merge 4 commits into
Conversation
Scan both "<activity>" and "<activity-alias>" elements when parsing raw "AndroidManifest.xml" in "AndroidApk.fromAndroidProject". This allows applications that define their main launcher activity via an activity-alias to be successfully detected and launched. Added unit tests in "application_package_test.dart" to verify activity-alias parsing in both the raw XML manifest parser and the "aapt" dump parser (which already implicitly supported it). TAG=agy CONV=8e04fc99-af40-4f70-9234-266a4f69c16e
…ty resolution Update raw manifest parser to support '<activity-alias>' elements when searching for main launcher activity. This aligns behavior with compiled manifest parsing which already supports it, and allows apps using activity-alias for launchers to start successfully. Also fixed parser consistency by breaking on first launcher match, and improved safety against missing name attributes on launcher elements. TAG=agy CONV=9697b14d-2ef7-49c4-a41b-7296635fc856
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Android application package parsing to support activity-alias elements in the manifest alongside standard activity elements, and adds corresponding unit tests. Feedback on the changes suggests ensuring packageId is not null before setting launchActivity to prevent string interpolation from bypassing subsequent null checks, and using followedBy to lazily concatenate the activity iterables instead of using the spread operator.
- Prevent packageId null bypass via string interpolation by adding a defensive null check. - Optimize XML activity parsing by lazily concatenating iterables with followedBy instead of allocating a list. TAG=agy CONV=d492ea8e-4d8e-443f-b7c7-76f68efb5fc4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support activity-alias in Android launcher activity detection
Fixes: #38965
Pre-launch Checklist
///).