Reputation: 1
I am trying (and failing) to find out how, for example, file browser app access the root-only folders, for example /data
.
From what I have read so far it seems that the only way is to spawn a new process and execute normal terminal commands using su
and processing the standard output,
But the thing is that I have seen numerous apps that for example show the icon of an .apk
stored in the /data/app
folder.
How do you do that since I don't know how would a program return that in stdout.
To me it seems that somehow they have access it right from java without using an external process.
Upvotes: 0
Views: 1274
Reputation: 52966
APKs in /data/app
are world readable, so you don't actually need root access to read them, you only need to know the actual file name (because you don't have permissions to list file) and that is easy to find out. In short, unless you forward-lock the APK, it is world readable and that is by design.
There is no way to run an app with root privileges without starting a new process, and 'root explorer' style apps are using clever tricks to make think it is possible. They are either copying file to a temporary folder to let you edit them and then copying them back, or piping the whole pipe to parse it on memory, or using other similar methods.
So, the question, as usually, becomes: What are you trying to do and why?
Upvotes: 2