alexrintt / shared-storage

Flutter plugin to work with Android external storage.
http://alexrintt.io/shared-storage/
MIT License
54 stars 26 forks source link

Cannot get full access to SD Card #112

Closed jakhongirovjasurbek closed 1 year ago

jakhongirovjasurbek commented 1 year ago

Could not get full access to SD card I'm working on a file manager using flutter. Because of limitations of writing access to external storage is denied and new android versions are making it too hard to get access to folders like Android/data, Android/obb and sdcard/Android/, I tried Storage Access Framework (SAF). But, I see that even this package could not get full access to SD card because of privacy related issues. It is very easy to reproduce this error

  1. Using SAF, try to get an access to sdcard in Android 12. There you will see that access to sd card is locked.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Screen Shot 2022-12-22 at 20 04 16

Android Phone

alexrintt commented 1 year ago

Hi, this is the expected behavior.

And it's frustrating, this is where both, end-users and developers, gets upset. Unfortunately only rooted devices can access sdcard/Android folder from Android 12+ (and some Android 11 cases).

Some resources may be helpful: https://www.androidcentral.com/what-scoped-storage:

jakhongirovjasurbek commented 1 year ago

Hi, this is the expected behavior.

And it's frustrating, this is where both, end-users and developers, gets upset. Unfortunately only rooted devices can access sdcard/Android folder from Android 12+ (and some Android 11 cases).

Some resources may be helpful: https://www.androidcentral.com/what-scoped-storage:

Hi dear ))

I see ) But, how do file managers are working in these versions as well then? )

alexrintt commented 1 year ago

There is already a SO question about this: https://stackoverflow.com/questions/71654722/how-do-i-navigate-the-external-storage-file-system-in-android-12.

In summary:

I would like to make a file manager app targeting API level 31 that requires access to all files on the device. To do this, I have followed the guidance here: https://developer.android.com/training/data-storage/manage-all-files.

R: You can't, at least on unrooted devices. Even with MANAGE_EXTERNAL_STORAGE, all that you have access to is external storage, not the entire device filesystem.

But I'm bit hopeful with Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION that the guy mentioned in the answers, take a look at it, though I'll not promise it will work since I never tried it.

https://developer.android.com/training/data-storage/manage-all-files.

alexrintt commented 1 year ago

Since there no more questions, I'll close this as wontfix since it is not a issue with the package itself.