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

Add support for maxSdkVersion attribute in permission element. #1812

Open
MAJigsaw77 opened this issue Jul 8, 2024 · 1 comment · May be fixed by #1814
Open

Add support for maxSdkVersion attribute in permission element. #1812

MAJigsaw77 opened this issue Jul 8, 2024 · 1 comment · May be fixed by #1814

Comments

@MAJigsaw77
Copy link
Contributor

There's currently no support for having a permission with a maxSdkVersion attribute, which could be useful to limit permissions to specific Android versions, ensuring compatibility.

@player-03
Copy link
Contributor

Interesting. I didn't know that was a thing.

The problem is we don't have anywhere to store that data. If you typed <config:android permission="android.permission.WRITE_EXTERNAL_STORAGE" maxSdkVersion="18" />, you'd be setting two entirely separate config values. Fortunately, maxSdkVersion doesn't do anything, but if it did, it would limit your whole app to <= SDK 18.

Permissions are stored as an Array<String>. Add another string to the array, that's another permission. There's nowhere to store an integer in that array, and Haxe's templates aren't powerful enough to handle two side-by-side arrays.

It is possible to do a bit of string injection, though it isn't pretty: <config:android permission='android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18' />. Not recommended.

I guess we could add a entire separate attribute, like <config:android permission-max-sdk-18="android.permission.WRITE_EXTERNAL_STORAGE" />. And that would work for SDK 18, but if you wanted some other SDK, we'd have to go back and add a whole new attribute for that.

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 a pull request may close this issue.

2 participants