Latest product reviews
ARCHOS 50 Diamond
ARCHOS GamePad2
ARCHOS
Smartphones
ARCHOS
TV Connect
ARCHOS 101 XS

A A A
Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?

ClockworkMod (CWM) Recovery easy install for RK3066 and RK3188 -- TWRP/CWM Flash-Tool and root for RK3288

 Please donate to support OMA and CrewRKTablets firmware work, thank you !

sp_Feed sp_TopicIcon
Enable multi-user on RK3188 4.4.2
This procedure disables Rockchip's forced single-user patch
Avatar
didierm

Contributor
Forum Posts: 12
Member Since:
2013/07/19
sp_UserOfflineSmall Offline

Thanks Received: 4
1
2014/01/26 - 20:56
sp_Permalink sp_Print sp_EditHistory

Admin edit: I have removed the <PRE> tags in this post HTML code so it appears properly formatted.

 

This is a guide to re-enable multi-user support on Rockchip-based Android 4.4.2.

Disclaimers :

- Please note : as I am a complete Android novice, it is entirely possible (and even probable) that alternative and more straightforward solutions exist.
- I accept no responsability should you brick or otherwise make defunct your device by following this guide.
- AOSP seems to be licensed under ASLv2.0 and GPLv2 ; should this guide conflict with Rockchip's rights, I kindly ask the forum admins to remove this post.

Preamble :

Examining the MK908 Android 4.4.2 source code (*), Rockchip uses the build.prop "ro.factory.hasUMS" property to apply custom codepaths.
(*) http://www.cnx-software.com/2013/12/31/android-4-4-2-kitkat-sdk-released-for-rockchip-rk3188-mini-pcs-mk908-mk908-ii-mk918-and-a9/

'hasUMS' is used in :
device/rockchip/rksdk/device.mk
device/rockchip/rksdk/init.rk30board.rc
frameworks/base/core/java/android/os/UserManager.java
frameworks/base/services/java/com/android/server/MountService.java
frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
packages/apps/Settings/src/com/android/settings/deviceinfo/UsbSettings.java

Examining init.rk30board.rc, it appears 'hasUMS' decides between emulated and physical storage (hence my guess UMS stands for 'USB Mass Storage').

Problem :

In Android 4.4 (and possibly earlier) and for reasons hitherto unknown (maybe because VFAT does not support multi-user file ownership ?), Rockchip disables multi-user support in UserManager.java if "ro.factory.hasUMS=true" (which is the default) :

        String enableUms= SystemProperties.get("ro.factory.hasUMS","false");
        if("true".equals(enableUms))
        {
            Log.d(TAG,"---getMaxSupportedUsers,we has UMS,force disabled M-user---");
            return 1;
        }

Re-enabling multi-user by setting "ro.factory.hasUMS=false" in /system/build.prop (and adding the property "fw.max_users=X", with X>1) is not possible, as this renders the O/S unusable (probably due to the custom codepaths in other parts of the source tree, see above).

Hence it seems the solution requires the "hasUMS=true" condition to be removed from UserManager.java.

My testing device is an FNF iFive X2, with the most recent firmware ifiveX2_FW_442_V2.0.1_201401221700 .
Recompiling the published source tree (see above) is not feasible, as the code may be oriented to the MK908, and the status and/or existence of custom patches by FNF/iFive is unknown.

Solution :

Patch the binary containing the compiled UserManager.java code.

Step-by-step guide :

(Linux-oriented, similar tools exist for Windows)

