Repository navigation
Support permission properties (maxSdkVersion and usesPermissionFlags) + remove WRITE_EXTERNAL_STORAGE permission, which has been previously declared by default - #2725
Merged
misl6 merged 2 commits intoDec 30, 2022
Conversation
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.
The
--permissionargument historically only accepted something like--permission android.permission.WRITE_EXTERNAL_STORAGEand--permission VIBRATEwhich is not enough in certain use cases.As an example, when dealing with bluetooth permissions and targeting API 31, the legacy
android.permission.BLUETOOTHandandroid.permission.BLUETOOTH_ADMINpermissions need the propertyandroid:maxSdkVersionbe set to30, andthe
"android.permission.BLUETOOTH_SCANneeds to strongly assert that the app never derives physical location from Bluetooth scan results viaandroid: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.pyscript. 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.