How To Guide Rooting the Mi 11 with the latest Xiaomi.eu ROM

Search This thread

Lucavon

Member
Jan 28, 2018
34
36
Hannover
lcvn.eu
EDIT: This is not for the TWRP version. I will update this thread soon!

Hello!

Since I saw a lot of people asking, I decided to post how to root a Mi 11 (as of 2021-02-11).

  1. Install the Xiaomi.eu ROM. You can find more details in this post. Keep the ROM's files, you will need some of them!
  2. Connect your phone to the PC and put it into file transfer mode.
  3. Download Magisk Manager from the official GitHub repository and install the APK. DO NOT DOWNLOAD MAGISK MANAGER FROM ANYWHERE ELSE. THIS GITHUB REPOSITORY IS THE ONLY OFFICIAL, TRUSTED SOURCE.
  4. In the directory you extracted the ROM zip file to, there's a directory called images. This directory contains a file called boot.img. Copy the boot.img to your phone's Download folder.
  5. Open the Settings app, go to My Device, then tap MIUI Version until it says You are now a developer.
  6. Go back to your Settings app and use the search bar to search for USB Debugging and enable it. Click on Yes when it asks whether you want to trust this computer.
  7. Once the file is completely copied, open Magisk Manager on your phone. There will be 2 categories: Magisk and Manager. On the Magisk category, click on Install and choose Select and Patch a File. Navigate to your downloads and select boot.img. Click on Let's go.
  8. When Magisk has finished patching your boot.img file, it will say Output file written to /storage/emulated/0/Download/magisk_patched_XXXXX.img, where XXXXX is 5 random letters/digits.
  9. Open a command prompt on your computer and run adb pull /sdcard/Download/magisk_patched_XXXXX.img , replacing XXXXX with the random characters Magisk showed you earlier. This will copy the file to the directory you are currently in; on Windows, if you are using cmd, this will be C:\Users\[your username].
  10. Reboot your phone into fastboot mode by turning it off, then holding the power and volume-down buttons until it vibrates.
  11. Run the commands fastboot flash boot_a magisk_patched_XXXXX.img and fastboot flash boot_b magisk_patched_XXXXX.img (notice the difference: boot_a and boot_b). Don't forget to replace XXXXX with the random characters Magisk Manager generated. Run the command fastboot reboot and open the Magisk Manager app when your phone has finished rebooting. The app should say that it needs to install some other components; click yes and let it do its thing. It will reboot the phone, and after that, Magisk and therefore the root should be working!

When I first did this, my SafetyNet check failed. I fixed this by repeating all the steps, except that I updated the ROM instead of reinstalling it. You can update it even if it's the same version; it will just flash everything again. You may need to clear the cache of Google Play and reinstall Google Pay if the SafetyNet check initially failed.
 
Last edited:

PandaKiller

Senior Member
Sep 21, 2008
466
86
Lisboa / Leiria
Hi, I tryed fastboot oem unlock after alow it in developer settings but it says token verification failed.
It is my first Xiaomi, afert came from a OnePlus 5.
How can I manage to flash the boot image?
 

Lucavon

Member
Jan 28, 2018
34
36
Hannover
lcvn.eu
Hi, I tryed fastboot oem unlock after alow it in developer settings but it says token verification failed.
It is my first Xiaomi, afert came from a OnePlus 5.
How can I manage to flash the boot image?
You do not need to use the OEM Unlock option in the developer options. Mine is still off even after I unlocked my bootloader. You need to use the Xiaomi Unlock Tool found at https://en.miui.com/unlock/ .
Before using this tool, you need to log in to you Mi account on your phone. Then, reboot the phone into fastboot mode, connect it to your PC, and use the unlock tool. It will tell you to wait 168 hours (1 week) before trying again. DO NOT RETRY BEFORE THE 168 HOURS ARE OVER OR THE TIMER RESETS! Even if you are a single minute early, it will reset the timer.
Once the week has passed, do this again and your phone will be unlocked. Warning: This will erase your data.

You should prepare the boot image BEFORE unlocking, because otherwise you will have to go through the phone's setup, install Magisk, patch the image, and wipe the phone again.


Another warning: Do not re-lock your bootloader. If the bootloader is re-locked with any ROM other than the one the phone shipped with installed, the phone gets bricked.
 

PandaKiller

Senior Member
Sep 21, 2008
466
86
Lisboa / Leiria
Thank you for the explanation.
I did everything as you said, now just need to wait for the painfully 168 hours...

Is there already a .zip to flash in order to disable encryption? Just to not risk losing my data in future updates.
 

Lucavon

Member
Jan 28, 2018
34
36
Hannover
lcvn.eu
Thank you for the explanation.
I did everything as you said, now just need to wait for the painfully 168 hours...

