Once you logged in, you should be
able to download Unlock bootloader and MI Unlock without any further
steps (this was the case when I was performing the procedure).
If you aren’t able to download
the tools right away, apply and wait for confirmation.
Install Xiaomi USB Drivers (from
the link provided above). You can also install it by MI Unlock app
Launch MI Unlock app and turn off
your phone manually.
Now press and hold Volume down
button and Power button. Your device should enter into Fastboot
Connect your Xiaomi device to your
PC using a USB cable and click on Unlock.
Boot into TWRP
Launch Minimal ADB Fastboot
terminal as Administrator on your PC.
Turn off your Xiaomi device.
Connect the phone to your PC.
Press and hold Power and Volume
down buttons until Fastboot screen shows up.
Type the following command in your
Minimal ADB Fastboot terminal: fastboot devices Now your phone
should show up. (something like this “9e00a7e3 fastboot”)
Type the following
command: fastboot boot <path to your TWRP .img recovery
file> Your phone should boot up into TWRP recovery.
If it requires a password, click
If it is
asking for keeping/system read only, swipe to allow the
Type the following command: adb
Now you have access
to Super User shell via ADB.
While in TWRP, go to Advanced and
tap on File Manager.
Now go to “dev/block/platform/”
then open the “soc” folder if it is there.
Here you can see folders and
files. You will need to open the folders and search for the one
called “by-name.” (it should be in one of the folders) In my
case it was located in /dev/block/platform/soc/1d94000.ufshc.
Now we need the name of the folder
that contains “by-name” example:
soc – you should
also have this folder if present. FOLDER NAME – the folder which
“by-name” is located in.
Into the terminal type the
following command (replace soc and FOLDER NAME respectively): ls
-al /dev/block/platform/soc/FOLDER NAME/by-name
Now you will see the partitions of
your phone. You will need to locate your boot
partition. example: lpwxrwxrwx 1 root root
25 Feb 15 1970 boot -> /dev/block/sde45
Pulling your Stock Boot.img
Launch ADB Shell terminal and type
the following command (replace sde45 with your partition – see the
Now type: exit
Then type the following: adb
Your stock boot.img
should be downloaded into your Minimal ADB Fastboot folder.
Type: adb reboot
And you are done.
To install OTA Updates you will need to
do one of the following methods.
Uninstall Magisk using Magisk Manager.
Install the OTA update.
Pull boot.img and patch it again
Now flash the newly patched
boot.img or try with the last one you had before the OTA update.
Keep in mind that with this tutorial we
are not flashing TWRP. We are just booting the device into TWRP
without flashing it. That way we are accessing to Super User via ADB.