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

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
arberg
Junior Member
Junior Member
Posts: 9
Joined: 2018-04-20, 10:00 UTC

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

Post 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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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.
Author of Total Commander
https://www.ghisler.com
Post Reply