• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[ROOT] [UNLOCK] [ANE-LX1/L01/L21] [Stock EMUI 8/9] P20 Lite

Search This thread

gh0stza

Member
May 30, 2021
18
0
ZA
Today I will be giving a tutorial on how to root the Huawei P20 Lite (ANE-LX1 ANE-L01 ANE-L21)

Step 1: Find somebody to trade your P20 Lite with and root that phone instead. :ROFLMAO:

THIS PHONE HAS BEEN THE BIGGEST PAIN IN MY ASS

However, if you're still intent on rooting, here goes...

If you need bootloader unlock code
----------------------------------------
You can use dc-unlocker but, only if you can rollback to 8.0.0.146 or lower (i was on 8.0.0.46 when i used dc-unlocker).
You can try to use PotatoNV, but that will require testpoint access (haven't tested yet).
You can use HCU client with a 3day account pass, which is quite expensive (I have not actually tested this yet).

Rollback EMUI 9 to EMUI 8
-----------------------------
This is where my frustrations with this phone began.
You can try to use dload method, but in my experience this DOES NOT WORK when you're on EMUI 9.
It will just give you an error about incompatible version, every time.
Forced dload was also a complete bust for me, 24 hours wasted

I was finally able to rollback from HiSuite 11. I was on 9.1.0.200 when I had the option to rollback and it rolled me back to 8.0.0.163.
From 8.0.0.163 I could use normal dload to rollback further until I could use dc-unlocker.

I made the mistake of upgrading to EMUI 9 after I unlocked my bootloader. My advise: if you can manage to get to 8, stay there. It's less bloated and feels smoother. I have not received the option to rollback after I re-upgraded to 9 since. And I have not found AANNYY method to rollback to 8 since then, I pretty much gave up and stayed on EMUI 9.

EMUI 8
---------
copy magisk23.zip to sdcard
flash twrp to recovery_ramdisk.img
Code:
fastboot flash recovery_ramdisk "twrp-3.2.1-0.img"
Code:
fastboot reboot recovery
Once in twrp install the magisk23.zip file.
This will patch the boot.img from recovery_ramdisk.img with magisk v23
Reboot -> System
Once in android you will get the usual magisk app, open and allow to perform additional tasks like installing the manager app.

Pretty straight forward

EMUI 9
---------
While still on stock firmware, update your android to the highest possible firmware (HiSuite or on phone -> Settings -> System ....)
1. When your back in android power off phone.
2. Go into fastboot (USB cable plugged in -> Power + Vol Down)
3. Flash twrp into recovery_ramdisk
Code:
fastboot flash recovery_ramdisk twrp-3.2.1-0.img
Code:
fastboot reboot recovery
Now In TWRP
4. Install Image -> twrp-3.2.1-0.img into eRecovery partition
5. Install Image -> magisk23_patched-ane.img into Recovery Partition
6. Reboot -> Recovery

That's it. Now you should have root access.

You can still use twrp, but you have to access it like you would access eRecovery. So from power off (coldstart) -> Hold Vol Up while plugging in the USB Cable, continue to hold Vol Up, till you get the twrp logo.

Caution: This overwrites eRecovery, this can be dangerous, as eRecovery is the only thing standing between you can a hard brick if twrp wont boot anymore. This is due to fastboot not being able to flash eRecovery. You can only flash eRecovery from twrp. This is particularly dangerous if your data partition gets corrupted, this can happen when formatting data through twrp 3.4.0 and above. When your data partition is corrupt, twrp will freeze on the loading logo, leaving you no way to flash the original eRecovery.

Note: I think you can flash the eRecovery_ramdisk.img over the normal recovery_ramdisk in case of a brick situation. Though I haven't tested that idea yet, im just planning on going that route if I run into such a scenario. The eRecovery is particularly usefull as it can recover almost any situation by using wifi to download a stock rom and full flash that entire rom.


This way is robust, no need for key combo's when restarting the device etc.


All Downloads (GDrive):
Gdrive

After the root, you might find yourself needing safetynet attest pass.
This can be achieved by:

1. Open Magisk and setup MagiskHide ( Search on XDA if you don't know how to do this )
2. Magisk Modules -> Install Riru
3. Magisk Modules -> Install from storage -> Select safetynet-fix-v2.1.0.zip
note: If PropsConfig is installed, remove it first and reboot

If you need to use Smali then it's once again kinda straight forward.
1. Copy /system/framework to sdcard (anywhere u can copy it from)
2. Copy the framework folder onto pc
3. Open SmaliPatcher.exe -> Select the framework folder -> select patch options and patch
4. Copy the created magisk module zip file onto sdcard
5. Install magisk module -> Magisk -> Modules -> Install from storage


Hope you have a smoother experience rooting this hell device then I did.

External links:

Tested custom recoveries from -Alf-
Source of rooting and flashing information by -Alf-

Credits:
@-Alf- for the magisk patched image. I only repatched his recovery_ramdisk from magisk v21 to v23
And also for the twrp recovery 3.2.1-0 GAGUGA Edition
 
Last edited:

-Alf-

Senior Member
Sep 28, 2017
1,461
469
Huawei P9 Lite
Huawei P10 Lite
And I have not found AANNYY method to rollback to 8 since then,
https://forum.xda-developers.com/t/losq-lir-lineageos-17-1-18-1-unofficial-gsi.4219291/post-85379393
eRecovery is the only thing standing between you can a hard brick if twrp wont boot anymore
there is one more thing - Service ROM aka 'full stock ROM' & dload method
your data partition gets corrupted, this can happen when formatting data through twrp.
Can happen only with TWRP 3.4.0 and above.

Regards
 

gh0stza

Member
May 30, 2021
18
0
ZA
No matter what I did, dload failed, I must have downloaded 30 roms and tried every which way with dload. Nothing worked!!!!!

dload only worked on same EMUI. So nope sorry dude dload was a no go for me. Maybe it works for someone else, which is why I mentioned it.

And yes, TWRP 3.4.0 and above. I was using a twrp(3.5.2_9-0) from official twrp repository for ANE-LX1 when I formatted my data partition. However, that's not the point.

Someone else is absolutely BOUND to fall into this trap too, and as I said that TWRP came from the official chain.

So my only intention is to warn the next guy who might just be using that version or for whatever other reason twrp doesn't start anymore. I'm just saying - BE CAREFUL
 

-Alf-

Senior Member
Sep 28, 2017
1,461
469
Huawei P9 Lite
Huawei P10 Lite
No matter what I did, dload failed, I must have downloaded 30 roms and tried every which way with dload. Nothing worked!!!!!

dload only worked on same EMUI. So nope sorry dude dload was a no go for me. Maybe it works for someone else, which is why I mentioned it.

And yes, TWRP 3.4.0 and above. I was using a twrp(3.5.2_9-0) from official twrp repository for ANE-LX1 when I formatted my data partition. However, that's not the point.

Someone else is absolutely BOUND to fall into this trap too, and as I said that TWRP came from the official chain.

So my only intention is to warn the next guy who might just be using that version or for whatever other reason twrp doesn't start anymore. I'm just saying - BE CAREFUL
this is why we have this article here: https://forum.xda-developers.com/t/recommended-and-tested-twrp-recovery.4199099/
 

gh0stza

Member
May 30, 2021
18
0
ZA
Oreo and Pie Stock & Custom ROMs:
3.2.1-0 by pretoriano80 (data decryption on Android 8 ) - on Pie use this TWRP e.g. if you want to downgrade to Oreo via HuRupdater.
https://mega.nz/#!Fgd0xa4R!1o5ejzDnkLJLG2tAZG-STtlJ4nnNCHfwwZdOlmOkrVw

Are you saying I should try to use this TWRP to use HuRUpdater to downgrade to 8?

I plan on using the HiSuite downloaded firmware ANE-LX1 8.0.0.163(C185) with HuRUpdater.

Current folder stucture:
ANE-LX1 8.0.0.163(C185)\full\update.zip
ANE-LX1 8.0.0.163(C185)\full\ANE-L01_hw_meafnaf\update_full_ANE-L01_hw_meafnaf.zip

Planned folder structure after renames:
ANE-LX1 8.0.0.163(C185)\full\update.zip
ANE-LX1 8.0.0.163(C185)\full\update_all_hw.zip
ANE-LX1 8.0.0.163(C185)\full\HuRUpdater_0.4.zip

Then flash HuRUpdater_0.4.zip in twrp 3.2.1-0 by pretoriano80 like the quoted text suggests?

Am I getting this right?

PS: The twrp I am using now -> 3.2.1-0 GAGUGA Edition (Also the one in my download hyperlink)

EDIT: I am on 9.1.0.355(C185) now. But, it is still trying to give me OTA update of the exact same build, so dunno what thats about
 
Last edited:

-Alf-

Senior Member
Sep 28, 2017
1,461
469
Huawei P9 Lite
Huawei P10 Lite
The twrp I am using now -> 3.2.1-0 GAGUGA Edition (
Read carefully bro: https://forum.xda-developers.com/t/losq-lir-lineageos-17-1-18-1-unofficial-gsi.4219291/post-85380241

You need 3 .zip files - update, hw and data
IMG_20210224_103059.png
 

gh0stza

Member
May 30, 2021
18
0
ZA
Then I have a problem.

Not one single downloaded firmware anywhere gave me 3 files. It's always just the update.zip (or update_sd.zip for dload) and the hw update.

How can HiSuite flash that firmware then? I just need to flash this 163 rom. But nothing works

***EDIT***
Know what, doesn't matter. I'm pretty fed up with this phone and how Huawei implemented this phones partitioning style and just everything.
I mean where is Odin for Huawei? And just how they withdrew support to get unlock code, limited fastboot command etc.
Just everything about huawei....

I got my ANE-LX1 to a stable root with everything I need working perfectly, so Imma call it a win and move on.

But, you've been great dude and basically almost all useful information I got either came from you ( @-Alf- ) or XDA, so thnx everyone
 
Last edited:

-Alf-

Senior Member
Sep 28, 2017
1,461
469
Huawei P9 Lite
Huawei P10 Lite
Then I have a problem.

Not one single downloaded firmware anywhere gave me 3 files. It's always just the update.zip (or update_sd.zip for dload) and the hw update.

How can HiSuite flash that firmware then? I just need to flash this 163 rom. But nothing works

***EDIT***
Know what, doesn't matter. I'm pretty fed up with this phone and how Huawei implemented this phones partitioning style and just everything.
I mean where is Odin for Huawei? And just how they withdrew support to get unlock code, limited fastboot command etc.
Just everything about huawei....

I got my ANE-LX1 to a stable root with everything I need working perfectly, so Imma call it a win and move on.

But, you've been great dude and basically almost all useful information I got either came from you ( @-Alf- ) or XDA, so thnx everyone
Try this way out...
Flash via dload
https://androidhost.ru/1lsA
and try downgrade via HiSuite.
 

gh0stza

Member
May 30, 2021
18
0
ZA
:ROFLMAO: :ROFLMAO: :ROFLMAO: dunno how to respond to that....

I'll keep it in my back pocket, when i'm bored some time this week I might try it.

Else screw it, to hell with you huawei.

PS: Still better then the LG G6, which is unrootable (short of opening it up) due to the total inablility to get unlock code.
 

khal_nayak

Senior Member
May 27, 2006
300
42
41
Sharjah
so do we run this to keep the stock eRecovery?
Install Image -> twrp-3.2.1-0.img into eRecovery partition

coz i got stuck in a situation where the phone would boot to twrp only and nothing else, somehow managed to get back to stock
 

khal_nayak

Senior Member
May 27, 2006
300
42
41
Sharjah
ok but i was trying to remove bloatware i caused the rom to bootloop and then tried factory reset from twrp and now other than twrp nothing boots, where can i get factory image from to get it back to working?

all i need is root with magisk and want to keep the stock erecovery.

if there are better custom roms with volte etc all working then im willing to try it out
 

-Alf-

Senior Member
Sep 28, 2017
1,461
469
Huawei P9 Lite
Huawei P10 Lite
tried factory reset from twrp
That was not a good idea. On Huawei phones, you can only perform a factory reset from stock recovery.
where can i get factory image from to get it back to working
Depends on your build number - model, EMUI version, region variant (Cxxx). What is your b.number?
custom roms with volte etc all working
All Treble GSI ROMs on Huawei have common bugs - no VoLTE, no offline charging, no native call recording...
 

khal_nayak

Senior Member
May 27, 2006
300
42
41
Sharjah
since now i can only boot to twrp and fastboot mode how do i know the model and region?
i bought the phone as nova3e in UAE and currently was on emui 9.1, if i can just get the erecovery back then can make it download the firmware and flash it
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    ANE-LX1
    ANE-LX1 9.1.0.390(C185E7R1P8)
    Okay, you can try eRecovery variant, or download Service ROM and flash it via dload method. This process will erase all your data ane will lock the bootloader again.
    Also you can try flash some GSI ROM to get it back to working , flash in fastboot mode.
    1
    Go: root/data/data , here you can identify applications (or use another method).
    The applications themselves are at several addresses:
    - Data/hw_init/preload/app
    - System/app
    - System/priv-app
    - Product/app

    You must restart your phone when you have finished editing.