Redmi K20 (Pro) Guide: Unlock Bootloader, Install TWRP Recovery, and Root using Magisk

Guide to Unlock Bootloader, Install TWRP Recovery, and Root Redmi K20/K20 Pro using Magisk

In this guide, you will learn how to unlock the bootloader, install TWRP recovery, and root Redmi K20 / Redmi K20 Pro using Magisk. This same guide is also applicable to the Xiaomi Mi 9T and Mi 9T Pro, which are global variants of the said phones.


If you’re thinking of tweaking the software on your Redmi K20 or K20 Pro to your needs and liking, then TWRP and Magisk root are two tools that you should have in your arsenal.

The former is a custom recovery that can be used to flash ZIP files, like those of custom ROMs, kernels, and mods. It could also be used to take NANDroid backups of the complete system (OS) that could come in really handy when switching ROMs. On the other hand, Magisk is a tool you could use not only to root your phone, but also to supervise root permissions, install modules to modify your phone’s software systemless-ly, and more.

Both the Redmi K20 and K20 Pro, as well as their global counterparts (Mi 9T and 9T Pro) have received a decent amount of attention from the Android custom development community over at XDA. Developer mauronofrio has been successful in compiling and providing unofficial and official builds of TWRP recovery for the Redmi K20 and K20 Pro. With that installed, you can easily flash the Magisk ZIP file to root your phone.

This guide will take you through the complete process in a step-by-step manner, from unlocking the phone’s bootloader, all the way to rooting it.

Guide to Unlock Bootloader, Install TWRP Recovery, and Root Redmi K20/K20 Pro using Magisk

Table of Contents


Ensure that you fulfill all the requirements stable below before you head over to the instructions.

  • It is extremely important to have a backup of your entire device. Unlocking the phone’s bootloader will erase all your data stored on the phone. This includes messages, contacts, photos, music, documents, and everything stored on the internal storage of the phone. So, take a complete backup beforehand to safeguard it. If you need help, you may also refer to our guide on how to create a full backup of your data on Android devices.
  • In order to avoid any sudden shutdowns, make sure to keep your device charged to at least 50% battery.
  • Download and install the latest version of the Xiaomi USB drivers on your PC.
  • You will be using ADB and Fastboot tools to flash files to your phone. So, download the latest Android SDK platform-tools package from here and install them on your PC using this guide.
  • When asked to launch the command-line window on your PC, do the following:
    • On Windows PC: Open the folder where the Android platform-tools are installed (e.g. C:\platform-tools). Then hold the SHIFT key of the keyboard and right-click on an empty space inside this folder. Select the ‘Open PowerShell window here’ option.
      Redmi K20/K20 Pro Guide - Launch PowerShell in Windows
    • On macOS/Linux PC: Open the ‘Terminal’ and change its directory to the folder where the Android platform-tools are installed. For example, if the tools are installed to /Documents/platform-tools, then enter the following command:
      cd Documents/platform-tools

      Redmi K20/K20 Pro Root Guide - Launch Terminal in macOS/Linux


Below, you will find the links to download all the files you’ll need while performing the instructions.

Both official and unofficial builds of TWRP recovery are available for the Redmi K20 devices, thanks to XDA Senior Member mauronofrio. According to the developer, the available builds are fully stable. All features including /data partition decryption, MTP, Nandroid backups, etc work too. The recovery supports both Android 10 and Android 9 Pie.

Note: It’s strongly recommended to use the unofficial version as they are more constantly updated and receive better support from the developer.


For your convenience and easy understanding, we have split this guide and its instructions into three major steps.

In brief, the first step is to unlock the bootloader of your Redmi K20/k20 Pro, which is a prerequisite to install TWRP, root, or perform any sort of modification to the software. Then the second step is to flash TWRP recovery on your phone through a fastboot command and then boot directly into it. This is followed by the third and final step, which is to flash the VBMeta Patcher and Magisk ZIP files to prevent bootloops and simultaneously root your Redmi K20/K20 Pro using Magisk.

Now without any ado, let us start with the instructions.

Step 1: Unlock the Bootloader

In order to unlock the bootloader of your phone, you must first enable OEM unlocking and properly bind your Mi account. So start off by going to ‘Settings’ → ‘About phone’ on your Redmi K20 and continuously tap on the ‘MIUI version’ until you see the ‘You’re now a developer!’ message on the screen.

Enable Developer Options on Redmi K20/K20 Pro

Then go to ‘Settings’ → ‘Additional settings’ → ‘Developer options’ and enable the ‘OEM unlocking’ toggle in there. Once you have enabled it, access the ‘Mi Unlock Status’ menu within ‘Developer options’ and bind your Mi account to the phone by following the on-screen instructions.

