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 11, Can't access /storage/emulated/0/android/data #2015
Comments
@SudosFTW I'd like to +1 to this... I'm expecting comments from @TranceLove here as he worked on the current implementation. |
Best case scenario, you would want to ditch But this is too a big task (that I may want to Kotlintize and refactor the whole |
@TranceLove I mean, no need to ditch File API at all.. just ways to fix the Android/data/ directories not being accessible right now. Even when we're explicitly giving Read / write permissions with the Uri. |
As stated in https://developer.android.com/about/versions/11/privacy/storage:
Although, there were cases claimed that Meanwhile, may try to see if adding Will try make a case for this. Though getting Android 11 scoped storage work with Amaze is still a long battle... |
Tried some little tests today with Pixel 4 emulator running stock Android 11. Even with opt-out of scoped storage with the 2 methods
contents of data directory is still not visible. Not other apps too - only Android's own DocumentUI can get through. Though some point in the future we shall be asking Google for Also check https://developer.android.com/training/data-storage for a quick table of file accessibility in Android 11. |
Related crashes Rename:
Copy:
|
No app on Android 11 is supposed to be able to access
The built-in OS one might be able to read, but not even it has write access
Unfortunately, I don't think it will ever be possible to access that without root. I am in a rooted environment, and it still doesn't work normally. However, I found that a workaround is to use |
…is rooted Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to /data/media/0/Android/data and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
…is rooted Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to /data/media/0/Android/data and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to /data/media/0/Android/data and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to /data/media/0/Android/data and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to /data/media/0/Android/data and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to /data/media/0/Android/data and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to /data/media/0/Android/data and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to use /data/media as prefix and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to use /data/media as prefix and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to use /data/media as prefix and list files using root. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to use /data/media as prefix and list files using root. Have Toast to notify user is being redirected. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Fixes TeamAmaze#2015. If user is on Android 11 or above, and device is rooted, when accessing Android data directory which would be blocked access, augment the path to use /data/media as prefix and list files using root. Have Toast to notify user is being redirected. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..". Thanks again to @danielzgtg for the workaround idea!
Implementation is heavily related to TeamAmaze#2015
Fixes #2015. Additionally, added filter to ls results for some devices (including AVD emulator) where toybox is used instead of busybox, to filter out entries "." and "..".
Implementation is heavily related to #2015
If anyone wishes, it seems to only work for Android 11: Sadly it doesn't seem to work on Android 12, and I can't find any file manager app that can reach the folder anymore ... |
How can you say it's not working on android 12? Did you accept the permission for folder at Android/data from DocumentUI screen? |
@VishalNehra I can say it because I have Pixel 4 with Android 12 beta 5, and it failed on all file managers that used to be able to allow it: Total Commander, X-plorer, and Mixplorer. I'm the one that created the post. I thought this workaround would stay for longer. |
Please open a new issue for Android 12. |
@EmmanuelMess OK here: Please consider starring. I've posted about it in the past, but sadly doesn't seem like Google will do it: |
Ok i tried on android 12 emulator. The document ui even doesn't show android/data or Android/obb for me to select them. |
Wait, why is this re-opened? |
For android 12 will create a new issue later. Reopened this as I broke file / folder create functionality for normal folders while fixing for android/data. Will fix this as a part of this issue only. |
@VishalNehra Do you think there is a solution for Android 12? |
@AndroidDeveloperLB I cannot think of one, if others cannot do so without going through the Google Play review too.😕 |
I'll try to look for some way later, will update here. The android 12 images are quite laggy on my Macbook. |
Note to self - Our existing logic to create file / directory was, build newPath = oldPath + newFileName, create directory on this newPath.
|
If your phone updated from Android 10 to 11 recently and amaze can't access these folders, uninstalling amaze and installing it again would fix the issue |
App isn't fully capable of the scoped storage API calls for accessing said directory as a file manager.
I can't access files saved with apps like Telegram which store downloads in such a location. They don't even show up as recent files in anything else but the built-in file manager in Android (not google files, I have that disabled)
There should be a n actual API call specifically for file managers to access that location but as I'm not completely savvy on the inner workings of modern Android APIs I don't exactly know what it's called. This should probably be looked into heavily when building for Android 11 since the scoped storage API is mandatory now, and it should be seamless to Android 10 users already using the app.
The text was updated successfully, but these errors were encountered: