Page 1 of 1

Android 11 - How does TC manage to access /Android/data/* ?

Posted: 2021-05-28, 08:47 UTC
by arberg
Hi Ghisler et.al.

This is a Android development question. I have a stack overflow question here about how to access /Android/data in Android-11:

https://stackoverflow.com/questions/67726278/android-11-read-android-data-directory-of-all-apps-without-legacy-request-fil

I can see that Total Commander, probably through evil black magic but obviously without root'y type of magic, manages to get programmatic access to /Android/data of other apps. How? Is that the legacy appreach with requestLegacyExternalStorage=true in the manifest and target < 30?

I'm asking because I would like to have scheduled backups (copies) of some of the documents that some app's place there, and TC cannot do that (to my knowledge).

Best Alex

Re: Android 11 - How does TC manage to access /Android/data/* ?

Posted: 2021-05-28, 10:28 UTC
by ghisler(Author)
No, it's not black magic, the answer to your stackoverflow question is correct:
TC just asks for access to /storage/emulated/0/Android/data via OPEN_DOCUMENT_TREE intent.
The trick is to tell the intent where to go - you cannot go there manually, but the files app will open the folder when directly told.

Then access the folders via scoped storage functions.