What is the GID/UID of the system on Android?

10.6k views Asked by At

How do I identify the number (integer value) of a particular group associated with a file?

ls -l
drwxr-x--x root     system              2014-11-26 10:59 xyz

I have managed to check that group id of root is 0. What is the corresponding number of group id for system?

I need to change the group of my file to system. How do I do it using chown? gid_t is internally of int type. So what value should I pass to make it system? How do I know?

4

There are 4 answers

0
Sandeep On BEST ANSWER

Check with AID_XXX Ex: AID_SYSTEM in the source code. The corresponding value is the integer value of it.

AID_SYSTEM is 1000

Similarly it can be found for other groups as well.

I don't know if there is a better way.

0
nandeesh On

At adb shell

su 1000

since 1000 is the system uid

id

This returns

uid=1000(system) gid=1000(system)

So gid for system is 1000 too

0
domen On

Since you're talking about files specifically, the easiest way is just ls -n:

$ ls -ld /data
drwxrwx--x system   system            2015-06-04 11:59 data
$ ls -ldn /data
drwxrwx--x 1000     1000              2015-06-04 11:59 data
0
Rickey On
chgrp 1000 /path/filename

1000 is the system group id, and also the system user id

chgrp is included in busybox.