Page 1 of 1
Suggestion: File ownership
Posted: 2011-11-29, 17:20 UTC
by Tyxerakias
I didn't see this as a suggestion anywhere, but at the moment one serious drawback in using TC as a root file manager, is the inability to chown. Since we can now chmod, could we please also have chown?
This would put it in the same league as root explorer, and eliminate the need for other root file managers.
Please please consider it!

Posted: 2011-11-30, 15:15 UTC
by ghisler(Author)
I couldn't find out how user names are organized on Android, that's why I haven't added that yet. It seems that each app has their own user name (???).
Posted: 2011-12-01, 12:33 UTC
by Tyxerakias
ghisler(Author) wrote:I couldn't find out how user names are organized on Android, that's why I haven't added that yet. It seems that each app has their own user name (???).
True, but that doesn't prevent you to do it as root exploer does, i.e. with a long list of numbers.
You have 0 for root, and then, respectively,
1000 to 1017 for system, radio, bluetooth, graphics, input, audio, camera, log, compass, mount, wifi, adb, install, media, dhcp, sdcard_rw, vpn, keystore
2000-2002 for shell, cache and diag,
3001-3005 for net_bt_admin, net_bt, inet, net_raw, net_admin,
9998 for misc,
9999 for nobody,
and then from 10000 to whatever, you have all the app names, app_0 to app_1000 if you have a thousand and one of them.
Posted: 2011-12-01, 13:44 UTC
by ghisler(Author)
Thanks, that info was very useful! Any idea how to get the owner number for a specific app name?
Posted: 2011-12-02, 00:05 UTC
by SithLord
Hi,
Here are the complete and exact list of UIDs and GIDs taken from the source of Busybox, the patched version in use for Android releases.
UID/GID list : (equivalent of /etc/passwd and /etc/group)
Code: Select all
root:0
system:1000
radio:1001
bluetooth:1002
graphics:1003
input:1004
audio:1005
camera:1006
log:1007
compass:1008
mount:1009
wifi:1010
dhcp:1014
adb:1011
install:1012
media:1013
shell:2000
cache:2001
diag:2002
net_bt_admin:3001
net_bt:3002
sdcard_rw:1015
vpn:1016
keystore:1017
inet:3003
net_raw:3004
net_admin:3005
misc:9998
nobody:9999
Every UID maps to its exact GID counterpart. AFAIK and according to patched Busybox sources, there's no UID being member of another group than it's own.
Hope it helps.
Posted: 2011-12-02, 11:25 UTC
by ghisler(Author)
Nice, thanks! Are they the same on all Android versions, or is there a file where they can be read from?
And what about the UIDs of user-installed apps? Any idea on how to get them?
Posted: 2011-12-04, 03:13 UTC
by Tyxerakias
ghisler(Author) wrote:Thanks, that info was very useful! Any idea how to get the owner number for a specific app name?
I found this, does it help? :
Code: Select all
final PackageManager pm = getPackageManager();
//get a list of installed apps.
List<ApplicationInfo> packages = pm.getInstalledApplications(
PackageManager.GET_META_DATA);
int UID;
//loop through the list of installed packages and see if the selected
//app is in the list
for (ApplicationInfo packageInfo : packages) {
if(packageInfo.packageName.equals(app_selected)){
//get the UID for the selected app
UID = packageInfo.uid;
}
//Do whatever with the UID
Log.i("Check UID", "UID is: " + UID);
I do believe the first bit is the same for all android versions, yes.
And as you can see the list that SithLord gave is identical to mine.
Posted: 2011-12-04, 14:20 UTC
by ghisler(Author)
Yes, that looks exactly like what I need, thanks!
Posted: 2012-09-10, 00:02 UTC
by Tyxerakias
Even if it took a while, you never disappoint
Thank you very much for the functions in v.2! Really appreciated

Posted: 2012-09-10, 13:50 UTC
by ghisler(Author)
Thanks for the help with implementing this!
Posted: 2012-10-08, 09:02 UTC
by charly_35
Hello,
Would it be possible to add the options to the chmod (file property) to be able to set them with sid/gid fonction. Like when doing a "chmod 06755 /system/xbin/su". Thks
Posted: 2012-10-08, 12:52 UTC
by ghisler(Author)
I will consider it.