* Download and unpack 'APK-Multi-Tool' (http://forum.xda-developers.com/showthread.php?t=1808319)
* Download 'baksmali'/'smali' (https://code.google.com/p/smali/), and move these files into APK-Multi-Tool's "other" directory

* Run 'setup.sh' :
    - apply file permissions and create default directories
* 'UserManager.java' was compiled into 'framework.jar' :
    $ adb pull /system/framework/framework.jar
    $ mv framework.jar place-jar-here-for-modding/
* Disassemble the jar by running './script.sh' :
    - choose option 14 ('decompile Jar / classes.dex')
* In another shell, modify UserManager.java, so the Rockchip-added codepath never gets executed :
    $ sed -i 's/ro.factory.hasUMS/ro.factory.ha__MS/' working/framework.jar/android/os/UserManager.smali
* Back to APK-Multi-Tool, recompile classes.dex :
    - choose option 15 ('Compile Jar / classes.dex'), and exit the tool
* Reassemble the jar :
    $ mkdir framework-new ; cd framework-new
    $ unzip ../place-jar-here-for-modding/org-framework.jar
    $ cp -a ../place-jar-here-for-modding/classes.dex .
    $ jar cf ../framework-new.jar classes.dex preloaded-classes
* Replace the old jar and enable multi-user :
    $ adb remount
    $ adb push ../framework-new.jar /system/
    $ adb shell chown 0.0 /system/framework-new.jar
    $ adb shell chmod 0644 /system/framework-new.jar
    $ adb shell echo "fw.max_users=8" >> /system/build.prop
    $ adb shell mv /system/framework-new.jar /system/framework/framework.jar
    $ adb reboot recovery
   
* In recovery mode, clean the dalvik-cache and reboot

Notes :

1. As code changes between firmware updates, you will need to repeat this procedure after every firmware upgrade.
The string "we has UMS,force disabled M-user" in /system/framework/framework.jar/classes.dex may be a good indicator of the presence of Rockchip's patch.

2. Considering the fact that the above is based on Rockchip's source code, this procedure should apply to all RK3188-based 4.4.2 tablets.

HTH.

The following users say thank you to didierm for this useful post:

admin, manupc
Avatar
manupc

Contributor
Forum Posts: 18
Member Since:
2013/08/27
sp_UserOfflineSmall Offline

Thanks Received: 12
2
2014/01/28 - 12:54
sp_Permalink sp_Print

Hi, thanks for effort. I have followed all your steps and tested the modified framework.jar but somehow multi-user is not full working at all. I am able to create so many users as stated in fw.max_users but the problem is when swichting to a new created user, im not able to use the back button and not able to change the new user´s name since keyboard wont appear. There must be something else needed to be changed to make it completely work. The new added ro.factory.hasUMS in ifive X2 could be messing somewhere else...

Avatar
didierm

Contributor
Forum Posts: 12
Member Since:
2013/07/19
sp_UserOfflineSmall Offline

Thanks Received: 4
3
2014/01/28 - 19:52
sp_Permalink sp_Print

manupc said
I am able to create so many users as stated in fw.max_users but the problem is when swichting to a new created user, im not able to use the back button and not able to change the new user´s name since keyboard wont appear.

 

When you navigate to Settings > Language & input > Keyboard & Input Methods, you'll notice [Default] is an empty field, and the [Android Keyboard Settings (AOSP)] is not activated and greyed out.

By activating [Google voice typing], [Android Keyboard Settings (AOSP)] gets activated too.

Entering and exiting the settings of AOSP, renders it as [Default], after which you can deactivate [Google voice typing] again.

 

You should now have a working virtual keyboard.

 

 

Avatar
admin

admin
Forum Posts: 5872
Member Since:
2010/09/11
sp_UserOfflineSmall Offline

Thanks Received: 3163
4
2014/01/28 - 20:51
sp_Permalink sp_Print

Thanks again didierm Wink

I have patched and rebuilt the framework.jar file for the PiPO M9 Pro and will be testing it shortly, I will then post the results here.

 

Cheers.

If you like our web site, applications and firmwares, feel free to support our site. Donations are used to pay the bills for our server hosting costs, development tools and purchase new tablets to support.


Avatar
admin

admin
Forum Posts: 5872
Member Since:
2010/09/11
sp_UserOfflineSmall Offline

Thanks Received: 3163
5
2014/01/28 - 21:25
sp_Permalink sp_Print sp_EditHistory

From my PiPO M9 Pro test results, I am getting some kind of Android restart (not really a full reboot) after I did Add  / User and I clicked OK button. Still, it seems to have worked as I got the new user created and working.

 

pipo_m9_pro_android442_kitkat_20131226_adduser2b.png

pipo_m9_pro_android442_kitkat_20131226_adduser4b.png

 

 

I have posted a rebuilt firmware for the PiPO M9 pro with the multi-user patch in the M9 Pro section:

http://www.arctablet.com/blog/forum/pipo-max-m9/rom-pipo-m9-pro-wifi-model-android-4-4-2-kitkat-custom-root-firmware-20131226/page-7/#p38083

 

Cheers.

If you like our web site, applications and firmwares, feel free to support our site. Donations are used to pay the bills for our server hosting costs, development tools and purchase new tablets to support.

Avatar
manupc

Contributor
Forum Posts: 18
Member Since:
2013/08/27
sp_UserOfflineSmall Offline

Thanks Received: 12
6
2014/01/28 - 23:10
sp_Permalink sp_Print

Thanks didierm. I got it working now. I will implement it in my rom and share soon. Shame something like that wasnt working before. Nice find!

Avatar
didierm

Contributor
Forum Posts: 12
Member Since:
2013/07/19
sp_UserOfflineSmall Offline

Thanks Received: 4
7
2014/01/28 - 23:15
sp_Permalink sp_Print

admin said
From my PiPO M9 Pro test results, I am getting some kind of Android restart (not really a full reboot) after I did Add  / User and I clicked OK button.

If I am not mistaken, this is expected behaviour : the chain of events more or less forces the newly added user to promptly change his/her account details (display name, password mechanism, ...).

 

Avatar
didierm

Contributor
Forum Posts: 12
Member Since:
2013/07/19
sp_UserOfflineSmall Offline

Thanks Received: 4
8
2014/01/28 - 23:22
sp_Permalink sp_Print

admin said

I have posted a rebuilt firmware for the PiPO M9 pro with the multi-user patch in the M9 Pro section:

Glad to be of help ; without your reference to Rockchip's KK source code, this would never have been possible. Thanks again !

 

Avatar
didierm

Contributor
Forum Posts: 12
Member Since:
2013/07/19
sp_UserOfflineSmall Offline

Thanks Received: 4
9
2014/01/28 - 23:33
sp_Permalink sp_Print

manupc said
Thanks didierm. I got it working now. I will implement it in my rom and share soon. Shame something like that wasnt working before. Nice find!

 

My pleasure.

 

Aren't you the manupc of the Rockchip-4.4.2 modified CWM and OC kernel ?

Do you mind me asking some questions ? Feel free to reply or not, as you see fit.

  1. Do you have any references to your CWM and/or kernel modifications ?
  2. Is your kernel RK3188-generic, or is it adapted to specific brands (Pipo, iFive, ...) ?
  3. What is your build environment for kernel development ?

 

Myself, I am looking into including Xposed/XPrivacy (and some system-oriented F-Droid OSS apps) into an iFive-oriented firmware roll-out. XPrivacy seems to be rapidly evolving into a decent multi-user aware app, which IMO is required when sharing a tablet with others (kids !).

 

Avatar
admin

admin
Forum Posts: 5872
Member Since:
2010/09/11
sp_UserOfflineSmall Offline

Thanks Received: 3163
10
2014/01/29 - 21:34
sp_Permalink sp_Print

If you like our web site, applications and firmwares, feel free to support our site. Donations are used to pay the bills for our server hosting costs, development tools and purchase new tablets to support.

Avatar
manupc

Contributor
Forum Posts: 18
Member Since:
2013/08/27
sp_UserOfflineSmall Offline

Thanks Received: 12
11
2014/01/29 - 23:53
sp_Permalink sp_Print

didierm said

My pleasure.

Aren't you the manupc of the Rockchip-4.4.2 modified CWM and OC kernel ?

Do you mind me asking some questions ? Feel free to reply or not, as you see fit.

  1. Do you have any references to your CWM and/or kernel modifications ?
  2. Is your kernel RK3188-generic, or is it adapted to specific brands (Pipo, iFive, ...) ?
  3. What is your build environment for kernel development ?

 

Of course, no problem.

To be honest, i didnt build a CWM recovery and kernel from source. I just applied modifications to previous builds.

In case of CWM recovery, it is a simple copy-paste of files pointing to the right storage partitions and taken from the original kitkat recovery.

In case of the kernel modification, and since i dont have a kernel source, i hex searched a kernel file for a group or table of some specific voltages/frequencies. Once found, replaced them with desired values.

As i know, my kernel does only work on ifive x2, since no other rk3188 kernel ive tested was working on my device.

Im sure you could apply the same method with any other rk3188 kernel. It is just not that funny working with binary code XD

 

If you need more information im pleasured to help

Avatar
jazzman123
New Member
Forum Posts: 4
Member Since:
2014/01/30
sp_UserOfflineSmall Offline
12
2014/02/02 - 09:36
sp_Permalink sp_Print

Is there any change a new ROM will be out with this patch for the ifive x3 ?

 

Thank you for your great work!

Avatar
admin

admin
Forum Posts: 5872
Member Since:
2010/09/11
sp_UserOfflineSmall Offline

Thanks Received: 3163
13
2014/02/02 - 19:29
sp_Permalink sp_Print

jazzman123,

Maybe next week, once the current custom firmwares in the works are finished.

Cheers.

 

If you like our web site, applications and firmwares, feel free to support our site. Donations are used to pay the bills for our server hosting costs, development tools and purchase new tablets to support.

Avatar
jazzman123
New Member
Forum Posts: 4
Member Since:
2014/01/30
sp_UserOfflineSmall Offline
14
2014/02/02 - 21:11
sp_Permalink sp_Print

Thanks

Avatar
Nilist
New Member
Forum Posts: 3
Member Since:
2014/02/23
sp_UserOfflineSmall Offline
15
2014/02/24 - 05:55
sp_Permalink sp_Print

The creation of new users work, but you are stuck with the name "New User". trying to change the name by tapping on it in setting causes settings to crash.

If you would like a different user name, I found this work-around:

From a Terminal window enter

"su"

"pm create-user someusername"

 

replace someusername with the name you would like to see on the lock screen (doesn't have to be your gmail name)

Very much appreciated by my kids when they can log on with their own names ;-)

Forum Timezone: Europe/Paris

Most Users Ever Online: 749

Currently Online: Bahramz, rysieks, WILD_pianist
202 Guest(s)

Currently Browsing this Page:
1 Guest(s)


Devices in use: Desktop (161), Phone (35), Tablet (9)

Top Posters:

Oma7144: 5783

globula_neagra: 2424

finless: 604

DarthJabba: 551

exelletor: 450

JochenKauz: 450

cracktech: 432

maikal: 394

Newest Members:

WILD_pianist

Doddsy

rysieks

akheel

Kuzmi4

ampao2

Forum Stats:

Groups: 10

Forums: 185

Topics: 5916

Posts: 58848

 

Member Stats:

Guest Posters: 43

Members: 256487

Moderators: 5

Admins: 1

Administrators: admin

Moderators: globula_neagra, exelletor, JochenKauz, Oma7144, cracktech


CrewRKTablets moderators: JochenKauz and Astralix