Note: Must have an work profile already setup, So that we can modify fw.sys.max_profiles to allow more work profiles
su # to gain root access
resetprop ro.debuggable 1
am restart
setprop fw.sys.max_profiles 10
# this is the user id of the initial island which was setup from the application
exid="10"
id="$(pm create-user --profileOf 0 --managed Island | grep -Eo '[0-9]+')"
echo "ID: ${id}"
where 11 is the user id of newly created work profile
<restrictions no_wallpaper="true" />
<device_policy_local_restrictions>
<restrictions_user user_id="10">
<restrictions allow_parent_profile_app_linking="true" />
</restrictions_user>
</device_policy_local_restrictions>
It should look like this
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<user id="10" serialNumber="28" flags="4144" type="android.os.usertype.profile.MANAGED" created="1652171823625" lastLoggedIn="1652351262370" lastLoggedInFingerprint="Sat Apr 23 21:25:20 IST 2022" profileGroupId="0" profileBadge="0">
<name> Island </name>
<restrictions no_wallpaper="true" />
<device_policy_local_restrictions>
<restrictions_user user_id="10">
<restrictions allow_parent_profile_app_linking="true" />
</restrictions_user>
</device_policy_local_restrictions>
<lastRequestQuietModeEnabledCall>1652340558380</lastRequestQuietModeEnabledCall>
</user>
cd "/data/system/users/${exid:?}" || exit 1
cp app_idle_stats.xml appwidgets.xml \
device_policies.xml \
package-restrictions.xml profile_owner.xml \
settings_secure.xml settings_ssaid.xml settings_system.xml \
"/data/system/users/${id:?}/"
@danielsanaw
I don't have any experience with apatch root, but magisk has its own busybox which if memory serves lives at /data/adb/magisk/busybox
Apparently the propsconfig module expects it to be present which I presume is not the case with apatch root
Do bear in mind that module appears heavily dependent on other magisk instrumentation, such as resetprop tool and Magisk's early boot script semantics.
I don't know how closely can apatch root emulate the necessary environment.
However, if you have Zygisk and Lsposed you can try this tool which does what my lifehack does but via lsposed hooking
https://github.com/icepony/AlwaysCreateUser
(In fact my hack was born from carefully looking at what alwayscreateuser does and finding a way to recreate it without Zygisk, because getting Zygisk on Graphene is a massive boondongle I am too lazy to mess with)