Is there already a .zip to flash in order to disable encryption? Just to not risk losing my data in future updates.
If you use the Xiaomi.EU ROM, you can update without wiping your data. They give you 2 scripts - 1 for installing and 1 for updating.
 
  • Like
Reactions: PandaKiller

Giova19

Member
May 12, 2018
21
1
Hi Lucavon,
Thx for the guide. I did it twice and after reboot and launch Magisk Manager I got no message asking that other components need to be installed. Did I miss something?
 

Lucavon

Member
Jan 28, 2018
34
36
Hannover
lcvn.eu
  • Like
Reactions: xXSkylinexX

Plathoon

Senior Member
SOLVED

- enable magiskhide
- download "magiskhide props config"
- use app like termux and follow steps :
* "su"
* "props"
* "1" (edit device fingerprint)
* "f" (pick a certified fingerprint)
* select your phone
* accept and reboot.

and now it work.
 
Last edited:

bert4711

New member
Aug 12, 2013
3
2
Hello,
I followed all the steps in the root guide. I also have root access. However, I do not have write access to the root directory. What I have done wrong? I have no more idea what it could be. Can someone help me?

Note: I installed the Rom Version xiaomi.eu_multi_MI11_21.3.31_v12-11-fastboot
After installing the Rom, the following error message appeared at the end.
fastboot: error: Cannot generate image for userdata
Can it have anything to do with it?
 

Attachments

  • Log.txt
    1.5 KB · Views: 358
Last edited:
  • Like
Reactions: Personal Sandwich

Personal Sandwich

Senior Member
Feb 4, 2013
55
14
I followed all the steps in the root guide. I also have root access. However, I do not have write access to the root directory. What I have done wrong? I have no more idea what it could be. Can someone help me?
Idk if I was having and same issues, but for me on 3.31 xiaomi.eu I was having issues with the superuser prompt not appearing. I found it happened only when the magisk app was repackaged. Approving prompts while it was unhidden then hiding magisk worked great.
 

bert4711

New member
Aug 12, 2013
3
2
I use the root explorer, the root query also appears with Magisk. But I still don't get write access to the root directory. I originally had the Global Rom V12.0.4.0.RKBMIXM on it. After the bootloader was open, I flashed the Rom Version xiaomi.eu_multi_MI11_21.3.31_v12-11-fastboot. The following error message occurred at the end of the flash process. fastboot: error: Cannot generate image for userdata I am currently assuming that the problem with root has something to do with it. I have already tried the Version xiaomi.eu_multi_MI11_V12.5.1.0.RKBCNXM_v12-11-fastboot. The result is the same... fastboot: error: Cannot generate image for userdata and no write permissions in the root directory ...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    EDIT: This is not for the TWRP version. I will update this thread soon!

    Hello!

    Since I saw a lot of people asking, I decided to post how to root a Mi 11 (as of 2021-02-11).

    1. Install the Xiaomi.eu ROM. You can find more details in this post. Keep the ROM's files, you will need some of them!
    2. Connect your phone to the PC and put it into file transfer mode.
    3. Download Magisk Manager from the official GitHub repository and install the APK. DO NOT DOWNLOAD MAGISK MANAGER FROM ANYWHERE ELSE. THIS GITHUB REPOSITORY IS THE ONLY OFFICIAL, TRUSTED SOURCE.
    4. In the directory you extracted the ROM zip file to, there's a directory called images. This directory contains a file called boot.img. Copy the boot.img to your phone's Download folder.
    5. Open the Settings app, go to My Device, then tap MIUI Version until it says You are now a developer.
    6. Go back to your Settings app and use the search bar to search for USB Debugging and enable it. Click on Yes when it asks whether you want to trust this computer.
    7. Once the file is completely copied, open Magisk Manager on your phone. There will be 2 categories: Magisk and Manager. On the Magisk category, click on Install and choose Select and Patch a File. Navigate to your downloads and select boot.img. Click on Let's go.
    8. When Magisk has finished patching your boot.img file, it will say Output file written to /storage/emulated/0/Download/magisk_patched_XXXXX.img, where XXXXX is 5 random letters/digits.
    9. Open a command prompt on your computer and run adb pull /sdcard/Download/magisk_patched_XXXXX.img , replacing XXXXX with the random characters Magisk showed you earlier. This will copy the file to the directory you are currently in; on Windows, if you are using cmd, this will be C:\Users\[your username].
    10. Reboot your phone into fastboot mode by turning it off, then holding the power and volume-down buttons until it vibrates.
    11. Run the commands fastboot flash boot_a magisk_patched_XXXXX.img and fastboot flash boot_b magisk_patched_XXXXX.img (notice the difference: boot_a and boot_b). Don't forget to replace XXXXX with the random characters Magisk Manager generated. Run the command fastboot reboot and open the Magisk Manager app when your phone has finished rebooting. The app should say that it needs to install some other components; click yes and let it do its thing. It will reboot the phone, and after that, Magisk and therefore the root should be working!

    When I first did this, my SafetyNet check failed. I fixed this by repeating all the steps, except that I updated the ROM instead of reinstalling it. You can update it even if it's the same version; it will just flash everything again. You may need to clear the cache of Google Play and reinstall Google Pay if the SafetyNet check initially failed.
    3
    Hi, I tryed fastboot oem unlock after alow it in developer settings but it says token verification failed.
    It is my first Xiaomi, afert came from a OnePlus 5.
    How can I manage to flash the boot image?
    You do not need to use the OEM Unlock option in the developer options. Mine is still off even after I unlocked my bootloader. You need to use the Xiaomi Unlock Tool found at https://en.miui.com/unlock/ .
    Before using this tool, you need to log in to you Mi account on your phone. Then, reboot the phone into fastboot mode, connect it to your PC, and use the unlock tool. It will tell you to wait 168 hours (1 week) before trying again. DO NOT RETRY BEFORE THE 168 HOURS ARE OVER OR THE TIMER RESETS! Even if you are a single minute early, it will reset the timer.
    Once the week has passed, do this again and your phone will be unlocked. Warning: This will erase your data.

    You should prepare the boot image BEFORE unlocking, because otherwise you will have to go through the phone's setup, install Magisk, patch the image, and wipe the phone again.


    Another warning: Do not re-lock your bootloader. If the bootloader is re-locked with any ROM other than the one the phone shipped with installed, the phone gets bricked.
    3
    Hello guys,

    i'm coming from the Oneplus Nord and its rooted with Magisk.
    How it does work with Xiaomi MI11? Can i use the original ROM (which is delivered) and flash magisk in the recovery mode and my phone is rooted?
    Next question, can i OTA Update -> Magisk flash into other boot_a/b and reboot? and its still rooted?

    After all this time, i answer for us by myself lol, it work fine like OnePlus method (keep Root after a local update/On the Fly /OTA), i have succesfull update EEA 12.5.2 Rooted/Unlocked to EEA 12.5.3 :

    1/ Download the Local Update : here
    Be sure to update from the same branch, EEA/EEE to EEA/EEE, Global to Global, CN to CN, if update is not the same branch upgrade will be not granted.

    2/ Put the Local update *.zip in a folder on the root storage folder, i create "downloaded_rom" folder

    3/ Now, Settings > About Phone > Open 12 Logo MIUI Version / Updater > Click 3/5 time on the MIUI 12 logo, you will see message "Additional update features are on" > click three ticks on the right corner > you have now access to a local upgrade option "Choose update package" > choose the Rom *.zip update path (so for my "downloaded_rom" and click update. If Archive is good (CRC) and same branch, MIUI will asked if you want upgrade, click YES

    4/ After some minutes installing, come the finalizing state and just after MIUI purpose reboot system, DON'T REBOOT, WE WILL UPDATE BOOT.IMG ROOTED NOW

    5/ Open Magisk > Install > Install to inactive Slot (After OTA) > Let's Go (Boot.img will be patched) > Success

    6/ You can reboot, after unlock PIN / etc, waiting 30 secondes for upgrade / cache finish (when data carrier is back), go in Magisk, enjoy ! You have keep root and all your access/Modules :D
    2
    It is enough to flash magisk in TWRP. It is not needed to extract boot.img. Just flash magisk in TWRP, it is all. I am using on last xiaomi.eu weakly ROM.
    Flash archive under Recovery (by *.zip) is not supported by Magisk from the 23 build, especially for problem boot/trebble slot compatibility. It's possible to just rename *.apk to *.zip and flash under TWRP, but it's not recommanded by dev and it's highly recommanded to using Patched image method.

    Installation by Custom Recovery
    2
    Why don't write directly fastboot flash boot_ab magisk_patched_XXXXX.img ? Is that intended ?
    Hey, sorry, haven't been on this forum for a while.
    I have only ever separately flashed boot_a and boot_b and I'm anxious to try anything I haven't done before when it comes to flashing anything, so I decided to stick with what I know works.

    What is the best/safe way to update rooted phone with EU Weekly Rom?
    You can use the Xiaomi.eu ROM's update script. I recommend doing it on a laptop and not touching the cable at all while flashing. If the power goes out, the laptop can finish the flash while it's running on battery. If you touch the cable and the connection breaks at the wrong moment, your phone might not boot anymore.
    So, basically: use the official update script and take measures to prevent the flash from failing.

    Do we need to do those steps each time updated the miui?

    If you use the Xiaomi.eu ROM and want to update, then yes. You will probably need to do it after updating normally, too, but I haven't tried any normal updates.

    As for Magisk: in V22, the SafetyNet test broke and wrongly showed it as failing. In V23, it's all working just fine for me without MagiskHide.