Enable OEM Unlocking and Bind Mi Account on Redmi K20/K20 Pro

Once the account is properly bound to your Redmi K20, you should see the ‘Added successfully. Mi account is associated with this device now.‘ message on the screen.


You’re now ready to unlock the bootloader. To do this, first power off your phone and boot it into Fastboot Mode by holding the Volume Down and Power keys together. Once in Fastboot Mode, connect the phone to your PC via a USB cable.

Boot Redmi K20/K20 Pro into Fastboot Mode and Connect it to PC

Now download the latest version of the Mi Unlock tool to your PC from this page. Once downloaded, extracted the ZIP file and run the ‘miflash_unlock.exe’ executable to launch the Mi Unlock Tool. When the tool’s GUI appears on your PC’s screen, log into it with your Mi account. The tool will perform the required verifications and then show the ‘Phone connected’ message.

Unlock Bootloader on Redmi K20/K20 Pro using Mi Unlock Tool

Click the ‘Unlock’ button in the tool’s window and select ‘Unlock anyway’ to finally unlock the bootloader on your Redmi K20/K20 Pro. Once the process finishes, you should the ‘Unlocked successfully’ message and can now click on ‘Reboot phone’.

Redmi K20/K20 Pro Bootloader Unlock Successful

Step 2: Install TWRP Recovery

With the bootloader unlocked, you can now install TWRP recovery on your Redmi K20. To begin, download the IMG file of the latest TWRP recovery from the ‘Downloads’ section to your PC.

Next, move the downloaded TWRP IMG file to the folder where the Android SDK platform-tools are installed (e.g. C:\platform-tools on Windows, or Documents/platform-tools on macOS/Linux). Then launch the command-line window on your PC (Refer to pointer #5 in ‘Prerequisites’).

Move TWRP IMG file to 'Platform-tools' folder on the PC

Note: All the commands below are to be preceded with “.\” (dot and backward slash) when using PowerShell on a Windows PC, or with “./” (dot and a forward slash) when using Terminal on a macOS/Linux PC.

With everything now ready on your computer, boot your Redmi K20 device into Fastboot Mode using the Volume Down and Power button combination while the phone is powered off. Once in Fastboot Mode, connect the phone to the PC via a USB cable.

Now, enter the following command in the PowerShell/Terminal window to ensure that your PC can identify the phone over fastboot:

fastboot devices

This command should return a unique device ID along with the ‘fastboot’ message. In case it doesn’t, then it means that the proper USB drivers for your phone are missing. To fix this, simply download the latest drivers from here, install them, and reboot your PC.

Finally, enter the following command to flash/install TWRP recovery on your phone:

fastboot flash recovery twrp-filename.img

Here, ‘twrp-filename.img’ should be replaced with the actual filename of the TWRP IMG you have downloaded for your phone. For example, if you have downloaded the latest recovery for the Redmi K20 Pro, the command should look like the following:

fastboot flash recovery twrp-3.3.1-32-raphael-raphaelin-mauronofrio.img

Flash TWRP Recovery on Redmi K20 Pro via Fastboot Command

Important Information!

Once you have flashed TWRP, it is extremely important that you boot your phone directly into TWRP recovery mode. If the phone tries to enter the system (OS), TWRP will automatically be replaced by the MIUI stock recovery and you’d need to re-flash it.

To force-reboot into TWRP mode, hold the Power button to exit Fastboot Mode. As soon your phone’s screen turns off, quickly press and hold the Volume Up and Power buttons together. Upon doing this, your Redmi K20 should now be in the TWRP recovery mode.

Step 3: Flash VBMETA Patcher and Magisk ZIP to Root Redmi K20/K20 Pro

With TWRP now properly installed, you can now flash Magisk to root your phone. However, before you do this, you must first patch the VBMeta of your phone. VBMeta is basically responsible for verifying the integrity of the boot, system, and other partitions of your phone. The stock vbmeta on your Redmi K20 wouldn’t allow the phone to boot after flashing Magisk.

To do this, you just have to flash the provided VBMeta Patcher via TWRP recovery. Once patched, you can continue to flash the Magisk ZIP file to finally root your Redmi K20/K20 Pro. To do all this, follow the instructions listed below:

  1. Go to the ‘Mount’ menu in TWRP and press the ‘Enable MTP’ button.
    Enable MTP in Redmi K20 Pro TWRP Recovery
  2. Connect your phone to the PC via a USB cable.
  3. Download the VBMeta Patcher and Magisk ZIP files on your PC.
  4. Transfer all the three downloaded ZIP files to the internal storage of your phone.
  5. Once transferred, disconnect your phone from the PC and go back to the TWRP main menu.
  6. Press the ‘Install’ button in TWRP and navigate to the location where the files were transferred earlier.
    Flash VBMeta Patcher ZIP via TWRP on Redmi K20/K20 Pro
  7. Select the VBMeta Patcher file ( first and then tap on the ‘Add more Zips’ button.
  8. Next, select the Magisk ZIP file ( to add it to the flashing queue. At this point, you have all the files added to TWRP’s flashing queue.
    Flash Magisk ZIP via TWRP to root Redmi K20/K20 Pro
  9. Finally, swipe the button at the bottom of the screen to flash all the files and finally root your Redmi K20/Redmi K20 Pro.

Once the flashing process finishes press the ‘Reboot System’ button.

Your phone will now boot into the system (OS) and should be rooted with Magisk. To verify this, you can launch the Magisk Manager application and it should show that Magisk is installed on your phone.

You can now go ahead and start using root apps or use Magisk Hide to hide root from other apps that might stop working if root is detected. You can also install Magisk Modules to make modifications to your phone’s software systemless-ly, or install audio mods like ViPER4Android for boosting the sound quality.

You can also use TWRP recovery to flash custom ROMs should you like. There are plenty of these available for the Redmi K20 devices on the XDA forums.

Also Read: Download Google Camera Port for Redmi K20 (Pro) and Xiaomi Mi 9T (Pro)

So there you go! You have just learned how to root the Redmi K20 (Mi 9T) and Redmi K20 Pro (Mi 9T Pro) using Magisk and install TWRP recovery on it. If you have any questions regarding the process or the instructions in this post, then feel free to ask us.

TWRP Source: XDA (1 & 2)


  1. Hi I have a Mi 9T pro with MIUI stable rom
    I followed your steps and went to leave the downloaded files in the C: / folder of windows, then I started my phone directly in the powershell window and gave the command to flash twrp 3.3.1-25.
    Then write in the fastboot boot command and paste the recovery here, everything will restart my phone, but I will not load the twrp recovery.
    I am trying this since I came from flashing twrp official, but I cannot install magisk because it gives me ERROR 1.
    What problem do you think it is giving me, because the bootloader is unlocked and I enable developer permissions and USB debugging ???
    I would really appreciate your help

    1. Hi Jose. Thanks for giving a clear explanation of the whole situation.

      May I know what the PowerShell windows show when you enter the fastboot boot command? A screenshot would be nice.

    2. Sure
      I can’t paste the screenshot I don’t know why. I will copy all my lines written in powershell.

      PS C:\Users\chisp> adb devices
      * daemon not running; starting now at tcp:5037
      * daemon started successfully
      List of devices attached
      761856ec device

      PS C:\Users\chisp> adb reboot bootloader
      PS C:\Users\chisp> fastboot devices
      761856ec fastboot
      PS C:\Users\chisp> fastboot flash recovery C:\adb\twrp-3.3.1-25-raphael-mauronofrio.img
      Sending ‘recovery’ (2149 KB) OKAY [ 0.056s]
      Writing ‘recovery’ OKAY [ 0.016s]
      Finished. Total time: 0.095s
      PS C:\Users\chisp> fastboot boot C:\adb\twrp-3.3.1-25-raphael-mauronofrio.img
      Sending ‘boot.img’ (2149 KB) OKAY [ 0.055s]
      Booting FAILED (remote: ‘BootImage is Incomplete’)
      fastboot: error: Command failed
      PS C:\Users\chisp>

      This happens bro thanks for the support

    3. Hi again, Jose. Please try the more recent version of TWRP from this link and repeat the steps. See if the phone then boots into TWRP mode.

    4. Ready I already flashed twrp 3.3.1 official in my MI 9T PRO starts and everything, but I have already tried several times to flash MAGISK from version 20 and followed until 20.4, but after the restart, it does not want to start the system and it returns me to TWRP again, I don’t know what’s going on

    5. Hi again Jose. I think I found the solution. It was posted on the TWRP thread by the developer himself.

      Do this:
      1) Flash the latest TWRP from here: twrp-3.3.1-32-raphael-raphaelin-mauronofrio.img
      2) Boot into TWRP directly
      3) Download and
      4) Transfer the files to the phone’s internal storage or external storage. To do this, go to ‘Mount’ in TWRP and press the ‘Enable MTP’ button.
      3) Flash the AVB patcher file and then the Magisk file.

      Once both the files have been flashed, reboot your phone and see if it enters the system. Please do let me know how it goes.

    6. Please help I don’t know what to do, I would like to have Magisk to enable some modules in my Mi 9t pro and configuration apps or magisk modules

  2. I solved a problem when the magix installed your device to not work and go directly to the recovery bootloader
    1 /
    When you install the magisk root
    Go to the wipe data and wait for your phone is open and you see that no root in your phone

    2/go to the files and install the magisk root
    And you will se your rooted is done

  3. Hi,
    I have problem with my K20 Pro Premium Edition, I did everything in right order, but I stucked in twrp bootloop. It keeps tuning on over and over again. How to fix it? I have MIUI Global 11. 0. 1 and Android 10Q. I need Magisk, because my widevine is l3, so I can’t watch Netflix on my phone 🙁

    1. Hi Dawid. The instructions have been revised completely and should now work without causing any bootloops.

  4. I have tried twrp latest but when I have installed Magisk 20.1 always bootloop and return to twrp again I use mi 9t pro Miui 11.0.1 stable please help me

    1. Hi. Did you boot your phone straight into TWRP recovery after flashing it?

    2. Hi, I have the same problem. I follow the guide and directly booted my phone straight into TWRP recovery after flashing it, but it always bootloop and return to twrp again. What shall I do?

    3. That’s odd. Can you let me know which ROM you have got installed on your K20 Pro?

    4. Hi Yves. I have updated the post with a completely new set of instructions. These instructions also involve flashing the vbmeta patcher which should fix the bootloop you’ve been facing.

  5. Hello, I have the Redmi K20 Pro Exclusive Edition.
    Which are the steps for this version – how to root and install TWRP Recovery.
    Can I use this tutorial or do I need another one?

    1. Hi Yves. If the specs of the phone are the same as the regular K20 Pro (I am quite sure they are), then you can surely use this guide for rooting and installing TWRP.

  6. so i installed magisk on my phone but every time i install i get a boot loop to twrp. im using miui 11.

    1. Hi Anon. I have updated the download links with the latest version of TWRP, which should work for MIUI 11, along with the Magisk 20.1 zip file.

      Download the new files, then boot your phone into TWRP. Use the ‘Enable MTP’ option in TWRP > Mount and transfer both the files ( and twrp-3.3.1-25-raphael-mauronofrio.img) to the phone’s storage.

      Then go to TWRP > Install and tap on the ‘Install Image’ button. Select the ‘twrp-3.3.1-25-raphael-mauronofrio.img’ file and flash it to the ‘Recovery Ramdisk’ partition. Once flashed, go to TWRP > Reboot > Recovery.

      When the phone reboots into TWRP, flash the file and finally reboot your phone into the System (OS).

      Let me know how it goes.

  7. Thanks for this exceptional guide. I expect to get my mi9t pro soon and very glad I came across your very clear guide that will help me with the process

    1. You’re welcome! I appreciate the kind words, plus I am glad that you’re reading the instructions before you start performing them on your Mi 9T Pro. It’s a good practise.

    2. Hello my dear friend, I have a K 20 Pro Premium Android version device 9.0
      Would you do this way for him?thanks for you

  8. Hello. Thank you for this guide.
    I have one question:
    Do I have to unlock the bootloader when using your method ?
    And if the bootloader is not unlocked it will be overwritten with original after the reboot to system but Magisk will stay, right ?

    1. Hi Anand. Yes, you will need to unlock the bootloader first. Without it, you won’t be able to install TWRP or root at all.

  9. Hello my friend! Unfortunately I do not have coustum rom installed. I hope you can help. When I install ( rom it throws this error: patching vendor image unconditionally.
    Thank you in advance for your help

    1. Hi Rahel. Despite the error, the ROM flashed correctly, right? I mean the flashing process finished?

  10. Thanks for the guide,

    but the root steps doesn’t work for my redmi k20 pro, after flashing the magisk zip file and then press reboot system, the phone will be booted to twrp over and over again.

    Please help.

    1. Hi Muhammad. Could you please let me know the Android version installed on your K20 Pro?

  11. Thanks for the amazing article. Was having the issue of installing custom recovery okay, but not being able to boot into it. Did not know about the direct booting into recovery step right after flashing or else have it replaced by stock one due to dm-verity.

    That highlighted tip, helped me quick.

    Appreciate it.

    1. Hi Anon. That’s a very important part, which is why it was put up in that red box. I am glad this article proved helpful to you.

      BTW, have you tried Google Camera port on your phone yet?

Leave a Reply

Your email address will not be published. Required fields are marked *