Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 12: Cannot setup storage access framework #639

Closed
demetry14 opened this issue Sep 19, 2023 · 13 comments · Fixed by #703
Closed

Android 12: Cannot setup storage access framework #639

demetry14 opened this issue Sep 19, 2023 · 13 comments · Fixed by #703
Labels
api: 30 A11 (Red Velvet Cake) api: 31 A12 (Snow Cone) api: 32 A12L (Snow Cone) bug Something isn't working as expected c: Setup Device specific A device specific issue or behavior. Google Play SAF Storage Access Framework

Comments

@demetry14
Copy link

demetry14 commented Sep 19, 2023

Cannot access Android/obb when attempting to setup storage access framework on Android 12. I read that was an issue on Android 13, but I am on a Galaxy S10 and they max out at Android 12.

Click setup > Grant Access > Android > "all you see is media"

Screenshot_20230919-010126_SD Maid SE

Screenshot_20230919-010113_Files

@demetry14 demetry14 added bug Something isn't working as expected triage This ticket needs to be sorted and labeled. labels Sep 19, 2023
@demetry14
Copy link
Author

demetry14 commented Sep 19, 2023

Also note the folder exists as I have Solid Explorer and can access them.

Screenshot_20230919-010859_Solid Explorer

Screenshot_20230919-010905_Solid Explorer

@KryptoKing93
Copy link

Hooe this gets resolved soon. I'm facing the same issue

@demetry14
Copy link
Author

Hopefully this helps as well.

eu.darken.sdmse_logfile_1695108257091.log.zip

@Pawwwle
Copy link

Pawwwle commented Sep 21, 2023

I also have this error on two Android 12 devices.

@d4rken
Copy link
Member

d4rken commented Sep 21, 2023

Is the issue accessing Android/data or Android/obb or both?

Currently it looks like Samsung's latest OneUI update backported some Android 13 changes to Android 12.

Solid Explorer and can access them.

Hm will look into that, if Solid Explorer has found a workaround we could do that too. It's possible they are faking access though, or "simulating" it. You can guess some of the content and display it as "access". Can Solid Explorer write to data or obb?

@d4rken d4rken added c: Setup Device specific A device specific issue or behavior. and removed triage This ticket needs to be sorted and labeled. labels Sep 21, 2023
@Pawwwle
Copy link

Pawwwle commented Sep 21, 2023

Boths. The problems occurs on my Motorola smartphone and Lenovo tablet.

@demetry14
Copy link
Author

demetry14 commented Sep 22, 2023

Is the issue accessing Android/data or Android/obb or both?

Currently it looks like Samsung's latest OneUI update backported some Android 13 changes to Android 12.

Solid Explorer and can access them.

Hm will look into that, if Solid Explorer has found a workaround we could do that too. It's possible they are faking access though, or "simulating" it. You can guess some of the content and display it as "access". Can Solid Explorer write to data or obb?

I have no issues accessing Android/data, only Android/obb.

Android/data was accessible right away and I verified by clearing app data and rechecking.

Screenshot_20230921-202627_SD Maid SE

Solid Explorer can add/edit/delete from both Android/data and Android/obb.

@268Vladimir
Copy link

Android 12 (A11+), NO root(!), MIUI 14, Redme Note 9S, global, stock.
No access to Android/data (obb).
Wiche turns SDMaid SE (SDMaid) into a regular cache cleaning program . ?!

@268Vladimir
Copy link

268Vladimir commented Sep 25, 2023

IMG_20230925_082951

@268Vladimir
Copy link

268Vladimir commented Sep 25, 2023

I followed the recommendations, the result was zero. Documents from system applications in A11+ are excluded.
IMG_20230925_162106
IMG_20230925_153210

@JohannesOe
Copy link

Samsung OneUi 3.1 Android 11 same problem. Only "media" folder shows up

@d4rken-org d4rken-org deleted a comment from 268Vladimir Sep 29, 2023
@MeloriTensei
Copy link
Collaborator

@demetry14 @Pawwwle @KryptoKing93 Hi, please rest assured that we (me and possibly the community with Darken) are currently looking into how other apps got around this. This issue has been present since Samsung's July 2023 Security patch because they brought the restrictions from Android 13 to Android 12.

@d4rken d4rken added api: 31 A12 (Snow Cone) SAF Storage Access Framework labels Oct 10, 2023
d4rken added a commit that referenced this issue Oct 10, 2023
…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
Copy link
Member

d4rken commented Oct 10, 2023

TL;DR: Google Play updated the Files app. The newer Files app has backported some restrictions from Android 13 and 14.

Workaround: Uninstall the update to the Files app and then set up SD Maid.

See #703 for a detailed explanation.

d4rken added a commit that referenced this issue Oct 10, 2023
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: 30 A11 (Red Velvet Cake) api: 31 A12 (Snow Cone) api: 32 A12L (Snow Cone) bug Something isn't working as expected c: Setup Device specific A device specific issue or behavior. Google Play SAF Storage Access Framework
Projects
None yet
7 participants