Official LineageOS 16.0 (15.02.2021)
.401 Stock Images (C432)
Stock Recovery
Stock E-recovery
Official TWRP (3.7.0)
Official TWRP (3.4.0-1)
Modified TWRP (3.4.0)
Heavily Modified TWRP (3.4.0)
Magisk Patched Recovery (25.2)
Magisk-Delta Patched Recovery (25.2-delta)
Stock Kernel (4.9.148)
Phenix Kernel (4.9.319 by Turex)
Phenix Permissive Kernel (4.9.319 by Iceows)
Phenix Permissive Kernel (4.9.235 by Abdelhay.ali)
Phenix Enforcing and Permissive Kernel for Android 13 (4.9.319 by Abdelhay.ali)
Selinux Rules for Android 13 (by Abdelhay.ali)
Everything Else (47GB)
.401 Stock Images (C432)
Stock Recovery
Stock E-recovery
Official TWRP (3.7.0)
Official TWRP (3.4.0-1)
Modified TWRP (3.4.0)
Heavily Modified TWRP (3.4.0)
Magisk Patched Recovery (25.2)
Magisk-Delta Patched Recovery (25.2-delta)
Stock Kernel (4.9.148)
Phenix Kernel (4.9.319 by Turex)
Phenix Permissive Kernel (4.9.319 by Iceows)
Phenix Permissive Kernel (4.9.235 by Abdelhay.ali)
Phenix Enforcing and Permissive Kernel for Android 13 (4.9.319 by Abdelhay.ali)
Selinux Rules for Android 13 (by Abdelhay.ali)
Everything Else (47GB)
Special key combos:
Power
+Vol+
= Recovery Mode- While USB connected,
Power
+Vol+
= Erecovery Mode - While USB connected,
Vol-
= Fastboot - Plug USB while holding down
Vol+
+Vol-
= Download Mode Power
+Vol+
+Vol-
= Force Dload
Flashing Any GSI
Note:
Phh is "retiring". Community of builders created trebledroid initiative to keep his work alive. Don't expect same level of quality for a while.- Use vndklite variants.
- At no point you need to wipe /data or any other partition. Just do factory reset.
- If you want to backup via twrp you need to have encryption disabled.
- Almost all chromium based browsers including chrome freeze after few minute of use. That is caused by DRM not working as intended in gsis. To fix it flash DRM fix.
- Permissive kernel shouldn't be used daily. Please only use it for debugging purposes.
Prerequisites:
- ADB and Fastboot Installed (1)
- Any Arm64 AB GSI image (1) (2) (3) (4) (5)
- Google apps package (Optional) (1) (2) (3) (4)
- TWRP
- Unlocked Bootloader
- Tick "Enable OEM Unlock" from developer options
- Boot into fastboot: Hold
vol-
while usb connected and phone rebooting - Flash gsi image:
fastboot flash system
drag & drop img file to console - Flash Stock Recovery:
fastboot flash recovery_ramdisk
and drag & drop img file to console - Boot into recovery:
power
+vol+
while NOT connected to pc - Factory reset:
Factory Reset
> Typeyes
> Presspower
- Boot into system
- Tick "Enable OEM Unlock" from developer options
- Boot into fastboot: Hold
vol-
while usb connected and phone rebooting - Flash gsi image:
fastboot flash system
drag & drop img file to console - Flash Phenix Kernel (Optional):
fastboot flash kernel
and drag & drop img file to console - Flash this TWRP:
fastboot flash recovery_ramdisk
and drag & drop img file to console - Boot into recovery:
power
+vol+
while NOT connected to pc - Factory reset:
Wipe
> SwipeFactory Reset
- Resize system:
Wipe
>Advanced Wipe
> TickSystem
>Repair or Change File System
> SwipeResize File System
if it fails issue these commands from your computer:
adb shell "/sbin/e2fsck -fp /dev/block/platform/hi_mci.0/by-name/system"
adb shell "/sbin/resize2fs /dev/block/platform/hi_mci.0/by-name/system"
- Encrypt or Decrypt /Data (Optional):
Mount
> TickVendor
>adb push
drag & drop fstab file to console/vendor/etc
- Flash DRM fix (Optional): ''
- Flash NFC fix (Optional / Might not Work): ''
- Flash Gapps Zip (Optional): ''
- Boot into system:
Reboot
>System
- Tick "Enable OEM Unlock" from developer options
- Boot into fastboot: Hold
vol-
while usb connected and phone rebooting - Flash gsi image:
fastboot flash system
drag & drop img file to console - Flash one of these kernel (Optional):
fastboot flash kernel
and drag & drop img file to console - Flash this TWRP:
fastboot flash recovery_ramdisk
and drag & drop img file to console - Boot into recovery:
power
+vol+
while NOT connected to pc - Factory reset:
Wipe
> SwipeFactory Reset
- Flash this AIO fix :
Advanced
>ADB Sideload
>Swipe to Start Sideload
> Writeadb sideload
and drag & drop zip file to console - Flash Gapps Zip (Optional): ''
- Boot into system:
Reboot
>System
Flash over to erecovery:
- Boot into fastboot: Hold
vol-
while usb connected and phone rebooting - Flash one of these (1) (2) twrp images:
fastboot flash recovery_ramdisk
and drag & drop img file to console - Boot into twrp:
power
+vol+
while NOT connected to pc - Push twrp to /cache:
adb push
drag & drop img file to console/cache
- Flash twrp to erecovery:
Install
>Install Image
> Select twrp image from /cache folder > Pickerecovery_ramdisk
partition > Swipe
- Boot into fastboot: Hold
vol-
while usb connected and phone rebooting - Flash magisk patched image:
fastboot flash recovery_ramdisk
and drag & drop img file to console
- No keypress: System (Long yellow warning)
- Power & Vol+ before Yellow Warning : System with magisk (Short yellow warning)
- Vol+ on Yellow Warning : TWRP
- Boot into twrp
- Push erecovery image to /cache:
adb push
drag & drop img file to console/cache
- Flash erecovery to erecovery:
Install
>Install Image
> Select erecovery image from /cache folder > Pickerecovery_ramdisk
partition > Swipe
Keep in mind that Safetynet is deprecated and Google is encouraging developers to switch to Play Integrity API. To pass safetynet you need to have 3 checkmarks, as such you'll need to follow all 3 instructions I'm about to give you.
Disable "Spoof Pixel 5" & Enable Safetynet in phh options then reboot.
Download YASNAC from play store and check for "Evaluation Type" from result.
If it says Basic and others fail you can skip this part.
If test fails or doesn't finish do these:
Install Magisk
Enable Zygisk & Enforce denylist
Install Universal SafetyNet Fix module by kdrag0n
Now check YASNAC again. It should finish test and say Basic in evaluation type.
Download YASNAC from play store and check for "Evaluation Type" from result.
If it says Basic and others fail you can skip this part.
If test fails or doesn't finish do these:
Install Magisk
Enable Zygisk & Enforce denylist
Install Universal SafetyNet Fix module by kdrag0n
Now check YASNAC again. It should finish test and say Basic in evaluation type.
This happens because root is detected most of the time.
If your GSI has Dynamic Root, uncheck root from phh settings.
If your GSI has SU, securize from phh settings.
If you had to flash magisk because of evaluation type, tick google play and google play services in denylist.
If those didn't fix, contact GSI maintainer.
If your GSI has Dynamic Root, uncheck root from phh settings.
If your GSI has SU, securize from phh settings.
If you had to flash magisk because of evaluation type, tick google play and google play services in denylist.
If those didn't fix, contact GSI maintainer.
This happens because build fingerprint is not play certified.
Make sure you have safetynet option ticked in phh settings and do these:
Edit /data/adb/phh/secure
Add these 2 lines to bottom:
Reboot and test again.
Everytime you untick safetynet you have to edit this file again. You can also pick any other fingerprint from here should you choose to. You need both fingerprint and patch date. If you want to simulate other devices add following lines:
Make sure you have safetynet option ticked in phh settings and do these:
Edit /data/adb/phh/secure
Add these 2 lines to bottom:
resetprop_phh ro.build.fingerprint HUAWEI/ANE-LX1/HWANE:9/HUAWEIANE-L01/9.1.0.368C432:user/release-keys
resetprop_phh ro.build.version.security_patch 2020-08-01
Reboot and test again.
Everytime you untick safetynet you have to edit this file again. You can also pick any other fingerprint from here should you choose to. You need both fingerprint and patch date. If you want to simulate other devices add following lines:
resetprop_phh ro.product.brand HUAWEI
resetprop_phh ro.product.device HWANE
resetprop_phh ro.product.manufacturer HUAWEI
resetprop_phh ro.product.model ANE-LX1
resetprop_phh ro.product.name ANE-LX1
If you want to pass it you're going to have to read this wall of text. I can't shorten it.
What is Play Integrity:
Google enforces Play Inregrity once your api level is set to 33 (android 13). I currently don't have enough information about it other than apps can decide which checks to perform on your device. One of those checks is called strong integrity. We can't pass strong integrity because it requires hardware backed checks which our device lack. However you can still fool some apps that don't enforce strong integrity.
How you can fool it:
Ever since magisk retired magiskhide, some forks have been made to keep it maintained and improved. One of those forks is Magisk Delta. Before you head over to it's github and install it, you still need to install a valid CTS fingerprint. Then you can install Magisk Delta.
Steps:
Disable Spoof Pixel 5 & Enable Safetynet from phh settings if they exist.
Add these 2 lines to bottom of /data/adb/phh/secure (create if it doesnt exist) & Reboot
If you have magisk :
- Download Magisk Delta apk
- Change .apk to .zip
- Install it as magisk module
If you don't have magisk :
- Download & install Magisk Delta apk
- Patch recovery_ramdisk & flash it via fastboot
Enable Zygisk and MagiskHide from Magisk Delta App
Install this module : https://github.com/HuskyDG/safetynet-integrity-fix/releases
MAKE SURE GMS IS NOT IN HIDELIST
Reboot and test safetynet. (Feel free to link any app that tests for Play Integrity)
What is Play Integrity:
Google enforces Play Inregrity once your api level is set to 33 (android 13). I currently don't have enough information about it other than apps can decide which checks to perform on your device. One of those checks is called strong integrity. We can't pass strong integrity because it requires hardware backed checks which our device lack. However you can still fool some apps that don't enforce strong integrity.
How you can fool it:
Ever since magisk retired magiskhide, some forks have been made to keep it maintained and improved. One of those forks is Magisk Delta. Before you head over to it's github and install it, you still need to install a valid CTS fingerprint. Then you can install Magisk Delta.
Steps:
Disable Spoof Pixel 5 & Enable Safetynet from phh settings if they exist.
Add these 2 lines to bottom of /data/adb/phh/secure (create if it doesnt exist) & Reboot
resetprop_phh ro.build.fingerprint HUAWEI/ANE-LX1/HWANE:9/HUAWEIANE-L01/9.1.0.368C432:user/release-keys
resetprop_phh ro.build.version.security_patch 2020-08-01
If you have magisk :
- Download Magisk Delta apk
- Change .apk to .zip
- Install it as magisk module
If you don't have magisk :
- Download & install Magisk Delta apk
- Patch recovery_ramdisk & flash it via fastboot
Enable Zygisk and MagiskHide from Magisk Delta App
Install this module : https://github.com/HuskyDG/safetynet-integrity-fix/releases
MAKE SURE GMS IS NOT IN HIDELIST
Reboot and test safetynet. (Feel free to link any app that tests for Play Integrity)
That happens because EMUI stores it's themes and few stock apps in /data/hw_init folder. When you factory reset with stock recovery, they are preserved. But when you use twrp to factory reset they are removed. Doing factory reset once from twrp is enough to make EMUI think it's corrupted, in acuality it isn't. To fix it you can either let EMUI update from system settings or you can download this, extract hw_init folder and push folder to /data from twrp with this command :
adb push
drag & drop hw_init folder to console /data
Flashing LineageOS 16.0
Note:
Stock kernel from EMUI .300> have trouble with wifi. Use Phenix 4.9.319 or above to fix it.Prerequisites:
- ADB and Fastboot Installed (1)
- Google apps package (Pick Pie or 9.0 editions) (1) (2) (3) (4)
- LineageOS Zip (From Archive or From Mega)
- Phenix Kernel (Else you won't have wi-fi)
- TWRP (3.4.0 is needed for factory reset functionality)
- Unlocked Bootloader
- Tick "Enable OEM Unlock" from developer options
- Boot into fastboot: Hold
vol-
while usb connected and phone rebooting - Flash this TWRP:
fastboot flash recovery_ramdisk
and drag & drop img file to console - Flash Phenix Kernel (Required for Wi-Fi):
fastboot flash kernel
and drag & drop img file to console - Boot into twrp:
power
+vol+
while NOT connected to pc - Flash lineage zip:
Advanced
>ADB Sideload
>Swipe to Start Sideload
> Writeadb sideload
and drag & drop zip file to console - Factory reset:
Wipe
> SwipeFactory Reset
- Boot into Vanilla LineageOS or Keep following to flash gapps
- Encrypt or Decrypt /Data (Optional):
Mount
> TickVendor
>adb push
drag & drop fstab file to console/vendor/etc
- Flash gapps zip:
Advanced
>ADB Sideload
>Swipe to Start Sideload
> Writeadb sideload
and drag & drop zip file to console - Boot into system:
Reboot
>System
Getting Stock Firmware Files And Downgrading
Sources:
- A certain russian site (linking is prohibited)
- EMUI's System Updater (via root)
- Firmware Finder (Revived)
- HiSuite
- Huawei Update Extractor
- HuRUpdater Guide / HuRUpdater Download (For older builds)
- HwOTA8 (For Emui 8)
Firmware finder has been revived and you can use that to get your prefered cust or build.
If you need only one image not the whole build, I uploaded each one you'd typically need below.
CUST.img
DTS.img
ERECOVERY_KERNE.img
ERECOVERY_RAMDI.img
ERECOVERY_VBMET.img
ERECOVERY_VENDO.img
FASTBOOT.img
KERNEL.img
ODM.img
PRODUCT.img
RECOVERY_RAMDIS.img
RECOVERY_VBMETA.img
RECOVERY_VENDOR.img
SYSTEM.img
VBMETA.img
VENDOR.img
XLOADER.img
They are from .401 c432.
If you wiped /data once you probably won't have emui themes etc if you go back to emui. To fix that you can push hw_init folder (in data.7z) to /data. Not the contents of it, just put the folder in root of /data. It should be like this: /data/hw_init
If you need only one image not the whole build, I uploaded each one you'd typically need below.
CUST.img
DTS.img
ERECOVERY_KERNE.img
ERECOVERY_RAMDI.img
ERECOVERY_VBMET.img
ERECOVERY_VENDO.img
FASTBOOT.img
KERNEL.img
ODM.img
PRODUCT.img
RECOVERY_RAMDIS.img
RECOVERY_VBMETA.img
RECOVERY_VENDOR.img
SYSTEM.img
VBMETA.img
VENDOR.img
XLOADER.img
They are from .401 c432.
If you wiped /data once you probably won't have emui themes etc if you go back to emui. To fix that you can push hw_init folder (in data.7z) to /data. Not the contents of it, just put the folder in root of /data. It should be like this: /data/hw_init
Connect your phone to pc and open up hisuite. Check for updates and if it finds one it'll download following files update_full_base.zip, update_full_ANE-L01_hw_eu.zip and update_full_cust_ANE-L01_hw_eu.zip to your documents folder. update_full_base.zip file contains main UPDATE.APP. You can extract images from it with Huawei Update Extractor
Flash magisk patched image from quick links. After you get root in EMUI allow system updater to do its job and update. It'll ask to reboot, allow it. It will throw you back to system after reboot because recovery is not stock. Get a file manager that allows root access. Allow system updater to download again. But this time do not allow it to reboot. First one downloaded OTA, second one downloaded FullOTA. Which is better for archival purposes. After download is done go to /data/update with a root file explorer. Copy HwOUC folder to internal storage and from there to your pc. There should be 3 folders with numbers. You can find our main update_full_base.zip in one of them.
Get files of your prefered build. I recommend build .278. Extract SYSTEM.IMG from UPDATE.APP via huawei update extractor and flash it with
fastboot flash system
. Factory reset with stock recovery then flash any TWRP except for the official ones. Official TWRPs freezes when wiping /data which is what we need to do. After wiping /data boot into system. You should have aosp background with square app icons if you did correctly. Check for system updates and it should find your current build. Download and install.BOOTLOADER WILL RELOCK, DON'T DO THIS IF YOU DON't HAVE YOUR BL CODE
For this you need to have a sd card that is formated as exfat. Fat32 doesn't allow >4gb files so exfat is required. Download your prefered build fromAndroidhost.ru or mega link above. Inside the zip file you'll find a folder named dload. Extract this folder to somewhere and transfer it to your sd card. Folder structure should look like below. Hw_eu and L01/L21 will depend on your region and single/dual sim status. After this unplug your phone and shut it down. Start pressing vol- vol+ and power all at the same time. Different kind of yellow warning will appear and a screen with blue progress bar over black background will appear. If you downloaded correct variant for your phone it'll start progressing. After process is done you'll boot into stock emui with NO yellow warning. This is because your bootloader is locked. Do whatever you want at this point but remember, unlocking bootloader again will low level factory reset your phone.
-/storage/AAAA-BBBB/dload
---/update_sd
---/ANE-L01_hw_eu
---/ANE-L21_hw_eu
For this you need to have a sd card that is formated as exfat. Fat32 doesn't allow >4gb files so exfat is required. Download your prefered build from
-/storage/AAAA-BBBB/dload
---/update_sd
---/ANE-L01_hw_eu
---/ANE-L21_hw_eu
If I recall correctly there is only one way to do this. You can't dload between emui versions. You also need to be on stock emui for hisuite to function. Some people say a specific hisuite version is required but it wasn't the case for me. Plug your phone to pc, hisuite should show up beside your phone in drives section. Install it and open it. Do whatever it instructs you to function correctly. After you see your phone in app click Update button. Then click on "Earlier Versions". It'll show version 8.0.0.167 along with some warnings. Rest it pretty straightforward. Follow along and it'll return you back to emui 8. But if you're doing this to unlock your bootloader, build .167 is not enough. Exploit that dc-unlocker uses is patched in this version. So you have to roll back further. I had success with .125 build but up until .150 could work. Link to .125 build.
edit ? : Revised guide
Last edited: