[Guide][Mi 8 Lite](Global) how to install TWRP + root with Magisk

Did this tutorial work for you?

  • Yes

    Votes: 23 79.3%
  • No

    Votes: 6 20.7%

  • Total voters
    29

sting12345

Senior Member
Jan 19, 2018
128
12
0
An update: I've now got over this encryption thing. It is indeed the screen PIN that was causing me problems. While I had tried removing the PIN and all fingerprints last time, I had powered down the phone immediately after removing the PIN and booted into fastboot mode. Today I thought I better try it one more time: after removing the PIN, reboot the phone to system first before powering it down and restarting in fastboot mode. This cycles the phone system at least once without the PIN so hopefully any traces of the PIN would really be wiped. And indeed it works - the booted TWRP (i.e. not flashed to phone) has no problems reading my phone and I could install Magisk.

So I now have stock recovery + Magisk on my Mi8 Lite, which is the minimum I wished to do to it. Maybe at a later date I would flash TWRP onto the phone as well.
I just purchased the mi 8 lite and after I unlock the bootloader I plan to flash TWRP and then a custom ROM like havocOS official but I do want encryption on for sure. Will that be the case since you are doing the verity flash to disable this feature? I wonder why do you guys not want the phone to encrypted? Wouldn't that be much safer. Also I don't plan to root just flash my ROM, encrypt and be happy.
 

daverock

Senior Member
Oct 2, 2013
65
9
0
Milan
I followed the procedure, TWRP asking me for a password to decrypt.
I have already tried to format data partition, but each OS boot, the phones perform the encryption again (and format data, internal storage, etc).
I don't want to install a new rom, I would just like to have the stock with root and TWRP working.
 

lexridge

Senior Member
May 19, 2011
617
110
63
I followed the procedure, TWRP asking me for a password to decrypt.
I have already tried to format data partition, but each OS boot, the phones perform the encryption again (and format data, internal storage, etc).
I don't want to install a new rom, I would just like to have the stock with root and TWRP working.
The phone will always turn back on encryption on first boot after formatting data, unless you set up some Magisk options by creating a new file from within recovery. Depending on whether you want to keep encryption, or not. . I posted those commands in post #38.

First, download the Magisk Manager apk install it, then copy to your microSD. Run it and then click to install Magisk (first option) You will be ask to install or just download. Choose to only download. When downloaded, move it to your microSD. Flash this one, NOT the one from the OP. I had problems using that one.

After you flash TWRP via Fastboot, boot into recovery, format data, IMPORTANT: REBOOT BACK INTO RECOVERY (Otherwise DATA will get encrypted again on normal boot). Run the command you want, to encryption or not (if you want to keep encryption, no need to create the file. It will keep encryption automatically). Install Magisk (the one you just downloaded, NOT the Manager apk). Magisk will report on install whether it is keeping encryption or not. Reboot to System. Install the MagiskManager.apk from microSD. Run it and check it. You should have root now with or without encryption.

EDIT: I personally don't like for DATA to be encrypted. The major disadvantage is that you cannot back it up with TWRP. Sure, if it takes your password, you can.....but it seems to rarely work. Even with the CORRECT PASSWORD (your login password). Maybe just a bug in the Mi 8 Lite build of TWRP. I dunno.

EDIT: Well, it seems that version 1003 (for Oreo) cannot decrypt the data in Pie, but versions 0121 and 0212 can.
 
Last edited:
  • Like
Reactions: malek_anas_97

p4trk

Member
Apr 25, 2019
27
0
0
Disclaimer :
Code:
 * I'm not responsible for bricked devices, dead SD cards, thermonuclear war, or you getting fired because the alarm app failed
