[ROOT] How to properly root the P20 lite

Search This thread

RogerXIII

Member
Jan 13, 2010
22
13
Even without a custom recovery like TWRP you can get Magisk on your phone.
To do this you need to manually patch the stock boot image and flash that to your boot partition.
However, I've done all of this and with a few steps you'll be rooted.

There's a more detailed guide below.

1) Get bootloader unlock code here
2) Enable "OEM Unlocking", boot into fastboot and type: "fastboot oem unlock your-unlock-code"
3) Download patched ramdisk image here and put it in fastboot directory.
4) Reboot into fastboot and type: "fastboot flash ramdisk patched_ramdisk.img"
(Optional) 5) Flash this to go back to stock ramdisk

[Detailed Guide]

First off, you need an unlocked bootloader. To do this, you need a special code from Huawei, you can request this here:
https://emui.huawei.com/en/plugin.php?id=unlock

With this code, and having "OEM unlocking" enabled in debugger settings, boot in fastboot mode.
Afterwards, open fastboot console and type: "fastboot oem unlock your-unlock-code"
Your device will now reboot.

Now reboot your device back into fastboot mode and open a fastboot console once more.
Download this patched ramdisk partition and place it in the same folder as your fastboot executable.
http://www.mediafire.com/file/9yfz6w9e8q7j5u2/patched_ramdisk.img

Now simply type in the console: "fastboot flash ramdisk patched_ramdisk.img".
Reboot your phone and it is rooted!
Download Magisk Manager to update/configure Magisk.


[REMOVE ROOT]

To remove the root, simply flash this original ramdisk partition, the same way as above. You can also relock the bootloader if wanted.
http://www.mediafire.com/file/4d6w2labc6cmh2o/original_ramdisk.img
 
Last edited:

r00terb3y

New member
Apr 6, 2018
3
0
When I'm trying to install the patched ramdisk with "fastboot flash ramdisk patched_ramdisk.img" it says "cannot load patched_ramdisk.img".

What's the exactly directory?
 

RogerXIII

Member
Jan 13, 2010
22
13
WORKS IN ANE-AL00 china model??

Only tested on ANE-LX1, you're welcome to try it though.

When I'm trying to install the patched ramdisk with "fastboot flash ramdisk patched_ramdisk.img" it says "cannot load patched_ramdisk.img".

What's the exactly directory?

It has to be in the directory of your fastboot executable.

@RogerXIII, from which build did you patched ramdisk?

Version 8.0.0.104 (C185)
 
  • Like
Reactions: kilroystyx

RogerXIII

Member
Jan 13, 2010
22
13
And how do I find out?

I think you mean the directory:
On your computer you have the file "fastboot" that you use for sending fastboot commands to your phone, put the .img file in yhe same folder as that program. If you don't know where it is located, you can download the platform-tools files separately and use those.
 

coant

Member
Jul 3, 2010
11
1
Thank you worked very well. I need twrp but i cant find or Build compatibility with p20 do you find any way to get it work?
 
  • Like
Reactions: HUAWEI P20

bjpafa

Senior Member
Aug 29, 2011
54
4
Porto
Hi. Huawei P20 lite ANE-LX1 8.0.0.111(C432).
Asking for some advice. Having read several how to guide to root, installed adb on Linux, connected, backup ok, patched ram disk, original ram disk and so on and so on, Running in circles about UNLOCK CODE: OR getting a 404 eng/Chinese, Or logging at Huawei and getting a US page for honor 7/10. Cannot get the unlock page to fill the formulary, although having all necessary info, IMEI, Product ID etc. My region is PT. Request advice, considering returning the phone wich is not so bad at benchmarks... Thank you. Congrats
 

Dr. Neuhaus

Member
Aug 9, 2008
44
17
Yekaterinburg
Just got an OTA: ANE-LX1 8.0.0.105(C10). My device OS ver.: ANE-LX1 8.0.0.102(C10). Please tell me, should I apply it? What will happen with root? Will I need to reflash ramdisk after update?
 
  • Like
Reactions: angelillom

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Even without a custom recovery like TWRP you can get Magisk on your phone.
    To do this you need to manually patch the stock boot image and flash that to your boot partition.
    However, I've done all of this and with a few steps you'll be rooted.

    There's a more detailed guide below.

    1) Get bootloader unlock code here
    2) Enable "OEM Unlocking", boot into fastboot and type: "fastboot oem unlock your-unlock-code"
    3) Download patched ramdisk image here and put it in fastboot directory.
    4) Reboot into fastboot and type: "fastboot flash ramdisk patched_ramdisk.img"
    (Optional) 5) Flash this to go back to stock ramdisk

    [Detailed Guide]

    First off, you need an unlocked bootloader. To do this, you need a special code from Huawei, you can request this here:
    https://emui.huawei.com/en/plugin.php?id=unlock

    With this code, and having "OEM unlocking" enabled in debugger settings, boot in fastboot mode.
    Afterwards, open fastboot console and type: "fastboot oem unlock your-unlock-code"
    Your device will now reboot.

    Now reboot your device back into fastboot mode and open a fastboot console once more.
    Download this patched ramdisk partition and place it in the same folder as your fastboot executable.
    http://www.mediafire.com/file/9yfz6w9e8q7j5u2/patched_ramdisk.img

    Now simply type in the console: "fastboot flash ramdisk patched_ramdisk.img".
    Reboot your phone and it is rooted!
    Download Magisk Manager to update/configure Magisk.


    [REMOVE ROOT]

    To remove the root, simply flash this original ramdisk partition, the same way as above. You can also relock the bootloader if wanted.
    http://www.mediafire.com/file/4d6w2labc6cmh2o/original_ramdisk.img
    2
    Just a clarification. So lite version come with 8.0 ? Not 8.1 ?

    Correct
    2
    1) Get bootloader unlock code here
    this is giving me a 404 error...:rolleyes:
    2
    Hey there PartyPeople.

    A few days ago Magisk 18.0 released and i was so free to create a ramdisk containing the updated Magisk package since i had troubles getting things to work with a new Magisk manager on an old ramdisk.
    You'll find the download right here: https://mega.nz/#!ryhlEaTB!ulJZHuHobCIL4V8xhezP-anbAnm7lpsBPdY4XPupc5c

    Please keep in mind that i haven't tested this yet, however i am pretty confident this will work just fine. Should this not work then feel free to contact me or flash the unmodified ramdisk.

    As an addendum to the general consensus of flashing TWRP in this thread, i would advise against that, until at least the folks from OpenKirin have figured out TWRP support. If you just want to root your P20 Lite, don't bother with TWRP, you might regret it later
    1
    apparently free method wont work anymore.
    In September it was still working... :cool: