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

Search This thread

-DarkKnight-

Senior Member
Mar 14, 2011
6,483
1,303
Gotham
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.

are you saying that only the primary account can use root permissions?

and i downloaded your app. i accedently created an account with an empty string as the name

now when i try to remove it, it force closes. what do i do.


I made another account called "guest" and that removes just fine
 

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
are you saying that only the primary account can use root permissions?

and i downloaded your app. i accedently created an account with an empty string as the name

now when i try to remove it, it force closes. what do i do.

I made another account called "guest" and that removes just fine

As far as I can see, only the Primary account has root. I even tried rerooting the device, but it didn't work.

Could you provide a LogCat trace for that? I created and deleted a user with an empty name on my Nexus S and it went perfectly.
 

Stramondroid

Senior Member
Mar 12, 2010
311
21
Austin Texas
Google Pixel 6
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.

Maybe mention this, in the OP... I was a bit confused thinking I messed it up... works great otherwise...
 
  • Like
Reactions: Raghav Sood

Stramondroid

Senior Member
Mar 12, 2010
311
21
Austin Texas
Google Pixel 6
You may want to look at UserDetailSettings.java in the Settings app for the package manager code to enable/disable apps per user.

https://android.googlesource.com/platform/packages/apps/Settings/+/jb-release/src/com/android/settings/users/UserDetailsSettings.java

attachment.php

This isn't available on CM10 on the phone... crespo4G
 

TBayTom

Senior Member
Mar 17, 2011
575
120
Orlando
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.
Great, thank you!

I was expecting to see an interface such as this upon boot:
Multiple-User-Accounts_android.jpg


Is this just a mock picture they have posted on the main site?
 
Last edited:

virtualflyer

Senior Member
Mar 16, 2011
352
46
are you saying that only the primary account can use root permissions?

and i downloaded your app. i accedently created an account with an empty string as the name

now when i try to remove it, it force closes. what do i do.


I made another account called "guest" and that removes just fine
For the empty string, rename then delete. It worked for me
 

karrb

Senior Member
Jan 4, 2011
69
12
VA
www.karrbs.com
Every time I go to remove a user it force closes. I am going to remove it manually... I will install log cat later if I can replicate it. This is the first time I am testing an app outside of work O.O
 

Chilling_Silence

Senior Member
Dec 7, 2007
91
14
I've also noticed the 'no root' on secondary user accounts. Trying to un-freeze Google Movies for my wifes account with Titanium Backup reports "success" but it doesn't *actually* do anything.

However doing that on the primary account works fine and the apps show up in the App drawer immediately on my rooted Nexus 7.
 

SilencerOfLambs

Senior Member
Dec 8, 2011
1,832
1,100
Mumbai
Interesting and cool. Definitely a start for something big. Does it work well if you are using a JB ROM as your secondary ROM?

Good job btw. :)

Sent from a phone that makes nearby iPhones self destruct :D
 
  • Like
Reactions: Raghav Sood

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
Can you post the apk in XDA not just in the play store ? Or simply add support for Android 4.0 ?

I suppose I could put up the free one.

As I told you on the other thread, adding support for ICS is beyond my power. Jelly Bean added a lot of multiuser support at a source code level, not at an application level. As such, it is impossible for me to make my app ICS compatible without modifying the ICS ROM the user is running at a source code level.
 

SferaDev

Inactive Recognized Developer
Jun 28, 2012
1,602
3,494
sferadev.github.io
I suppose I could put up the free one.

As I told you on the other thread, adding support for ICS is beyond my power. Jelly Bean added a lot of multiuser support at a source code level, not at an application level. As such, it is impossible for me to make my app ICS compatible without modifying the ICS ROM the user is running at a source code level.

I just ask for the apk because my tab it's Android 4.0 and play says that I couldn't download !

I'll just modify the app manifest to be able to run in Android 4.0 and try if it works with my port !
 

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
Interesting and cool. Definitely a start for something big. Does it work well if you are using a JB ROM as your secondary ROM?

Good job btw. :)

Sent from a phone that makes nearby iPhones self destruct :D

Thanks :) I haven't really tried it on a device with JB as a secondary ROM, but it should work on any JB ROM, regardless of CM10, AOSP, Primary, Secondary etc.
 
  • Like
Reactions: SilencerOfLambs

Raghav Sood

Senior Member
Aug 4, 2012
63
100
New Delhi
www.appaholics.in
Ok thanks, I ask your permission to deodex you app and recompile it.

Your app rocks and maybe cm guys add it to the nexts nightly !

Sent from my RK29 tab...

As long as you don't publish the recompiled version, okay. Also, please don't mess around with the Java files. A lot of the work in there is hacky at best, as this is totally unofficial functionality. Even a small change could bring the whole app crashing down.
 
  • Like
Reactions: SferaDev

SferaDev

Inactive Recognized Developer
Jun 28, 2012
1,602
3,494
sferadev.github.io
As long as you don't publish the recompiled version, okay. Also, please don't mess around with the Java files. A lot of the work in there is hacky at best, as this is totally unofficial functionality. Even a small change could bring the whole app crashing down.

Of course don't worry about it only for personal testing !

Sent from my RK29 tab...
 
  • Like
Reactions: Raghav Sood

Schrotty35

Senior Member
Oct 30, 2010
4,407
616
Vienna
I can create but not delete. Whene i delete a get a FC.

Gesendet von meinem GT-I9300 mit Tapatalk 2
 
Last edited:

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.