yashsingh1/xdaforums huggingface dataset:
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
Non-Official Lineage 20.0 for EMUI 9 Huawei (ANE, FIG, POT, VTR, STF)

LeaOS is a project which based on LineageOS 20.0 with Andy Yan's and TrebleDroid GSI patches. I have added my personnals patches for Huawei devices : Encryption, Signal Strengh, Speed Boot, Assisted GPS, NFC, CAST/Miracast, Media App fixes, Camera HDR, SafetyNet etc..)

Changelog :

LeaOS Maarch 2024 version

Move to last Last Lineage 20.0 source (SPL Maarch 2024)

Fix Bluetooth call

Use last TrebledDroid patch

Add preset for hi6250, kirin 710 and hi3660

Add option to set the phone in mono-sim mode

LeaOS Maarch 2023 version

Move to Android r35 (SPL Maarch)

Add offline charging

Add spoof model to pass safetynet

LeaOS February 2023 version

First release

Pre-requisite :

You must have TWRP installed if you want install patch. and a phone with unlock bootloader

Installation (crypt or uncrypt)

Download the version that corresponds to your Huawei phone model here and extract img file. You can choose with ou without GoogleApps

Flash system image : fastboot flash system <drag system.img here>

Flash twrp image: fastboot flash recovery_ramdisk <drag twrp img here>

Boot into twrp: power + vol+ while NOT connected to pc

Resize system: Wipe > Advanced Wipe > System > Repair or Change File System > Resize File System > Swipe

Wipe cache, dalvik/art cache, internal storage

Wipe data

(option) Install DRM patch for EMUI 9.1 to support DRM : 8-Huawei-FixPreav-AB-v1.3-signed.zip

reboot to System and set up the phone with Lineage first start assistant.

Enjoy !!!

Source Code:

https://github.com/Iceows

ROM OS Version: Android 13

ROM Kernel: Linux Huawei 4.9.148 or Phenix 4.9.337

ROM Firmware Required: EMUI 9.1

Based On: Lineage 20.0 and TrebleDroid

Credits:

@Frax3r (Testing)

@PHH

@eremitein

@RakinTheGreat (GCam)

@TureX (Kernel)

And all the others who tested my patches and helped me improve this ROM

Support Group

Channel update
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
Screen
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] eiabea:
Thank you for releasing this ROM, gave my old P20 lite new life! Everything works as far as i can tell, only one minor annoying thing: When i unlock the phone via finger print a random widget gets highlighted on the home screen or if i am in a messaging app while unlocking it types the "="-sign into the input field
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Chrisu_Kun:
Same here. What do you think the possible solution?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] eiabea:
I started digging around in some logcat logs and found a bunch of errors/warnings related to not finding some apps due to the fact that i don't have gapps installed.

I also noticed, that the "=" sign only appears if i unlock the screen via the fingerprint reader, not when unlocking with my pin, @Chrisu_Kun can you confirm this behavior?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Frax3r:
It was a problem even back in android 10 era. I do not have a fix for it as I broke my fingerprint sensor. But I can give some insights into the issue. Here you can see wakeup function is using key number 118 which corresponds to KEYCODE_META_RIGHT. When used it unlocks the phone which means it does work and does execute. After that it writes "=" (KEYCODE_EQUALS) which is keycode 70. Totally unrelevant 2 seperate keycodes. This is strange because keycode 70 doesn't exist in /system/usr/keylayout/fingerprint.kl or /vendor/usr/keylayout/fingerprint.kl. My speculation is that keyboard apps, mainly gboard as it is bundled with aosp, translates KEYCODE_META_RIGHT into KEYCODE_EQUALS because it doesn't know what to do with that key. Keyboard apps does that regularly. For example if you want to press enter via keycodes you can use adb shell input keyevent 61 which is KEYCODE_TAB. How to be sure? Try multiple keyboard apps, gboard, swiftkey, samsung keyboard, simple keyboard, anysoftkeyboard, hacker keyboard even some lesser known keyboards. If one of them doesn't have this issue that means my speculation is correct and keyboard app translates KEYCODE_META_RIGHT. You might ask if this is the case why it doesn't happen in emui, i can't answer that honestly. As i said this is just a speculation.

edit: also could you try installing gapps? swipelibrary in gapps packages could be another factor
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] uukelele:
How do you install this? I thought Huawei disabled unlocking bootloaders. Is there another way, then?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] DadiBit:
Yes, take a look at PotatoNV (in the linux/macos crossplatfrom project some bootloaders are missing): I haven't tried using it yet, but I'm planning to.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] luc.sol:
I hope @AltairFR stay on top of the fixes on this custom rom, and thank you again for all the work you doing for us.

I havnt booted this on my p20 lite, what are known buggs, and when should we expect a patch.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Chrisu_Kun:
I may be misunderstood it but even I Install Nikgapps there is always an error/crashing when I open in my phone. Even so, how you will I remove KEYCODE_META_RIGHT?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Chrisu_Kun:
Even I unlocked it with my password. It still does the same thing
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Chrisu_Kun:
Well you expect a bugg such as this

The problem has not yet been fix. As I'm using this custom rom, i clearly say it's true
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] d0zzerr:
USB tethering is not working on Phenix 4.9.319 but works on Linux Huawei 4.9.148.

Other things just works fine.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
@TureX
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] TureX:
Hi!

Please share logs and i will take a look.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] DadiBit:
I've successfully unlocked the bootloader, installed twrp-3.7.0_9-0-anne.img and LeaOS-20.0-20230304-iceows-google-ane.img. First time doing it, but the guides had enough details for doing most of the stuff. I can share the .md file if anyone is a newbie like me.

I have gapps installed (probably doesn't matter, but it's better to specify), and while testing with both the AOSP keyboard and Gboard, I couldn't reproduce the bug, neither with the normal pin unlock, nor with the fingerprint + neither with the screen properly locked nor by "unlocking" via fingerprint before the locking timeout fired.

On the other hand, I encountered another bug: although enabled in the settings, I couldn't show the notification panel by sliding on the fingerprint reader.

PS: thanks for the great ROM, if I can help in any way I'd be happy to :)
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] DadiBit:
I've been using this ROM for a few days and I noticed a two bugs:

Audio and usb data not working. Neither in TWRP, nor in OS: might be a hardware problem, but it's strange, since I've used adb on Monday and my alarm rang Thursday 100%. It's really strange that I changed the USB port a week ago (same usb data issue) and it's back again... I'm going to do some testing

Data can't be backed up: twrp errors in createTarFork() when copying the nfc module data
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] danerrickcuba@gmail.com:
As per OP emui 9.1 is required, am on vtr-l29(EMUI 9.0), so this rom ain't gonna work?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] wugo201812:
The system partition cannot be adjusted, an error occurred （error:4）

start infinite loop

The platform-tools version problem has been solved
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] agatone:
very very very fantastic job!!!

i never see something like this (is mine first lineageOs)

the only thing not work is camera go app (ho care, the other app camera work perfect)

and a quik drain battery (maybe afwall+)

(installed the one with gapps)
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] muhammadbahaa2001:
Must I have kernel 4.9.148+ installed or must I have EMUI 9.1 installed in order to get Android 13 GSI working on Huawei?

Does it releate to kernel version or EMUI version? (I know EMUI 9.1 includes kernel 4.9.148 but I want to know which one is must).
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
Emui 9 provide kernel 4.9.148, you can use the stock kernel
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] muhammadbahaa2001:
Well, I flashed the stock kernel version 4.9.148 the phone got stuck at bootloop untill I rolled back to kernel 4.9.111.

Note: installed firmware is EMUI 9.0 not EMUI 9.1.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
Oh yes , you must have emui 9.1
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] D3vith:
Hi, does this ROM needs the phone to be decrypted? I was trying to encrypt the phone through settings>security, but it doesnt return anything. Is that last thing supossed to be that way? Thanks in advance.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] craigsoup:
Ok, so I got this rom up and running but by pure luck I think.

LeaOS - Lineage 20.0 seem to run just fine. Not tested all things, but it runs stable,

but it does seem a bit slugish (too used to the my new oneplus 8T)

I downgraded the firmware to be able to get a unlock code for the bootloader using (dc-unlocker not free).

I got the latest firmware I could find installed (P20 Lite Anne-L21 9.1.0.355)

Extracted the recovery_ramdisk image from official firmware (with HuaweiUpdateExtractor_0.9.9.5)

In HuaweiUpdateExtractor, remember to uncheck all verify options in the settings if the program won't open

the update.app file found in the stock firmware. The bootloader and recovery_ramdisk are the same thing?

Got the twrp-3.7.0_9-0-anne, SHRP_recovery_anne_yahia-4-12-2022 (Sky Hawk Recovery), and Magisk-v26.1 ready.

TWRP only show a 9.0 version - is it compatible with version 9.1?

TWRP did not show any option to flash ramdisk image to erecovery!! SHRP does so I dropped TWRP.

As it sits now I have the phone running with unpatched bootloader (stock ramdisk) flashed to e-recovery.

And Sky Hawk Recovery flashed to normal recovery. I can't get into android with root access.

On first boot the stock bootloader flagged an error and wanted me to low-level format the phone,

but after a reboot it loaded the custom rom normally!

I tried to run Magisk and get a patched bootloader installed too, but when I tried to boot the phone

it would be very slow and when it got into android it would stay there for a few seconds and

automatically reboot.

I was actually at some point able to get the phone to start and I had root access, but it would have major

issues with startup. It would just hang and take forever to boot. Not sure how I managed that...

CPU-z info:

buildID: TQ3A.230605.012

kernel: 4.9.148
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] craigsoup:
Various key combination to access the recovery system (P20 lite).

Just adding some findings on how my phone now operates:

No usb attached: (I think it behaves different with usb connected)

boot custom recovery (TWRP, SHRP etc.) -- Phone OFF->hold V+ & Power (not releasing any buttons)

boot stock (e)recovery -- Phone OFF->hold V+ & Power (release power after screen wakes)

normal boot (no root) -- Phone OFF->Power...

fastboot -- Phone OFF->Connect usb to PC->hold V- & Power
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] -Alf-:
Of course not.

Use recommended

TWRP

As for magisk root, look

here
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] craigsoup:
So I found the recovery_ramdisk image, but no trace of a "bootloader" image (that is supposed to be patched).

And "of course not"? Please, I'm an amateur here, don't be rude...

Thank you for the links! Those were really helpful🙏
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] rcky844:
Here is some feedback and observations I've made when using Android 13 on my Huawei P20 Lite.

LeaOS

The problem with this OS is that it doesn't auto detect your device model, causing it to enable features not available for different variants. For example, my P20 Lite is a ANE-LX2 which doesn't have support for NFC. This can be solved by either spiting different models or some other method that I can't think of. NFC currently constantly crashes in the background.

Another thing I observed is that Bluetooth audio is slightly broken. It crashes every so often which makes it nearly unusable. I forgot to capture logs but I think it isn't hard to figure out.

LineageOS TrebleDroid

This is more stable for my device., but suspend seems to broken. Sometimes Spotify doesn't work properly when dozing and Bluetooth audio cuts in and out every so often. It is also smoother than LeaOS. Pausing music when using Blueooth headsets is completely impossible as it complains about not sending any data.

I think I might do my own builds later, but I currently don't have the time to do so. If the author wants testing and building help, my i9 13th Gen rig with me in summer holiday can provide some help. :D
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] well83:
Hi. I want to try this rom. Is there working twrp for huawei vtr emui9.1?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
Yes..but to try this rom..twrp is not necesserary
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] well83:
Thanks for your reply. But for installing original huawei camera or magisk i think i need twrp. If you have a link. Could you please share it.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] well83:
Hi. I tried your rom for vtr p10 but it gives me sparse flash write failure. Seems too big

Edit

Without gapps it's flashing but it's unusable without this patch for screen not working on sides https://github.com/Coconutat/GSI_Generic_Fix_Magisk_Module_For_Huawei_P10/releases

so it's always twrp issue
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] baxxx2:
is any version of this stable?

I get anroid app media stopped working crashes all times
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] smith.burns:
Unfortunately, my device is unable to make and receive phone calls using the preinstalled dialer. Occasionally, I can make the callee ring but sometimes telephoning just fails completely and the network indicator on my devices switches to the symbol that indicates that there's no reception while the dialer attempts to connect. If the callee answers the phone, no sound is transmitted and after a few seconds the call is ended.

Spoiler content hidden.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] sadiqsalau:
Thanks for this rom sir, I've flashed it successfully on my Huawei Y9 2018. I have also created a repository with guide on how to resize the system partition. https://github.com/sadiqsalau/android-device-huawei-y9-2018
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] frituurvet:
Something's confusing me in the instructions where it says to wipe data

See here an explanation why wiping data from twrp can break it:

https://xdaforums.com/t/stock-rom-8...e-c675-unbrick-lld-al10.3813875/post-87666709

So far I've managed to unlock the bootloader and I can just flash whatever through fastboot but it ends up not being able to mount /data, not booting at all, constantly booting into recovery... leaOS oughta work somehow but i'm starting to think it's a dark art ;)

UPDATE: not using TWRP at all and simply doing this makes it boot:

(...after restoring to emui 9.1...)

fastboot flash system LeaOS-20.0-20230710-iceows-ane.img

fastboot reboot recovery
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] wax_77:
Hello,

what are images inside LeaOS-OSS folder?

Thank you
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Frax3r:
It's a full rom. Any and all roms you saw for this device so far was either a gsi or a rom that heavily relies on proprietary huawei stuff. OSS roms by design aims to replace most -if not all- proprietary stuff with open sourced, reproducible blobs. I tested an android 11 oss build a while back then it got abandoned until android 13 release. It got bumped to android 13 but left unfinished with mostly broken stuff. Iceows picked up where og devs left off. Installation of it is kinda different so I'd rather not get into details until iceows decides to publish it publicly. In the last build almost everything is working but that being said it's not polished enough for daily usage as there is a heavy flickering issue.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] KimS1989:
Hi, Thank you for this Guide,

this has been my first try to play around with smartphone software, and after screwing up along the way with downgrading, unlocking bootloader and flashing twrp on my ane, Ive managed to get LeaOs working as per your guide. Well after resetting to factory, after flashing system that is, since it looped in and out of recovery otherwise.

Ive read some comments about having issues with fingerprint unlocking, but I dont seem to find the option to turn that feature on. Any advice what I might be overlooking?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Fatnessguru:
"Download the version that corresponds to your Huawei phone model here and extract img file. You can choose with ou without GoogleApps"

This might be a dumb question, but how do I know which version cortresponds with my phone?

P20 Lite, EMUI 9.1.0, ANE-LX1

Ist it the ending of the file name?

fig.img, ane.img, stf.img etc?

So in my case ane.img?

Thanks!
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
yes use ane.img for p 20 lite
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Fatnessguru:
Great, thanks. I just learned, I need to unlock the bootloader to install TWRP. And apparently, I need to rololback to EMUI8 first.

Oh boy.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
No my gsi work on emui9
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Fatnessguru:
Can you elaborate? I don't want to try anything before I am sure.

I can't get the bootloader unlock code from huawei anymore, so I read that I should use dc-unlocker.

On the DC unlocker side it says:

"

WARNING:

If your phone runs Android 8 or later with latest security patch - then this service won't work"

Am I missing something? Another tool maybe?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Fatnessguru:
I finally got it running, thanks to Relected. My mistake was the incorrect flashing order.

I always flashed TWRP first because I thought it is a prerequisite. But you need to flash the ROM, then wipe with stock recovery, then flash twrp.

I have an issue though, I can't propperly use my google account.

I can use the google apps, but I can't connect the google accounts to other apps (whatsapp, for example)

It won't even let my synch my contacts.

Do I need to relock the bootloader for this?

