0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00
Anki-Android/api
David Allison 56a195bf46 Bump to API 30 & enable MANAGE_EXTERNAL_STORAGE
MANAGE_EXTERNAL_STORAGE is for non-Google Play builds.

Google won't let us have the permission, but there's no reason
other stores + users have to suffer this decision.

This allows a Google Play user to restore their data if they uninstall
(uninstall, then download the APK and data is available again)

* Remove MANAGE_EXTERNAL_STORAGE from the manifest if targeting `play`

Version Codes & Outcomes:

1 < Q - force storage permissions as done previously (incl. Play Store)
2   Q - Users are unsafe and need a storage migration
        * MANAGE_EXTERNAL_STORAGE is unavailable
        * READ/WRITE_EXTERNAL_STORAGE is unavailable
3 > Q - Non-Play-Store users need MANAGE_EXTERNAL_STORAGE (*)
4 > Q - Play Store users are unsafe and need a storage migration

If a user is starting out and may request 'safe' permissions (1) (3)
Then we keep `deckPath` as a legacy path.

1) & 3) We do not allow access to the app until they give permission

----

Storage can be re-enabled after this change via:

```
adb shell am compat disable DEFAULT_SCOPED_STORAGE com.ichi2.anki.debug
adb shell am compat disable FORCE_ENABLE_SCOPED_STORAGE com.ichi2.anki.debug
adb shell pm grant com.ichi2.anki.debug android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant com.ichi2.anki.debug android.permission.WRITE_EXTERNAL_STORAGE
```

on an API 30 emulator (or a non-AOSP emulator)

Related: Issue 5304
Fixes 13051 - targetSdkVersion 30 fixes this
2023-03-20 12:44:59 -05:00
..
src Dependency Updates 20220219 (#13305) 2023-02-19 12:15:26 -05:00
.gitignore Create API for easier integration with 3rd party apps 2015-09-11 05:08:18 +09:00
build.gradle Bump to API 30 & enable MANAGE_EXTERNAL_STORAGE 2023-03-20 12:44:59 -05:00
COPYING.LESSER Create API for easier integration with 3rd party apps 2015-09-11 05:08:18 +09:00