[GUIDE]Unlocking Bootloader + Magisk Root for Huawei Mate 20 Pro

Search This thread

twisted89

Senior Member
Mar 29, 2010
506
992
There's so much missing information in this thread -
Easy way to get magisk and keep it without booting to recovery every time (tested on 9.1):

1. Download latest twrp from here https://twrp.me/huawei/huaweip20pro.html
2. Install magisk manager and patch the twrp image
3. Boot to fast boot and flash magisk patched img
4. reboot into erecovery, select wipe and continue (this didn't actually wipe anything for me)
5. reboot into phone normally, magisk will now be permanent.
 
Last edited:

WhyExactlyIsTha

New member
Oct 16, 2023
1
0
I read through quite a few post here to get everything sorted out and in order to save every one some time here is a summary of all the info I have gathered so far, and my way to thank the forum for offering me so many helpful tips. I'll try to keep this thread updated as information comes in.

All credit goes to their respective owners, I am only aggregating all the information here.

Current status on BL Unlock:

China version: OEM unlock not greyed out, direct BL unlock possible
EU/NA version (L09/L29/L0C): OEM unlock greyed out in developer options, BL unlock possible via FunkyHuawei method by upgrading to .170.
UPDATE 2019/01/02: Some users reported they have already received the .171 update from carrier (https://xdaforums.com/showpost.php?p=78571337&postcount=6), if that is the case you can skip the FH Method part and go directly to unlock BL.

Note: Currently .170 is not GooglePay certified, so Google Pay won't work on this, if you must have Google pay please wait for your carrier to update to some version that support OEM unlock (tap build number 7x to get Developer Options in Settings -> System -> About Phone and then go to Settings -> System -> Developer Options and see if Enable OEM Unlock option is enabled).

Also current recovery install requires you to boot into recovery (Power and volume up with phone disconnected from USB) every single time if you want root, which is not perfect.

The only time you'd be required to wipe your phone is right after your BL is unlocked with fastboot OEM unlock, please make sure you have a backup before doing that step.

Where to get unlock code?
In order to get BL unlocked, you need both allow OEM unlock option NOT greyed out (i.e., you can enable it) AND a BL unlock code. BL unlock code can only be purchased either from FunkyHuawei (55 USD one time for BL unlock code only or if you buy an unlimited pass 132USD for unlimited flashing + BL unlock code (note that it is locked to your phone and can not be transferred)), or MinistryOfSolutions (30 Euro, https://ministryofsolutions.com/huawei-bootloader-unlock-service-all-new-models-new-firmwares, BL unlock code only).

FunkyHuawei Method (for non-China version)
1. Create an account in https://funkyhuawei.club/membersarea, buy 1 credit (if you just want to download .170 firmware, each credit cost 18USD).
2. Go to Select Firmware tab, use LYA-Global if you don't see the exact model. Then select .171 version.
3. Follow instructions here: https://pastebin.com/raw/Db5ZSyqu, you must download the specific HiSuite version (9.0.2.301)and the specific installer executable. Run the executable FHHiSuiteInstaller.exe as administrator (right-click and choose Run As Administrator) <- must run as admin since it will need to modify your host file. Make sure the script runs without error.
3.1 (Additional step for L0C): Edit the c:\users\YOURHOMEFOLDER\appdata\local\hisuite\userdata\updatedogdev\hisuiteconfig.xml file and change LYA-L29 to LYA-L0C everywhere it occurs and save the file. (Thanks to FunkyHuawei Support for pointing this one out).
4. Put the phone into fastboot mode (adb reboot-bootloader or with the phone off connect the usb cable while holding volume down, or boot the phone holding volume down with USB cable connected to PC).
5. Go to HiSuite on your PC and click on System Recovery (furthest to the right towards the bottom of the main screen), and let it do the magic. You will see some cmd windows pop up however it should get to the download progress with a percentage pretty fast, if you don't see that pop up then please check to make sure you have at least one credit in the FH Select Firmware tab and you have installed the specific versions of HiSuite and ran the installer as admin in Step 3.
6. Once everything is completed please verify to see if your firmware version is .171.

Unlock Bootloader
Again, get the BL code and go to Settings -> System -> Developer Options and make sure Enable OEM Unlock option is enabled. Also check to make sure you have everything backed up. Also enable USB Debugging in the same screen as well.
Rest is pretty standard:
Code:
adb devices (will bring up the authorization window on your phone, click on Always Trust)
adb reboot-bootloader
fastboot devices (make sure the device is in fastboot mode)
fastboot oem unlock *UNLOCK CODE*

at this point there will be a format operation performed on the phone, if it didn't complete successfully don't worry, your phone is wiped. During the boot you should see a black window with yellow text of warnings to tell you your phone is unlocked and not secured.

Go through all the steps to initialize the phone, turn on Developer options again, and enable USB Debugging again.

Root

1. Download and install Magisk Manager from this XDA post: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
2. Switch channel, go to Magisk Manager -> Settings -> Update Channel , set it to Custom, and the URL is https://bit.ly/2N8UVlq (at the moment, per https://xdaforums.com/apps/magisk/dev-magisk-canary-channel-bleeding-edge-t3839337). Go back to main screen and down swipe to refresh, it should say Latest Version > v18.0.
3. You will need to find the stock RECOVERY_RAMDIS.img file, I used HW Firmware Finder (https://xdaforums.com/tools/general/huawei-firmware-finder-team-mt-t3469146) to help me with the task, however I couldn't find the L0C update file and ended up using L09 update file instead, which appear to work. I also couldn't find the update.zip for .171 so I ended up using the latest full update version that was available to me (http://update.hicloud.com:8180/TDS/...69/g1750/v181585/f1/full/update_full_base.zip).
4. Unzip the file, drag out UPDATE.APP file in the zip package, and opened it with Huawei Firmware Extractor (I used 0.9.9.5 in this thread: https://xdaforums.com/showthread.php?t=2433454). Extract and open the UPDATE.APP in update file. If you get a checksum error make sure to uncheck both of the verify checksum in Settings -> Extract.
5. Now you should see a RECOVERY_RAMDIS.img file, right click and extract it.
6. Send the RECOVERY_RAMDIS.img file back to your phone (anywhere is fine), go back to Magisk Manager -> Install -> Patch boot, get the patched_boot.img file from the phone back to the PC.
UPDATE 2019/01/02: @pvillasuso was kind enough to post the ramdisk image (both original and Magisk modified) for Mate 20 Pro LYA-L09 (Firmware version .171):https://xdaforums.com/showpost.php?p=78575496&postcount=13, obviously use it at your own risk.
7. Go to fastboot mode again:
Code:
adb devices
adb reboot-bootloader
fastboot devices
fastboot flash recovery_ramdisk "PATH_TO_patched_boot.img"
fastboot reboot

Now your phone should be back to normal with no root yet, turn off your phone and turn it back on by booting into recovery (Power and volume up with phone disconnected from USB)

Boot up and if you go to Magisk now you should be able to see Magisk installed with Installed Version same as Latest Version.

Congrats you are now rooted!

In future you will need to boot into recovery each time to maintain root (which requires you to turn phone off and power + vol up), if you prefer not to do so @ThatsJustLogic suggested you can use the app https://xdaforums.com/showpost.php?p=78569733&postcount=2 to add a one-click reboot from your dropdown menu.

Credits:
@ThatsJustLogic - Figured out the installation steps to patch ramdisk: https://xdaforums.com/showpost.php?p=78554707&postcount=125
@duraaraa - Guy behind FunkyHuawei for figuring out the .171 upgrade and make everything works smoothly https://xdaforums.com/mate-20-pro/how-to/unlock-rebrand-unbrick-update-t3855065
@mutahharbashir - Guy behind MinistryOfSolutions for the unlock BL code.
And creators of Magisk, HWFirmwareFinder, HWUpdateExtractor.

I may have a really dumb question: Why is it that in every single post I ever found to this, the "unlock code" can only be obtained by some dubious "paid" services? Where do THEY get them from, hmm?
Do they work for huawei? Do you work for huawei? Surely they do not get the code from Huawei for my phone, instantly, when even Huawei does not offer the service anymore?

So where and how do they get the codes? Why can I not find the code myself? I am pretty sure I can do it myself.

I would rather pay 55 USD for a guide that explains to me in minute detail how they obtain the code themselves, than unlocking the device, simply to save time, and still have learned something.


If I do not get that information, I will simply throw it in the bin, where all huawei devices belong after all, and buy me another one to play around with. It is as simple as that.
 

mutahharbashir

Senior Member
Mar 31, 2016
960
192
Gujranwala
I may have a really dumb question: Why is it that in every single post I ever found to this, the "unlock code" can only be obtained by some dubious "paid" services? Where do THEY get them from, hmm?
Do they work for huawei? Do you work for huawei? Surely they do not get the code from Huawei for my phone, instantly, when even Huawei does not offer the service anymore?

So where and how do they get the codes? Why can I not find the code myself? I am pretty sure I can do it myself.

I would rather pay 55 USD for a guide that explains to me in minute detail how they obtain the code themselves, than unlocking the device, simply to save time, and still have learned something.


If I do not get that information, I will simply throw it in the bin, where all huawei devices belong after all, and buy me another one to play around with. It is as simple as that.
Don't throw in dustbin
Donate it to someone 👍
 

rufftommy

New member
Nov 18, 2023
2
0
Hi, sorry to hijack this thread but i wasn't sure if i should start a new one. I have a Huawei Mate 20 Pro LYA-L09 that has android 10, EMUI 11.0.0 current build 11.0.0.162 Currently unlocked but with Optus flash screen. I have just discovered that Android Auto on this phone doesn't support wireless AA. I have purchased a wireless AA adapter for my car and it appears I need minimum Android 11. Wired works ok for this phone and AA in my car.
This has been a really solid phone for me and i didn't realise that I have owned it for so long as its been such a reliable phone with good battery life.
Question I have is can this phone be flashed with android 11 and if so is it easy to do following guides?
Or if not, do I cut my losses and purchase a new phone?
Looking forward for advice, thanks
 

mutahharbashir

Senior Member
Mar 31, 2016
960
192
Gujranwala
Hi, sorry to hijack this thread but i wasn't sure if i should start a new one. I have a Huawei Mate 20 Pro LYA-L09 that has android 10, EMUI 11.0.0 current build 11.0.0.162 Currently unlocked but with Optus flash screen. I have just discovered that Android Auto on this phone doesn't support wireless AA. I have purchased a wireless AA adapter for my car and it appears I need minimum Android 11. Wired works ok for this phone and AA in my car.
This has been a really solid phone for me and i didn't realise that I have owned it for so long as its been such a reliable phone with good battery life.
Question I have is can this phone be flashed with android 11 and if so is it easy to do following guides?
Or if not, do I cut my losses and purchase a new phone?
Looking forward for advice, thanks
Hi, sorry to hijack this thread but i wasn't sure if i should start a new one. I have a Huawei Mate 20 Pro LYA-L09 that has android 10, EMUI 11.0.0 current build 11.0.0.162 Currently unlocked but with Optus flash screen. I have just discovered that Android Auto on this phone doesn't support wireless AA. I have purchased a wireless AA adapter for my car and it appears I need minimum Android 11. Wired works ok for this phone and AA in my car.
This has been a really solid phone for me and i didn't realise that I have owned it for so long as its been such a reliable phone with good battery life.
Question I have is can this phone be flashed with android 11 and if so is it easy to do following guides?
Or if not, do I cut my losses and purchase a new phone?
Looking forward for advice, thanks
Simple answer is no.
You can't get android 11 on this phone.
No matter how hard you try
Just impossible.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 14
    I read through quite a few post here to get everything sorted out and in order to save every one some time here is a summary of all the info I have gathered so far, and my way to thank the forum for offering me so many helpful tips. I'll try to keep this thread updated as information comes in.

    All credit goes to their respective owners, I am only aggregating all the information here.

    Current status on BL Unlock:

    China version: OEM unlock not greyed out, direct BL unlock possible
    EU/NA version (L09/L29/L0C): OEM unlock greyed out in developer options, BL unlock possible via FunkyHuawei method by upgrading to .170.
    UPDATE 2019/01/02: Some users reported they have already received the .171 update from carrier (https://xdaforums.com/showpost.php?p=78571337&postcount=6), if that is the case you can skip the FH Method part and go directly to unlock BL.

    Note: Currently .170 is not GooglePay certified, so Google Pay won't work on this, if you must have Google pay please wait for your carrier to update to some version that support OEM unlock (tap build number 7x to get Developer Options in Settings -> System -> About Phone and then go to Settings -> System -> Developer Options and see if Enable OEM Unlock option is enabled).

    Also current recovery install requires you to boot into recovery (Power and volume up with phone disconnected from USB) every single time if you want root, which is not perfect.

    The only time you'd be required to wipe your phone is right after your BL is unlocked with fastboot OEM unlock, please make sure you have a backup before doing that step.

    Where to get unlock code?
    In order to get BL unlocked, you need both allow OEM unlock option NOT greyed out (i.e., you can enable it) AND a BL unlock code. BL unlock code can only be purchased either from FunkyHuawei (55 USD one time for BL unlock code only or if you buy an unlimited pass 132USD for unlimited flashing + BL unlock code (note that it is locked to your phone and can not be transferred)), or MinistryOfSolutions (30 Euro, https://ministryofsolutions.com/huawei-bootloader-unlock-service-all-new-models-new-firmwares, BL unlock code only).

    FunkyHuawei Method (for non-China version)
    1. Create an account in https://funkyhuawei.club/membersarea, buy 1 credit (if you just want to download .170 firmware, each credit cost 18USD).
    2. Go to Select Firmware tab, use LYA-Global if you don't see the exact model. Then select .171 version.
    3. Follow instructions here: https://pastebin.com/raw/Db5ZSyqu, you must download the specific HiSuite version (9.0.2.301)and the specific installer executable. Run the executable FHHiSuiteInstaller.exe as administrator (right-click and choose Run As Administrator) <- must run as admin since it will need to modify your host file. Make sure the script runs without error.
    3.1 (Additional step for L0C): Edit the c:\users\YOURHOMEFOLDER\appdata\local\hisuite\userdata\updatedogdev\hisuiteconfig.xml file and change LYA-L29 to LYA-L0C everywhere it occurs and save the file. (Thanks to FunkyHuawei Support for pointing this one out).
    4. Put the phone into fastboot mode (adb reboot-bootloader or with the phone off connect the usb cable while holding volume down, or boot the phone holding volume down with USB cable connected to PC).
    5. Go to HiSuite on your PC and click on System Recovery (furthest to the right towards the bottom of the main screen), and let it do the magic. You will see some cmd windows pop up however it should get to the download progress with a percentage pretty fast, if you don't see that pop up then please check to make sure you have at least one credit in the FH Select Firmware tab and you have installed the specific versions of HiSuite and ran the installer as admin in Step 3.
    6. Once everything is completed please verify to see if your firmware version is .171.

    Unlock Bootloader
    Again, get the BL code and go to Settings -> System -> Developer Options and make sure Enable OEM Unlock option is enabled. Also check to make sure you have everything backed up. Also enable USB Debugging in the same screen as well.
    Rest is pretty standard:
    Code:
    adb devices (will bring up the authorization window on your phone, click on Always Trust)
    adb reboot-bootloader
    fastboot devices (make sure the device is in fastboot mode)
    fastboot oem unlock *UNLOCK CODE*

    at this point there will be a format operation performed on the phone, if it didn't complete successfully don't worry, your phone is wiped. During the boot you should see a black window with yellow text of warnings to tell you your phone is unlocked and not secured.

    Go through all the steps to initialize the phone, turn on Developer options again, and enable USB Debugging again.

    Root

    1. Download and install Magisk Manager from this XDA post: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
    2. Switch channel, go to Magisk Manager -> Settings -> Update Channel , set it to Custom, and the URL is https://bit.ly/2N8UVlq (at the moment, per https://xdaforums.com/apps/magisk/dev-magisk-canary-channel-bleeding-edge-t3839337). Go back to main screen and down swipe to refresh, it should say Latest Version > v18.0.
    3. You will need to find the stock RECOVERY_RAMDIS.img file, I used HW Firmware Finder (https://xdaforums.com/tools/general/huawei-firmware-finder-team-mt-t3469146) to help me with the task, however I couldn't find the L0C update file and ended up using L09 update file instead, which appear to work. I also couldn't find the update.zip for .171 so I ended up using the latest full update version that was available to me (http://update.hicloud.com:8180/TDS/...69/g1750/v181585/f1/full/update_full_base.zip).
    4. Unzip the file, drag out UPDATE.APP file in the zip package, and opened it with Huawei Firmware Extractor (I used 0.9.9.5 in this thread: https://xdaforums.com/showthread.php?t=2433454). Extract and open the UPDATE.APP in update file. If you get a checksum error make sure to uncheck both of the verify checksum in Settings -> Extract.
    5. Now you should see a RECOVERY_RAMDIS.img file, right click and extract it.
    6. Send the RECOVERY_RAMDIS.img file back to your phone (anywhere is fine), go back to Magisk Manager -> Install -> Patch boot, get the patched_boot.img file from the phone back to the PC.
    UPDATE 2019/01/02: @pvillasuso was kind enough to post the ramdisk image (both original and Magisk modified) for Mate 20 Pro LYA-L09 (Firmware version .171):https://xdaforums.com/showpost.php?p=78575496&postcount=13, obviously use it at your own risk.
    7. Go to fastboot mode again:
    Code:
    adb devices
    adb reboot-bootloader
    fastboot devices
    fastboot flash recovery_ramdisk "PATH_TO_patched_boot.img"
    fastboot reboot

    Now your phone should be back to normal with no root yet, turn off your phone and turn it back on by booting into recovery (Power and volume up with phone disconnected from USB)

    Boot up and if you go to Magisk now you should be able to see Magisk installed with Installed Version same as Latest Version.

    Congrats you are now rooted!

    In future you will need to boot into recovery each time to maintain root (which requires you to turn phone off and power + vol up), if you prefer not to do so @ThatsJustLogic suggested you can use the app https://xdaforums.com/showpost.php?p=78569733&postcount=2 to add a one-click reboot from your dropdown menu.

    Credits:
    @ThatsJustLogic - Figured out the installation steps to patch ramdisk: https://xdaforums.com/showpost.php?p=78554707&postcount=125
    @duraaraa - Guy behind FunkyHuawei for figuring out the .171 upgrade and make everything works smoothly https://xdaforums.com/mate-20-pro/how-to/unlock-rebrand-unbrick-update-t3855065
    @mutahharbashir - Guy behind MinistryOfSolutions for the unlock BL code.
    And creators of Magisk, HWFirmwareFinder, HWUpdateExtractor.
    4
    No BL Unlock? Bye bye Huawei!

    I upgraded to the Mate20 Pro 20 months ago, from a Samsung S7 Edge *still a capable device and naturally has been rooted and a custom ROM now as a backup phone* .

    Huawei's decision to apparently permanently lock the devices BL so it can't be rooted or custom ROM'd etc, really has 100% decided that I will never own one of their devices again. Quite a shame really as shortly after I got the Mate20 Pro I actually got to really like & enjoy using it, and said then "next upgrade will be another Huawei"!

    A strange and possibly questionable decision to treat buyers & owners of Huawei devices by locking to their own firmware only. Sure I can imagine a large number of people don't mind and just use their chosen phone as purchased, and there is certainly nothing wrong with that at all.

    But it does feel insulting and a slap in the face if you wanted to modify it at some point, we pay good money to buy new devices after all. Bye bye HUAWEI!
    4
    Hey crys18... do you have any idea of how long this Huawei unlocking service will last? A friend of mine has ordered a mate 20 pro but it won’t be arriving until late next week. Will it still be available by then? Or do you have no idea?

    Yes, it will work until your friend gets his phone :)
    3
    Now your phone should be back to normal with no root yet, turn off your phone and turn it back on by booting into recovery (Power and volume up with phone disconnected from USB)
    To stop you needing to do this on every boot this app: https://play.google.com/store/apps/details?id=com.superthomaslab.rootessentials allows you to add a "Reboot Recovery" button to your notification tray so its just a one tap reboot instead of holding volume up when you want to reboot after applying a change or something its something small but it saves some hassle.
    3
    Too bad we cannot root 10 and 11, my last huawei phone.
    My last one too sadly