Skip to content

Android 11, Can't access /storage/emulated/0/android/data #2015

Closed

Description

@SudosFTW

App isn't fully capable of the scoped storage API calls for accessing said directory as a file manager.

  • Device: Pixel 3a
  • OS: Android 11
  • Rooted: No
  • Version: 3.5.0

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.

Activity

  1. VishalNehra commented on Oct 17, 2020

    @VishalNehra
    Member

    @SudosFTW I'd like to +1 to this... I'm expecting comments from @TranceLove here as he worked on the current implementation.

  2. added
    Area-FileOperationsRelated to file operations (e.g. moving, copying, renaming).
    Issue-BugRelated unexpected behavior or something worth investigating.
    on Oct 17, 2020
  3. added this to the v3.5 milestone on Oct 17, 2020
  4. TranceLove commented on Oct 18, 2020

    @TranceLove
    Collaborator

    Best case scenario, you would want to ditch java.io.File at all and use content:// URI to even internal/external storages, so you won't need to maintain 2 sets of APIs.

    But this is too a big task (that I may want to Kotlintize and refactor the whole HybridFile system) that perhaps too big to fit in 3.5 timeline as well.

  5. VishalNehra commented on Oct 18, 2020

    @VishalNehra
    Member

    @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.

  6. TranceLove commented on Oct 20, 2020

    @TranceLove
    Collaborator

    As stated in https://developer.android.com/about/versions/11/privacy/storage:

    Access to app-specific directories on external storage

    On Android 11, apps can no longer access files in any other app's dedicated, app-specific directory within external storage.

    Although, there were cases claimed that java.io.File APIs can still access these storage without problems. We probably need some kind of fallback mechanism so that when accessing files using content:// URI fails, we may try using java.io.File instead.

    Meanwhile, may try to see if adding android:requestLegacyExternalStorage="true" to AndroidManifest.xml can be a band-it fix.

    Will try make a case for this. Though getting Android 11 scoped storage work with Amaze is still a long battle...

  7. TranceLove commented on Oct 21, 2020

    @TranceLove
    Collaborator

    Tried some little tests today with Pixel 4 emulator running stock Android 11. Even with opt-out of scoped storage with the 2 methods

    • no actions at all (compile with SDK 28, no extra flag in AndroidManifest.xml), that user will see Amaze is allowed to manage all files

    Screenshot_1603265044

    • adding android:requestLegacyExternalStorage="true" and upgrade SDK to either 29 or 30 (which is required by setting this flag)

    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 MANAGE_EXTERNAL_STORAGE permission via app review anyway, I'm afraid users of Android 11 not using Google Play may be left behind unless Google reaches some kind of agreements with third-party app stores, since this permission shall only benefit apps distributed by Google Play.

    Also check https://developer.android.com/training/data-storage for a quick table of file accessibility in Android 11.

  8. modified the milestones: v3.5, v3.6 on Oct 28, 2020
  9. VishalNehra commented on Nov 15, 2020

    @VishalNehra
    Member

    Related crashes

    Rename:

    2020-11-16 03:34:28.529 5634-5935/com.amaze.filemanager.debug E/ActivityThread: Rename recovery failed 
        android.system.ErrnoException: rename failed: EXDEV (Cross-device link)
            at libcore.io.Linux.rename(Native Method)
            at libcore.io.ForwardingOs.rename(ForwardingOs.java:190)
            at libcore.io.BlockGuardOs.rename(BlockGuardOs.java:350)
            at libcore.io.ForwardingOs.rename(ForwardingOs.java:190)
            at android.app.ActivityThread$AndroidOs.rename(ActivityThread.java:7581)
            at java.io.UnixFileSystem.rename(UnixFileSystem.java:368)
            at java.io.File.renameTo(File.java:1412)
            at com.amaze.filemanager.asynchronous.asynctasks.MoveFiles.doInBackground(MoveFiles.java:109)
            at com.amaze.filemanager.asynchronous.asynctasks.MoveFiles.doInBackground(MoveFiles.java:59)
            at android.os.AsyncTask$3.call(AsyncTask.java:394)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
            at java.lang.Thread.run(Thread.java:923)
    
    

    Copy:

    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err: java.io.FileNotFoundException: /storage/emulated/0/Android/data/DummyFile: open failed: EACCES (Permission denied)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:492)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.amaze.filemanager.filesystem.FileUtil.isWritable(FileUtil.java:754)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.amaze.filemanager.utils.MainActivityHelper.checkFolder(MainActivityHelper.java:420)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.amaze.filemanager.asynchronous.asynctasks.PrepareCopyTask.finishCopying(PrepareCopyTask.java:325)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.amaze.filemanager.asynchronous.asynctasks.PrepareCopyTask.onEndDialog(PrepareCopyTask.java:275)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.amaze.filemanager.asynchronous.asynctasks.PrepareCopyTask.onEndDialog(PrepareCopyTask.java:269)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.amaze.filemanager.asynchronous.asynctasks.PrepareCopyTask.onPostExecute(PrepareCopyTask.java:186)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.amaze.filemanager.asynchronous.asynctasks.PrepareCopyTask.onPostExecute(PrepareCopyTask.java:64)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at android.os.AsyncTask.finish(AsyncTask.java:771)
    2020-11-16 03:34:56.761 5634-5634/com.amaze.filemanager.debug W/System.err:     at android.os.AsyncTask.access$900(AsyncTask.java:199)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at android.os.Looper.loop(Looper.java:223)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7656)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at libcore.io.Linux.open(Native Method)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
    2020-11-16 03:34:56.762 5634-5634/com.amaze.filemanager.debug W/System.err:     at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7542)
    2020-11-16 03:34:56.763 5634-5634/com.amaze.filemanager.debug W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:478)
    2020-11-16 03:34:56.763 5634-5634/com.amaze.filemanager.debug W/System.err: 	... 17 more
    
  10. danielzgtg commented on Jan 21, 2021

    @danielzgtg

    On Android 11

    No app on Android 11 is supposed to be able to access /sdcard/Android/data/ no matter the mechanism. If you are able to, then you should report such a security vulnerability to Google.

    only Android's own DocumentUI can get through

    The built-in OS one might be able to read, but not even it has write access

    Rooted: No

    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 /data/media/0/Android/data instead of /sdcard/Android/data. It would be nice if Amaze could detect whether the device is on Android 11 and viewing /sdcard/Android/data and automatically use root to access that

  11. self-assigned this
    on Jan 22, 2021
  12. added
    Environment-API30This is for issue relating to issues after the lockdown of API 30
    on Jan 22, 2021
  13. added a commit that references this issue on Jan 22, 2021
    ef485b7
  14. 79 remaining items

  15. VishalNehra commented on Sep 25, 2021

    @VishalNehra
    Member

    @VishalNehra Do you think there is a solution for Android 12?

    I'll try to look for some way later, will update here. The android 12 images are quite laggy on my Macbook.

  16. VishalNehra commented on Sep 26, 2021

    @VishalNehra
    Member

    Note to self - Our existing logic to create file / directory was, build newPath = oldPath + newFileName, create directory on this newPath.
    This however, doesn't work in case of DocumentFile in Android 11, as when we try to iterate to newPath it'll throw an exception saying the newPath is not valid.
    So we have to modify our workflow to include oldpath while creating file / directory instead of utilizing just the newPath (getting newPath.parent doesn't work either).

    content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fdata/document/primary%3AAndroid%2Fdata%2Fcom.activision.callofduty.shooter%2Ffiles
    
    content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fdata/com.activision.callofduty.shooter/files
    
  17. unpinned this issue on Oct 2, 2021
  18. HasinduLanka commented on Nov 12, 2021

    @HasinduLanka

    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

  19. B2A1E5 commented on Jun 7, 2025

    @B2A1E5
  20. wisnuwidana961-alt commented on Sep 25, 2025

    @wisnuwidana961-alt
  21. rafa2024234-hub commented on Sep 27, 2025

    @rafa2024234-hub
  22. hgfrhte-create commented on Oct 31, 2025

    @hgfrhte-create
  23. gmmmccntbcknow-dev commented on Nov 17, 2025

    @gmmmccntbcknow-dev
  24. maeflorarana43-prog commented on Dec 15, 2025

    @maeflorarana43-prog
  25. Padfgycm commented on Feb 20, 2026

    @Padfgycm

    قم بدمج Git في المشروع
    اختبر ما إذا كان Git مُهيأً.
    في برنامج Android Studio، انتقل إلى Android Studio > التفضيلات > التحكم في الإصدار > Git . انقر فوق اختبار للتأكد من تهيئة Git بشكل صحيح في Android Studio.

  26. kim926451-cmd commented on Mar 25, 2026

    @kim926451-cmd

    @suho:com.dts.freefireth
    1 /storage/emulated/0/ Android/data/com.dts.freefireth/com.dts.freefireth: Failed to create

  27. EmmanuelMess commented on Mar 29, 2026

    @EmmanuelMess
    Member

    Please open a new issue if this is still a problem with your device or android version.

  28. locked as resolved and limited conversation to collaborators on Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area-FileOperationsRelated to file operations (e.g. moving, copying, renaming).Environment-API30This is for issue relating to issues after the lockdown of API 30Issue-BugRelated unexpected behavior or something worth investigating.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions