Install TWRP Recovery and Root Huawei P20 Pro (Guide)

Install TWRP Recovery and Root Huawei P20/Huawei P20 Pro

In this article, we will take you through the complete process on how to root Huawei P20 Pro and install TWRP recovery on it.

Huawei took the smartphone market last month with the set of the latest P series devices. Of the trio, the P20 and P20 Pro are tagged among the premium flagships. These are already known for packing in a very powerful hardware and the latest EMUI software based on Android 8.1 Oreo, that’s focused on AI and machine learning technology. The devices have also received the highest DxOMark score  (102 and 109) surpassing some known flagships including Galaxy S9 Plus and Google Pixel 2. While the software experience is great, certain users might still want to step further and root Huawei P20 Pro/Huawei P20. The extensive tutorial below will take you through the complete process, step-by-step.

Install TWRP Recovery and Root Huawei P20/Huawei P20 Pro

Table of Contents

Guide to Root Huawei P20 Pro and Install TWRP Recovery

Judging by the hardware configuration, software, and all the unique features, the latest Huawei flagships have all the potential to stand against the competitors. While the devices have only started reaching a few markets till now, the community is making solid progress towards third-party development. XDA senior member Pretoriano80 has already managed to compile and release TWRP Recovery for the said devices.

Update (12 June 2018): Official TWRP recovery for Huawei P20 Pro is now available for download. Download link and instructions have been updated.

Which means you can easily install TWRP recovery on Huawei P20 Pro/Huawei P20 and use it too root the device. So far, there’s no information on when the P20 will be added to the official TWRP support list. But with the momentum we are seeing, it doesn’t seem to be too far away.

Rooting the phone is a three-step process. The first step is to unlock the phone’s bootloader, which will enable the user to flash TWRP recovery (second step). Afterward, you can flash Magisk installer ZIP using TWRP to root Huawei P20 Pro and Huawei P20.

Prerequisites

Unlock Huawei P20 Pro Bootloader

Now, the first step in order to root Huawei P20 Pro/Huawei P20 is to unlock the phone’s bootloader. This will allow you to manually flash the TWRP recovery image using Fastboot. Note that this process will completely erase the device. First, make sure to enable OEM unlocking on the phone. Then go ahead and follow our tutorial on how to unlock bootloader on Huawei P20.

Install TWRP Recovery on Huawei P20 Pro

  1. Go to C:\adb on the PC.
  2. This is the folder where the Android SDK tool binaries are present.
  3. Hold the SHIFT key on the keyboard and right-click on an empty space inside the folder.
  4. Select the ‘Open PowerShell window here’ option.
    Install TWRP Recovery and Root Huawei P20 Pro - Open PowerShell
  5. Power off the Huawei P20 completely.
  6. Connect the device to the PC while holding the Volume Down key.
  7. The Huawei device should now be in Fastboot mode.
    Install TWRP Recovery and Root Huawei P20 Pro - Fastboot Mode
  8. Execute the following command to install TWRP recovery on Huawei P20:
    fastboot flash recovery_ramdisk twrp_p20_0.1.img
  9. To install TWRP recovery on Huawei P20 Pro, use the following:
    fastboot flash recovery_ramdisk twrp-3.2.1-0-charlotte.img
  10. Finally, reboot your device using:
    fastboot reboot

Now move towards the third and the last step in order to root Huawei P20 Pro and Huawei P20.

How to Root Huawei P20 Pro?

  1. Download latest Magisk or SuperSU ZIP file.
  2. Copy the downloaded files to the phone’s storage or SD card.
  3. Disconnect the phone and power it off.
  4. Hold the Volume Up and Power keys simultaneously to enter TWRP recovery mode.
  5. Swipe the button on the ‘Unmodified system partition’ warning.
  6. Tap on the ‘Install’ button.
    How to Root Huawei P20 Pro using Magisk
  7. Navigate to the storage and select the Magisk/SuperSU ZIP file.
  8. Finally, swipe the button on the screen to root Huawei P20 Pro/Huawei P20.
  9. When finished, press ‘Reboot System’.

