File-Manager icon indicating copy to clipboard operation
File-Manager copied to clipboard

Allow accessing /Android/data and /Android/obb with root

Open Aga-C opened this issue 1 year ago • 17 comments

Checklist

  • [x] I can reproduce the bug with the latest version.
  • [x] I made sure that there are no existing issues - open or closed - to which I could contribute my information to.
  • [x] I have read the FAQ and my problem isn't listed.
  • [x] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • [x] This issue contains only one bug.
  • [x] I have read and understood the contribution guidelines.

Describe the bug Use this folder button is inactive, hence /Android/data and /Android/obb can't be accessed due to missing Storage permission.

To Reproduce Steps to reproduce the behavior:

  1. Open the app.
  2. Go to /Android/data or /Android/obb.
  3. After the confirmation dialog appeared (about allowing the app accessing the selected storage on the next screen), tap OK.

Expected behavior Use this folder button at the bottom of the next screen should be active, and after tapping it, the access to the selected storage should be granted.

Device info (please complete the following information):

  • Model: OnePlus 9 Pro
  • OS: Android 13
  • Version 1.0.0

Additional context

  • My phone is not rooted.
  • I can access both folders via Total Commander app.

Aga-C avatar Jan 07 '24 08:01 Aga-C

The restriction was introduced in Android 11: https://developer.android.com/about/versions/11/privacy/storage#other-apps-data

People found a workaround but it was patched in Android 13. Resorting to workarounds is not a good idea if those directories are supposed to be invisible even to apps with MANAGE_EXTERNAL_STORAGE permission.

I think the current flow is confusing, we should provide the user with clarification. Probably a static text like "Due to system restrictions, this directory is inaccessible."

naveensingh avatar Jan 07 '24 08:01 naveensingh

I can access both folders via Total Commander app.

Which version do you have?

naveensingh avatar Jan 07 '24 08:01 naveensingh

Which version do you have?

3.42d

Aga-C avatar Jan 07 '24 09:01 Aga-C

https://github.com/SimpleMobileTools/Simple-File-Manager/issues/685

inson1 avatar Jan 08 '24 03:01 inson1

I think we should do as material files, and only allow access with root. the work around carried over from simple file manager doesn't work anyway.

BioRider17 avatar Jan 11 '24 23:01 BioRider17

I have Android 12 and from MiXplorer I can access Data and OBB. It would be nice to try to replicate your solution, and for Android 13+ just the warning sign.

AnotherJavaUser avatar Jan 12 '24 11:01 AnotherJavaUser

I have Android 12 and from MiXplorer I can access Data and OBB. It would be nice to try to replicate your solution, and for Android 13+ just the warning sign.

Mix is also working fine under 13, without root

gargamel17 avatar Jan 20 '24 22:01 gargamel17

While access to /Android/data or /Android/obb is restricted, access can be granted directly to /Android/data/<PACKAGE_NAME> or /Android/obb/<PACKAGE_NAME> (or at least, that's what I heard).

So to work around the fix to the workaround, the file manager could make it look like it is accessing /Android/data or /Android/obb and displaying their contents when it actually does this:

  1. Check which apps are installed on the system.
  2. For each app, check whether the directory /Android/data/<PACKAGE_NAME> (if inside /Android/data) or /Android/obb/<PACKAGE_NAME> (if inside /Android/obb) exists. If so, display the directory.
  3. When the user clicks on one of the directories, ask for permission to access that directory.

That's probably what Total Commander is doing.

Versions of Android where the old workaround still works should ideally continue to use the current logic.

luewolf avatar Jan 23 '24 21:01 luewolf

Note that the old logic is also broken, unsure why exactly, but when trying to grant SAF permissions, Files opens in the user directory instead of /Android/data or /Android/obb. Since these two directories are hidden when attempting to grant SAF permissions, this makes accessing them not possible. This seems to be a bug partially inherited from SMT as SMT file manager opens /Android/data for both /Android/data and /Android/obb.

Might need a separate issue though, as this one is more focused on issues related to Android 13.

MinekPo1 avatar Jan 25 '24 16:01 MinekPo1

I'd like to see this fixed at least for root. Sucks that simple and now fossify have claimed root support but access to the data folder has been broken.

TheShanMan avatar Jan 27 '24 19:01 TheShanMan

I have Android 12 and from MiXplorer I can access Data and OBB. It would be nice to try to replicate your solution, and for Android 13+ just the warning sign.

Mix is also working fine under 13, without root

With android 14 it still works perfectly

gargamel17 avatar Mar 18 '24 09:03 gargamel17

As leuwolf mentioned above, MiXplorer is also constructing the data, obb folders using the list of installed apps but they are not accessible on Android 11, 12, 13, and 14. I couldn't access the contents of Android/data/any.package.name/* and Android/obb/any.package.name/* because the system SAF dialog (launched by MiXplorer) doesn't show the data and obb folders:

image

I got the same results with Total Commander.

naveensingh avatar Mar 18 '24 10:03 naveensingh

I found this: https://issuetracker.google.com/issues/256669329

naveensingh avatar Mar 18 '24 11:03 naveensingh

Android 14, is there really no way to access data or obb?

notIkibo avatar Apr 28 '24 10:04 notIkibo

Wouldn't it be possible by adding Shizuku support to the app?

tswistak avatar Nov 24 '24 18:11 tswistak

As a workaround, the app could show a placeholder message like "Due to system restrictions, this folder is not available" when users try to open inaccessible folders like data or obb. There could also be a button to open the same folder in system file manager or a button to "Request access" on older versions where it is possible with SAF permissions.

naveensingh avatar Mar 30 '25 15:03 naveensingh

All these SAF workarounds no longer work (even on Android 11) due to Google's mainline updates which also patches the DocumentsUI app (the system file picker). The simple solution I have found on previous versions is to downgrade the DocumentsUI app but on recent Android versions, even that won't help since the preinstalled system version is already patched.

Fossify File Manager will, for now, just offer an option to browse these folders in DocumentsUI. Later, I'll see if I can find the exact DocumentUI version code where they fixed the bug to continue using the workaround when you have a downgraded version.

naveensingh avatar Apr 05 '25 15:04 naveensingh