Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,943 Members 52,919 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
Raghav Sood
Old
(Last edited by Raghav Sood; 21st August 2012 at 09:02 AM.)
#1  
Raghav Sood's Avatar
Member - OP
Thanks Meter 99
Posts: 63
Join Date: Aug 2012
Location: New Delhi

 
DONATE TO ME
Default [APP][4.1+][ROOT] User Management - Simple multi user helper

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.





The Following 39 Users Say Thank You to Raghav Sood For This Useful Post: [ Click to Expand ]
 
Raghav Sood
Old
(Last edited by Raghav Sood; 10th August 2012 at 06:00 PM.)
#2  
Raghav Sood's Avatar
Member - OP
Thanks Meter 99
Posts: 63
Join Date: Aug 2012
Location: New Delhi

 
DONATE TO ME
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:
Select Code
pm create-user "user name"
To delete a user (replace <user-id> with the user's ID):

Code:
Select Code
pm remove-user <user-id>
To list all users:

Code:
Select Code
pm list-users
To switch to another user (replace <user-id> with the user's ID):

Code:
Select 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:
Select Code
reboot
The Following 8 Users Say Thank You to Raghav Sood For This Useful Post: [ Click to Expand ]
 
sanghaviraj
Old
#3  
sanghaviraj's Avatar
Senior Member
Thanks Meter 44
Posts: 316
Join Date: Apr 2010
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
Old
#4  
Raghav Sood's Avatar
Member - OP
Thanks Meter 99
Posts: 63
Join Date: Aug 2012
Location: New Delhi

 
DONATE TO ME
Quote:
Originally Posted by sanghaviraj View Post
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
Old
#5  
Raghav Sood's Avatar
Member - OP
Thanks Meter 99
Posts: 63
Join Date: Aug 2012
Location: New Delhi

 
DONATE TO ME
Any other comments/suggestions from anybody?
 
ken2802
Old
#6  
Senior Member
Thanks Meter 16
Posts: 193
Join Date: Aug 2010
cool app
The Following User Says Thank You to ken2802 For This Useful Post: [ Click to Expand ]
 
JeepFreak
Old
#7  
JeepFreak's Avatar
Senior Member
Thanks Meter 204
Posts: 688
Join Date: May 2008
Good job brotha!
Billy
The Following 2 Users Say Thank You to JeepFreak For This Useful Post: [ Click to Expand ]
 
TBayTom
Old
#8  
TBayTom's Avatar
Senior Member
Thanks Meter 113
Posts: 532
Join Date: Mar 2011
Location: Orlando
Quote:
Originally Posted by Raghav Sood View Post
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!
 
Raghav Sood
Old
(Last edited by Raghav Sood; 20th August 2012 at 04:05 PM.)
#9  
Raghav Sood's Avatar
Member - OP
Thanks Meter 99
Posts: 63
Join Date: Aug 2012
Location: New Delhi

 
DONATE TO ME
Quote:
Originally Posted by TBayTom View Post
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.
The Following User Says Thank You to Raghav Sood For This Useful Post: [ Click to Expand ]
 
dietrichmd
Old
#10  
Junior Member
Thanks Meter 1
Posts: 23
Join Date: Jun 2008
One suggestion: Landscape mode

Quote:
Originally Posted by Raghav Sood View Post
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





------------
Samsung Galaxy S3
Model: SPH-L710 -- Rooted
Android 4.0.4
Kernel ver: 3.0.8-618049-user
Baseband: L710VPLG2
Build: IMM76D.L710VPALG2


Motorola Xoom
Model: Xoom -- Rooted
Android 4.0.4
Kernel ver: 2.6.39.4-g42a0480
Build: IMM76


Samsung Galaxy S (Epic4g)
Model: SPH-D700 - Rooted
Android: 2.3
Baseband: S700.0.5S.FC09
Kernel ver: 2.6.35.7
Build: Gingerbread.FC09

The Following User Says Thank You to dietrichmd For This Useful Post: [ Click to Expand ]
Tags
jelly bean 4.1, multi user, root
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes