Suggestion: File ownership
Moderators: white, Hacker, petermad, Stefan2
-
- Junior Member
- Posts: 6
- Joined: 2011-11-29, 14:45 UTC
- Location: London, UK
Suggestion: File ownership
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!
This would put it in the same league as root explorer, and eliminate the need for other root file managers.
Please please consider it!
- ghisler(Author)
- Site Admin
- Posts: 48203
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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 (???).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Junior Member
- Posts: 6
- Joined: 2011-11-29, 14:45 UTC
- Location: London, UK
True, but that doesn't prevent you to do it as root exploer does, i.e. with a long list of numbers.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 (???).
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.
- ghisler(Author)
- Site Admin
- Posts: 48203
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks, that info was very useful! Any idea how to get the owner number for a specific app name?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
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)
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.
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
Hope it helps.
- ghisler(Author)
- Site Admin
- Posts: 48203
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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?
And what about the UIDs of user-installed apps? Any idea on how to get them?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- Junior Member
- Posts: 6
- Joined: 2011-11-29, 14:45 UTC
- Location: London, UK
I found this, does it help? :ghisler(Author) wrote:Thanks, that info was very useful! Any idea how to get the owner number for a specific app name?
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);
And as you can see the list that SithLord gave is identical to mine.
- ghisler(Author)
- Site Admin
- Posts: 48203
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
-
- Junior Member
- Posts: 6
- Joined: 2011-11-29, 14:45 UTC
- Location: London, UK
- ghisler(Author)
- Site Admin
- Posts: 48203
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
- ghisler(Author)
- Site Admin
- Posts: 48203
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact: