• XDA Forums have been migrated to XenForo. We are aware of several issues including missing threads, logins not working, and more. To discuss, use this thread.
  • If you are experiencing issues logging in, we migrated and software and made it more secure. We recommend trying to reset your password.

[GUIDE] Root using Magisk, keep stock recovery for OTA

Dr. Hurt

New member
Jan 31, 2012
812
455
0
Cairo
This is a guide for people who want a rooted MIUI. It will keep stock recovery and system partitions untouched to allow MIUI OTAs to install without problems. It will also pass Google's safety net test so bank apps keep working. The best of both worlds really :)

Requirements:
- Unlocked bootloader
- Windows PC
- fastboot (present in the miunlock app folder)
- Latest TWRP (download here)
- Latest Magisk (download here)

Steps:
- Install latest Magisk app
- Put latest Magisk zip on your device storage (SD)
- Shut down device
- put latest twrp.img in miunlock folder
- Connect phone to PC
- Press volume down and power button to boot to fastboot mode
- Open "Command Prompt" on your PC
- Type: (without quotes)
----- "cd C:\Users\[your name]\Desktop\miflash_unlock-en-2.3.803.10" . (or wherever the folder is)
----- "fastboot devices"
----- "fastboot boot twrp.img"
- In a few seconds, TWRP will boot on your phone. DO NOT swipe to make changes to system.
- In TWRP, flash the Magisk zip

Enjoy root :cowboy:

Disclaimer: I will not be help responsible for any damage or loss caused by following those steps.
 

Dr. Hurt

New member
Jan 31, 2012
812
455
0
Cairo
This guide DOES NOT flash TWRP. Stock recovery remains so OTA updates work.

The only thing that is touched by this guide is the "Boot" partition to install magisk. You can restore stock "Boot" using magisk manager's uninstall option at any moment and be 100% stock again.
 
Last edited:

MayankMathur

New member
Feb 24, 2015
192
52
0
Jaipur
Just a quick question. I've TWRP right now with SuperSU. So I'll remove SuperSU, flash Magisk in TWRP. All good till now, but I'd want the stock recovery, a flash-able zip maybe. How can I get it? From where?

**[EDIT]**
Okay. One can get it from fastboot ROMs available at MIUI website (here), extract the pack and get recovery.img.
 
Last edited:
  • Like
Reactions: edwardenglish

Giacomo_ITA

New member
Sep 14, 2016
40
3
0
I have two questions:
1. Why does the bootloader need to be unlocked and how can I do that?
2. What happens to Magisk if I install an OTA?

I'd like to keep the phone untouched but I need to change emojis and with Xposed I can use Youtube in background.
 
  • Like
Reactions: jime1

Baxeisindi

New member
Feb 12, 2018
2
1
0
I have two questions:
1. Why does the bootloader need to be unlocked and how can I do that?
2. What happens to Magisk if I install an OTA?
1. sign on en.miui com and you can use xiaomi unlocker (after 72 hours)
2. two OTA updates and I had to reroot it :(
but it seems that it is not necessary, I can not post the link :(
google --> github magisk tips (it should be the first result)
 
  • Like
Reactions: jime1

Giacomo_ITA

New member
Sep 14, 2016
40
3
0
1. sign on en.miui com and you can use xiaomi unlocker (after 72 hours)
2. two OTA updates and I had to reroot it :(
but it seems that it is not necessary, I can not post the link :(
google --> github magisk tips (it should be the first result)
Do you mean this?

When an OTA is available, please go to Magisk Manager → Uninstall → Restore Images. Do not reboot immediately or you will have Magisk uninstalled. This will restore your boot (or dtbo if available) back to 100% untouched stock images in order to pass verifications. This step is required before doing any of the following steps written below!
 
  • Like
Reactions: jime1
Our Apps
Get our official app! (coming soon)
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone