[APP][4.1+][ROOT] User Management - Simple multi user helper

Search This thread

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
User Management





Dropbox link - While it's available on Dropbox, I'd really prefer it if you would use the Google Play option, as it help me keep statistics on device usage, and allows you to send error reports in case of problems

As recently discovered, Jelly Bean contains experimental and unofficial multi user support.

I've written an app for rooted Jelly Bean devices that allows anyone to use a simple GUI interface to do the following, without even touching the command line:

  • Create a user
  • View list of existing users
  • Rename users
  • Delete users
  • Switch to another user

The Primary user can be renamed, but not deleted. I disabled its deletion as it near-bricks the device, as detailed here (along with fix if you somehow manage it).

There is a donate version as well, but I won't be linking to that as it seems to be against the rules.

NOTICE: The SD Card permissions are required to rename the users. I couldn't find a way to save to the file system, so I read the user's file using the cat shell command, edited it with the new name, saved it to the SD Card and then used the cat command to overwrite the initial file. It's hacky, but it works.

I'd appreciate it if you could try out the app, perhaps buy it if you like it ;)

Comments/suggestions are always welcome :)

As of now, the only way to switch back to the Primary user is if you hold down the power button and select the Primary user from there. This is because root access does not persist for any app, including Superuser itself across different accounts.

zHiWzblyakdMePg2DRrWfh8S38vmTBjNKIknBFhNqStE8Dywor_OVPsHYHEZbdZHYAI


_Fizi4KwfMSiUyVecJ5FBvLgHKRy5fQP8zrXw_nvm5uaDOZXCfVpLtFcGcWpafB-yv6i


xMEpukRO_f4sy-lntqyozjUCfvAcaVb178n1dqB4j7tPS2pcG60uL3ODzMCuqLEe6VU
 
Last edited:

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
FAQ

What commands were used?

