Skip to content

Support permission properties (maxSdkVersion and usesPermissionFlags) + remove WRITE_EXTERNAL_STORAGE permission, which has been previously declared by default - #2725

Merged
misl6 merged 2 commits into
kivy:developfrom
misl6:fix/reverse-2694-and-add-a-way-to-set-sdkversion
Dec 30, 2022
Merged

misl6 merged 2 commits into
kivy:developfrom
misl6:fix/reverse-2694-and-add-a-way-to-set-sdkversion

Conversation

@misl6

@misl6 misl6 commented Dec 29, 2022

Copy link
Copy Markdown
Member

The --permission argument historically only accepted something like --permission android.permission.WRITE_EXTERNAL_STORAGE and --permission VIBRATE which is not enough in certain use cases.

As an example, when dealing with bluetooth permissions and targeting API 31, the legacy android.permission.BLUETOOTH and android.permission.BLUETOOTH_ADMIN permissions need the property android:maxSdkVersion be set to 30, and
the "android.permission.BLUETOOTH_SCAN needs to strongly assert that the app never derives physical location from Bluetooth scan results via android:usesPermissionFlags="neverForLocation".

Basically, nowadays, android permissions declarations need a lot of fine-tuning, which is not possible at this time via python-for-android, unless an extra manifest is used.

This PR introduces a new syntax: --permission (name=android.permission.WRITE_EXTERNAL_STORAGE;maxSdkVersion=18) that allows the user to set every single (and currently available/supported) property of the <uses-permission> element.

The old syntaxes are migrated before the template gets processed, so users will only notice this change when needed, and when reading the docs.

I also started to add some tests for our build.py script. I needed to add a switch to skip some things as ATM are not patchable (at least easily). The whole script needs some refactoring in order to be well-tested.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants