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

ilos

Senior Member
Jun 17, 2007
1,523
244
0
Saint Priest
It still bootloops for me updating this way. Are you on the custom update channel (https://bit.ly/2N8UVlq) or something else?
Like you I've tried to update directly with magisk manager canary (coming from patched twrp Charlotte with 18.1 magisk version) but got bootloop. So I've patched an original ramdisk with magisk manager and v19.1 canary version and flashed with fastboot. Now phone boot (a bit longer..) and no more bootloops (just one when I've removed a module).

Sent from my LYA-L29 using Tapatalk
 

JFenlon

Senior Member
Nov 27, 2009
68
5
0
Doncaster
teesbox.com
I'm on the Canary build 19003, previously I was on 19001

Sent from my HUAWEI LYA-L29 using XDA Labs
I still can't get it to boot.

Installed the latest Magisk Canary APK, set channel to Canary, patched 'RECOVERY_RAMDIS.img' with Magisk, flashed 'magisk_patched.img' with adb and all I get is back to the bootloader, after a couple of mins attempting to load.

Have I missed something?
 

ilos

Senior Member
Jun 17, 2007
1,523
244
0
Saint Priest
It's what I've done and it boot (longer than 18.1 but it boot..) . Do you have any modules installed? Did you press volume up after reboot from fastboot?

Sent from my LYA-L29 using Tapatalk
 

JFenlon

Senior Member
Nov 27, 2009
68
5
0
Doncaster
teesbox.com
It's what I've done and it boot (longer than 18.1 but it boot..) . Do you have any modules installed? Did you press volume up after reboot from fastboot?

Sent from my LYA-L29 using Tapatalk
I did have some modules installed, but now I can't get the phone to boot while rooted so not even sure how I'd uninstall them.
 

ilos

Senior Member
Jun 17, 2007
1,523
244
0
Saint Priest
try to flash again stable patched img (18.1). Also you can use the canary patched by me . i attach both

Stable recovery img magisk V18.1 (patched twrp Charlotte from P20 Pro )

https://drive.google.com/file/d/1ASb5h0PcQKZPmz5DR7Np4oopOxWYTgGW/view?usp=sharing

Canary recovery img Magisk V19

https://drive.google.com/open?id=1j__y_krHL0E8iC3HIAnatDFOlpZiX6of

Stock recovery img without any patch ( in case you really stuck on bootloop)

https://drive.google.com/open?id=1mbWMPDDm9APv_eqtBwTD9IMFY6cRuoyj

Don't install Viper module coz you will have bootloop issue with it
 
Last edited:

JFenlon

Senior Member
Nov 27, 2009
68
5
0
Doncaster
teesbox.com
try to flash again stable patched img (18.1). Also you can use the canary patched by me . i attach both

Stable recovery img magisk V18.1 (patched twrp Charlotte from P20 Pro )

https://drive.google.com/file/d/1ASb5h0PcQKZPmz5DR7Np4oopOxWYTgGW/view?usp=sharing

Canary recovery img Magisk V19

https://drive.google.com/open?id=1j__y_krHL0E8iC3HIAnatDFOlpZiX6of

Stock recovery img without any patch ( in case you really stuck on bootloop)

https://drive.google.com/open?id=1mbWMPDDm9APv_eqtBwTD9IMFY6cRuoyj

Don't install Viper module coz you will have bootloop issue with it
Still no joy. I think it's likely the installed modules causing the issue. Do you know of a way to uninstall the modules without root? Do I need to install TWRP?
 

ilos

Senior Member
Jun 17, 2007
1,523
244
0
Saint Priest
I'm not sure but if I remember, I flashed stock recovery and uninstall magisk with magisk manager... I'm really not sure.. You can try by flashing the stock img, let phone boot and go to magisk manager and uninstall. With stock img you will boot, it doesn't matter if a module is the coz of your bootloop. Latest chance will be to flash twrp, wipe data, cache, dalvik, and start on fresh install...

Sent from my LYA-L29 using Tapatalk
 
  • Like
Reactions: JFenlon

jfenlon01

Member
Jan 27, 2016
17
4
0
I'm not sure but if I remember, I flashed stock recovery and uninstall magisk with magisk manager... I'm really not sure.. You can try by flashing the stock img, let phone boot and go to magisk manager and uninstall. With stock img you will boot, it doesn't matter if a module is the coz of your bootloop. Latest chance will be to flash twrp, wipe data, cache, dalvik, and start on fresh install...

Sent from my LYA-L29 using Tapatalk
I don't see an option to uninstall. The times I do get it to boot (still with holding volume up while powering on) it shows as Magisk not installed. I have successfully had root, I have installed modules (the props one, another that I don't recall, certainly not v4a), but now I can't seem to get root at all, even flashing files that I still had on my computer that worked previously. I don't understand why. My only thought it that one of the modules is perhaps causing the issue. I guess I should have uninstalled them before trying to update Magisk, but I don't know how to do it now.

I already tried TWRP and it just hangs on the splash screen too. Screenshot_20190409_170716_com.topjohnwu.magisk.jpg
 

JFenlon

Senior Member
Nov 27, 2009
68
5
0
Doncaster
teesbox.com
Try to set to stable channel and install from magisk manager
Weirdly I can't even get the phone to boot into the bootloader now. It just boots as though I booted to recovery, although still no root when it does boot. So don't see how I can try another patched recovery or TWRP.

If I back everything up and then use eRecovery, will that help?

[edit] nm, bootloader working again after a reboot.
 
Last edited:

User422

Senior Member
Aug 8, 2015
146
16
0
How did you flashed it ?
With Twrp or fastboot or in Magisk directly like I said
How do you flash a file in magisk itself?
I can only download magisk.zip or patch a boot.img

---------- Post added at 11:25 PM ---------- Previous post was at 11:24 PM ----------

Sorry to hear that. Did the one from the first post work for you?
The method in the very first post by the OP has worked once.
I have later lost magisk and haven't been able to get it to work sibce then.
 

jfenlon01

Member
Jan 27, 2016
17
4
0
How do you flash a file in magisk itself?
I can only download magisk.zip or patch a boot.img

---------- Post added at 11:25 PM ---------- Previous post was at 11:24 PM ----------



The method in the very first post by the OP has worked once.
I have later lost magisk and haven't been able to get it to work sibce then.
I think I have the same experience as you. I had root but no matter what I try now, I can't get it to boot with root.

Please post if you find a solution that works.
 
  • Like
Reactions: User422

flyl0

Senior Member
Dec 8, 2018
167
34
38
Paris
How do you flash a file in magisk itself?
I can only download magisk.zip or patch a boot.img

---------- Post added at 11:25 PM ---------- Previous post was at 11:24 PM ----------



The method in the very first post by the OP has worked once.
I have later lost magisk and haven't been able to get it to work sibce then.
It may sounds dumb but do you have the latest version of Magisk Manager ?

Sent from my HUAWEI LYA-L29 using XDA Labs
 

JFenlon

Senior Member
Nov 27, 2009
68
5
0
Doncaster
teesbox.com
In my case, yes.
I rolled back firmware with eRecovery yesterday, didn't help. Today I've installed TWRP, wiped and removed encryption. I then tried to use the Magisk Module removal zip (because I think Magisk Modules are the likely cause of me not being able to boot with the device rooted anymore) but that resulted in an error.

I've just restored a backup in HiSuite, and then rooted again and it worked. A lot of messing around, but hope it helps you.
 
Last edited:

Oreology

Member
Apr 19, 2019
6
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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.com/showpost.php?p=78554707&postcount=125
@duraaraa - Guy behind FunkyHuawei for figuring out the .171 upgrade and make everything works smoothly https://forum.xda-developers.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.
do you have a video tutorial? or does somebody else have a video? im afraid i might do something bad with my Mate 20 Pro. im kinda slow with these things and totally noob with rooting. also is this compatible for me?
phone model/version is:
LYA-L29
9.0.0.232(C636E10R2P1)

it's OEM Unlocked so i dont have the unlock codes.
 
Last edited:

pvillasuso

Senior Member
Apr 16, 2007
1,672
705
143


do you have a video tutorial? or does somebody else have a video? im afraid i might do something bad with my Mate 20 Pro. im kinda slow with these things and totally noob with rooting. also is this compatible for me?
phone model/version is:
LYA-L29
9.0.0.232(C636E10R2P1)

it's OEM Unlocked so i dont have the unlock codes.
Why do you need root ? to do what? with your phone ...
 
Our Apps
Get our official app!
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