Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporary fix for maxSdkVersion attribute parsing #194

Closed
wants to merge 1 commit into from

Conversation

ankur2136
Copy link
Contributor

https://developer.android.com/guide/topics/manifest/uses-permission-element

Client should avoid taking a long term dependency on this format.

Updates #193

if (permission[1] === undefined)
return permission[3]
else
return permission[1] + " maxSdkVersion=" + permission[2]
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend we add a comment here noting that this format will change in the future, with a link to the GitHub issue.

@@ -283,7 +283,7 @@ const getAndroidDetails = async (
const minSdk = new RegExp(
AaptPrefixes.sdkPrefix + AaptPrefixes.quoteRegex
).exec(stdout);
const permissions = [...stdout.matchAll(/uses-permission: name='(.*)'/g)];
const permissions = [...stdout.matchAll(/uses-permission: name='(.+)?' maxSdkVersion='(\d\d)'|uses-permission: name='(.+)'/g)];
Copy link
Contributor

Choose a reason for hiding this comment

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

name='(.+)?'

Won't the ? serve to make the characters between the '' optional? To make this match stingy, I think it should be name='(.+?)'.

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.

3 participants