Skip to content

Setup: Improve SAF access handling on Android 11 and Android 12 after Google Play system update of the Files app - #703

Merged
d4rken merged 3 commits into
mainfrom
setup_a12plus_saf_trick
Oct 10, 2023
Merged

d4rken merged 3 commits into
mainfrom
setup_a12plus_saf_trick

Conversation

@d4rken

@d4rken d4rken commented Oct 10, 2023 •

Copy link
Copy Markdown
Member

Google seems to have backported some Android 14 changes with tighter restrictions on access to Android/data and Android/obb The previous EXTRA_INITIAL_URI argument trick is no longer working.

Also see:
https://cs.android.com/android/platform/superproject/main/+/main:packages/apps/DocumentsUI/src/com/android/documentsui/picker/ActionHandler.java;l=84;bpv=1;bpt=0;drc=901f1d6044aade190bb943ccc18d26244132648e;dlc=306a2b606a1f01498d2d83a1d8362962f114e6e8

There are now 3 states to this for Android 11 and Android 12 users:

  • You have the original "Files" app (API-level 31, e.g. aml_doc_310851020 (310851020)) that came with your ROM, then you can just grant access as expected
  • You have the latest "Files" app (API-level 34 or later, e.g. 14-10492947 (340916000)), then you can't grant access
  • You have a version in between those two, then you should be able to grant access after this code change. Though I couldn't confirm this myself, just based on user reports.

Updates not compiled for API-level 34 still work, if you try some of the older versions.

In any case, a possible workaround to this is uninstalling the application updates. You can uninstall the update of the Files app, then complete the setup in SD Maid. Updating the Files app again won't break the granted permission.

  • Open device settings
  • Go to "Apps & notifications" or "Application Manager"
  • Find the Files system app
  • Tap on the three-dot menu, usually on the top right corner
  • Choose "Uninstall updates"

or

adb uninstall com.google.android.documentsui

I've updated the Setup WIKI with instructions:

https://github.com/d4rken-org/sdmaid-se/wiki/Setup#saf-androiddataobb-access

Closes #639

…date of the `Files` app

Google seems to have backported some Android 14 changes with tighter restrictions on access to `Android/data`
The previous `EXTRA_INITIAL_URI` argument trick is no longer working.

Also see:
https://cs.android.com/android/platform/superproject/main/+/main:packages/apps/DocumentsUI/src/com/android/documentsui/picker/ActionHandler.java;l=84;bpv=1;bpt=0;drc=901f1d6044aade190bb943ccc18d26244132648e;dlc=306a2b606a1f01498d2d83a1d8362962f114e6e8

There are now 3 states to this for Android 12 users:

* You have the original "Files" app (API-level 31, e.g. `aml_doc_310851020 (310851020)`) that came with Android 12, then you can just grant access as expected
* You have the latest "Files" app (API-level 34 or later, e.g. `14-10492947 (340916000)`), then you can't grant access
* You have a version in between those two, then you should be able to grant access after this code change

In any case, a possible workaround to this is uninstalling the application updates.
You can uninstall the update of the `Files` app, then complete the setup in SD Maid.
Updating the `Files` app again won't break the granted permission.

* Open device settings
* Go to "Apps & notifications" or "Application Manager"
* Find the `Files` system app
* Tap on the three-dot menu, usually on the top right corner
* Choose "Uninstall updates"

or

`adb uninstall com.google.android.documentsui`

Closes #639
@d4rken d4rken added enhancement New feature, request, improvement or optimization c: Setup Automation Accessibility service related (ACS) Google Play labels Oct 10, 2023
@d4rken d4rken changed the title Setup: Improve SAF access handling on A12 after Google Play system update of the Files app Setup: Improve SAF access handling on Android 11 and Android 12 after Google Play system update of the Files app Oct 10, 2023
@d4rken

d4rken commented Oct 10, 2023

Copy link
Copy Markdown
Member Author

Latest version, does not work:

Screenshot from 2023-10-10 17-42-37

Original version, works:

Screenshot from 2023-10-10 17-43-03

Inbetween version, works:

Screenshot from 2023-10-10 17-43-35

@d4rken
d4rken merged commit a20b0e1 into main Oct 10, 2023
@d4rken
d4rken deleted the setup_a12plus_saf_trick branch October 10, 2023 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Automation Accessibility service related (ACS) c: Setup enhancement New feature, request, improvement or optimization Google Play

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android 12: Cannot setup storage access framework

1 participant