All were executed in a # (root) shell
To create a user (leave the quotes in if the username being create has a space. Single word names don't need them):

Code:
pm create-user "user name"

To delete a user (replace <user-id> with the user's ID):

Code:
pm remove-user <user-id>

To list all users:

Code:
pm list-users

To switch to another user (replace <user-id> with the user's ID):

Code:
am switch-user <user-id>

To rename a user:

There is no command for this. I used the cat command to read the user's xml file (/data/system/users/<user-id>.xml) into a string array, replaced the user name, saved the file to the SD Card and used the cat command again to overwrite the original file. To reboot after the rename I used:

Code:
reboot
 
Last edited:
What could come handy is setting profiles for personal n General usage, most people use various call hiding, media hiding apps to hide personal stuff, the ideal way will be to unlock the phone with two patterns at the screen lock level, one pattern unlock for general profile the other for personal use where your personal call logs, media for gets unlocked automatically, there's an app call switch me, but it requires rebooting which is not practically usable

Sent from my GT-N7000 using xda premium
 

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
What could come handy is setting profiles for personal n General usage, most people use various call hiding, media hiding apps to hide personal stuff, the ideal way will be to unlock the phone with two patterns at the screen lock level, one pattern unlock for general profile the other for personal use where your personal call logs, media for gets unlocked automatically, there's an app call switch me, but it requires rebooting which is not practically usable

Sent from my GT-N7000 using xda premium

This is really not what the app was designed for. This app was meant to be a simple GUI interface to try out the limited multi user support without having to go to a terminal emulator or adb each time you wanted to do something like create or modify a user. The features you request should be implemented by Google themselves, as they likely will be in upcoming upgrades, and not by a third party app.
 

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
Could you show a screen shot of the final build main menu (the user selection screen)? Does this show up when you first boot up your phone/tablet?

Thanks!

The third screenshot does show the user selection screen. You can tap on any one of the users, and a Context Menu shows up allowing you to rename, switch to, and delete that user.

Here is a screenshot of the menu:

WnYyxcG-9qEBmrYpQXyBhuzeP9TImhq5cbd4JWQskmZwiFhyiIp37YGJ6soGM1cTD8Uh


This app does not start up on boot. Once booted, you must manually use the Primary account to open the app. This is because the app is simply meant to allow you to create and manage the users without using the terminal with a nice GUI, not attempt to replace or provide functionality that can only come from Google.
 
Last edited:
  • Like
Reactions: TBayTom

dietrichmd

Member
Jun 17, 2008
23
1
One suggestion: Landscape mode :)

User Management





As recently discovered, Jelly Bean contains experimental and unofficial multi user support.

I've written an app for rooted Jelly Bean devices that allows anyone to use a simple GUI interface to do the following, without even touching the command line:

  • Create a user
  • View list of existing users
  • Rename users
  • Delete users
  • Switch to another user

The Primary user can be renamed, but not deleted. I disabled its deletion as it near-bricks the device, as detailed here (along with fix if you somehow manage it).

There is a donate version as well, but I won't be linking to that as it seems to be against the rules.

NOTICE: The SD Card permissions are required to rename the users. I couldn't find a way to save to the file system, so I read the user's file using the cat shell command, edited it with the new name, saved it to the SD Card and then used the cat command to overwrite the initial file. It's hacky, but it works.

I'd appreciate it if you could try out the app, perhaps buy it if you like it ;)

Comments/suggestions are always welcome :)

zHiWzblyakdMePg2DRrWfh8S38vmTBjNKIknBFhNqStE8Dywor_OVPsHYHEZbdZHYAI


_Fizi4KwfMSiUyVecJ5FBvLgHKRy5fQP8zrXw_nvm5uaDOZXCfVpLtFcGcWpafB-yv6i


xMEpukRO_f4sy-lntqyozjUCfvAcaVb178n1dqB4j7tPS2pcG60uL3ODzMCuqLEe6VU
 
  • Like
Reactions: Raghav Sood

Zemaree

Senior Member
Nov 25, 2009
55
1
Alice Castello
Not sure if it's easy or not but your app driven by a nfc tags open some interesting scenario like when i give the phone to my wife and she say: "oh, what a mess my iphone have few icons..."

or a shared phone usage for team ... or something like the chamaleon gui that when I arrive at home i switch the user from the profession usage to the private ones. Should be nice.

Is this doable?
 

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
Not sure if it's easy or not but your app driven by a nfc tags open some interesting scenario like when i give the phone to my wife and she say: "oh, what a mess my iphone have few icons..."

or a shared phone usage for team ... or something like the chamaleon gui that when I arrive at home i switch the user from the profession usage to the private ones. Should be nice.

Is this doable?

Yes. Both of these are doable. However, this isn't the purpose of the app. Though considering the amount of requests I've received for such features, I'll be making another app that does all this and more very soon.
 
  • Like
Reactions: Sensation-al!

ellesshoo

Senior Member
Jul 10, 2010
446
137
So other than creating/naming etc is there any functionality like choosing apps/restrictions for accounts at this stage?
 

lost_man10002

Senior Member
Oct 19, 2010
598
65
NYC
works as advertised keeps all apps from primary user on the guest accounts they just don't see any info becuase its like just installing them. Good job.
 
  • Like
Reactions: Raghav Sood

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
So other than creating/naming etc is there any functionality like choosing apps/restrictions for accounts at this stage?

Well, @bradymobile did post a link to the source code of a User Specific Settings screen a few posts back. However, this appears to be in accessible from the normal Settings menu, and so I'm currently looking for the correct intent to open it up. Beyond that, you can use Nova or Apex as the launcher for the guest user(s), and hide all the apps you don't want to be visible there.
 

mallman

Senior Member
Aug 17, 2008
2,018
140
on latest cm10 the user management app doesnt seem to be able to gain root. In fact, even superuser isnt granted root once you switch to an account other than the primary. suerpuser denies itself and the user mangement app.
 

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
on latest cm10 the user management app doesnt seem to be able to gain root. In fact, even superuser isnt granted root once you switch to an account other than the primary. suerpuser denies itself and the user mangement app.

This is because apparently root doesn't persist across user accounts. The only way to switch back to the primary account is by using the power menu options. I haven't quite figured out why the root won't persist. It happens to all apps that need root.
 
  • Like
Reactions: mallman

mallman

Senior Member
Aug 17, 2008
2,018
140
This is because apparently root doesn't persist across user accounts. The only way to switch back to the primary account is by using the power menu options. I haven't quite figured out why the root won't persist. It happens to all apps that need root.

that is interesting. i would ask if the superuser permissions have changed upon switch but obviously you're not rooted so you cant tell. Following closely so god luck and thanks for the dev!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 39
    User Management





    Dropbox link - While it's available on Dropbox, I'd really prefer it if you would use the Google Play option, as it help me keep statistics on device usage, and allows you to send error reports in case of problems

    As recently discovered, Jelly Bean contains experimental and unofficial multi user support.

    I've written an app for rooted Jelly Bean devices that allows anyone to use a simple GUI interface to do the following, without even touching the command line:

    • Create a user
    • View list of existing users
    • Rename users
    • Delete users
    • Switch to another user

    The Primary user can be renamed, but not deleted. I disabled its deletion as it near-bricks the device, as detailed here (along with fix if you somehow manage it).

    There is a donate version as well, but I won't be linking to that as it seems to be against the rules.

    NOTICE: The SD Card permissions are required to rename the users. I couldn't find a way to save to the file system, so I read the user's file using the cat shell command, edited it with the new name, saved it to the SD Card and then used the cat command to overwrite the initial file. It's hacky, but it works.

    I'd appreciate it if you could try out the app, perhaps buy it if you like it ;)

    Comments/suggestions are always welcome :)

    As of now, the only way to switch back to the Primary user is if you hold down the power button and select the Primary user from there. This is because root access does not persist for any app, including Superuser itself across different accounts.

    zHiWzblyakdMePg2DRrWfh8S38vmTBjNKIknBFhNqStE8Dywor_OVPsHYHEZbdZHYAI


    _Fizi4KwfMSiUyVecJ5FBvLgHKRy5fQP8zrXw_nvm5uaDOZXCfVpLtFcGcWpafB-yv6i


    xMEpukRO_f4sy-lntqyozjUCfvAcaVb178n1dqB4j7tPS2pcG60uL3ODzMCuqLEe6VU
    9
    FAQ

    What commands were used?

    All were executed in a # (root) shell
    To create a user (leave the quotes in if the username being create has a space. Single word names don't need them):

    Code:
    pm create-user "user name"

    To delete a user (replace <user-id> with the user's ID):

    Code:
    pm remove-user <user-id>

    To list all users:

    Code:
    pm list-users

    To switch to another user (replace <user-id> with the user's ID):

    Code:
    am switch-user <user-id>

    To rename a user:

    There is no command for this. I used the cat command to read the user's xml file (/data/system/users/<user-id>.xml) into a string array, replaced the user name, saved the file to the SD Card and used the cat command again to overwrite the original file. To reboot after the rename I used:

    Code:
    reboot
    2
    Good job brotha!
    Billy
    1
    Could you show a screen shot of the final build main menu (the user selection screen)? Does this show up when you first boot up your phone/tablet?

    Thanks!

    The third screenshot does show the user selection screen. You can tap on any one of the users, and a Context Menu shows up allowing you to rename, switch to, and delete that user.

    Here is a screenshot of the menu:

    WnYyxcG-9qEBmrYpQXyBhuzeP9TImhq5cbd4JWQskmZwiFhyiIp37YGJ6soGM1cTD8Uh


    This app does not start up on boot. Once booted, you must manually use the Primary account to open the app. This is because the app is simply meant to allow you to create and manage the users without using the terminal with a nice GUI, not attempt to replace or provide functionality that can only come from Google.