Your Huawei device should now reboot into the OS. You can now take its advantage to install Magisk modules or mods like Dolby Atmos, ViPER4Android, and Xposed Framework on the device. Rooting gives you complete control over the system, which means you now have the privilege to modify the software according to your terms.

So you have just been able to root Huawei P20 Pro and Huawei P20. If you have any questions regarding the process, then leave us a comment.

Source 1, Source 2

Comments

  1. hello,

    I know this article is old but I hope it will work for me still.
    I have huawei p20 pro EMUI 9.1

    I did everything as you wrote, I only face 1 problem which is I can not locate Magisk zip in the twrp boot. all the folders have mangled names.

    please tell me how to locate the zip file.

    1. Hi Zac. That’s because the storage is encrypted and TWRP cannot decrypt it. I tried researching on XDA forums, but couldn’t find a TWRP build that supports EMUI 9.

      For now, you can install Magisk by doing the following:
      1) Download the latest Magisk v20.3 from here and copy it to the folder where ADB/Fastboot are installed.
      2) Then connect your phone to the PC (while it’s in TWRP) mode.
      3) In TWRP, go to ‘Advanced’ and enable ‘ADB Sideload’.
      4) Then, enter the following command on PC:
      .\adb sideload Magisk-v20.3.zip

      This should allow you to flash Magisk and root the phone.

    1. Hi Nizar, please share a screenshot of the TWRP backup menu or write down the list of partitions available for backup. This will let me suggest you the correct partitions you need to back up.

  2. In /sdcard I can’t see real folder names just randomly words and numbers and I can’t find anywhere magisk-16.4.zip

    1. Hi John, that’s because the storage is encrypted. Please remove the PIN/Pattern/Password lock and set it to Swipe. Then go into TWRP and try again.

    1. You will need to flash the stock ramdisk image from the stock firmware package. Please let me know which device you have (Pro, Lite, or normal)?

      Also, share a screenshot of Settings -> System -> About phone with me.

  3. These instructions, while well intended and well written, don’t seem to work as written. Although you can unlock the bootloader and install TWRP, you can’t use TWRP to backup the existing image before attempting to flash a new image because you get Permission Denied error backing up to /data partition.

    Then you can’t use “adb push” or a drag-n-drop transfer to transfer the the Magisk zip file to the device because all writeable partitions are encrypted, so the filenames are mangled, and all non-encrypted partitions are mounted read-only and we can’t change that until we have root privileges. “adb root” doesn’t work.

    You could possibly use TWRP to wiping and reformatting the /data partition (which is wruteable) and remount it unencrypted, but that would wipe system info so you will also have to flash public and HW zips after formatting /data, because files in /data/hw_init are removed which are needed for themes to work and ‘System Update’ and a few other apps. This might be possible, but that would need different instructions.

    1. Hi Dean, thanks for taking the time and explaining the whole situation. There are a few things that I can suggest right now.

      1) The Huawei P20 Pro has recently received official TWRP support. Though, I am not exactly sure which one of the both – unofficial or official builds support encryption.

      2) The partition and the files/folders inside it will be scrambled. To resolve this, simply boot into the OS and remove any PIN/PASSWORD/Pattern lockscreen. Once disabled, reboot back into the recovery and make sure to allow for modifications. Once done, TWRP should easily be able to decrypt your phone’s storage.

    2. thanks Dhananjay for the tip on removing the PIN/password/pattern.
      This doesn’t work to get past encryption in the /data partition (we are running as user “shell” but /data is owned by root.root with permissions rwxrwx–x so we still get “Permission Denied” trying to navigate into /data ).
      I couldn’t find a way to download the zip file while the device is booted into the OS. However, here’s a workaround…
      When booted to the OS there is no /tmp directory. However when booted into recovery, there is a /tmp directory owned by root.shell, so we *can* write to it.
      So the instructions for installing Magisk are to boot to recovery, then use TWRP to mount all partitions, then use adb push to push the Magisk.zip file to /tmp/Magisk.zip, and then use TWRP Install to install /tmp/Magisk.zip.
      That works 🙂

    3. Wow! Thanks for all the thorough research and the solution! Have you also given a try to ADB sideload in TWRP?

    4. For ADB sideload in TWRP? Here:

      1) Go to TWRP > Advanced > Sideload and enable it
      2) After enabling, connect the phone to the PC using the USB cable.
      3) Open a PowerShell/Terminal window inside the folder where the Magisk zip file is present.
      4) Finally, execute the following command: adb sideload Magisk-v18.0.zip

  4. I reached step 9 to Install TWRP Recovery on my Huawei P20 Pro but when I type in the following: fastboot flash recovery_ramdisk twrp-3.2.1-0-charlotte.img. Windows Powershell tells me “The term fastboot is not recognized.” My first attempt had a delay after I executed the command but any attempt after goes straight to “not recognized.” If someone can tell me what I did wrong, I would appreciate it.

  5. Hello, i got a problem when rooting, the following text are avaible when trying to root with magisk. When i installing magisk throught twrp i says:

    Failed to mount ´/system´ (device or resource busy)
    Error installing zip file ´/sdcard/magisk-v16.4 (1)

    And then
    Failed to mount ´/system´ (device or resource busy)
    Failed to mount ´/system´ (device or resource busy)

    ….Done

    1. Hi Pratik, the resource busy error means that the connection is disturbed between the phone and PC. Kindly try restarting your PC and change the USB port to a different one.

  6. Hi Dhananjay when i enter TWRP i cannot find the file copied over to the phone, i do not have a option to Enable MTP? please advise.

    Thanks.

  7. Hello,
    Thank you for for guide.

    Number 2 : ” Copy the downloaded files to the phone’s storage or SD card.”

    How to copy zip files into Huawei P20 without sd card ?
    And find it in twrp ?

    1. Hi, kindly go to the ‘Mount’ menu in TWRP and press the “Enable MTP” button. Once done, connect the phone to the PC using the USB cable. Once done, you can copy the file(s) onto the phone’s internal storage.

  8. Hi Dhananjay, something is wrong. I can’t enter the TWRP recovery mode. Instead of that I get the information on my P20 pro:
    Quot
    YOUR DEVICE HAS BEEN UNLOCKED AND CAN’T BE TRUSTED
    to learn more , visit :……
    Than I get the choice:
    1) Press Power key to continue or
    2) Press Volume Up key up to 3 seconds to enter erecovery to restore your device
    selecting 2) I get the next picture with different choises:
    DOWNLOAD LATEST VERSION AND RECOVERY
    WIPE DATA/FACTORY RESET
    REBOOT
    SHUTDOWN
    What shall I do? I am little bit afraid to choose (Download latest…) maybe I have to customize the P20 pro again from scratch. Any idea?
    Best regards
    Johann

    1. Hi Johann, which recovery file did you exactly use? Also please let me know what’s the output that you see on the PowerShell window after executing the TWRP flash command.

    2. Hi Dhanajay,
      sorry that I late. I was on a long journey. I have used both recovery files the official and the unofficial one.

      PS C:\ADB\platform-tools> .\fastboot flash recovery_ramdisk twrp-3.2.1-0-charlotte.img
      target reported max download size of 471859200 bytes
      sending ‘recovery_ramdisk’ (8634 KB)…
      OKAY [ 0.266s]
      writing ‘recovery_ramdisk’…
      OKAY [ 0.094s]
      finished. total time: 0.359s
      PS C:\ADB\platform-tools>

    3. Right after that command, simply type in: fastboot reboot

      Now exactly when your phone boots after executing the command, hold on to the Volume Up button. You will see the “YOUR DEVICE HAS BEEN UNLOCKED AND CAN’T BE TRUSTED” screen again. Just keep holding the Volume Up button.

      What happens is, if your phone boots into the OS (And not recovery mode) after flashing TWRP, then the system overwrites the just flashed TWRP with stock again.

      So, we have to boot into recovery mode right after we flash TWRP.

    4. Thanks. I got it now.
      The problem was that I have to hold the buttons until the boot screen comes up and not releasing the buttons after the short vibration. Now everything works perfect. By the way I have used the TWRP_clt_0.1.img from April 2018. There is no problem with encrypted data when all passwords and fingerprints are deleted.

Leave a Reply

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