Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP Raghav Sood

9th August 2012, 07:03 PM   |  #1  
Raghav Sood's Avatar
OP Member
Flag New Delhi
Thanks Meter: 99
 
63 posts
Join Date:Joined: Aug 2012
Donate to Me
More
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.





Last edited by Raghav Sood; 21st August 2012 at 10:02 AM.
The Following 39 Users Say Thank You to Raghav Sood For This Useful Post: [ View ]
9th August 2012, 07:08 PM   |  #2  
Raghav Sood's Avatar
OP Member
Flag New Delhi
Thanks Meter: 99
 
63 posts
Join Date:Joined: Aug 2012
Donate to Me
More
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 by Raghav Sood; 10th August 2012 at 07:00 PM.
The Following 8 Users Say Thank You to Raghav Sood For This Useful Post: [ View ]
9th August 2012, 08:54 PM   |  #3  
sanghaviraj's Avatar
Senior Member
Thanks Meter: 44
 
319 posts
Join Date:Joined: Apr 2010
More
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
9th August 2012, 09:01 PM   |  #4  
Raghav Sood's Avatar
OP Member
Flag New Delhi
Thanks Meter: 99
 
63 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Quote:
Originally Posted by sanghaviraj

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.
12th August 2012, 08:31 PM   |  #5  
Raghav Sood's Avatar
OP Member
Flag New Delhi
Thanks Meter: 99
 
63 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Any other comments/suggestions from anybody?
14th August 2012, 02:54 PM   |  #6  
Senior Member
Thanks Meter: 17
 
205 posts
Join Date:Joined: Aug 2010
More
cool app
The Following User Says Thank You to ken2802 For This Useful Post: [ View ]
17th August 2012, 02:40 AM   |  #7  
JeepFreak's Avatar
Senior Member
Thanks Meter: 210
 
706 posts
Join Date:Joined: May 2008
Thumbs up
Good job brotha!
Billy
The Following 2 Users Say Thank You to JeepFreak For This Useful Post: [ View ]
20th August 2012, 04:45 PM   |  #8  
TBayTom's Avatar
Senior Member
Flag Orlando
Thanks Meter: 120
 
571 posts
Join Date:Joined: Mar 2011
More
Quote:
Originally Posted by Raghav Sood

Any other comments/suggestions from anybody?

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!
20th August 2012, 05:01 PM   |  #9  
Raghav Sood's Avatar
OP Member
Flag New Delhi
Thanks Meter: 99
 
63 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Quote:
Originally Posted by TBayTom

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:



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 by Raghav Sood; 20th August 2012 at 05:05 PM.
The Following User Says Thank You to Raghav Sood For This Useful Post: [ View ]
20th August 2012, 05:02 PM   |  #10  
Junior Member
Thanks Meter: 1
 
23 posts
Join Date:Joined: Jun 2008
More
Thumbs up
One suggestion: Landscape mode

Quote:
Originally Posted by Raghav Sood

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






The Following User Says Thank You to dietrichmd For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
jelly bean 4.1, multi user, root
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes