Reputation: 5300
There is literally nothing on the web about Android users. I'm on a rooted busyboxed platform and I cannot get the list of users. There is no /etc/passwd
, or any other passwd
file (that is not empty) anywhere else. I can only observe some users that are owners of processes as
reported by ps
, and probe their groups using groups
. What's even more weird is that Android app processes belong to users such as u0_aSOMENUMBER, e.g u0_a1, u0_a53. groups
ing them results in groups: unknown user u0_a1
. su
ing into them results in nothing happening. I'm also guessing that there is no such thing as a user password on Android.
Can you enlighten me on the Android user structure?
Upvotes: 0
Views: 1909
Reputation: 39836
Can you enlighten me on the Android user structure?
yes. although I do not know all the small details, I believe I can give you a good direction.
The Linux Users and Groups are created and managed by the Android system. They're used as a system tool to sand-box the applications. Each application goes into their own process and each process to their own user. User of the application have permission for X, Y, Z on the system and the Linux makes sure to crash your process (your app process) if you go beyond what you can do.
That's why it's so important to declare the app permission in the app manifest file.
So, because it's all auto-generated, they're just random numbers as you've seen.
If you want a list of users on the device in a sense of [email protected] and [email protected] are users registered in the device settings you should in Java code, query the AccountManager, like this:
AccountManager manager = AccountManager.get(context);
Accounts[] accs = manager.getAccounts();
for(Account acc: accs)
aac.name << here
Upvotes: 1