* YOU are choosing to make these modifications, and if you point the finger at me for messing up your device, I will laugh at you :D
with that out the way and without bothering you with more useless things to read
let's get started shall we?
==== Notes ====
you should have already unlocked your bootloader (if not then start the process as soon as possible because it's going to take a while)
backup your stuff, make sure you have sufficient charge just in case anything goes wrong
download the unoffical TWRP port from Here
get the latest magisk from Here
install device usb drivers
set up fastboot properly

---------------------------------------------
What do you mean by set up fastboot properly?

Im having a hard time figuring everything out as its my first time trying to root and flash a mobile phone.
 

SubwayChamp

Senior Member
Aug 6, 2016
2,345
951
113
What do you mean by set up fastboot properly?

Im having a hard time figuring everything out as its my first time trying to root and flash a mobile phone.
There are many versions of adb/fastboot but for easier task download this version https://androidmtk.com/download-minimal-adb-and-fastboot-tool and follow the on-screen instructions, when the tool prompts to set up as wide system on windows type "y" and it will be ready to use. I use other version but I guess that this will install adb on your main drive and when you want to do some operation localize the folder on main drive and open it from there.
 

Marek89

Member
Mar 13, 2012
43
1
0
I have MIUI 11.0.7.0, PIN lock screen, TWRP 3.2.3-0. I stuck in decrypt data. When enter PIN lock, password failed. Whats next ?????? i'm frustrated
 

borg4571

New member
Apr 22, 2019
4
0
0
I have MIUI 11.0.7.0, PIN lock screen, TWRP 3.2.3-0. I stuck in decrypt data. When enter PIN lock, password failed. Whats next ?????? i'm frustrated
I use TWRP-3.3.1.-1207-XIAOMI8LITE-CN-wzsx150.img and decryption is working running (xiaomi.eu) MIUI 11.2 Android 10
 

malek_anas_97

Senior Member
Nov 24, 2013
113
76
0
What do you mean by set up fastboot properly?

Im having a hard time figuring everything out as its my first time trying to root and flash a mobile phone.
sorry i haven't been here for a while
thread is updated and cleaned up to make it easier to understand
i also added more links in the top section you can follow them and see :
https://www.xda-developers.com/install-adb-windows-macos-linux/
or
https://forum.xda-developers.com/mi-8-Lite/how-to/guide-how-to-install-update-adb-wide-t3903135
or
https://www.youtube.com/watch?v=vr0GLIufzkM
 

sgheillups

Member
Apr 11, 2015
22
1
0
Sorry for noob question but my last device was an Asus Zenfone 3 Max with a Mediatek CPU and 0 possibililty of modding, so I've been out from this world for a while. Moreover the Mi 8 Lite is my first Xiaomi.
Will my device receive OTA updates after rooting and unlocking bootloader? If not, how can I update my devices?
Thanks in advance
 

chan200606

Senior Member
Feb 2, 2008
170
43
48
Brisbane
Sorry for noob question but my last device was an Asus Zenfone 3 Max with a Mediatek CPU and 0 possibililty of modding, so I've been out from this world for a while. Moreover the Mi 8 Lite is my first Xiaomi.
Will my device receive OTA updates after rooting and unlocking bootloader? If not, how can I update my devices?
Thanks in advance
Assuming that you do it what most people do, i.e. unlock bootloader, install TWRP then Magisk to obtain root, the answer is yes with some qualifications.

Your rooted Mi 8 Lite will continue to receive OTA notifications, and when you tell the phone to update, it will download the update then reboot to recovery to install it. However the first round will always fail, as the default download will be the incremental update which will check that you have a stock ROM before installation. As you have installed Magisk, this will fail so you will reboot back to system with nothing applied.

Now if you tell the phone to update again, it will download the full ROM package (usually >1.5G compared with the <0.7G incremental update). This time when the phone reboots to recovery, the update will be installed unconditionally and successfully. However, as this is a full ROM, it will overwrite the boot/system partitions (hence you lose Magisk root) and the recovery partition (TWRP gone too) with the stock versions. So on reboot to system, you get an updated stock phone. You will have to go through the installation of TWRP/Magisk again if you want root again.

You can make the re-installation of TWRP and Magisk easier by:
(1) When you have TWRP, boot into it and change the setting to NOT reboot automatically after running a script (which is what the OTA will do). Also make sure that you have a copy of the TWRP image and the Magisk ZIP somewhere on your phone.
(2) After the OTA full ROM has been downloaded and has updated successfully, it will return to the TWRP interface. At this point, install the TWRP image to the recovery partition, install the Magisk ZIP, then wipe the caches before rebooting the phone.
 

sgheillups

Member
Apr 11, 2015
22
1
0
Assuming that you do it what most people do, i.e. unlock bootloader, install TWRP then Magisk to obtain root, the answer is yes with some qualifications.

Your rooted Mi 8 Lite will continue to receive OTA notifications, and when you tell the phone to update, it will download the update then reboot to recovery to install it. However the first round will always fail, as the default download will be the incremental update which will check that you have a stock ROM before installation. As you have installed Magisk, this will fail so you will reboot back to system with nothing applied.

Now if you tell the phone to update again, it will download the full ROM package (usually >1.5G compared with the <0.7G incremental update). This time when the phone reboots to recovery, the update will be installed unconditionally and successfully. However, as this is a full ROM, it will overwrite the boot/system partitions (hence you lose Magisk root) and the recovery partition (TWRP gone too) with the stock versions. So on reboot to system, you get an updated stock phone. You will have to go through the installation of TWRP/Magisk again if you want root again.

You can make the re-installation of TWRP and Magisk easier by:
(1) When you have TWRP, boot into it and change the setting to NOT reboot automatically after running a script (which is what the OTA will do). Also make sure that you have a copy of the TWRP image and the Magisk ZIP somewhere on your phone.
(2) After the OTA full ROM has been downloaded and has updated successfully, it will return to the TWRP interface. At this point, install the TWRP image to the recovery partition, install the Magisk ZIP, then wipe the caches before rebooting the phone.
Thank you so much for your complete and exhaustive answer!
 

sgheillups

Member
Apr 11, 2015
22
1
0
My experience rooting Mi 8 Lite

I bring to you my experience trying to root Mi 8 Lite:
I followed the guide but when booting into TWRP it was asking me the password, I clicked Cancel and then tried to install TWRP but I wasn't able to access the folder where I downloaded the Magisk.zip (I also tried mounting etc., but sdcard and many other folders were empty). Then I went to "Advanced" in TWRP menu and then "Install Root" but when rebooting there wasn't Magisk App. So I downloaded Magisk Manager apk from website and through the app I reinstalled latest Magisk version, then reboot and now everything works fine.
Mi 8 Lite with MIUI Global 11.0.8, Android 9 Pie.
 
Last edited:

Blackcatt11

Member
Apr 21, 2019
9
5
0
I bring to you my experience trying to root Mi 8 Lite:
I followed the guide but when booting into TWRP it was asking me the password, I clicked Cancel and then tried to install TWRP but I wasn't able to access the folder where I downloaded the Magisk.zip (I also tried mounting etc., but sdcard and many other folders were empty). Then I went to "Advanced" in TWRP menu and then "Install Root" but when rebooting there wasn't Magisk App. So I downloaded Magisk Manager apk from website and through the app I reinstalled latest Magisk version, then reboot and now everything works fine.
Mi 8 Lite with MIUI Global 11.0.8, Android 9 Pie.
If you still have problems with decryption in twrp, I recommend this (RECOVERY][UNOFFICIAL][PitchBlack-Recovery][Decrypted_Data] v2.9.0 base twrp v3.3.1) work to me very well in Mi 8 Lite with MIUI Global 11.0.8, Android 9 Pie.

