[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

malek_anas_97

Senior Member
Nov 24, 2013
113
76
0
Disclaimer :
YOU are choosing to make these modifications
and YOU are the only one responsible for any damages done to your device


==== Notes/Prerequisets/Links ====
* 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 went wrong.
* download the unoffical TWRP port from Here (get the latest version)
* get the latest magisk from Here
* install device usb drivers
* set up fastboot properly Method A, Method B (using chocolaty)
- - - - - - - - - - - -
instructions :
1- shutdown your device completely.
2- enter fastboot mode by pressing and holding the Vol Down + Power Button button until you see xiaomi's mi bunny with a blue "fastboot" text underneath it.
3- connect your device to your pc via usb cable.
4- on your pc check if you have fastboot configured properly and your device recognized by typing:
Code:
fastboot devices
if it's detected then you're good to proceed to the next step.
5- flash the twrp recovery image by using the usual fastboot commands.
Code:
fastboot flash recovery recovery.img
in our case it should look something like:
Code:
fastboot flash recovery recovery-TWRP-3.3.0-0517-XIAOMI8LITE-CN-wzsx150.img
6- unplug usb cable and hold the Vol up + Power Button (don't let go of the buttons untill the devices vibrates) and let it boot to the twrp recovery you just installed.
7- if you rebooted successfully, you should be at TWRP splash screen, if greeted with a slider slide it and continue.
8- in the main menu of TWRP, go to "Install" choose the magisk zip file you downloaded and flash it, when done reboot the device.
9- congratulations friend, you're now rooted and have TWRP as your recovery :D Happy Flashing :highfive:
- - - - - - - - - - - -
Optional : install Orange Fox Recovery from Here (Supports Encryption and MIUI OTA updates).
- - - - - - - - - - - -
2020-02-25 Last upated and working on MIUI Global Stable 11.0.8 Pie
 

Attachments

Last edited:

antonioli84

Senior Member
Jan 1, 2018
122
38
28
Is it possible to just accesss the TWRP to edit build.prop enabling camera2 Api?

If I remember is something about:
fastboot boot twrp.img

and then:
setprop persist.camera.HAL3.enabled 1

Without the need of root the device.

Thanks for the guide!
 
  • Like
Reactions: malek_anas_97

malek_anas_97

Senior Member
Nov 24, 2013
113
76
0
Is it possible to just accesss the TWRP to edit build.prop enabling camera2 Api?

If I remember is something about:
fastboot boot twrp.img

and then:
setprop persist.camera.HAL3.enabled 1

Without the need of root the device.

Thanks for the guide!
Sorry for the late reply
No problem
+
I'm not really sure if you could do it with TWRP's built in file manager without root
You could try

I've seen people do it with adb but haven't had the chance to try it yet
take a look here : https://www.google.iq/amp/s/amp.red...gswg/camera2_api_without_root/#ampf=undefined

And here (this has some very useful info)
https://www.google.iq/amp/s/forum.x...o/guide-enable-camera2-api-root-t3690366/amp/
 
Last edited:

antonioli84

Senior Member
Jan 1, 2018
122
38
28
Sorry for the late reply
No problem
+
I'm not really sure if you could do it with TWRP's built in file manager without root
You could try

I've seen people do it with adb but haven't had the chance to try it yet
take a look here : https://www.google.iq/amp/s/amp.red...gswg/camera2_api_without_root/#ampf=undefined

And here (this has some very useful info)
https://www.google.iq/amp/s/forum.x...o/guide-enable-camera2-api-root-t3690366/amp/
Thank you for the reply. I've done it in Mi A1 but I don't know if it's the same procedure because of the MIUI. One of the links says that we have to change something in kernel to do it.

It would be good expert people try it to see what method works. It's sad that the Mi 8 Lite doesn't have a proper forum until now.
 
  • Like
Reactions: malek_anas_97

malek_anas_97

Senior Member
Nov 24, 2013
113
76
0
Thank you for the reply. I've done it in Mi A1 but I don't know if it's the same procedure because of the MIUI. One of the links says that we have to change something in kernel to do it.

It would be good expert people try it to see what method works. It's sad that the Mi 8 Lite doesn't have a proper forum until now.
i enabled it in stock miui by adding "persist.camera.HAL3.enabled=1" to my build prop and then rebooting
 

antonioli84

Senior Member
Jan 1, 2018
122
38
28

chan200606

Senior Member
Feb 2, 2008
170
43
48
Brisbane
7- if you rebooted successfully, you should be at TWRP splash screen
you will be greeted with a slider slide it and continue
Hi Malek,

When you first boot to TWRP, were you asked for the decryption password? If yes, did you just format data to skip this? I was asked for the password and my screen PIN did not work. Just wondering if there is no other choice that to format data.
 

malek_anas_97

Senior Member
Nov 24, 2013
113
76
0
Hi Malek,

When you first boot to TWRP, were you asked for the decryption password? If yes, did you just format data to skip this? I was asked for the password and my screen PIN did not work. Just wondering if there is no other choice that to format data.
to this point i don't really understand how encryption works on this device
it's on by default i guess
so what i finally did the other day to be kinda sure of what's happening
i flashed stock rom in Mi Flash with the clean all option checked
i set up the phone for the first time without setting any fingerprint or security or anything
after that i flashed twrp
from twrp i flashed dm verity and encryption disable
get it from here https://forum.xda-developers.com/android/software/universal-dm-verity-forceencrypt-t3817389
(make aure to read the first post)
then formatted data
after that the booted up and i set it up normally
and then booted to twrp again to flash latest magisk

now when i check if my device is encrypted using this adb command "adb shell getprop ro.crypto.state"
i get "unencrypted"
so i guess it works? i don't know lol
 

chan200606

Senior Member
Feb 2, 2008
170
43
48
Brisbane
i flashed stock rom in Mi Flash with the clean all option checked
i set up the phone for the first time without setting any fingerprint or security or anything
after that i flashed twrp
from twrp i flashed dm verity and encryption disable
It looks like your phone was not encrypted (or was encrypted with MIUI's default password) when you flashed TWRP, as you had clean flashed stock then set up without setting security. That you could start TWRP to flash "dm versity and encryption disable", without being asked to input a password first, shows that TWRP was able to handle the default encryption (or no encryption) of the clean MIUI install.

In my case I already have a screen PIN set up on my phone before trying to install TWRP, and this version of TWRP can't handle it. Another difference is that I have not actually flashed TWRP onto the phone but have merely booted to TWRP via fastboot. I wouldn't have thought that this would affect TWRP's ability to decrypt the DATA partition though.

In hindsight I should have just done the minimum setup after the phone was wiped by the bootloader unlocking process before installing TWRP. I guess that unless there is another version of TWRP out that can handle the screen PIN encryption, my only option is to wipe clean the phone so that I can repeat what you did. However, now that I have reinstalled everything on the phone, I am a bit reluctant to do this just to get root. I think I will wait until there is an AOSP ROM available and do the wipe/format at the time of switching. Hopefully I don't have to wait too long!
 
  • Like
Reactions: malek_anas_97

chan200606

Senior Member
Feb 2, 2008
170
43
48
Brisbane
In my case I already have a screen PIN set up on my phone before trying to install TWRP, and this version of TWRP can't handle it. Another difference is that I have not actually flashed TWRP onto the phone but have merely booted to TWRP via fastboot. I wouldn't have thought that this would affect TWRP's ability to decrypt the DATA partition though.
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.
 

vonclutch

Member
Jan 15, 2011
29
4
0
Everything is ok for global rom.

For the language twrp asked directly at first launch for it and you don't need anymore magisk, you can install it directly from twrp. ( advance/install root ) it'll install the version 17.1 and you can update it from the app on the phone.

No problem for reboot into twrp ( volume up + power) even with fingerprint.
 

malek_anas_97

Senior Member
Nov 24, 2013
113
76
0
i cant unlock my mi 8 lite, say user portrait scores too low or black, i activate all need, oem, usb, sync device. no work, any help?
i really have no idea why this is happening to you :(
i searched online and it seems like you're not the only one having this
 

malek_anas_97

Senior Member
Nov 24, 2013
113
76
0
Everything is ok for global rom.

For the language twrp asked directly at first launch for it and you don't need anymore magisk, you can install it directly from twrp. ( advance/install root ) it'll install the version 17.1 and you can update it from the app on the phone.

No problem for reboot into twrp ( volume up + power) even with fingerprint.
yeah i know there's no problem in turning the phone off then rebooting manually with the buttons
but i was talking about using "fastboot reboot recovery" command to reboot to recovery from fastboot directly
anyways glad everything worked for you friend : )