Or reactivate FRP? I don't find the "Lock OEM" function in the developer options anymore.

Thanks
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] -Alf-:
Strongly not recommended :)

Probably your firmware is incomplete (some parts from Vendor, Cust, etc. are missing).
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Fatnessguru:
So, best to reflash the whole thing, I guess?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] -Alf-:
I would definitely do it. You have had a problem with the FW from the beginning, that's why hcu-client could not recognize your phone, imo.

Use dload method & full Stock FW. (it will lock your bootloader).
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Fatnessguru:
Thanks, will do. I did that before though.

I even updated with hisuite to the latest Version.

Any additional steps i can take to be extra clean?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] -Alf-:
no, just install the full ROM. But in the right way.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Fatnessguru:
Sadly, same result. I realised, that it not even registers the SIM correctly.

I'll give it one more try after redownloading the Rom. If that won't work, I give up and use it as a webcam
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dmcgee4204:
This ROM is absolutely disgusting so clean, Too good thanks for saving my phone also i wiped my EMUI firmware couldn't reflash kept getting error if i tried to restore because of unlocked bootloader. After about 25 attempts i finally was able to install and get play protect running (I dont think i formatted phone properly before install) Thanks alot for working on this and it means alot to users like me if you can drop a crypto donation link i will donate pretty often.(this is much better than lineage OS 16 which i was running) Thanks again if you need someone to Test or help with debugging issues or otherwise just let me know!.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dmcgee4204:
fixed
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] AltairFR:
Add the APN manually
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dmcgee4204:
Sorry wiped cache partition and then updated the APN and it was fixed. Once again thanks for the rom if other person who was having sim issues needs help you can message me i used sim switcher app and modified apn directly then wiped cache.

Also for anyone who wants to keep the e recovery stock you can boot into the two seperate ram disk images through fast boot mode (plug into pc holding volume down) then unplug from pc and by clicking volume up and power or a combination of all three buttons a menu will appear Fastboot Options. its random idk why but allows you to get into stock boot loader and TWRP if you dont want to go through rooting process but still want to edit system files.

Thanks again AltairFR ill be keeping up to date with any work you do next!
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] Brayan Jh:
Is there a rom dedicated to gaming for Huawei P20 lite?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dominoforever67:
Hi,

I want to install this ROM on my P20 lite but when trying I have a message, invalid zip file. I tried to install it with file manager on TWRP but same problem.

I used this file: LeaOS-20.0-20230331-iceows-ane.img.xz

What is the problem?

Thank you.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] -Alf-:
Follow the instructions in OP:
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dominoforever67:
Ok I don't need to use TWRP to flash my phone?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dominoforever67:
I cannot boot into bootloader, my phone start with TWRP. How to fix it?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] -Alf-:
Turn off, hold Vol Down and plug the cable.
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dominoforever67:
I have tried but going to TWRP...
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] -Alf-:
Strange... Try it with the via ADB, run command:

ADB reboot bootloader
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dominoforever67:
It's still the same... what can I do?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dominoforever67:
I got it, the problem is my cable.

I followed these steps:

Flash system image : fastboot flash system <drag system.img here>

Flash twrp image: fastboot flash recovery_ramdisk <drag twrp img here>

Boot into twrp: power + vol+ while NOT connected to pc

Resize system: Wipe > Advanced Wipe > System > Repair or Change File System > Resize File System > Swipe

Wipe cache, dalvik/art cache, internal storage

Wipe data

and then what should I do, install gapps?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] frituurvet:
I'd like to dirty flash LeaOS-20.0-20231030-iceows-ane.img over LeaOS-20.0-20230710-iceows-ane.img and keep data intact. It oughta be fine, no?

Flashing's the theme, do you know what I mean?
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] dominoforever67:
How to boot to system after installing LeaOS? My phone boot on TWRP only...
[Huawei P20 Lite ROMs, Kernels, Recoveries, & Other] frituurvet:
I had the same problem. Omitting the recovery altogether fixed it for me but ofc now I can't enter TWRP (it boots to charge mode or simply turns off).