[Xiaomi Mi MIX  Questions & Answers] underlines:
Dear fellow mixers,

I try to achieve the combination of:

MIUI 9 Android 7.0 either from EpicROM or xiaomi.eu

Installing Magisk systemless root

Installing Xposed for magisk

3 Questions:

Anyone achieved this already? If yes, can you tell us which version/release of MIUI, which variant of Magisk & Exposed did you use?

If someone didn't do it, but knows which combination of MIUI, Magisk and Xposed (especially which versions and mods) should work in theory, can you say so?

To my understanding this should help to *not* trip safetynet and allow us to run Snapchat?

My research so far:

According to this post, Unofficial Xposed 88.1 for MIUI9 SDK24 should work

According to this post, 88.1 works and xmiui also has a magisk zip

Another guide that seems to be written before 88.1 was released with MIUI 9 compatibility. So I'm confused which guide to follow, which combination of systemless xposed/magisk will work?

Edit:

I'll use my experiences and document them here to later create another how-to for systemless magisk/xposed on miui9 and another guide how to properly backup second space apps.

Second space backup:

Using Titanium Backup installed and started in First Space will only backup first space apps. Installing Titanium Backup in Second space also didn't work properly for me for some apps like LINE messenger.

Actually there are two (somethimes three) places that need to be backed up:

1. App APK (the installation files itself)

/data/app/<appname>

for both spaces, because they use the same app installation, as no user data is saved here, so it's in a single location, no matter how many android user accounts or MIUI spaces you have.

2. App's user data (like LINE Messenger database etc. normally not visible to you but important):

First space: /data/user/0/<appname>

Second space: /data/user/10/<appname>

This is unique for every user account (or miui space), here individual data is being saved, like two different LINE messenger accounts, or FB accounts.

3. User's accessible app data (where your app stores things that you produce in your apps and are visible to you when connecting your phone to your PC or checking your sdcard/internal storage):

First Space: /storage/emulated/0/<folder>

Second Space: /storage/emulated/10/<folder>

the folder names can be a mess here, whatsapp names their user data folder simply Whatsapp. Here they store your chat history DB, your downloaded pictures, videos and audio. Other apps can basically name their folder however they want and sometimes it's difficult to find out what folder your app stores files in. The app "Magix Pro Screen Recorder" as a fictional example could store your screen recordings in /storage/emulated/0/Movies/recordings/

To properly backup whatsapp in second space:

copy /storage/emulated/10/whatsapp folder to your PC

in new rom/phone create second space, then copy the backup form your PC to the same location as above in your new rom/phone

install whatsapp from play store, open it and it should recognize the backup and ask you to directly restore it

To properly backup a more complex app that uses all three folder types described above I take Naver LINE Messenger as an example:

backup /data/user/10/jp.naver.line.android/ *

backup /data/app/jp.naver.line.android-1 *

in new rom/phone create second space, then copy the backups to the same locations as above

don't open line app yet

install terminal emulator and delete the previous LINE settings by using the following commands:

su

sqlite3

/data/user/10/jp.naver.line.android/databases/naver_line

delete from setting;

.quit

if you don't have the sqlite3 binary, you can try to find it online for android (arm64 binary), paste it to your /bin folder and try again, or open the file on your computer with an sqlite explorer

if available, delete the following xml:

/data/user/10/jp.naver.line.android/shared_prefs/jp.naver.line.android.settings.xml

open the Line app and it will ask you to enter your user and password

Alternative method:

backup /data/user/10/jp.naver.line.android/

backup /data/app/jp.naver.line.android-1

in new rom/phone create second space, then copy the backups to the same locations as above

don't open line app yet

use an sqlite editor on your phone or on your pc to empty the following database:

/data/user/10/jp.naver.line.android/databases/naver_line

start line

My preferred method:

on old phone, install device id changer pro in second space and open it

note down device ID

backup /data/user/10/jp.naver.line.android/

backup /data/app/jp.naver.line.android-1

in new rom/phone create second space, then copy the backups to the same locations as above

don't open line app yet

install device id changer pro in second space and open it

enter the previously noted down device ID and set it

start line

* creating proper backups of the two LINE folders is a whole procedure again, we need to use tar gz to preserve permissions when copying and pasting:

- enable developer mode and usb debugging

- connect to pc

- install minimal adb & fastboot on your PC

- start cmd, execute:

adb shell

- accept popup on device, then type into cmd:

su

- accept supersu on device

- type:

cd /data/user/10/jp.naver.line.android

tar -cvpzf /storage/emulated/0/user-10-jp.naver.line.android.tar.gz .

cd /data/user/0/jp.naver.line.android

tar -cvpzf /storage/emulated/0/user-0-jp.naver.line.android.tar.gz .

cd /data/app/jp.naver.line.android-1

tar -cvpzf /storage/emulated/0/app-jp.naver.line.android-1.tar.gz .

- copy the 3 backup tar.gz files into your first space internal storage, and type:

cd /storage/emulated/0/

tar xpvzf user-10-jp.naver.line.android.tar.gz /data/user/10/

tar xpvzf user-0-jp.naver.line.android.tar.gz /data/user/0/

tar xpvzf app-jp.naver.line.android-1.tar.gz /data/app/