-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(android)!: Android 13 support (#844)
* feat(android)!: Android 13 support * refactor(android): simplify getPermissions logic * feat(android)!: bump cordova-android requirement to >=12.0.0 * feat(android): update saveAlbumPermission to include Android 9 and below use case --------- Co-authored-by: ochakov <[email protected]>
- Loading branch information
Showing
4 changed files
with
61 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
505ccef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I'm testing the version "7.0.0-dev" in order to make android API 33 work.
android:maxSdkVersion="32"
from the xml line<uses-permission android:maxSdkVersion="32" android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Why?
Regards.
505ccef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this, I understand what you're saying but there was already an extensive on this topic in the original PR. While it's not strictly necessary, it's "more" correct and the conflict could happen regardless of what we actually choose (e.g. we don't specify the maxSdkVersion but another plugin does).
Personally how I want to address this problem is to make the plugin not use external storage by default which eliminates the need to use WRITE_EXTERNAL_STORAGE even for < API 28 devices at all. It will simplify a lot of things and the app developer can then choose where they want to store the media asset from there, whether that is to move it to a permanent internal location, or a permanent external location, or off-device, etc. We have a PoC in the media-capture plugin that does just this and it appears to work well (for audio anyway).
In the meantime however, if you're using a plugin that conflicts with the permission, you can use an
after_prepare
hook to "correct" it. Ideally Cordova would just figure it out but handling configuration updates is something that never worked well.In
hooks/stripExtraWritePerm.js
In your
config.xml
:The regex will look for
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
include any prefixed whitespace. If you want to remove something else or if you have multiple plugins all adding this permission in a slightly different way you may need to modify or add additional regex tests.On this, I'd suggest creating an issue that can be better tracked.