Now I have the Miui 11.0.1.0 QDTMIXM Android 10 rom installed and the previous twrp (PichtBlack) asks me for the password, now I have this TWRP installed: TWRP-3.3.2B-0304-MI8LITE-CN-wzsx150-Android 10 (Decrypted_Data) and it works very well for me.
 

sgheillups

Member
Apr 11, 2015
22
1
0
If you still have problems with decryption in twrp, I recommend this (RECOVERY][UNOFFICIAL][PitchBlack-Recovery][Decrypted_Data] v2.9.0 base twrp v3.3.1) work to me very well in Mi 8 Lite with MIUI Global 11.0.8, Android 9 Pie.

Now I have the Miui 11.0.1.0 QDTMIXM Android 10 rom installed and the previous twrp (PichtBlack) asks me for the password, now I have this TWRP installed: TWRP-3.3.2B-0304-MI8LITE-CN-wzsx150-Android 10 (Decrypted_Data) and it works very well for me.
I am now trying PixelExperience with TWRP 3.3.0-0517 and everything is fine. Probably I was using the wrong version of TWRP with MIUI 11.0.1, but now I'm okay. Thanks for suggestions anyway ;)
 

pedroslr

New member
Jan 20, 2016
2
0
0
If you still have problems with decryption in twrp, I recommend this (RECOVERY][UNOFFICIAL][PitchBlack-Recovery][Decrypted_Data] v2.9.0 base twrp v3.3.1) work to me very well in Mi 8 Lite with MIUI Global 11.0.8, Android 9 Pie.

Now I have the Miui 11.0.1.0 QDTMIXM Android 10 rom installed and the previous twrp (PichtBlack) asks me for the password, now I have this TWRP installed: TWRP-3.3.2B-0304-MI8LITE-CN-wzsx150-Android 10 (Decrypted_Data) and it works very well for me.
I'm with the same rom and twrp, and magisk is installed too. But when I try to put any app on system/app with lucky patcher the cellphone reboot and stay stuck on twrp screen and to turn on I have to wipe and reinstall the rom. Can you help me?

idk if my english is right, but I hope u understand what I'm trying to say.
 

elbatsi

New member
Jun 16, 2020
3
0
0
So basically i did all of those... followed all the steps but everytime i flash the twrp then reboot to recovery manually with power button and vol up it doesnt seem to work but when i do itthrough adb it works. the only problem here is that the twrp cannot read my internal storage. seems like adb just boots the img and does not flash it (when i flash it it seems to be succesful). the thing that kinda scares me is that when i reboot to system its lagging so bad (only the apps like system, camera etc.). Also the boot animation changed (idk if this is normal, thats my first xiaomi device). If anyone had a similar problem and knows how to solve it please reply.