My HowTos for the ASUS Zenfone 8

 Last Update: 12.11.2025/bs

(see also the News section)


Contents


  1. My HowTos for the ASUS Zenfone 8
    1. Contents
    2. Introduction
    3. News
    4. History
    5. Instructions to compile the OmniROM for the ASUS Zenfone 8
    6. Instructions to compile other Custom ROMs for the ASUS Zenfone 8
    7. Instructions to compile TWRP for the ASUS Zenfone 8 
    8. Instructions to compile OrangeFox for the ASUS Zenfone 8
    9. Instructions to compile a recovery for LineageOS 21.x or newer running on the ASUS Zenfone 8
    10. Trouble Shooting Guides for compiling OS image or recoveries
    11. Misc
      1. How to compile the OmniROM for the ASUS Zenfone 8
      2. How to compile other CustomROMs for the ASUS Zenfone 8
      3. How to compile the OmniROM 12 for the ASUS Zenfone 8
      4. How to compile the OmniROM 13 for the ASUS Zenfone 8
      5. How to compile TWRP for the ASUS Zenfone 8
      6. How to compile the image for TWRP 3.7.0.12-1 w/ the bootctl binary
      7. How to re-install the Android OS from ASUS on the ASUS Zenfone 8
      8. How to use TWRP if LineageOS 20.x is installed
      9. ASUS Zenfone 8 Firmware Download
      10. How to compile the OmniROM 14 for the ASUS Zenfone 8
      11. Some hints for repo sync troubleshooting
      12. Some hints for fixing errors building an Custom ROM Android image
      13. Infos for building an Android 14 based Custom ROM image in Q1 2024 or later
      14. How to boot the ASUS Zenfone 8 into the bootloader using the physical buttons
      15. How to create a TWRP image for LineageOS based ROMs using a script
      16. How to compile the OrangeFox Recovery for the ASUS Zenfone 8
      17. How to compile the OmniROM 15 for the ASUS Zenfone 8
      18. TWRP images for ASUS Zenfone 8 with /e/
      19. Temporary fix for using the Google PlayStore in the OmniROM with_MicroG
      20. Compiling /e/ for the ASUS Zenfone 8 using the docker image
      21. How to compile LineageOS 22.x for the ASUS Zenfone 8
      22. How to compile the OmniROM 16 for the ASUS Zenfone 8
      23. How to create a TWRP recovery image for the ASUS Zenfone 8 running a LineageOS 22.x based OS
      24. How to use the OrangeFox addons when the phone is booted from the OrangeFox recovery image file
      25. How to compile /e/ based on Android 15 for the ASUS Zenfone 8
      26. How to compile the official LineageOS 22.2 for the ASUS Zenfone 8
      27. How to compile the crDroid CustomROM for the ASUS Zenfone 8
      28. How to compile the evolutionX Custom ROM for the ASUS Zenfone 8
      29. How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU
      30. How to create a OrangeFox Recovery using the OrangeFox Recovery Builder 2024
      31. How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024
      32. How to compile LMODroid 6.x for the ASUS Zenfone 8
      33. How to create an LMODroid 6.x image with MicroG
      34. How to compile the iodeOS 4.x for the ASUS Zenfone 8
      35. How to compile the iodeOS 6.x for the ASUS Zenfone 8
    12. Links
      1. Files mentioned in the HowTos
      2. Other Android related files
      3. Links for the ASUS Zenfone 8
      4. Distributions for the ASUS Zenfone 8
  

Introduction


On this page I mirror my HowTos related to the ASUS Zenfone 8 which I published elsewhere (for example in the XDA Forums). The page also contains some HowTos I have not (yet) published elsewhere.

The general HowTos for Android are available here: http://bnsmb.de/My_HowTos_for_Android.html.


Please note that all instructions for the PC in the HowTos apply to the Linux OS.

There is also a section with links to other useful URLs for using or developing Android at the end of this page.

Some of the files mentioned in this HowTos can also be found in my repositories on GitHub: https://github.com/bnsmb

The list of Magisk Modules and the documentation for the Magisk Modules can be found here: Magisk_Modules

 


News


News



Old news
none



----



Back to my home page


History

 
ChangeLog


12.11.2025

initial release



---
 

Instructions to compile the OmniROM for the ASUS Zenfone 8




Instructions to compile other Custom ROMs for the ASUS Zenfone 8




Instructions to compile TWRP for the ASUS Zenfone 8 




Instructions to compile OrangeFox for the ASUS Zenfone 8




Instructions to compile a recovery for LineageOS 21.x or newer running on the ASUS Zenfone 8




Trouble Shooting Guides for compiling OS image or recoveries




Misc






How to compile the OmniROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-omnrom-for-the-asus-zenfone-8.4751666/


How to compile the OmniROM for the ASUS Zenfone 8

Here you will find links to the sections with instructions on how to compile the different versions of the OmniROM for the ASUS Zenfone 8:


HowTos to compile the OmniROM for the ASUS Zenfone 8:

OmniROM 12
How to compile the OmniROM 12 for the ASUS Zenfone 8
OmniROM 13 How to compile the OmniROM 13 for the ASUS Zenfone 8
OmniROM 14
How to compile the OmniROM 14 for the ASUS Zenfone 8
OmniROM 15
How to compile the OmniROM 15 for the ASUS Zenfone 8
OmniROM 16
How to compile the OmniROM 16 for the ASUS Zenfone 8

see How to compile other CustomROMs for the ASUS Zenfone 8 for instructions to compile other Custom ROMs for the ASUS Zenfone 8.


History of this entry

24.07.2025

initial release

28.07.2025

added links to the HowTos to create other CustomROMs for the ASUS Zenfone 8

01.08.2025

added the link to the instructions to compile the official LineageOS 22.2 for the ASUS Zenfone 8

03.08.2025

added the link to the instructions to compile crDroid for the ASUS Zenfone 8

04.08.2025

added the links to instructions to create the recoveries for the ASUS Zenfone 8
added  the link to the instructions to compile evolutionX for the ASUS Zenfone 8

05.08.2025

moved the instructions to compile other CustomROMs to a separate section


 

How to compile other CustomROMs for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-other-customroms-for-the-asus-zenfone-8.4753652/


How to compile other CustomROMs for the ASUS Zenfone 8

This section contains links to instructions to compile various Custom ROMs and Recovery images for the ASUS Zenfone 8.

Note that the links to the instructions to compile the OmniROM for the ASUS Zenfone 8 can be found here: How to compile the OmniROM for the ASUS Zenfone 8


HowTos to compile other custom ROMs for the ASUS Zenfone 8 are :

CustomROM
based on
HowTo
official supported?
Comment
LineageOS 22.2 (unofficial, Android 15)

How to compile LineageOS 22.x for the ASUS Zenfone 8
no

LineageOS 22.2 (official, Android 15)

How to compile the official LineageOS 22.2 for the ASUS Zenfone 8 yes

/e/ (Android 13)
LineageOS 20.x
Compiling /e/ for the ASUS Zenfone 8 using the docker image  
yes (community), but outdated now

/e/ (Android 15) LineageOS 22.x How to compile /e/ based on Android 15 for the ASUS Zenfone 8
yes (community)
crDroid 11.7 (Android 15)
LineageOS 22.x How to compile the crDroid CustomROM for the ASUS Zenfone 8 
no

evolutionX 10.7 (Android 15)
LineageOS 22.x How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 no

LMODroid 6.2 (Android 15)
LineageOS 22.x LMODroid 6.x for the ASUS Zenfone 8
yes

iodeOS 4.2 (Android 13)
LineageOS 20.x
How to compile the iodeOS 4.x for the ASUS Zenfone 8 no

iodeOS 6.x (Android 15)
LineageOS 22.x
How to compile the iodeOS 6.x for the ASUS Zenfone 8 no

       


Instructions to compile the TWRP recovery and other recoveries for the ASUS Zenfone 8:

Recovery
HowTo
official
supported?
Comment
TWRP 
How to compile TWRP for the ASUS Zenfone8 yes
This recovery can be used if either OmniROM (any version), LineageOS 19.x or older, or the original Android from ASUS is installed on the phone




OrangeFox
How to compile the OrangeFox Recovery for the ASUS Zenfone 8 no
OrangeFox is a recovery based on TWRP 

This recovery can be used if either OmniROM (any version), LineageOS 19.x or older, or the original Android from ASUS is installed on the phone




TWRP
How to use TWRP if LineageOS 20.x is installed 
How to create a TWRP image for LineageOS based ROMs using a script  
no
This recovery can be used if Lineage 20.x, Lineage 21.x or any Custom ROM based on these LineageOS versions is installed.

Note that it's necessary to create a unique recovery image for each LineageOS version





OrangeFox
How to create a TWRP recovery image for LineageOS 22.x   no
This recovery can be used if Lineage 22.x or any Custom ROM based on this LineageOS version is installed.

Note that it's necessary to create a unique recovery image for each LineageOS version



  




A OrangeFox based recovery for any LineageOS based Custom ROMs on the ASUS Zenfone 8 can be build using the workflows in the repository

https://github.com/bnsmb/OrangeFox-Recovery-Builder-2024

Please check the readme of that repository for instructions to create the recovery.

Note that the workflows on GitHub run on a virtual machine GitHub on a server -- it's not necessary to install or compile anything on your local machine to create a recovery using these workflows.


How to build a Custom ROM with GAPPS for instructions to add the Google Apps (GAPPS) to an OS image

see How to build a Custom ROM with MicroG for instructions to add MicroG to an OS image


see How to compile a LineageOS based Custom ROM for a not official supported phone for general instructions to build an LineageOS based Custom ROM for a not official supported phone




History of this entry


12.11.2025

added the link to the instructions to compile iodeOS 4.2
added the link to the instructions to compile iodeOS 6.x
added the link to the generell instructions to build a LineageOS based Custom ROM for not supported phones


05.10.2025

added the link to the instructions to compile LMODroid 6.2
added the links to the HowTos for adding GAPPS or MicroG to an OS image


05.08.2025

initial release






How to compile the OmniROM 12 for the ASUS Zenfone 8


URL:  https://xdaforums.com/t/how-to-compile-the-omnirom-for-the-asus-zenfone-8.4461525/


How to compile the OmniROM 12 for the ASUS Zenfone 8




This HowTo is about compiling the OmniROM 12 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile other versions of the OmniROM for the ASUS Zenfone 8.



Compiling the CustomROM OmniROM from within Linux is a very simple and straight forward process -- the developer for the OmniROM did a really amazing good job setting up the build environment for the OmniROM.

But some information are missing in the instructions (at least I did not found them ...)

Therefor I document here what I did to compile the OmniROM for the ASUS Zenfone 8 on my Linux notebook:

First install the necessary tool called "repo" to maintain the repositories for the OmniROM ; see here https://gerrit.googlesource.com/git-repo/

Next create a new directory on your PC; switch to that directory, and initialize the necessary repositories like described in the section "Getting Started" here: https://github.com/omnirom/android :


Note [29.07.2022]:

The repositories for the branch android-12.0 are somehow outdated with the security patch level from February 2022 . To get the code with the security patch level from June 2022 use the repositories for the branch android-12.1.

repo init -u https://github.com/omnirom/android.git -b android-12.1

Then to sync up:

repo sync


Be aware that the repositories need about 140 GB disk space so this will take a while.

Please note that I did not install any additional tool to compile the OmniROM - everything necessary was installed by synching the repositories.


When the download is finished you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories. This should be done in the file .repo/local_manifests/local_manifest.xml . For the ASUS Zenfone 8 the file should look like this:

[xtrnaw7@t15g /data/develop/android/OmniROM]$ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
<remote name="DonkeyCoyote"
fetch="https://github.com/DonkeyCoyote" />

<project path="device/asus/zenfone8" name="android_device_asus_zenfone8" remote="omnirom" revision="android-12.0" />
<project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-12.1" />
</manifest>


After updating the file local_manifest.xml do another

repo sync

to sync the added repositories. This time the download will be faster because only the two additional repos will be downloaded.

Now you can start the build with these commands:

. build/envsetup.sh

brunch omni_zenfone8-user

in the directory with the downloaded repositories (use the command "breakfast" instead of "brunch" to see other possible targets)

Note that the first time the compile process will take 4 hours or more. And keep in mind that the compile process will need additional 140 GB for the temporary output files.


If everything is fine there will be a ZIP file with your own CustomROM image in the directory ./out/target/product/zenfone8/ when the compile script is done, e.g:

[xtrnaw7@t15g /data/develop/android/OmniROM]$ ls -ltr out/target/product/zenfone8/omni-12-20220621-zenfone8-HOMEMADE.zip
 -rw-rw-r--. 25 xtrnaw7 xtrnaw7 1253703465 Jun 25 10:03 out/target/product/zenfone8/omni-12-20220621-zenfone8-HOMEMADE.zip
[xtrnaw7@t15g /data/develop/android/OmniROM]$


That image can now be installed on the Zenfone 8 using the LineageOS Recovery or TWRP.


Update 29.09.2022 /bs

There seems to be a bug or feature in the scripts to compile OmniROM:

Old versions of the ZIP file with the image in the output directory will always be overwritten or replaced with the current image, e.g.:


[ OmniRomDev - xtrnaw7@t15g /data/develop/android/test ] $ ls -l  /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220*zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220728-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220729-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220804-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220809-zenfone8-HOMEMADE.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220810-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220820-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220828-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220904-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220911-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220918-zenfone8-MICROG.zip
-rw-rw-r--. 20 xtrnaw7 xtrnaw7 1256445293 Sep 27 18:12 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220927-zenfone8-MICROG.zip
[ OmniRomDev - xtrnaw7@t15g /data/develop/android/test ] $

[ OmniRomDev - xtrnaw7@t15g /data/develop/android/test ] $ cksum /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220*zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220728-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220729-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220804-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220809-zenfone8-HOMEMADE.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220810-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220820-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220828-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220904-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220911-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220918-zenfone8-MICROG.zip
592627598 1256445293 /data/develop/android/OmniROM/out/target/product/zenfone8/omni-12-20220927-zenfone8-MICROG.zip
[ OmniRomDev - xtrnaw7@t15g /data/develop/android/test ]




Update 08.02.2024

see Some hints for repo sync troubleshooting for how to fix common errors executing repo sync.

see Some hints for fixing errros building an Custom ROM Android image for how to fix some common errors while creating the image


Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image


 
How to create an OmniROM image with MicroG
How to create an OmniROM image with MicroG

To create an OmniROM image with MicroG these additional steps are neccesarry:

Add the repo with the prebuild MicroG apks, android_prebuilts_prebuiltapks, to your local_manifests.xml file, e.g:

[xtrnaw7@t15g /data/develop/android/OmniROM]$ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="DonkeyCoyote"
fetch="https://github.com/DonkeyCoyote" />
<project path="device/asus/zenfone8" name="android_device_asus_zenfone8" remote="omnirom" revision="android-12.0" />
<project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-12.1" />
<project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-12.0" />
</manifest>
[xtrnaw7@t15g /data/develop/android/OmniROM]$



Do another repo sync to download the repository for MicroG:

repo sync


and create the CustomROM using these instructions:

export ROM_BUILDTYPE=MICROG

brunch omni_zenfone8-user



This creates an OmniROM Image with MicroG already installed, e.g:

[xtrnaw7@t15g /data/develop/android/OmniROM]$ ls -ltr out/target/product/zenfone8/omni-12-20220621-zenfone8-MICROG.zip
-rw-rw-r--. 25 xtrnaw7 xtrnaw7 1253703465 Jun 25 10:03 out/target/product/zenfone8/omni-12-20220621-zenfone8-MICROG.zip
[xtrnaw7@t15g /data/develop/android/OmniROM]$





How to compile the OmniROM 13 for the ASUS Zenfone 8


URL:  https://xdaforums.com/t/how-to-compile-the-omnirom-13-for-the-android-zenfone-8.4518733/


How to compile the OmniROM 13 for the ASUS Zenfone 8




This Howto is about compiling the OmniROM 13 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile the other versions of the OmniROM for the ASUS Zenfone 8.



Update 08.11.2024 /bs

Two repositories necessary to compile OmniROM 13 are now renamed, therefor to sync the repositories please update the XML file:


[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_13.0/.repo/manifests ] $ diff omni-aosp.xml omni-aosp.xml.org
38c38
<     <project path="frameworks/base" name="android_frameworks_base_old" remote="omnirom" revision="android-13.0" />
---
>     <project path="frameworks/base" name="android_frameworks_base" remote="omnirom" revision="android-13.0" />
58c58
<     <project path="system/core" name="android_system_core_old" remote="omnirom" revision="android-13.0" />
---
>     <project path="system/core" name="android_system_core" remote="omnirom" revision="android-13.0" />
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_13.0/.repo/manifests ] $



Compiling the CustomROM OmniROM 13 from within Linux is again a very simple and straight forward process -- the developer for the OmniROM did once again a really amazing good job setting up the build environment for the OmniROM 13.

Notes:

As of 22.01.2023 there is an additional repository required for compiling OmniROM 13 -- see below for details. I also added some more details at the end of this post.

This HowTo is about how to compile the OmniROM 13 for the ASUS Zenfone 8 -- see How to compile the OmniROM for the ASUS Zenfone 8 for how to compile the OmniROM 12 for the ASUS Zenfone 8.

Most (but not all) of the necessarry steps to sync the repositories are described in the section "Getting Started" here: https://github.com/omnirom/android.


Prerequisites

Some of the repositories for OmniROM 13 are on https://gitlab.com and the access to these repositories for the repository sync is done via ssh. Therefor to sync these repositories a user account on gitlab.com with configured public ssh key is required. The user account on gitlab.com is free of charge and the public ssh key can be uploaded into the user profile on gitlab.com (see here: https://docs.gitlab.com/ee/user/ssh.html)

The repositories on http://github.com are currently accessed via https but that might change in the future. Therefor it's recommended to create a user on github.com and add the ssh public key to the profile of that user also.

Note:

To check how the access to the repositories is configured use this command:

xtrnaw7@t15g /data/develop/android/OmniROM_13.0/.repo]$ grep fetch $( find . -name "*xml"  )
./local_manifests/local_manifest.xml:     fetch="https://github.com/DonkeyCoyote" />
./manifests/omni-aosp.xml:           fetch="https://github.com/" />
./manifests/omni-aosp.xml:           fetch="ssh://git@gitlab.com/omnirom" />
./manifests/omni-aosp.xml:           fetch="https://github.com/omnirom"
./manifests/omni-caf.xml:           fetch="https://github.com/" />
./manifests/omni-caf.xml:           fetch="https://github.com/omnirom"
./manifests/omni-caf.xml:           fetch="https://git.codelinaro.org/clo/la"
./manifests/omni-private.xml:           fetch="ssh://git@github.com/omnirom"
./manifests/default.xml:           fetch="https://android.googlesource.com"
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0/.repo]$


The tool repo is required to maintain the repositories for the OmniROM 13; you can download the tool "repo" from https://gerrit.googlesource.com/git-repo

It's not necessary to install additional tools for creating an OmniROM image -- all necessary tools to create the image are in the repositories for the OmniROM 13.



Creating the local copies of the repositories for the OmniROM 13

To create a local copy of the repositories for OmniROM 13 these steps are required:


First create a new directory for the repositories and change the working directory to the new directory, e.g.:

mkdir /data/develop/android/OmniROM_13.0

cd /data/develop/android/OmniROM_13.0


Init the local repositories using the command:

repo init -u https://github.com/omnirom/android.git -b android-13.0

Note that the command repo init only creates a hidden directory called .repo.


Next do the initial sync of the repositories using the command:

repo sync


Be aware that the repositories need about 160 GB disk space so this will take a while.


The initial repository sync will download all repositories necessary to create the OmniROM image except the hardware dependent repositories (these repos are different for the various phone models).

Therefor you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories after the download finished.

This should be done in the file .repo/local_manifests/local_manifest.xml (if the directory .repo/local_manifests does not exist create it).

For the ASUS Zenfone 8 the file should look like this:

[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
<remote name="DonkeyCoyote"
fetch="https://github.com/DonkeyCoyote" />

<project path="device/asus/zenfone8" name="android_device_asus_zenfone8" remote="omnirom" revision="android-13.0" />
<project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-13.0" />
<project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-13.0" />
<project path="vendor/images/asus" name="android_vendor_images_asus" remote="gitlab" revision="android-13.0" />
</manifest>
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$



Note:

The repository android_prebuilts_prebuiltapks is only necessary for OmniROM images that should include the MicroG packages.

Update 22.01.2023

The repository android_vendor_images_asus is now also required; currently this repository only contains the ASUS Galery.
I also added some more details at the end of this post.


After updating the file local_manifest.xml do another

repo sync


to sync the added repositories. This time the download will be faster because only the two (or three) additional repos will be downloaded.


Now you can start the build with these commands:

# optional:
#
# to create an OmniROM image with MicroG packages set the environment variable ROM_BUILDTYPE to MICROG before starting the build
#
# to create an OmniROM image with GAPPS packages set the environment variable ROM_BUILDTYPE to GAPPS before starting the build
#(that will only work if the repositories for the GAPPS are configured, of course)
#
export ROM_BUILDTYPE=MICROG

. build/envsetup.sh

brunch omni_zenfone8-user



in the directory with the downloaded repositories (use the command "breakast" instead of "brunch" to see other possible targets)

Note that the first time the compile process will take 4 hours or more. And keep in mind that the compile process will need additional 140 GB for the temporary output files.


If everything is fine there will be a ZIP file with your own CustomROM image in the directory ./out/target/product/zenfone8/ when the compile script is done, e.g. for images with the MicroG packages:

[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$ ls -l out/target/product/zenfone8/omni-13-2022*-zenfone8-*.zip
-rw-rw-r--. 3 xtrnaw7 xtrnaw7 1258920226 Nov 14 11:55 out/target/product/zenfone8/omni-13-202211141148-zenfone8-MICROG.zip
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$



The image can now be installed on the ASUS Zenfone 8 using the LineageOS Recovery or TWRP.


Notes


Be aware that each new ROM image created with brunch will overwrite the existing ROM images (even if the name of the image is different), e.g.

[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$ ls -li out/target/product/zenfone8/omni-13-2022*-zenfone8-*.zip
77928215 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1258920226 Nov 14 11:55 out/target/product/zenfone8/omni-13-202211131612-zenfone8-MICROG.zip
77928215 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1258920226 Nov 14 11:55 out/target/product/zenfone8/omni-13-202211141148-zenfone8-MICROG.zip
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$

[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$ cksum out/target/product/zenfone8/omni-13-2022*-zenfone8-*.zip
2429251380 1258920226 out/target/product/zenfone8/omni-13-202211131612-zenfone8-MICROG.zip
2429251380 1258920226 out/target/product/zenfone8/omni-13-202211141148-zenfone8-MICROG.zip
[xtrnaw7@t15g /data/develop/android/OmniROM_13.0]$


Therefor you should copy the zip file with the new image to a new directory before building new image



For OS images that should be used on the phone for daily use I strongly recommend to create your own certificates for the OS.

In the OmniROM development directory tree the necessary files, platform.pk8 and platform.x509.pem, are in the directory

./build/make/target/product/security

in your build tree for the CustomROM, e.g.

[xtrnaw7@t15g /data/develop/android/OmniROM]$ ls -l ./build/make/target/product/security/platform.* -rw-------. 1 xtrnaw7 xtrnaw7 1219 Jun 25 09:39 ./build/make/target/product/security/platform.pk8 -rw-rw-r--. 1 xtrnaw7 xtrnaw7 1460 Jun 25 09:39 ./build/make/target/product/security/platform.x509.pem [xtrnaw7@t15g /data/develop/android/OmniROM]$

Replace these files with your own certificate files and recreate the image using the command brunch (see above).


See here https://source.android.com/devices/tech/ota/sign_builds for how to create your own certificate.

How to manually create the SSL keys

To manually create the keys use these commands:

Android uses 2048-bit RSA keys with public exponent 3. You can generate certificate/private key pairs using the openssl tool from openssl.org:

# generate RSA key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl genrsa -3 -out temp.pem 2048
[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 4
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem


# create a certificate with the public part of the key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj  '/C=DE/ST=Hessen/L=Frankfurt am Main/O=Android/OU=Android/CN=Android/emailAddress=bnsmb01@gmail.com'
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
[xtrnaw7@t15g /data/develop/android/test1]$



# create a PKCS#8-formatted version of the private key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
[xtrnaw7@t15g /data/develop/android/test1]$



[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 12
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


# securely delete the temp.pem file

#
[xtrnaw7@t15g /data/develop/android/test1]$ shred --remove temp.pem
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


From the documentation:

The openssl pkcs8 command given above creates a .pk8 file with no password, suitable for use with the build system. To create a .pk8 secured with a password (which you should do for all actual release keys), replace the -nocrypt argument with -passout stdin; then openssl will encrypt the private key with a password read from standard input. No prompt is printed, so if stdin is the terminal the program will appear to hang when it's really just waiting for you to enter a password. Other values can be used for the-passout argument to read the password from other locations; for details, see the openssl documentation.

The temp.pem intermediate file contains the private key without any kind of password protection, so dispose of it thoughtfully when generating release keys. In particular, the GNUshred utility may not be effective on network or journaled filesystems. You can use a working directory located in a RAM disk (such as a tmpfs partition) when generating keys to ensure the intermediates are not inadvertently exposed.


Updating the local repositories [Update 22.01.2023]

To update the local repositories change the working directory to the directory with the repositories for OmniROM 13 and execute

repo sync

After the synchronization is complete, create a new operating system image using the commands described above.

It is recommended to create a new image at least once a month after the new security patches for Android are added to the repositories for OmniROM.

To view the date of the security patch in the source files for the OmniROM do:

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_13.0 ] $ grep "^[[:space:]]*PLATFORM_SECURITY_PATCH[[:space:]]*:=" ./build/make/core/version_defaults.mk
    PLATFORM_SECURITY_PATCH := 2023-01-05
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_13.0 ] $


Moving the repositories to another directory [Update 22.01.2023]

In case you want to move the repositories to another directory or rename the directory with the repositories:

Be aware that the make scripts create some absolute links in the output directory; to list these absolute links use while in the directory with the repositories:

find . -type l -ls | grep "$PWD"
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_13.0 ] $ find . -type l -ls | grep "$PWD"
 79960553      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        93 Dec 18 18:49 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher-autorun/linux_glibc_x86_64/py3-launcher-autorun -> /data/develop/android/OmniROM_13.0/prebuilts/build-tools/linux-x86/bin/py3-launcher-autorun64
 79960558      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        73 Dec 18 18:46 ./out/soong/.intermediates/prebuilts/build-tools/m4/linux_glibc_x86_64/m4 -> /data/develop/android/OmniROM_13.0/prebuilts/build-tools/linux-x86/bin/m4
 78782027      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 22 09:07 ./out/target/product/zenfone8/obj/DTBO_OBJ/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
 78931423      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 22 09:07 ./out/target/product/zenfone8/obj/DTB_OBJ/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
 78792528      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 15 11:56 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g3e8f0551c618/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
 78792529      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        77 Jan 15 11:56 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g3e8f0551c618/build -> /data/develop/android/OmniROM_13.0/out/target/product/zenfone8/obj/KERNEL_OBJ
 84806159      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 22 09:13 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g875131b91949/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
 84806160      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        77 Jan 21 11:25 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g875131b91949/build -> /data/develop/android/OmniROM_13.0/out/target/product/zenfone8/obj/KERNEL_OBJ
 78788578      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Jan 22 09:10 ./out/target/product/zenfone8/obj/KERNEL_OBJ/source -> /data/develop/android/OmniROM_13.0/kernel/asus/sm8350
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_13.0 ] $



Before starting another build after moving the directories with the repositories you must correct these links.

Trouble Shooting


Update 08.02.2024

see Some hints for repo sync troubleshooting for how to fix common errors executing repo sync.

see Some hints for fixing errros building an Custom ROM Android image for how to fix some common errors while creating the image


Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image





How to compile TWRP for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-twrp-for-the-asus-zenfone-8.4523817/


How to compile TWRP for the ASUS Zenfone 8

There are a lot of web pages about building your own TWRP image in the internet but at least I did not find a HowTo with all necessary instructions and infos in one place.

Therefor I wrote this little HowTo about building a TWRP image for the ASUS Zenfone 8. The instructions in the HowTo can also be used to create TWRP images for other phones supported by TWRP.

Note that this HowTo can only be used for phones that are officially supported by TWRP. The HowTo is for a PC running the Linux OS.


In the end, creating a TWRP image is also quite easy once you know how it works, thanks to the well-done setup of the development environment by the TWRP developer.


Prereqs

The repositories with the manifests for TWRP are here https://github.com/minimal-manifest-twrp and the repositories with the TWRP files and the device trees for the phones supported by TWRP are here: https://github.com/TeamWin. So you need access to github for creating your own TWRP image.

The tool repo is required to maintain the repositories for TWRP; you can download repo from https://gerrit.googlesource.com/git-repo

It's not necessary to install additional tools for creating an TWRP image -- all necessary tools to create the image are in the repositories for TWRP.


Note

To check if there is a repository with the device tree for another phone for TWRP use the search function on the page https://github.com/TeamWin and search for the device ID of the phone.

To search via script use (I006D is the device ID for the ASUS Zenfone 8):

wget "https://api.github.com/search/repositories?q=I006D" -O ./repository_list


search example for the ASUS Zenfone 8
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $ wget "https://api.github.com/search/repositories?q=I006D" -O ./repository_list
--2022-11-27 09:20:27--  https://api.github.com/search/repositories?q=I006D
Resolving api.github.com (api.github.com)... 140.82.121.5
Connecting to api.github.com (api.github.com)|140.82.121.5|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘./repository_list’

./repository_list                                      [ <=>                                                                                                            ]  46.30K  --.-KB/s    in 0.01s  


2022-11-27 09:20:28 (3.55 MB/s) - ‘./repository_list’ saved [47414]

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $ grep "full_name"  ./repository_list
      "full_name": "CaptainThrowback/android_device_asus_I006D",
      "full_name": "nguyenhung9xdev2022/android_kernel_asus_I006D",
      "full_name": "nguyenhung9xdev2022/android_vendor_asus_I006D",
      "full_name": "nguyenhung9xdev2022/android_device_asus_I006D",
      "full_name": "asus-development/android_device_asus_I006D",
      "full_name": "OpenPecha-Data/I006D4C7E",
      "full_name": "dmd79/android_device_asus_I006D",
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $



To get the device ID for a phone execute :

adb shell getprop ro.product.system.device

e,g.

#
# on a PC for a connected ASUS Zenfone 8
#
[xtrnaw7@t15g /data/develop/android/twrp]$ adb shell getprop ro.product.system.device
I006D
[xtrnaw7@t15g /data/develop/android/twrp]$

#
# on the ZUK Z2 Pro
#
z2_row:/ # getprop ro.product.system.device
z2_row
z2_row:/ #


The device ID is required for the lunch command used to copy the repositories with the device trees (see below).



Building the ROM

First copy the necessary repositories for building TWRP to your local machine using these commands:

#
# create a new directory for the repositories (optional)
#
mkdir twrp
cd twrp

# init the local repositories
#
# As of 27.11.2022 the latest version of the TWRP repositories is 12.1 ;
# to download the default repository version you can omit the parameter "-b twrp-12.1"
# As of 27.11.2022 the repositories for TWRP 12.1 use about 45 GB;
# to save some space (about 12 GB) you could add the parameter
--depth=1
#
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1

# sync the repositories (Parameter-j8
= use 8 parallel jobs; adjust this parameter to the number of CPU available on your PC)
#
repo sync -c -j8 --force-sync --no-clone-bundle --no-tags



Next add the device dependent repositories for the ASUS Zenfone 8.

The format of the parameter for the lunch command is

twrp_<device_id>-eng

So the parameter for the ASUS Zenfone 8 is twrp_I006D-eng.


#
# init the environment to build the TWRP image
#
. build/envsetup.sh

export ALLOW_MISSING_DEPENDENCIES=true

lunch twrp_I006D-eng



lunch example
TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $ lunch twrp_I006D-eng
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "twrp_I006D".
11:35:37 dumpvars failed with: exit status 1
Device I006D not found. Attempting to retrieve device repository from TeamWin Github (http://github.com/TeamWin).
Found repository: android_device_asus_I006D
Checking branch info
Calculated revision: android-12.1
Adding dependency:
Repository: android_device_asus_I006D
Branch: android-12.1
Remote: TeamWin
Path: device/asus/I006D

Syncing repository to retrieve project.
Fetching: 100% (1/1), done in 12.846s
NOT Garbage collecting: 0% (0/1), done in 0.001s
repo sync has finished successfully.
Repository synced!
Looking for dependencies
Adding dependencies to manifest

Adding dependency:
Repository: android_device_asus_sm8350-common
Branch: android-12.1
Remote: TeamWin
Path: device/asus/sm8350-common

Syncing dependencies
Fetching: 100% (1/1), done in 15.848s
NOT Garbage collecting: 0% (0/1), done in 0.001s
repo sync has finished successfully.
Looking for dependencies
device/asus/sm8350-common has no additional dependencies.
Done

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.0.9-200.fc36.x86_64-x86_64-Fedora-Linux-36-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $




And final build the TWRP image

mka bootimage


mka bootimage example
[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $ time mka bootimage
build/make/core/soong_config.mk:197: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:198: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.0.9-200.fc36.x86_64-x86_64-Fedora-Linux-36-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ 78% 246/312] including bootable/recovery/Android.mk ...
bootable/recovery/prebuilt/Android.mk:437: warning: vendor_hw: bootable/recovery/prebuilt/relink.sh out/target/product/I006D/recovery/root/vendor/bin/hw
[ 95% 299/312] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
[ 30% 8637/28297] //bionic/libc:libc_bionic clang arch-arm64/bionic/setjmp.S
....
Removing unneeded service: keymaster-4-1-citadel

Service_Cleanup script complete.

[100% 28297/28297] Target boot image from recovery: out/target/product/I006D/boot.img

#### build completed successfully (14:50 (mm:ss)) ####


real 14m50.110s
user 182m6.217s
sys 11m58.492s
[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $



Note:

For devices without A/B devices use mka recoveryimage.


The TWRP image will be created in file boot.img in the directory ./out/target/product/I006D, e.g.:

[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $ ls -ltr out/target/product/I006D/boot.img
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 100663296 Nov 27 12:06 out/target/product/I006D/boot.img
[ TWRP Dev - xtrnaw7@t15g /data/develop/android/twrp ] $ 


To test the image just boot the phone from the image

adb reboot bootloader

sudo fastboot boot out/target/product/I006D/boot.img


And check if the boot was succesfull:

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $  adb shell getprop ro.bootmode
unknown
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrpX ] $

unknown is the expected value here.


Trouble Shooting

On some pages I found a hint that the build scripts require python2 and will not work with python3. But this is most probably not true anymore because building the image with python3 worked without problems.


It's strongly recommended to use separate sessions for compiling OmniROM or TWRP or even different versions of TWRP:

All these build environments define the same commands in the file ./build/envsetup.sh but with different functionality.


As of 27.11.2022 there are only 2 branches in the repository with the manifests for TWRP : version 11 and version 12.1.
If there is no branch for one of these versions in the repositories for the device tree of the phone for which you want to create a TWRP image the lunch command will fail.

The repositories with the manifests for TWRP prior to version 11 can be fetched with this command:

# Minimal manifest for building TWRP for devices shipped with Android 5.1 through Android 9.0
#
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-9.0


Note that the lunch command in the old repositories does work different 


The warning message

[ OmniRom 16 - xtrnaw7@t15g //devpool001/develop/twrp_dev002 ] $ . build/envsetup.sh
Warning: completion file /devpool001/develop/twrp_dev002/tools/asuite/asuite.sh not found
[ OmniRom 16 - xtrnaw7@t15g //devpool001/develop/twrp_dev002 ]

can be ignored - asuite.sh a script used for the Android Studio Suite that is not used for building the TWRP image.


Notes:

The URL to the repository with the device tree for a phone is also on the page for the device on the TWRP device list: https://twrp.me/Devices/

See https://unofficialtwrp.com/build-compile-twrp-recovery/ for other possible settings for the build

see here for How to add additional files to an TWRP image

see also How to compile the image for TWRP 3.7.0.12-1 w/ the bootctl binary      

XDA Forum thread about compiling TWRP: How to compile TWRP touch recovery

see also OrangeFox Recovery using the OrangeFox Recovery Builder 2024 for a method to build the  TWRP recovery image or the OrangeFox recovery image on github.com




How to compile the image for TWRP 3.7.0.12-1 w/ the bootctl binary


URL: https://xdaforums.com/t/how-to-compile-the-image-for-twrp-3-7-0-12-1-w-the-bootctl-binary.4650684/


How to compile the image for TWRP 3.7.0.12-1 w/ the bootctl binary
In the official images for TWRP version 3.7.0.12-1 the binaries

bootctl
lpdump
lpdumpd
lptools


are not included anymore - see here: https://github.com/TeamWin/android_bootable_recovery/commit/aa3c77a0b5364782ab734cd8c511b85798d7452d

But it's simple to create your own TWRP image that again contains these binaries:

The post How to compile TWRP for the ASUS Zenfone8 describes in general how to compile the TWRP image.

To compile a TWRP image for version 3.7.0.12-1 that contains the missing binaries, use these commands:

# make the directory with the TWRP source the working directory
#
cd /data/develop/android/twrp

. build/envsetup.sh

export ALLOW_MISSING_DEPENDENCIES=true

# set this variable to include the missing binaries in the TWRP image
#
export TW_INCLUDE_LPDUMP=yes

# create a TRWP image for the ASUS Zenfone 8 (change the parameter for lunch to match your phone!)
#
lunch twrp_I006D-eng

mka bootimage







How to re-install the Android OS from ASUS on the ASUS Zenfone 8


URL: https://xdaforums.com/t/asus-zenfone-8-how-to-rollback-from-lineageos-to-original-rom.4583833/#post-88525935


How to re-install the Android OS from ASUS on the ASUS Zenfone 8



Update 12.01.2024

As of 17.08.2023 the firmware for the ASUS Zenfone 8 can not be downloaded from the ASUS web Page anymore.

see ASUS Zenfone 8 Firmware Download for alternatives for downloading the firmware.




How can I rollback to original Asus ROM without a need of a computer, can I do that with the Recovery mode using the Bootloader (Power button + Volume UP) then select reset to factory setting ?


I doubt that you can rollback without using a PC (how did you install the LineageOS without a Computer?)


The Android OS images from ASUS for the Zenfone 8 can be downloaded from here:

https://www.asus.com/de/Mobile/Phones/ZenFone/Zenfone-8/HelpDesk_BIOS/

In principal it should be possible to install them using fastboot commands or a recovery from one of the CustomROMs or TWRP (https://twrp.me/) but in my tests most of the time that did not work.


Therefor I recommend using a raw image to reinstall the Android OS from ASUS like described in this thread:

https://xdaforums.com/t/full-recover-to-stock-if-things-went-really-bad.4337467/

Note that installing a raw image will wipe all data on the phone!


The raw image for Android 13 for the ASUS Zenfone 8 is the image for the beta version of Android 13 on this page:

https://www.asus.com/Content/Android-13-Beta/

After the installation of the Beta image you should install the official Android 13 using the current Android 13 OS image for the Zenfone 8 from this page:

https://www.asus.com/de/Mobile/Phones/ZenFone/Zenfone-8/HelpDesk_BIOS/



The raw image for Android 12 for the ASUS Zenfone 8 can be found here (at the bottom of the page):

https://www.asus.com/Content/Android-13-Beta/


The raw image for Android 11 for the ASUS Zenfone 8 can be be found here (at the bottom of the page):

https://www.asus.com/Content/Android-12-Beta/


After the installation of one of the raw images the installation of the current version of the Android OS from ASUS via the "normal" method is strongly recommended.


How to properly install the GApps without using a computer ? can I download it as APK and install it ?

GApps are partially system apps and must still be installed while the Android OS is not running (e.g. while booted from a recovery like TWRP) 


If you do not really need all the Google apps but only the Google stack to get an appication running you could test if MicroG (a replacement for the Google Stack; see https://microg.org/) is sufficient for your application. MicroG seems to be a bit outdated but it isn't -it's still working fine.
I use it on my phone to be able to use Apps that require Google functionality but without installing the Google Stack (and some of the Google Apps I like for example. Google Maps)

To use MicroG either install a CustomROM with MicroG already included like the LinegaOS with MicroG (https://download.lineage.microg.org/sake/) or (my prefered ROM) the OmniROM with MicroG (https://dl.omnirom.org/zenfone8/). 

Or install the MicroG packages on your LineageOS either manually (not recommended) or using an installation image for MicroG like for example NanoDroid (https://nanolx.org/nanolx/nanodroid/).
One advantage of NanoDroid is that it also contains a  patched Playstore that does work with MicroG.





How to use TWRP if LineageOS 20.x is installed


URL: https://xdaforums.com/t/how-to-use-twrp-if-lineageos-20-x-is-installed.4599721/


How to use TWRP if LineageOS 20.x is installed


Update 23.07.2025

see the section How to create a TWRP recovery image for LineageOS 22  for information about creating a TWRP image for LineageOS 22.0 or newer.



After installing LineageOS 20.x or newer on a phone, booting the phone from the TWRP image using the command

sudo fastboot boot <twrp_image_file>

does not work anymore : The phone starts to boot; prints the ASUS logo and hangs forever (at least on the ASUS Zenfone 8).

To work around this annoying problem, it is necessary to create a new TWRP boot image file using the boot image from the LineageOS and the ramdisk and kernel parameter from the TWRP image.

This can be done as follows:

Download the image file for the boot partition (boot.img) used for LineageOS 20.x for your phone

For the ASUS Zenfone 8 the file boot.img can be downloaded from this URL:  https://download.lineageos.org/devices/sake/builds:

wget https://mirrorbits.lineageos.org/full/sake/20230616/boot.img


Unpack the boot image file using the Magisk binary magiskboot:


[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $ ls -ltr
total 98308
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 100663296 Jun 16 11:19 boot.img
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $

# the parameter -h for magiskboot is necessary to create the file header
#
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $ magiskboot unpack -h boot.img
Parsing boot image: [boot.img]
HEADER_VER      [4]
KERNEL_SZ       [39909888]
RAMDISK_SZ      [1663229]
OS_VERSION      [13.0.0]
OS_PATCH_LEVEL  [2023-05]
PAGESIZE        [4096]
CMDLINE         []
KERNEL_FMT      [raw]
RAMDISK_FMT     [lz4_legacy]
VBMETA
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $ ls -ltr
total 140364
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 100663296 Jun 16 11:19 boot.img
-rw-r--r--. 1 xtrnaw7 xtrnaw7  39909888 Jun 25 19:00 kernel
-rw-rw-rw-. 1 xtrnaw7 xtrnaw7        50 Jun 25 19:00 header
-rw-r--r--. 1 xtrnaw7 xtrnaw7   3147776 Jun 25 19:00 ramdisk.cpio
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $


In another directory unpack the TWRP image for the phone using magiskboot:

# the parameter -h for magiskboot is necessary to create the file header
#
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos/twrp ] $ magiskboot unpack -h ../../twrp-3.7.0_12-0-I006D-enhanced.img
Parsing boot image: [../../twrp-3.7.0_12-0-I006D-enhanced.img]
HEADER_VER      [3]
KERNEL_SZ       [18618540]
RAMDISK_SZ      [38299974]
OS_VERSION      [99.87.36]
OS_PATCH_LEVEL  [2099-12]
PAGESIZE        [4096]
CMDLINE         [twrpfastboot=1]
KERNEL_FMT      [gzip]
RAMDISK_FMT     [gzip]
VBMETA
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos/twrp ] $ ls -ltr
total 133992
-rw-rw-rw-. 1 xtrnaw7 xtrnaw7       66 Jun 25 19:03 header
-rw-r--r--. 1 xtrnaw7 xtrnaw7 41943552 Jun 25 19:03 kernel
-rw-r--r--. 1 xtrnaw7 xtrnaw7 95251796 Jun 25 19:03 ramdisk.cpio
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos/twrp ] $



Now copy the file ramdisk.cpio file from the TWRP image to the directory with the unpacked boot image file from the LineageOS :

# backup the existing ramdisk file
#
cp /data/develop/android/twrp_for_lineageos/ramdisk.cpio /data/develop/android/twrp_for_lineageos/ramdisk.cpio.org

# copy the ramdisk file from the TWRP image

#
cp /data/develop/android/twrp_for_lineageos/twrp/ramdisk.cpio /data/develop/android/twrp_for_lineageos/ramdisk.cpio


Then copy the kernel parameter from the TWRP image to the file header from the LineageOS boot image file:

# print the kernel parameter from the TWRP image
#
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos/twrp ] $ grep cmd /data/develop/android/twrp_for_lineageos/twrp/header
cmdline=twrpfastboot=1


# backup the file header from the LineageOS boot image file
#
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos/twrp ] $ cp /data/develop/android/twrp_for_lineageos/header  /data/develop/android/twrp_for_lineageos/header.org


# add the kernel parameter from the TWRP image to the file header from the LineageOS
#
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $ sed -i -e "s/cmdline=/cmdline=twrpfastboot=1/g" /data/develop/android/twrp_for_lineageos/header
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $

# check the result
#
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos/twrp ] $ cat /data/develop/android/twrp_for_lineageos/header
cmdline=twrpfastboot=1
os_version=13.0.0
os_patch_level=2023-05
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos/twrp ]



Now repack the boot image file from the LineageOS 20.x to create the new TWRP image:

[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $ magiskboot repack ./boot.img ./twrp_3.7.0_12-0-I006D_for_lineageOS20.img
Parsing boot image: [./boot.img]
HEADER_VER      [4]
KERNEL_SZ       [39909888]
RAMDISK_SZ      [1663229]
OS_VERSION      [13.0.0]
OS_PATCH_LEVEL  [2023-05]
PAGESIZE        [4096]
CMDLINE         []
KERNEL_FMT      [raw]
RAMDISK_FMT     [lz4_legacy]
VBMETA
Repack to boot image: [./twrp_3.7.0_12-0-I006D_for_lineageOS20.img]
HEADER_VER      [4]
KERNEL_SZ       [39909888]
RAMDISK_SZ      [44166258]
OS_VERSION      [13.0.0]
OS_PATCH_LEVEL  [2023-05]
PAGESIZE        [4096]
CMDLINE         [twrpfastboot=1]
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $


[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $ ls -ltr twrp_3.7.0_12-0-I006D_for_lineageOS20.img
-rw-r--r--. 1 xtrnaw7 xtrnaw7 100663296 Jun 25 19:11 twrp_3.7.0_12-0-I006D_for_lineageOS20.img
[ OmniRom 13 Dev - xtrnaw7@t15g /data/develop/android/twrp_for_lineageos ] $


The TWRP image file twrp_3.7.0_12-0-I006D_for_lineageOS20.img can now be used boot the phone via fastboot if the LineageOS 20.x is installed.


I successfuly tested this on an ASUS Zenfone 8 with the Lineage OS 20.x from the file lineage-20.0-20230616-nightly-sake-signed.zip and the TWRP image file twrp-3.7.0_12-0-I006D-enhanced.img.


Update 26.04.2024

I also tested this approach successfully with the in-official LineageOS 21.x image lineage-21.0-20240220-UNOFFICIAL-KSU-GPU_UV-sake.zip and the TWRP image file twrp-3.7.0_12-0-I006D-enhanced.img.


Update 25.06.2024

I also tested this approach successfully with the StatixOS and LMODroid 



Note that the TWRP image for LineageOS created using this method is version and build (!) dependent : A TWRP image must be created for each LineageOS image (even with the same LIneageOS version).
And the TWRP images for LineageOS cannot be used if another ROM is installed on the phone.


Therefor this is really only a very ugly workaround!



Update 26.06.2024

see also How to create a TWRP image for LineageOS based ROMs using a script 


Update 07.09.2024


see How to access the system partitions while the phone is booted into the LineageOS recovery for how to access the system partitions if the phone is booted into the original recovery from the LineageOS 


Trouble Shoooting


Problem: The TWRP GUI does not resume after the screensaver from TWRP was active (-> the screen remains black; the access to TWRP via adb shell still works)

Workaround

increase the screen timeout in the TWRP GUI or disable the screen saver in the TWRP GUI
(The TWRP settings are stored in the config file /data/media/0/TWRP/.twrps; this file is a binary file that can not be edited)


I did not find any other issues until now .. but I only did a few tests. I guess there are most probably more issues.

But the main function I use TWRP for in this configuration is access via adb - and that works.
(The recovery from the LineageOS also supports access via adb but adb is disabled after booting into the recovery and must be manually enabled in the GUI of the recovery)


Problem: The twrp executable does not work

Booting the phone from the twrp image file works but executing the twrp binary does not work and print an error message like this:

I006D:/ # twrp sideload
TWRP does not appear to be running. Waiting for TWRP to start . . .
Press CTRL + C to quit.
^C
130|I006D:/ # ^D


Solution

The TWRP image used does not match the installed OS on the phone. Create and use a TWRP version for the OS installed on the phone to fix this error.



Notes


Booting the phone from the recovery image for LineageOS 19.x does also not work anymore after installing LineageOS 20.x.

The file boot.img from the Download page for LineageOS 20.x (https://download.lineageos.org/devices/sake/builds for the ASUS Zenfone 8) is also the Recovery image for that OS.
Using that the file boot.img to boot the phone via "sudo fastboot boot boot.img" does not work

Unpacking and repacking the boot image files in the example above was done on a PC running the Linux OS and using the x86 version of magiskboot from the Magisk apk file.

To extract the magiskboot binary for 64 Bit Linux from the apk file use these commands:

unzip -p Magisk-v26.1.apk  lib/x86_64/libmagiskboot.so >magiskboot
chmod 755 magiskboot

The x86 binaries from the Magisk apk file are static linked binaries and should work on every Linux OS running on x86.

The commands listed above can also be done in an adb session on the phone with installed Magisk or in a booted TWRP image if no machine running Linux is available.

 

ASUS Zenfone 8 Firmware Download


URL: https://xdaforums.com/t/zenfone-8-need-android-12-firmware-to-downgrade-from-android-13.4617265/#post-88887299

As of 17.08.2023 the firmware for the ASUS Zenfone 8 can not be downloaded from the ASUS web page anymore.

Update 24.09.2023 /bs

There is now a forum entry with a collection of links to available OS images for the ASUS Zenfone 8:

https://xdaforums.com/t/zenfone-8-firmware-ota-collection.4620171/


ASUS Zenfone 8 Firmware download
There are some firmware images for the ASUS Zenfone 8 on this page:

https://www.firmware27.info/2023/03/asus-zenfone-8-zs590ks-flash-file.html

There is a link to the official ASUS download page and a link to a copy of the image on google drive for each firmware image.
The links to the ASUS download page do not work anymore but at least some of the links to the google drive work.

I successfully downloaded the image Asus ZenFone 8 (ZS590KS) Raw Firmware (last entry) from the link to google drive

The file looks like a raw image

The checksum of the zip file does not match the checksum of the original zip file with the raw image from ASUS:

Original ZIP file from ASUS

[ OmniRom 13 Dev - xtrnaw7@t15g ~ ] $ cksum  /data/backup/ASUS_ZENFONE8/raw_images/*/*MR*2204*zip
2848852431 4006660382 /data/backup/ASUS_ZENFONE8/raw_images/Android12/WW-ZS590KS-31.1010.0410.61-MR0-2204-user-20220422.zip
[ OmniRom 13 Dev - xtrnaw7@t15g ~ ] $


ZIP file downloaded from that page

[ OmniRom 13 Dev - xtrnaw7@t15g ~ ] $ cksum /data/download/'[up_addROM.com]_WW-ZS590KS-31.1010.0410.61-MR0-2204-user-20220422(1).zip'
1693297488 4006660447 /data/download/[up_addROM.com]_WW-ZS590KS-31.1010.0410.61-MR0-2204-user-20220422(1).zip
[ OmniRom 13 Dev - xtrnaw7@t15g ~ ] $


But the check sums for the zip file contents do match the the check sums for the contents of the original zip file:

cksum */* | tee chksum.out
[ OmniRom 13 Dev - xtrnaw7@t15g ~/test1 ] $ cksum */*  | tee chksum.out
1013896308 602112 original/abl.elf
2544193035 38517720 original/adb
1415468060 38320640 original/adb.exe
440910305 97792 original/AdbWinApi.dll
2062945662 62976 original/AdbWinUsbApi.dll
785625886 33554432 original/ADF.img
2047031777 8536296 original/asdf_384M.img
4046808373 10703200 original/ASUS-xrom.img
3346853190 38629376 original/boot-debug-gki.img
1689467234 55615488 original/boot-debug.img
684207671 100663296 original/boot-gki.img
217406089 100663296 original/boot.img
3762944689 1054 original/crc32_checksum.txt
3296223989 1007 original/crc32_img_size.txt
2101368269 8388608 original/dtbo.img
1823614613 14252200 original/fastboot
3212560529 13016576 original/fastboot.exe
3536915896 1705200 original/fastboot_for_mac
4294967295 0 original/firmware
1310895658 13800 original/flashall_AFT.cmd
3109226029 45056 original/gpt_both0.bin
2942924624 45056 original/gpt_both1.bin
3718285888 45056 original/gpt_both2.bin
3224877491 45056 original/gpt_both3.bin
3273120389 45056 original/gpt_both4.bin
2550846493 45056 original/gpt_both5.bin
3119167302 45056 original/gpt_both6.bin
105651610 135680 original/grep.exe
4294967295 0 original/lib64
4066097203 711720 original/make_f2fs
1138700453 413696 original/make_f2fs.exe
2657452820 4234408 original/mke2fs
245949360 4313600 original/mke2fs.exe
94533207 313 original/multiple_update_image.bat
852544587 356 original/multiple_update_image.sh
2645684121 33554432 original/persist.img
1741426147 6872867696 original/super.img
3772440178 14168 original/update_image.bat
3869862274 10484 original/update_image_for_mac.sh
2638570025 11245 original/update_image.sh
4209265207 8192 original/vbmeta.img
3157482219 4096 original/vbmeta_system.img
3413920804 6586368 original/vendor_boot-debug.img
2926086928 100663296 original/vendor_boot.img
1013896308 602112 unknown/abl.elf
2544193035 38517720 unknown/adb
1415468060 38320640 unknown/adb.exe
440910305 97792 unknown/AdbWinApi.dll
2062945662 62976 unknown/AdbWinUsbApi.dll
785625886 33554432 unknown/ADF.img
2047031777 8536296 unknown/asdf_384M.img
4046808373 10703200 unknown/ASUS-xrom.img
3346853190 38629376 unknown/boot-debug-gki.img
1689467234 55615488 unknown/boot-debug.img
684207671 100663296 unknown/boot-gki.img
217406089 100663296 unknown/boot.img
3762944689 1054 unknown/crc32_checksum.txt
3296223989 1007 unknown/crc32_img_size.txt
2101368269 8388608 unknown/dtbo.img
1823614613 14252200 unknown/fastboot
3212560529 13016576 unknown/fastboot.exe
3536915896 1705200 unknown/fastboot_for_mac
4294967295 0 unknown/firmware
1310895658 13800 unknown/flashall_AFT.cmd
3109226029 45056 unknown/gpt_both0.bin
2942924624 45056 unknown/gpt_both1.bin
3718285888 45056 unknown/gpt_both2.bin
3224877491 45056 unknown/gpt_both3.bin
3273120389 45056 unknown/gpt_both4.bin
2550846493 45056 unknown/gpt_both5.bin
3119167302 45056 unknown/gpt_both6.bin
105651610 135680 unknown/grep.exe
4294967295 0 unknown/lib64
4066097203 711720 unknown/make_f2fs
1138700453 413696 unknown/make_f2fs.exe
2657452820 4234408 unknown/mke2fs
245949360 4313600 unknown/mke2fs.exe
94533207 313 unknown/multiple_update_image.bat
852544587 356 unknown/multiple_update_image.sh
2645684121 33554432 unknown/persist.img
1741426147 6872867696 unknown/super.img
3772440178 14168 unknown/update_image.bat
3869862274 10484 unknown/update_image_for_mac.sh
2638570025 11245 unknown/update_image.sh
4209265207 8192 unknown/vbmeta.img
3157482219 4096 unknown/vbmeta_system.img
3413920804 6586368 unknown/vendor_boot-debug.img
2926086928 100663296 unknown/vendor_boot.img
[ OmniRom 13 Dev - xtrnaw7@t15g ~/test1



sort chksum.out
[ OmniRom 13 Dev - xtrnaw7@t15g ~/test1 ] $ sort chksum.out
1013896308 602112 original/abl.elf
1013896308 602112 unknown/abl.elf
105651610 135680 original/grep.exe
105651610 135680 unknown/grep.exe
1138700453 413696 original/make_f2fs.exe
1138700453 413696 unknown/make_f2fs.exe
1310895658 13800 original/flashall_AFT.cmd
1310895658 13800 unknown/flashall_AFT.cmd
1415468060 38320640 original/adb.exe
1415468060 38320640 unknown/adb.exe
1689467234 55615488 original/boot-debug.img
1689467234 55615488 unknown/boot-debug.img
1741426147 6872867696 original/super.img
1741426147 6872867696 unknown/super.img
1823614613 14252200 original/fastboot
1823614613 14252200 unknown/fastboot
2047031777 8536296 original/asdf_384M.img
2047031777 8536296 unknown/asdf_384M.img
2062945662 62976 original/AdbWinUsbApi.dll
2062945662 62976 unknown/AdbWinUsbApi.dll
2101368269 8388608 original/dtbo.img
2101368269 8388608 unknown/dtbo.img
217406089 100663296 original/boot.img
217406089 100663296 unknown/boot.img
245949360 4313600 original/mke2fs.exe
245949360 4313600 unknown/mke2fs.exe
2544193035 38517720 original/adb
2544193035 38517720 unknown/adb
2550846493 45056 original/gpt_both5.bin
2550846493 45056 unknown/gpt_both5.bin
2638570025 11245 original/update_image.sh
2638570025 11245 unknown/update_image.sh
2645684121 33554432 original/persist.img
2645684121 33554432 unknown/persist.img
2657452820 4234408 original/mke2fs
2657452820 4234408 unknown/mke2fs
2926086928 100663296 original/vendor_boot.img
2926086928 100663296 unknown/vendor_boot.img
2942924624 45056 original/gpt_both1.bin
2942924624 45056 unknown/gpt_both1.bin
3109226029 45056 original/gpt_both0.bin
3109226029 45056 unknown/gpt_both0.bin
3119167302 45056 original/gpt_both6.bin
3119167302 45056 unknown/gpt_both6.bin
3157482219 4096 original/vbmeta_system.img
3157482219 4096 unknown/vbmeta_system.img
3212560529 13016576 original/fastboot.exe
3212560529 13016576 unknown/fastboot.exe
3224877491 45056 original/gpt_both3.bin
3224877491 45056 unknown/gpt_both3.bin
3273120389 45056 original/gpt_both4.bin
3273120389 45056 unknown/gpt_both4.bin
3296223989 1007 original/crc32_img_size.txt
3296223989 1007 unknown/crc32_img_size.txt
3346853190 38629376 original/boot-debug-gki.img
3346853190 38629376 unknown/boot-debug-gki.img
3413920804 6586368 original/vendor_boot-debug.img
3413920804 6586368 unknown/vendor_boot-debug.img
3536915896 1705200 original/fastboot_for_mac
3536915896 1705200 unknown/fastboot_for_mac
3718285888 45056 original/gpt_both2.bin
3718285888 45056 unknown/gpt_both2.bin
3762944689 1054 original/crc32_checksum.txt
3762944689 1054 unknown/crc32_checksum.txt
3772440178 14168 original/update_image.bat
3772440178 14168 unknown/update_image.bat
3869862274 10484 original/update_image_for_mac.sh
3869862274 10484 unknown/update_image_for_mac.sh
4046808373 10703200 original/ASUS-xrom.img
4046808373 10703200 unknown/ASUS-xrom.img
4066097203 711720 original/make_f2fs
4066097203 711720 unknown/make_f2fs
4209265207 8192 original/vbmeta.img
4209265207 8192 unknown/vbmeta.img
4294967295 0 original/firmware
4294967295 0 original/lib64
4294967295 0 unknown/firmware
4294967295 0 unknown/lib64
440910305 97792 original/AdbWinApi.dll
440910305 97792 unknown/AdbWinApi.dll
684207671 100663296 original/boot-gki.img
684207671 100663296 unknown/boot-gki.img
785625886 33554432 original/ADF.img
785625886 33554432 unknown/ADF.img
852544587 356 original/multiple_update_image.sh
852544587 356 unknown/multiple_update_image.sh
94533207 313 original/multiple_update_image.bat
94533207 313 unknown/multiple_update_image.bat
[ OmniRom 13 Dev - xtrnaw7@t15g ~/test1 ] $ #




[ OmniRom 13 Dev - xtrnaw7@t15g ~/test1 ] $ sort chksum.out | cut -f1 -d " " | uniq -u
[ OmniRom 13 Dev - xtrnaw7@t15g ~/test1 ] $



I'm not sure if it's a good idea to install an OS image from an unknown source - I think I would not do that on my phone. But without another option this might be an option


 

How to compile the OmniROM 14 for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-omnirom-14-for-the-asus-zenfone-8.4643071/


How to compile the OmniROM 14 for the ASUS Zenfone 8



Update 14.01.2025

see also Building the OmniROM image fails with the error message  .../kernel/asus/sm8350/scripts/extract-cert.c:24:10: fatal error: 'openssl/engine.h' file not found



Update 29.03.2024:


Please see also the Infos for building a CustomROM image for changes in the build process since Q1 2024.




This HowTo is about compiling the OmniROM 14 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile the other versions of the OmniROM for the ASUS Zenfone 8.




Compiling the CustomROM OmniROM 14 from within Linux is again a very simple and straight forward process -- the developer for the OmniROM did once again a really amazing good job setting up the build environment for the OmniROM 14.

I'm repeating myself here - but it can't be said often enough.


Hardware requirements

Message from the repo tool:

"The minimum required amount of free memory is around 16GB, and even with that, some configurations may not work."

In my experience, the computer on which OmniROM is compiled should have at least 32 GB RAM and 4 CPU cores.
(The numbers in this document are for a PC with an Intel Core i7 with 16 cores and 128 GB RAM).

Note that the scripts used to create the OmniROM image start one workspace per CPU and each workspace requires about 4 GB of RAM. Plus about 2 GB RAM for the general tasks.

As of 09.01.2024, the repositories for OmniROM 14 occupy about 290 GB of disk space; the additional repositories for the hardware-specific repositories for the ASUS Zenfone 8 occupy about 30 GB of disk space.
The compile process will occupy additional 140 GB for the temporary output files.
In total, the repositories for OmniROM 14 require around 500 GB of storage space (the space used will increase with every "repo sync")



Prerequisites

Some of the repositories for OmniROM 14 are on https://gitlab.com and the access to these repositories for the repository sync is done via ssh. Therefore, to sync these repositories a user account on gitlab.com with configured public ssh key is required. The user account on gitlab.com is free of charge and the public ssh key can be uploaded into the user profile on gitlab.com (see here: https://docs.gitlab.com/ee/user/ssh.html)

The repositories on http://github.com are currently accessed via https but that might change in the future. Therefor it's recommended to create a user on github.com and add the ssh public key to the profile of that user also.

Note:

To check how the access to the repositories is configured use this command

[OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0/.repo ] $  grep fetch $( find . -name "*xml"  )
./local_manifests/local_manifest.xml:        fetch="https://github.com/DonkeyCoyote" />
./manifests/omni-aosp.xml:           fetch="https://github.com/" />
./manifests/omni-aosp.xml:           fetch="ssh://git@gitlab.com/omnirom" />
./manifests/omni-aosp.xml:           fetch="https://github.com/omnirom"
./manifests/omni-caf.xml:           fetch="https://github.com/" />
./manifests/omni-caf.xml:           fetch="https://github.com/omnirom"
./manifests/omni-caf.xml:           fetch="https://git.codelinaro.org/clo/la"
./manifests/omni-private.xml:           fetch="ssh://git@github.com/omnirom"
./manifests/default.xml:           fetch="https://android.googlesource.com"
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0/.repo ] $



Use the commands

ssh git@github.com

ssh git@gitlab.com

to test the access via ssh and add the ssh hostkeys of the hosts github.com and gitab.com to the known_hosts file.

Or use

grep"^gitlab.com"~/.ssh/known_hosts  ||ssh-keyscan gitlab.com >>~/.ssh/known_hosts

grep"^github.com"
~/.ssh/known_hosts || ssh-keyscan github.com >>~/.ssh/known_hosts

to add the ssh hostkeys of the repository server used to the local known_hosts file of the user used to retrieve the repositories.

It's recommended to start the ssh-agent and load the private ssh keys before starting the sync of the repositories, e.g. if no global ssh-agent is running use:

$( eval ssh-agent )
ssh-add

Use

ssh-add -l

to list the ssh keys already loaded by the ssh-agent.





The tool repo is required to maintain the repositories for the OmniROM 14; you can download the tool "repo" from https://gerrit.googlesource.com/git-repo or download it with this command:

curl https://storage.googleapis.com/git-repo-downloads/repo > ./repo
chmod a+x ./repo  


It's not necessary to install additional tools for creating an OmniROM 14 image -- all necessary tools to create the image are in the repositories for the OmniROM 14.



The repositories used for the OmniROM 14 use the git command line extension git lfs. At least in Fedora this extension is not installed by default while installing git. In Fedora git lfs can be installed using this command:

sudo dnf install git-lfs 



Creating the local copies of the repositories for the OmniROM 14


Most (but not all) of the necessarry steps to sync the repositories necessary to create an OmniROM 14 installation image are described in the section "Getting Started" here: https://github.com/omnirom/android but some instructions are missing the details.


To create a local copy of the repositories for OmniROM 14 these steps are required:


First create a new directory for the repositories and change the working directory to the new directory, e.g.:

mkdir /data/develop/android/OmniROM_14.0
cd /data/develop/android/OmniROM_14.0


Then init the local repositories using the command:

repo init -u https://github.com/omnirom/android.git -b android-14.0 --git-lfs

Note that the command repo init only creates a hidden directory called .repo.


Next do the initial sync of the repositories using the command:

repo sync

The initial repository sync will download all repositories necessary to create the OmniROM 14 image except the hardware dependent repositories (these repos are different for the various phone models).

Therefor you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories after the download finished.

This should be done in the file .repo/local_manifests/local_manifest.xml (just create the directory .repo/local_manifests if it does not exist).

For the ASUS Zenfone 8 the file should look like this:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
<remote name="DonkeyCoyote"
fetch="https://github.com/DonkeyCoyote" />

<project path="device/asus/zenfone8" name="android_device_asus_zenfone8" remote="omnirom" revision="android-14.0" />
<project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-14.0" />
<project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-13.0" />
<project path="vendor/images/asus" name="android_vendor_images_asus" remote="gitlab" revision="android-13.0" />

</manifest>
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $



Notes:

The repository android_prebuilts_prebuiltapks is only necessary for OmniROM 14 images that should include the MicroG packages.


After updating the file local_manifest.xml do another

repo sync

to sync the added repositories. This time the download will be faster because only the additional repos will be downloaded.


Now you can start the build with these commands:

# optional:
#
# to create an OmniROM image with MicroG packages set the environment variable ROM_BUILDTYPE to MICROG before starting the build
#
# to create an OmniROM image with GAPPS packages set the environment variable ROM_BUILDTYPE to GAPPS before starting the build
#(that will only work if the repositories for the GAPPS are configured, of course)
#
export ROM_BUILDTYPE=MICROG

. build/envsetup.sh

brunch omni_zenfone8-user


in the directory with the downloaded repositories (use the command "breakast" without parameter instead of "brunch" to see other possible targets)

Be aware that the first time the compile process will take 4 hours or more.


If everything is fine there will be a ZIP file with your own Custom OmniROM 14 image in the directory ./out/target/product/zenfone8/ when the compile script is done, e.g. for images with the MicroG packages:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -l out/target/product/zenfone8/omni-14-202311*zip
-rw-rw-r--. 3 xtrnaw7 xtrnaw7 1363298353 Nov 20 10:22 out/target/product/zenfone8/omni-14-20231119-zenfone8-MICROG.zip
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $



The image can now be installed on the ASUS Zenfone 8 using the LineageOS Recovery or TWRP.




Notes




Be aware that each new OmniROM 14 image created with brunch will overwrite the existing OmniROM 14 image (the name of the image is different but the used inodes are the same for all zip files):

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -il out/target/product/zenfone8/omni-14-202311*zip
80813412 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1363298353 Nov 20 10:22 out/target/product/zenfone8/omni-14-20231119-zenfone8-MICROG.zip
80813412 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1363298353 Nov 20 10:22 out/target/product/zenfone8/omni-14-20231120-zenfone8-MICROG.zip
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $

[OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ cksum out/target/product/zenfone8/omni-14-202311*zip
1217746399 1363298353 out/target/product/zenfone8/omni-14-20231119-zenfone8-MICROG.zip
1217746399 1363298353 out/target/product/zenfone8/omni-14-20231120-zenfone8-MICROG.zip
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


Therefor you should copy the existing zip file with the image to a new directory before building a new image.



Certificates for the OS images

For OS images that should be used on the phone for daily use I strongly recommend to create your own certificates for the OS.

In the OmniROM development directory tree the necessary files, platform.pk8 and platform.x509.pem, are in the directory

./build/make/target/product/security

in your build tree for the CustomROM, e.g.

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -l ./build/make/target/product/security/platform.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1216 Nov 14 15:24 ./build/make/target/product/security/platform.pk8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1675 Nov 14 15:24 ./build/make/target/product/security/platform.x509.pem
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


Replace these files with your own certificate files and recreate the image using the command brunch (see above).


See here https://source.android.com/devices/tech/ota/sign_builds for how to create your own certificate.

To manually create the keys use these commands:
To manually create the keys use these commands:


Android uses 2048-bit RSA keys with public exponent 3. You can generate certificate/private key pairs using the openssl tool from openssl.org:

# generate RSA key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl genrsa -3 -out temp.pem 2048
[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 4
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem


# create a certificate with the public part of the key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj  '/C=DE/ST=Hessen/L=Frankfurt am Main/O=Android/OU=Android/CN=Android/emailAddress=bnsmb01@gmail.com'
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
[xtrnaw7@t15g /data/develop/android/test1]$



# create a PKCS#8-formatted version of the private key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
[xtrnaw7@t15g /data/develop/android/test1]$



[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 12
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


# securely delete the temp.pem file

#
[xtrnaw7@t15g /data/develop/android/test1]$ shred --remove temp.pem
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$ 


From the documentation:

The openssl pkcs8 command given above creates a .pk8 file with no password, suitable for use with the build system. To create a .pk8 secured with a password (which you should do for all actual release keys), replace the -nocrypt argument with -passout stdin; then openssl will encrypt the private key with a password read from standard input. No prompt is printed, so if stdin is the terminal the program will appear to hang when it's really just waiting for you to enter a password. Other values can be used for the-passout argument to read the password from other locations; for details, see the openssl documentation.

The temp.pem intermediate file contains the private key without any kind of password protection, so dispose of it thoughtfully when generating release keys. In particular, the GNUshred utility may not be effective on network or journaled filesystems. You can use a working directory located in a RAM disk (such as a tmpfs partition) when generating keys to ensure the intermediates are not inadvertently exposed.



Update 01.07.2024

To view the certificate use this command:

openssl x509 -in ./build/make/target/product/security/platform.x509.pem -text



Updating the local repositories

To update the local repositories change the working directory to the directory with the repositories for OmniROM 14 and execute

repo sync

After the synchronization is complete, create a new operating system image using the commands described above.

It is recommended to create a new image at least once a month after the new security patches for Android are added to the repositories for OmniROM 14.

To view the date of the security patch in the source files for the OmniROM 14 execute this command in the directory with the source files for the OmniROM 14:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ date
Tue Jan  9 07:24:05 PM CET 2024
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ grep "^[[:space:]]*PLATFORM_SECURITY_PATCH[[:space:]]*:=" ./build/make/core/version_defaults.mk
    PLATFORM_SECURITY_PATCH := 2024-01-05
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


See How to apply the Android Security patches to a local repository for how to apply an Android Security patch to the local repository.



Moving the repositories to another directory

In case you want to move the repositories for OmniROM 14 to another directory or rename the directory with the repositories:

Be aware that the make scripts create some absolute links in the output directory; to list these absolute links use this command while in the directory with the repositories for OmniROM 14 :

find . -type l -ls | grep "$PWD"


e.g. there are currently a lot of absolute links in the output directory:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ find . -type l -ls | grep "$PWD" | wc -l
131245
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


Before starting another build after moving the directories with the repositories you must correct these links (or clean the directory ./out)



Log files

The verbose log of the compile script is always written to a compressed file in the output directory, e.g.:

ls -ltr /data/develop/android/OmniROM_14.0/out/verbose.log*
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -ltr /data/develop/android/OmniROM_14.0/out/verbose.log*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7     938 Nov 19 19:00 /data/develop/android/OmniROM_14.0/out/verbose.log.4.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 7321648 Nov 19 19:02 /data/develop/android/OmniROM_14.0/out/verbose.log.5.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7   21660 Nov 19 19:05 /data/develop/android/OmniROM_14.0/out/verbose.log.3.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7   20241 Nov 19 19:10 /data/develop/android/OmniROM_14.0/out/verbose.log.2.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 2917838 Nov 19 20:33 /data/develop/android/OmniROM_14.0/out/verbose.log.1.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7   73725 Nov 20 10:22 /data/develop/android/OmniROM_14.0/out/verbose.log.gz
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $




Other options of the make tools

To create the image with other options use

. build/envsetup.sh
lunch
make <options>


To list the known options for the make command use this command:

make help
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ make help
The basic Android build process is:

cd /data/develop/android/OmniROM_14.0
source build/envsetup.sh    # Add "lunch" (and other utilities and variables)
                            # to the shell environment.
lunch [<product>-<variant>] # Choose the device to target.
m [<goals>]                 # Execute the configured build.

Usage of "m" imitates usage of the program "make".
See /data/develop/android/OmniROM_14.0/build/make/Usage.txt for more info about build usage and concepts.

The parallelism of the build can be set with a -jN argument to "m".  If you
don't provide a -j argument, the build system automatically selects a parallel
task count that it thinks is optimal for your system.

Common goals are:

    clean                   (aka clobber) equivalent to rm -rf out/
    checkbuild              Build every module defined in the source tree
    droid                   Default target
    sync                    Build everything in the default target except the images,
                            for use with adb sync.
    nothing                 Do not build anything, just parse and validate the build structure

    java                    Build all the java code in the source tree
    native                  Build all the native code in the source tree

    host                    Build all the host code (not to be run on a device) in the source tree
    target                  Build all the target code (to be run on the device) in the source tree

    (java|native)-(host|target)
    (host|target)-(java|native)
                            Build the intersection of the two given arguments

    snod                    Quickly rebuild the system image from built packages
                            Stands for "System, NO Dependencies"
    vnod                    Quickly rebuild the vendor image from built packages
                            Stands for "Vendor, NO Dependencies"
    pnod                    Quickly rebuild the product image from built packages
                            Stands for "Product, NO Dependencies"
    senod                   Quickly rebuild the system_ext image from built packages
                            Stands for "SystemExt, NO Dependencies"
    onod                    Quickly rebuild the odm image from built packages
                            Stands for "Odm, NO Dependencies"
    vdnod                   Quickly rebuild the vendor_dlkm image from built packages
                            Stands for "VendorDlkm, NO Dependencies"
    odnod                   Quickly rebuild the odm_dlkm image from built packages
                            Stands for "OdmDlkm, NO Dependencies"
    sdnod                   Quickly rebuild the system_dlkm image from built packages
                            Stands for "SystemDlkm, NO Dependencies"


So, for example, you could run:

cd /data/develop/android/OmniROM_14.0
source build/envsetup.sh
lunch aosp_arm-userdebug
m -j java

to build all of the java code for the userdebug variant of the aosp_arm device.


#### build completed successfully (4 seconds) ####

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $





Creating only the kernel or the boot image

To create only the kernel or the boot image use these commands:

. build/envsetup

# select the target hardware
#
breakfast omni_zenfone8-user

# Now instead of following the rest of the guide (which will compile both Android and the kernel
# for your device), simply compile the kernel:
#
mka kernel

# This command will also generate the device tree, initramfs and boot.img images
#
mka bootimage

 

Trouble Shooting

see Some hints for repo sync troubleshooting for how to fix some common errors while executing the command "repo sync".

see Some hints for fixing errros building an Custom ROM Android image for how to fix some common errors while creating the image



TWRP and OmniROM 14


Update 10.01.2024

For OmniROM 14 and other Android 14 based CustomROMs on the ASUS Zenfone 8 the TWRP version 3.7.0.12-1 or newer is required (because TWRP version 3.7.0.12-0 or older can not mount the /data partitions created by Android 14). TWRP version 3.7.0.12-1 can now be downloaded from the TWRP webpage:

https://eu.dl.twrp.me/I006D/


Notes:

After dirty flashing an installed OmniROM 13 with OmniROM 14 the current official TWRP 3.7.0.12-0 can still access the /data partition - the "problem" only exists after a clean installation of OmniROM 14 (= with factory reset).




Update 10.01.2024

This workaround is not necessary anymore with TWRP version 3.7.0.12-1 or newer

Installing OmniROM 14 via script using the official TWRP image 3.7.0.12-0 for the ASUS Zenfone 8
The installation and customization of OmniROM 14 via script, as described in here How to install and configure the Android OS via Script, using the TWRP image for the ASUS Zenfone 8 3.7.0_12-0 will only partially work due to the missing support for Android 14 in that release of TWRP.

A workaround to install OmniROM 14 using the TWRP image without OmniROM 14 support is to use the scripts to install and customize OmniROM 13 first, and then use the scripts to update to OmniROM 14 , e.g.:

#install and customize OmniROM 13
#
./prepare_phone.sh in all

# update to OmniROM 14
#

# the name of the image must be a fully qualified path
#
export OMNIROM_14_OS_IMAGE_TO_INSTALL="/data/backup/ASUS_ZENFONE8/omnirom_local/omni-14/omni-14-20231119-zenfone8-MICROG.zip"

./prepare_phone.sh install_os:noreboot:${OMNIROM_14_OS_IMAGE_TO_INSTALL} install_twrp:noreboot:next install_magisk_v26_in_boot_partition:reboot:next

Note:  install_magisk_via_twrp.sh v3.1.3.1 or newer is required for this approach



Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image






History of this entry

09.01.2024

the repositories for OmniROM 14 are now final and can be used to create an OmniROM 14 installation image for the ASUS Zenfone 8 

Updated the section about TWRP for OmniROM 14

 
10.01.2024

The section about TWRP for OmniROM 14 was rewritten;, there is now an official TWRP version for the ASUS Zenfone 8 with support for Android 14


21.01.2024

Added note on handling 429 errors of the repo sync command

22.01.2024

Added info about the mandatory git command line extension "git lfs"

08.02.2024

moved the trouble shooting instructions to separate posts

31.03.2024

added a reference to a new post about changes in the build process in Q1 2024

01.07.2024

added the command to view the contents of a .pem file



 


Some hints for repo sync troubleshooting


URL: https://xdaforums.com/t/some-hints-for-trouble-shooting-repo-sync-issues.4655310/


Some hints for repo sync troubleshooting

The tool repo is used to synchronize local repositories for a custom Android ROM with the repositories used by the maintainer of the custom ROM.
(See https://source.android.com/docs/setup/reference/repo for usage details for the tool repo.)

In this post I collect the error messages I received while using the tool repo to synchronize the source for the custom ROM OmniROM and how I solved the problems..


I use a Linux installation (Fedora) to build the custom Android ROM images, but I suspect these errors may also occur in other build environments.


General hints

Do not use CTRL-C to stop a running "repo sync". In most cases, this will result in one or more repositories remaining in an inconsistent state.

Instead, use

CTRL-.Z

and  then

kill %1

to cancle a "repo sync" command


In case of a repo sync error try the command

repo sync -c --force-sync --optimized-fetch --prune -j1 --fail-fast

Using this command the repositories are synched one after the other and the sync fails after the first error.



How to fix corrupted repositories

To delete and resync a corrupted repository the following commands can be used:

rm -rf <LOCALPATH>
rm -rf .repo/projects/<LOCALPATH>.git
rm -rf .repo/project-objects/*<PATTERN>*.git
repo sync -c --force-sync --no-clone-bundle --no-tags -j1 <LOCALPATH>


To search and fix all corrupted repositories the following commands can be used:

for p in $(repo forall -c 'git status >/dev/null 2>&1 || echo $REPO_PATH'); do
    echo "FIXING $p"
    rm -rf "$p"
    rm -rf ".repo/projects/$p.git"
    repo sync -c --force-sync --no-clone-bundle --no-tags -j1 "$p"
done



error: command 'sync' requires repo to be installed first
Error:

xtrnaw7@fedora01:/data/develop/android$ repo sync
error: command 'sync' requires repo to be installed first.
        Use "repo init" to install it here.
xtrnaw7@fedora01:/data/develop/android


Solution:

"repo sync" must be executed in the directory with the source files for the Custom ROM


repo sync fails with error code 429

Error:

The command repo sync fails with an error message like this:

platform/external/rust/crates/instant:
error: RPC failed; HTTP 429 curl 22 The requested URL returned error: 429
fatal: expected 'acknowledgments'


Solution:

Restart the command repo sync again some minutes later. The error 429 is in most cases only a temporary error.


repo sync fails for unkown reason
Error

The command repo sync fails for unknown reason

Solution:

In this case, it is always a good idea to restart the "repo sync" with the parameter --force-sync:

repo sync --force-sync

If that doesn't help, I recommend waiting a day and repeating the synchronization of the project repositories - there may be ongoing updates to the project repositories that result in temporarily inconsistent project repositories.


A new version of repo is available

Error:

xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ time repo sync --force-sync
Fetching: 100% (1264/1264), done in 2m15.576s
info: A new version of repo is available
warning: repo is not tracking a remote branch, so it will not receive updates
================================================================================

Solution:

This is not an error but it's recommended to update the repo script:

curl https://storage.googleapis.com/git-repo-downloads/repo >/tmp/repo && cat /tmp/repo >$( which repo )



GitCommandError: 'reset --keep v2.41^0' on repo failed
Error:

xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ repo sync
Fetching: 100% (1264/1264), done in 8m2.961s
info: A new version of repo is available
warning: repo is not tracking a remote branch, so it will not receive updates
================================================================================
Repo command failed: RepoUnhandledExceptionError
    GitCommandError: 'reset --keep v2.41^0' on repo failed
stderr: error: Entry 'docs/python-support.md' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'v2.41^0'.

xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$


Solution:

Synchronise the directory .repo/repo manually:

xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ cd .repo/repo/
xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0/.repo/repo$ git pull
Updating 4c80921..4217a82
Fast-forward
 docs/python-support.md       |  5 ++---
 git_trace2_event_log_base.py |  3 +++
 manifest_xml.py              |  4 ++--
 project.py                   | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------
 repo                         | 41 +++++------------------------------------
 subcmds/sync.py              |  4 ++--
 tests/conftest.py            |  9 +++++++++
 tests/test_manifest_xml.py   | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 127 insertions(+), 70 deletions(-)
xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0/.repo/repo$



retrieving files from lfs storage fails

Normally, the command repo sync automatically fetches the files stored in the LFS storage without any additional command.

But if a file looks like this:

version https://git-lfs.github.com/spec/v1
oid sha256:38eb121872[...]
size 12345678

that did not work. This file is an LFS-pointer and must be replaced with the correct file from the LFS storage. To do this, change to the directory with the .git directory and issue

git lfs pull

or

git lfs fetch && git lfs checkout


Note:

To list the files in LFS storage execute the command

git lfs ls-files


To fetch only a single file from the LFS storage use

git lfs fetch origin <filename>
git lfs checkout <filename>


Sometimes the local LFS cache is corrupted. In this case use the commands

git lfs uninstall
git lfs install
git lfs fetch --all
git lfs checkout

to fix it.

If that does not help try these commands:

git lfs clean --force
git lfs fetch --all
git lfs checkout


To empty the LFS cache use

git lfs prune


To get more messages from git use these commands:

GIT_TRACE=1 GIT_CURL_VERBOSE=1 git lfs pull



fatal: not a git repository: '/datapool001/develop/iodeos/.repo/projects/external/abseil-cpp.git'
The command repo sync fails because a directory that should be a git repository is not a git repository, e.g:

[xtrnaw7@t15g /datapool001/develop/iodeos]$ repo sync external/abseil-cpp
fatal: not a git repository: '/datapool001/develop/iodeos/.repo/projects/external/abseil-cpp.git'

platform/external/abseil-cpp:
fatal: not a git repository: '/datapool001/develop/iodeos/.repo/projects/external/abseil-cpp.git'
platform/external/abseil-cpp: sleeping 4.0 seconds before retrying
fatal: not a git repository: '/datapool001/develop/iodeos/.repo/projects/external/abseil-cpp.git'
Syncing: 100% (1/1), done in 4.395s
error: Unable to fully sync the tree
error: Downloading network changes failed.
Failing repos (network):
external/abseil-cpp
Try re-running with "-j1 --fail-fast" to exit at the first error.
================================================================================
Repo command failed due to the following `SyncError` errors:
GitCommandError: 'fetch --quiet --progress aosp --prune --recurse-submodules=no --tags tag android-15.0.0_r32 +refs/tags/android-15.0.0_r32:refs/tags/android-15.0.0_r32 +refs/tags/*:refs/tags/*' on platform/external/abseil-cpp failed
stdout: fatal: not a git repository: '/datapool001/develop/iodeos/.repo/projects/external/abseil-cpp.git'
[xtrnaw7@t15g /datapool001/develop/iodeos]$

In this case, check the contents of the directory:

[xtrnaw7@t15g /datapool001/develop/iodeos]$ ls -al .repo/projects/external/abseil-cpp.git/
total 43
drwxrwxr-x.   3 xtrnaw7 xtrnaw7   6 Nov 10 22:04 .
drwxrwxr-x. 459 xtrnaw7 xtrnaw7 459 Nov 10 18:41 ..
-rw-rw-r--.   1 xtrnaw7 xtrnaw7 214 Nov 10 17:31 config
drwxrwxr-x.   2 xtrnaw7 xtrnaw7   3 Nov 10 17:30 info
-rw-rw-r--.   1 xtrnaw7 xtrnaw7 308 Nov 10 22:04 .repo_config.json
lrwxrwxrwx.   1 xtrnaw7 xtrnaw7  66 Nov 10 17:30 rr-cache -> ../../../project-objects/platform/external/abseil-cpp.git/rr-cache
[xtrnaw7@t15g /datapool001/develop/iodeos]$

If the git config files like HEAD, FETACH_HEAD, etc are missing are the git repository is corrupt (most probably the sync for that repository was aborted or failed).

To fix the error delete the local copies of the repository:

rm -rf .repo/projects/external/abseil-cpp.git
rm -rf .repo/project-objects/platform/external/abseil-cpp.git


and sync the repository again, e.g.:

repo sync external/abseil-cpp


Check the result:

[xtrnaw7@t15g /datapool001/develop/iodeos]$ ls -al .repo/projects/external/abseil-cpp.git/
total 247
drwxrwxr-x.   5 xtrnaw7 xtrnaw7     14 Nov 11 07:05 .
drwxrwxr-x. 459 xtrnaw7 xtrnaw7    459 Nov 11 07:02 ..
-rw-rw-r--.   1 xtrnaw7 xtrnaw7    361 Nov 11 07:02 config
-rw-rw-r--.   1 xtrnaw7 xtrnaw7     73 Nov 11 07:02 description
-rw-rw-r--.   1 xtrnaw7 xtrnaw7 293075 Nov 11 07:05 FETCH_HEAD
-rw-rw-r--.   1 xtrnaw7 xtrnaw7     41 Nov 11 07:05 HEAD
lrwxrwxrwx.   1 xtrnaw7 xtrnaw7     63 Nov 11 07:02 hooks -> ../../../project-objects/platform/external/abseil-cpp.git/hooks
-rw-rw-r--.   1 xtrnaw7 xtrnaw7 170848 Nov 11 07:05 index
drwxrwxr-x.   2 xtrnaw7 xtrnaw7      3 Nov 11 07:02 info
drwxrwxr-x.   3 xtrnaw7 xtrnaw7      4 Nov 11 07:05 logs
lrwxrwxrwx.   1 xtrnaw7 xtrnaw7     65 Nov 11 07:02 objects -> ../../../project-objects/platform/external/abseil-cpp.git/objects
drwxrwxr-x.   5 xtrnaw7 xtrnaw7      5 Nov 11 07:05 refs
-rw-rw-r--.   1 xtrnaw7 xtrnaw7    525 Nov 11 07:05 .repo_config.json
lrwxrwxrwx.   1 xtrnaw7 xtrnaw7     66 Nov 11 07:02 rr-cache -> ../../../project-objects/platform/external/abseil-cpp.git/rr-cache
[xtrnaw7@t15g /datapool001/develop/iodeos]$


To resync all corrupt repositories in ./projects/external this script can be used:

# for testing the commands use:
# PREFIX=echo

PREFIX=""

for CUR_DIR in  .repo/projects/external/*.git ; do
   [  -r ${CUR_DIR}/HEAD ] && continue
   echo
   CUR_REPO_DIR="${CUR_DIR##*/}"

   CUR_REPO="${CUR_REPO_DIR%.*}"

   echo "Resynching the repository \"${CUR_REPO}\" ..."

   ${PREFIX} rm -rf .repo/projects/external/${CUR_REPO_DIR}
   ${PREFIX} rm -rf .repo/project-objects/platform/external/${CUR_REPO_DIR}

   ${PREFIX} repo sync ${i##*/}
done




error: could not lock config file /datapool001/develop/iodeos/6.x/.repo/projects/device/common.git/config: File exists
An error like this

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$ repo sync device/common
Syncing:  0% (0/1) 0:00 | ..working..error.GitError: Cannot fetch git config ('--replace-all', 'remote.aosp.url', 'https://android.googlesource.com/device/common'): error: could not lock config file /datapool001/develop/iodeos/6.x/.repo/projects/device/common.git/config: File exists

Syncing: 100% (1/1), done in 0.113s
error: Unable to fully sync the tree
error: Downloading network changes failed.
Failing repos (network):
device/common
Try re-running with "-j1 --fail-fast" to exit at the first error.
================================================================================
Repo command failed due to the following `SyncError` errors:
git config ('--replace-all', 'remote.aosp.url', 'https://android.googlesource.com/device/common'): error: could not lock config file /datapool001/develop/iodeos/6.x/.repo/projects/device/common.git/config: File exists

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$

is caused by an interrupted sync : The sync failed but the lock file for the sync was not removed.

To fix the error, remove the lock file

rm -f .repo/projects/device/common.git/config.lock

and delete the incomplete repositories

rm -rf .repo/projects/device/common.git
rm -rf .repo/project-objects/*device_common*.git
rm -rf device/common

The sync the repository again:

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$ repo sync device/common
Syncing: 100% (1/1), done in 3.376s
repo sync has finished successfully.
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$




 
Cannot checkout lineage/bionic: Cannot initialize work tree for lineage/bionic
This error

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$ repo sync bionic
Syncing:  0% (0/1) 0:00 | 1 job | 0:00 lineage/bionic @ bionicerror.GitError: Cannot checkout lineage/bionic: Cannot initialize work tree for lineage/bionic
fatal: this operation must be run in a work tree
Syncing: 100% (1/1), done in 0.254s
error: Unable to fully sync the tree
error: Checking out local projects failed.
Failing repos (checkout):
bionic
Try re-running with "-j1 --fail-fast" to exit at the first error.
================================================================================
Repo command failed due to the following `SyncError` errors:
Cannot initialize work tree for lineage/bionic
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$

is also caused by an interrupted or failed sync .

To fix the error, remove the repositories

rm -rf bionic
rm -rf .repo/projects/bionic.git
rm -rf .repo/project-objects/*bionic*.git

and sync again

repo sync -c --force-sync --no-clone-bundle --no-tags -j1 bionic

----


--------


History of this entry
04.02.2024

initial release

05.02.2024
 
updated the section about failures for unkown reasons

25.03.2025

added the hints for git lfs errors

11.11.2025

added the infos to fix corrupt git repositories
added the infos to fix errors caused by interrupted syncs
added the commands to fix corrupted repositories





Some hints for fixing errors building an Custom ROM Android image


URL: https://xdaforums.com/t/some-hints-for-fixing-errors-building-an-custom-rom-android-image.4655328/


Some hints for fixing errors building an Custom ROM Android image
In this post I summarize all the errors I have encountered so far when creating a custom ROM Android image (in most cases the OmniROM). I'm using a Linux system with Fedora to build the Android image, but I suspect that the errors listed may also occur in other environments.

I will update this post as soon as I receive a new bug.

A change log of the changes can be found at the end of this entry.



Building the image fails with an error like this: unrecognized property "versions_with_info"


ERROR: unrecognized property "versions_with_info"
If the compile fails with error messages like these:

error: vendor/qcom/opensource/interfaces/wifi/supplicant/aidl/Android.bp:16:23: unrecognized property "versions_with_info"
error: vendor/qcom/opensource/interfaces/bluetooth_audio/aidl/Android.bp:17:23: unrecognized property "versions_with_info"

Do a forced repo sync:

repo sync --force-sync

and start the compile process again .



Building the image fails with an error like this: hardware/qcom-caf/sm8350/display/libhistogram/Android.bp:15:1: "libhistogram" depends on undefined module "qti_kernel_headers"

ERROR:  .. depends on undefined module ....
If the compile fails with error messages like these:

[100% 1027/1027] analyzing Android.bp files and generating ninja file at out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out "out"     -o out/soong/build.ninja --baze
l-mode --globListDir build --globFile out/soong/globs-build.ninja -t -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.build Android.bp
error: hardware/qcom-caf/sm8350/display/libhistogram/Android.bp:15:1: "libhistogram" depends on undefined module "qti_kernel_headers".
Module "libhistogram" is defined in namespace "." which can read these 5 namespaces: ["." "." "device/generic/goldfish-opengl" "device/generic/goldfish" "hardware/google/camera/devices/EmulatedCamera"]
Module "qti_kernel_headers" can be found in these namespaces: ["hardware/google/pixel" "kernel/asus/sm8350"]
Or did you mean ["device_kernel_headers" "kernel_log_monitor" "libkernel_cmdline" "qti_powerhal_headers"]?
error: hardware/qcom-caf/sm8350/display/libmemutils/Android.bp:1:1: "libmemutils" depends on undefined module "qti_kernel_headers".
Module "libmemutils" is defined in namespace "." which can read these 5 namespaces: ["." "." "device/generic/goldfish-opengl" "device/generic/goldfish" "hardware/google/camera/devices/EmulatedCamera"]
Module "qti_kernel_headers" can be found in these namespaces: ["hardware/google/pixel" "kernel/asus/sm8350"]
Or did you mean ["device_kernel_headers" "kernel_log_monitor" "libkernel_cmdline" "qti_powerhal_headers"]?
06:33:04 soong bootstrap failed with: exit status 1


Check the first lines about the config in the output of the build tools, e.g.:

...
making libs for aosp_arm-userdebug
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=14
PRODUCT_INCLUDE_TAGS=com.android.mainline
TARGET_PRODUCT=aosp_arm

TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=generic
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.6.14-200.fc39.x86_64-x86_64-Fedora-Linux-39-(MATE-Compiz)
HOST_CROSS_OS=windows
BUILD_ID=UQ1A.240205.004.B1
OUT_DIR=out
============================================
...


If the values for TARGET_PRODUCT, TARGET_ARCH, or TARGET_ARCH_VARIANT are not okay, you did not initialize the environment. To fix this error execute these commands:

. ./build/envsetup.sh

lunch omni_zenfone8-user


(replace omni_zenfone8-user with your the tag for your phone or use the command brunch to select from a list)

Afterwards check the results using the command printconfig, e.g.:

xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ printconfig
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=14
PRODUCT_INCLUDE_TAGS=com.android.mainline
TARGET_PRODUCT=omni_zenfone8
TARGET_BUILD_VARIANT=user
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.6.14-200.fc39.x86_64-x86_64-Fedora-Linux-39-(MATE-Compiz)
HOST_CROSS_OS=windows
BUILD_ID=UQ1A.240205.004.B1
OUT_DIR=out
ROM_BUILDTYPE=WEEKLY
============================================
xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$


and repeat the failed command.

The function printconfig is defined in the file ./build/envsetup.sh so in case you get this error:

xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ printconfig
bash: printconfig: command not found
xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ 


you did not source in ./build/envsetup.sh.





Building the image fails with an error like this : java.util.zip.ZipException: zip END header not found


ERROR: java.util.zip.ZipException: zip END header not found

If the build of the OmniROM installation image fails with error messages like this:

[ 28% 392/1395] //vendor/asus/zenfone8:AsusGalleryBurst signapk [common]
FAILED: out/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/signed/AsusGalleryBurst.apk
rm -f out/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/signed/AsusGalleryBurst.apk && prebuilts/jdk/jdk17/linux-x86/bin/java -XX:OnError="cat hs_err_pid%p.log" -XX:CICompilerCount=6 -XX:+UseDynamicNumberOfGCThreads
 -Djava.library.path=$(dirname out/host/linux-x86/lib64/libconscrypt_openjdk_jni.so) -jar out/host/linux-x86/framework/signapk.jar  build/make/target/product/security/platform.x509.pem build/make/target/product/security/platform.pk8 out/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/dex-uncompressed/AsusGalleryBurst.apkout/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/signed/AsusGalleryBurst.apk
java.util.zip.ZipException: zip END header not found

    at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1469)
....



Check the type of the source apk file from the error message:

xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ ls -l ./out/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/dex-uncompressed/AsusGalleryBurst.apk
-rw-rw-r-- 1 xtrnaw7 xtrnaw7 132 Jan 22 09:40 ./out/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/dex-uncompressed/AsusGalleryBurst.apk
xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$


xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ file  ./out/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/dex-uncompressed/AsusGalleryBurst.apk
./out/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/dex-uncompressed/AsusGalleryBurst.apk: ASCII text
xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$


xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ cat  ./out/soong/.intermediates/vendor/asus/zenfone8/AsusGalleryBurst/android_common/dex-uncompressed/AsusGalleryBurst.apk
version https://git-lfs.github.com/spec/v1
oid sha256:99eabd18346f546f38788ea9f64843f7a05fca87b3c1166b65be67f3a81bc722
size 6486605
xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$


These file contents are invalid -- that must be an installable Android apk file.

This error could be caused by a missing git component. To double check, check the file type of the original apk file in your local repositories:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ file vendor/asus/zenfone8/proprietary/priv-app/AsusGallery/AsusGallery.apk
vendor/asus/zenfone8/proprietary/priv-app/AsusGallery/AsusGallery.apk: ASCII text
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


In this case most probably the git command line extension git lfs is missing, use this command to check that:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ git lfs
git: 'lfs' is not a git command. See 'git --help'.

The most similar command is
    log
[ OmniRom 14 Dev - xtrnaw7@t15g


To fix the issue install git lfs - in Fedora this can be done using this command:

sudo dnf install git-lfs


Afterwards delete all files in the directory vendor/asus in your local repository and re-sync again to fetch the correct files:

cd <local_omnirom14_repository>
rm -rf vendor/asus/../../.repo/projects/vendor/asus.git
rm -rf vendor/asus/.git vendor/asus/.gitattributes vendor/asus
#
# fetch the ASUS packages again
#
repo sync


Check the result

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ file vendor/asus/zenfone8/proprietary/priv-app/AsusGallery/AsusGallery.apk
vendor/asus/zenfone8/proprietary/priv-app/AsusGallery/AsusGallery.apk: Zip archive data, at least v0.0 to extract, compression method=deflate
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $




Building the image fails with an error like this: fatal error: 'sound/voice_params.h' file not found


ERROR: fatal error: 'sound/voice_params.h' file not found
If the build of the OmniROM installation image fails with an error message like this

hardware/qcom-caf/sm8350/audio/hal/msm8974/platform.h:26:10: fatal error: 'sound/voice_params.h' file not found
#include <sound/voice_params.h>


or

hardware/qcom-caf/sm8350/audio/hal/audio_extn/spkr_protection.c:86:10: fatal error: 'linux/msm_audio_calibration.h' file not found
#include <linux/msm_audio_calibration.h>

you may try this approach:

# init the environment
#
. build/envsetup.sh

# cleanup the out directory (optional)
#
m clean

# select the phone model
#
lunch omni_zenfone8-user

# create the kernel
# (this command will only create the kernel, e.g. out/target/product/zenfone8/kernel)
#
mka kernel

# now create the complete image
#
brunch omni_zenfone8-user


If building the OS image fails again after a executing "repo sync", recreate the kernel again using these commands

lunch omni_zenfone8-user
mka kernel


before creating the OS image 



Building the image fails with an error like this: soong bootstrap failed with: exit status 1


ERROR: FAILED: out/soong/build.ninja
If creating the CustomROM image fails with an error message like this

[100% 3/3] analyzing Android.bp files and generating ninja file at out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --to
p "$TOP"     --soong_out "out/soong"     --out "out"     -o out/soong/build.ninja --bazel-mode --globListDir build --globFile out/soong/globs-build.ninja -t -
l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.build Android.bp
22:49:28 soong bootstrap failed with: exit status 1

and no other messages it might be because of an out of memory error. In this case check the OS log file for OOM messages, e.g.:

xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$ sudo grep -i "Out of memory" /var/log/messages | tail -2
Feb  7 22:49:25 fedora01 kernel: Out of memory: Killed process 358524 (soong_build) total-vm:39409176kB, anon-rss:25785600kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:64432kB oom_score_adj:0
Feb  7 23:30:59 fedora01 kernel: Out of memory: Killed process 361853 (soong_build) total-vm:40314564kB, anon-rss:25975352kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:65144kB oom_score_adj:0
xtrnaw7@fedora01:/data/develop/android/OmniROM_14.0$


-> soong_build is one of the processes used to build the image

To fix it either add more memory or swap. Another possible workaround for virtual machine is to remove CPUs from the virtual machine; the build process creates parallel running tasks depending on the number of CPUs and each process needs it own memory workload (according to aunt google you should calculate about 4 GB memory per used CPU plus 2 GB for the general tasks for the build)

To test if the command will work with less CPUs try these commands in the root directory for the repository:

. /build/envsetup

m -j4


(where 4 is the number of CPUs that should be used for the compile)

In Linux you might also use the command taskset to start a process with restricted CPU usage, e.g.:

taskset -c 0-2 bash

will start a bash that can only use the CPUs 0,1, and 2. This is also true for all processes started from within this shell




Building the image fails with an error like this: libcrypto's ABI has EXTENDING CHANGES. Please check compatibility report


ERROR: libcrypto's ABI has EXTENDING CHANGES. Please check compatibility report
If creating the CustomROM image fails with an error message like this:

[ 81% 144559/176309] //external/boringssl:libcrypto header-abi-diff libcrypto.so.abidiff
FAILED: out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.abidiff
(prebuilts/clang-tools/linux-x86/bin/header-abi-diff -target-version current -allow-unreferenced-changes -allow-unreferenced-elf-symbol-changes -lib libcrypto -arc
h arm64 -o out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.abidiff -new out/soong/.intermediates/external
/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.lsdump -old prebuilts/abi-dumps/vndk/34/64/arm64/source-based/libcrypto.so.lsdump)|| (echo
 'error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libcrypto' && (mkdir -p $DI
ST_DIR/abidiffs && cp out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_armv8-a_shared/libcrypto.so.abidiff $DIST_DIR/abidiffs/) && exi
t 1)
******************************************************
error: libcrypto's ABI has EXTENDING CHANGES. Please check compatibility report at: out/soong/.intermediates/external/boringssl/libcrypto/android_vendor.34_arm64_a
rmv8-a_shared/libcrypto.so.abidiff
******************************************************
error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libcrypto
22:11:58 ninja failed with: exit status 1

#### failed to build some targets (04:21:04 (hh:mm:ss)) ####


fix the error using these commands:

. ./build/envsetup.sh

lunch omni_zenfone8-user

${ANDROID_BUILD_TOP}/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libcrypto -products  $TARGET_PRODUCT --build-variant $TARGET_BUILD_VARIANT


see also this post: https://xdaforums.com/t/major-bug-in-android-14-breaks-building-aosp-on-debian-ubuntu.4636394/ 

AFAIK this error may occurs after the openssl libraries of the OS used to compile the Android image are updated to a new version.



Building the image fails with error messages about duplicat modules


ERROR: module "qcom.fmradio_defaults" already defined
If creating the CustomROM image fails with an error message like this:

error: vendor/qcom/opensource/fm-commonsys/qcom/fmradio/Android.bp:1:1: module "qcom.fmradio_defaults" already defined
       vendor/qcom/opensource/commonsys/fm/qcom/fmradio/Android.bp:1:1 <-- previous definition here
error: vendor/qcom/opensource/fm-commonsys/qcom/fmradio/Android.bp:6:1: module "qcom.fmradio" already defined
       vendor/qcom/opensource/commonsys/fm/qcom/fmradio/Android.bp:6:1 <-- previous definition here
error: vendor/qcom/opensource/fm-commonsys/qcom/fmradio/Android.bp:14:1: module "qcom.fmradio.xml" already defined
       vendor/qcom/opensource/commonsys/fm/qcom/fmradio/Android.bp:14:1 <-- previous definition here
ninja: build stopped: subcommand failed.

remove the roomservice

rm .repo/local_manifests/roomservice.xml

and try again




Executing lunch omni_zenfone8-user fails with "Invalid lunch combo"


ERROR: lunch fails with "Invalid lunch combo"
If the lunch, brunch, or breakfast command fails with an error message like this

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ lunch omni_zenfone8-user

Invalid lunch combo: omni_zenfone8-user
Valid combos must be of the form <product>-<release>-<variant>
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $

this is most probably caused by the new version configuration in AOSP since Q1 2024 -- see Infos for building a CustomROM image for details




Building the image fails with the error thread exhaustion



ERROR: program exceeds 10000-thread limit
If building the image fails because a thread limit was exceeded:

runtime: program exceeds 10000-thread limit
fatal error: thread exhaustion

this may be caused by invalid symbolic links in the directory ./out and you moved or copied the build tree to a new directory.

There are some absolute symbolic links in the directory ./out in the build tree and these links are broken after moving or copying the directory tree.

To fix it either correct the invalid symbolic links or clean the complete ./out directory.




Building the image fails with the error message extract-cert.c:24:10: fatal error: 'openssl/engine.h' file not found


ERROR: .../extract-cert.c:24:10: fatal error: 'openssl/engine.h' file not found
In newer Linux OS versions, creating the OmniROM 14 or OmniROM 15 image may fail with an error message like this:

make[1]: Entering directory '/devpool001/develop/OmniROM_14.0_eng/out/target/product/zenfone8/obj/KERNEL_OBJ'
  GEN     Makefile
  HOSTCC  scripts/extract-cert
/devpool001/develop/OmniROM_14.0_eng/kernel/asus/sm8350/scripts/extract-cert.c:24:10: fatal error: 'openssl/engine.h' file not found
   24 | #include <openssl/engine.h>
      |          ^~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [scripts/Makefile.host:107: scripts/extract-cert] Error 1


The reason for this error is the missing support for the OpenSSL engine in the Linux OS used to build the OmniROM image.
Support for the OpenSSL engine has been removed in the OpenSSL packages of some of the current LInux distributions (such as Fedora 41)

A work around to avoid the error is :

Install the missing files for the OpenSSL engine in the Linux OS used to build the OmniROM image.



Notes:


extract-cert is a x86 binary used in the build process to create the OmniROM image:

[xtrnaw7@t15g /datapool001/develop/lineageos]$ file /devpool001/develop/OmniROM_15.0/out/target/product/zenfone8/obj/KERNEL_OBJ/scripts/extract-cert
/devpool001/develop/OmniROM_15.0/out/target/product/zenfone8/obj/KERNEL_OBJ/scripts/extract-cert: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not stripped
[xtrnaw7@t15g /datapool001/develop/lineageos]$


I found this error while building the OmniROM image on a PC running Fedora 41.

Prior to Fedora 41, the files for the OpenSSL engine were part of the OpenSSL develop package; in Fedora 41 these files are in a a separate package (which is not installed by default while updating the OS from Fedora 40 to Fedora 41)

The command to install the missing files in Fedora 41 is:

sudo dnf install openssl-devel-engine.x86_64

(see https://discussion.fedoraproject.org/t/f41-change-proposal-disable-openssl-engine-support-system-wide/107511 for details regarding this issue in Fedora 41)

This error description is for Fedora but I guess the error might also occur on other Linux distributions.




The lunch or brunch command complains about a missing remote definition


ERROR: error: in `sync --force-sync --no-clone-bundle device/asus/zenfone8`: remote omnirom2 not defined in /data/develop/OmniROM_15.0/.repo/manifest.xml

If the lunch or brunch command ends with an error like this

error: in `sync --force-sync --no-clone-bundle device/asus/zenfone8`: remote omnirom2 not defined in /data/develop/OmniROM_15.0/.repo/manifest.xml

the definition of one of the remote repositories used in the XML files is missing.

In this example the definition for the remote repository omnirom2 is missing.

To fix that error, add the missing definition for the remote repository to one of the XML files used - IMHO it shoud be added to the file .repo/local_manifests/local_manifests. Example:

[xtrnaw7@arcolinux OmniROM_15.0]$ grep -B3 -A3  omnirom2 .repo/local_manifests/local_manifest.xml

<manifest>

<remote  name="omnirom2"
           fetch="ssh://git@github.com/omnirom"
           review="gerrit.omnirom.org" />

[xtrnaw7@arcolinux OmniROM_15.0]$


If the missing remote repository is not used in any of the XML files, it may be the default repository used. To see the repository used by default, check the script roomservice.py:

[xtrnaw7@arcolinux OmniROM_15.0]$ grep -E "default_rem |default_team_rem " ./vendor/omni/build/tools/roomservice.py 
default_rem = "omnirom2"
default_team_rem = "omnirom2"
[xtrnaw7@arcolinux OmniROM_15.0]$




The brunch command ends with an error in the config files for another phone


see How to temporary disable the config files for a specific phone in the repositories for details


The build command fails with an error message about a missing TARGET_RELEASE


build/make/core/release_config.mk:273: error: No release config set for target; please set TARGET_RELEASE, or if building on the command line use 'lunch <target>-<release>-<build_type>', where release is one of: .
An error like this:

xtrnaw7@t540p:/devpool001/develop/evolutionX$ mka vendorimage systemimage
In file included from build/make/core/config.mk:406:
In file included from build/make/core/envsetup.mk:51:
build/make/core/release_config.mk:273: error: No release config set for target; please set TARGET_RELEASE, or if building on the command line use 'lunch <target>-<release>-<build_type>', where release is one of: .
20:31:44 dumpvars failed with: exit status 1

#### failed to build some targets (13 seconds) ####

xtrnaw7@t540p:/devpool001/develop/evolutionX$

occurs if the lunch command was not executed or did not succeed.




external/prebuiltapks/Browser/arm64/TrichromeLibrary.apk: error: failed opening zip: Invalid file.


external/prebuiltapks/Browser/arm64/TrichromeLibrary.apk: error: failed opening zip: Invalid file.
If you get an error about corrupted apk files like this

external/prebuiltapks/Browser/arm64/TrichromeLibrary.apk: error: failed opening zip: Invalid file.
error: Command '['out/host/linux-x86/bin/aapt2', 'dump', 'badging', 'external/prebuiltapks/Browser/arm64/TrichromeLibrary.apk']' returned non-zero exit status 1.
18:58:18 ninja failed with: exit status 1

check the apk file. If the file looks like this:

[xtrnaw7@t540p /devpool001/develop/e/a15_3.1.1]$ file external/prebuiltapks/Browser/arm64/TrichromeLibrary.apk
external/prebuiltapks/Browser/arm64/TrichromeLibrary.apk: ASCII text

[xtrnaw7@t540p /devpool001/develop/e/a15_3.1.1]$
[xtrnaw7@t540p /devpool001/develop/e/a15_3.1.1]$ cat external/prebuiltapks/Browser/arm64/TrichromeLibrary.apk
version https://git-lfs.github.com/spec/v1
oid sha256:01a7381b4a8bd93b131487d0695fc35293199db81f5874d29c3cdaa37e4da61c
size 191448932
[xtrnaw7@t540p /devpool001/develop/e/a15_3.1.1]$

the file is an git LFS Pointer File. To fix that error, install the git lfs extension if not already done using the command

git lfs install

and then pull the real files from the repository:

cd external/prebuiltapks
git lfs pull

To avoid these kind of errors, execute the command

 repo forall -c 'git lfs pull

after every "repo sync" command.

To check wether the git lfs extension is alreay installed use the command

git lfs version

the output should look like this:

[ OmniRom 16 (devpool) - xtrnaw7@t15g ~ ] $ git lfs version
git-lfs/3.6.1 (GitHub; linux amd64; go 1.23.4)
[ OmniRom 16 (devpool) - xtrnaw7@t15g ~ ] $


---




History of this entry
08.02.2024

initial release

09.02.2024

added hint about missing environment setup 
added hint about how fix libcrypto AIB error 

02.03.2024

added hint about fixing duplicate module definitions 

29.03.2024

added the hint about Executing lunch omni_zenfone8-user fails with "Invalid lunch combo"  

24.06.2024

added the hint about Building the image fails with the error thread exhaustion 

14.01.2025

added the hint about Building the image fails with the error message extract-cert.c:24:10: fatal error: 'openssl/engine.h' file not found   
 
15.01.2025

added the hint about the error The lunch or brunch command complains about a missing remote definition  

07.08.2025

added the hint about The brunch command ends with an error in the config files for another phone     
added the hint about The build command fails with an error message about missing TARGET_RELEASE   

14.09.2025

added the hint about the usage of Git LFS pointers  

---

 

Infos for building an Android 14 based Custom ROM image in Q1 2024 or later


URL: https://xdaforums.com/t/infos-for-building-an-android-14-based-customrom-image-in-q1-2024-or-later.4664652/


Infos for building a Custom ROM image in Q1 2024 or later



Notes:

The info below are for building the OmniROM 14 for the ASUS Zenfone 8. But I assume that this is also true for other AOSP based Custom ROMs.
brunch and breakfast are commands defined in the init script for OmniROM and may not be available in other Custom ROMs


Credits

Thanks to the OmniROM developer for this hint.




Attempting to create a new OmniROM image based on Android 14 using the well-known parameter for the command lunch in Q1 2024 or later may fail with this error:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ lunch omni_zenfone8-user

Invalid lunch combo: omni_zenfone8-user
Valid combos must be of the form <product>-<release>-<variant>
[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


This is because Google changed the naming conventions for Android releases created with Google's repositories in QPR2 (QPR = Quarterly Platform Releases; QPR2 for Android 14 is the Android Security Patch android-14.0.0_r29 from 05.3.2024) :

It's now necessary to specify a specific version to create a new image using the commands lunch and brunch (see envsetup.sh).

To get the necessary values for the lunch and brunch command check the entries in the file AndroidProducts.mk for your device:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ cat ./device/asus/zenfone8/AndroidProducts.mk
PRODUCT_MAKEFILES := \
    $(LOCAL_DIR)/omni_zenfone8.mk

COMMON_LUNCH_CHOICES := \
    omni_zenfone8-ap1a-user \
    omni_zenfone8-ap1a-userdebug \
    omni_zenfone8-ap1a-eng


The example above is for a ASUS Zenfone 8; the file used for other phones is most probably in a different directory, of course)


So the commands lunch and brunch to build the OmniROM 14 image for an ASUS Zenfone 8 are now:

lunch omni_zenfone8-ap1a-user

brunch zenfone8 ap1a user


(use the parameter eng or userdebug instead of user for one of the other flavours of the ROM image).

The version string used, ap1a, is part of the build_id for the current security patch level: 




(see here: https://source.android.com/docs/setup/reference/build-numbers#source-code-tags-and-builds)


To check whether an AOSP source tree uses the new version definition, check whether the repository build/release exists, e.g:


[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ repo info build/release
Manifest branch: refs/tags/android-14.0.0_r29
Manifest merge branch: refs/heads/android-14.0
Manifest groups: default,platform-linux
----------------------------
Project: platform/build/release
Mount path: /devpool001/develop/OmniROM_14.0/build/release
Current revision: b63ef38d4ff1ced7ed8c16733b2b19c8d421aff8
Manifest revision: refs/tags/android-14.0.0_r29
Local Branches: 0
----------------------------
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $



In an AOSP source tree using the old version definitions the output looks like this:

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0_patch_2024-02-05 ] $ repo info build/release
Manifest branch: refs/tags/android-14.0.0_r27
Manifest merge branch: refs/heads/android-14.0
Manifest groups: default,platform-linux
----------------------------
error: project build/release not found
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0_patch_2024-02-05 ] $



I wrote a little script, print_security_patch, to print the current Security Patch level and build id for an AOSP based repository tree.
This script works for repositories that were last updated before Q1 2024 and after Q1 2024.

The script was only tested with the repositories for OmniROM 14 but I think it should work with every AOSP based repository tree.


Usage:

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ /data/develop/android/scripts_on_linux/print_security_patch  -h

print_security_patch - print the security patch and the the build id used in an repository tree for AOSP

This script works for repositories that were last updated before Q1 2024 and after Q1 2024.
The script must be executed at the top level in a repository tree for AOSP

[ OmniRom 14 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $



Examples
executed in the top level of an Android repository tree using the old definitions

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0_patch_2024-02-05 ] $  /data/develop/android/scripts_on_linux/print_security_patch ; echo "RC=$?"
The repository uses the old definitions
The current security patch is "2024-02-05"

The current build_id is "UP1A"
RC=1
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0_patch_2024-02-05 ]



executed in the top level of an Android repository tree using the new definitions

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $  /data/develop/android/scripts_on_linux/print_security_patch ; echo "RC=$?"
The repository uses the new definitions
The current security patch is "2024-03-05"

The current build_id is "ap1a"
RC=0
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $



sourced in in the top level of an Android repository tree using the new definitions

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ .  /data/develop/android/scripts_on_linux/print_security_patch
The repository uses the new definitions
The current security patch is "2024-03-05"

The current build_id is "ap1a"

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ echo $RELEASE_PLATFORM_SECURITY_PATCH
2024-03-05

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ echo $BUILD_ID
ap1a

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $ echo $REPO_FORMAT
new

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_14.0 ] $




The script can be downloaded from here: print_security_patch

Update 09.04.2024/bs

There is now a new version of the script available - see How to print the security patch level used in repositories or ROM image zip files for details.


Notes

Note that as of 29.03.2024 the command breakfast does not work anymore in repository trees with the new version definitions.

See How to compile the OmniROM 14 for the the ASUS Zenfone 8 for general instructions how to create your own Custom ROM image with OmniROM 14.






How to boot the ASUS Zenfone 8 into the bootloader using the physical buttons


URL: not yet published


How to boot the ASUS Zenfone 8 into the bootloader using the physical buttons
If an ASUS Zenfone 8 is no longer "usable", e.g. no longer boots, is stuck in a boot loop, etc., you can use the physical buttons to restart the phone in the bootloader.

  1. Power-off the phone using this approach : Press Volume Up, Volume Down, and the Power button at the same time for at least 10 seconds
  2. when the phone is really powered off: Press Volume Up , Volume Down, and the Power button at the same time until the bootloader prompt appaers
  3. now release the Power button but not the Volume Up and Volume Down buttons
  4. next release the Volume Up and Volume Down button
Now the phone should be in the bootloader.

If the OS on the phone is corrupted and it's not possible to install a new one, you can always install a raw image of the ASUS Android for the ASUS Zenfone 8 see here for instructions https://xdaforums.com/t/full-recover-to-stock-if-things-went-really-bad.4337467/
Note that a raw image can also be installed on phones with locked boot loader.

Unfortunately, ASUS has removed the raw images from their website, but some of the raw images are still available for download on other sites; a list can be found in this forum post: https://xdaforums.com/t/zenfone-8-firmware-ota-collection.4620171/

The installation of a raw image destroys all data on the phone, but you can continue to use the phone by installing an official Android from ASUS again (or a CustomROM if the bootloader of the phone is locked).

Note that this approach also works if the phone is in the ramdump after a crash



How to create a TWRP image for LineageOS based ROMs using a script


URL: https://xdaforums.com/t/how-to-use-twrp-if-lineageos-20-x-is-installed.4599721/#post-89582817


How to create a TWRP image for LineageOS based ROMs using a script


Update 23.07.2025

see the section How to create a TWRP recovery image for LineageOS 22  for information about creating a TWRP image for LineageOS 22.0 or newer.




The default TWRP image for the ASUS Zenfone 8 will no longer boot if a ROM based on LineageOS 20 or newer is installed on the phone - see How to use TWRP if LineageOS 20.x is installed for details. The post about how to use TWRP for these ROMs includes instructions to create an "ugly" TWRP image for use with these ROMs. But unfortunatley, it doesn't seeem to be possible to create a TWRP image for all LinegageOS based ROMs. Even worse, it looks like every other release of an LineageOS based ROM requires a TWRP image for that version.

I've read some posts and blog entries that TWRP is no longer needed for LineageOS as all necessary tasks can be performed with the recovery from the LineageOS, but I don't think so.

After booting the phone into LineageOS recovery, adb is not enabled by default in the user builds; that may be safe, but it's not very useful because you can't use the adb access to the phone in recovery mode for automatic tasks via script.
I finally figured out how to "fix" this problem (see How to add files to the ramdisk used for the recovery boot), but there is another drawback: /data is not mounted if the phone is booted into the LineageOS recovery and so far I do not know if /data can be mounted while the phone is booted into the LineageOS recovery.

In TWRP, adb is enabled by default and TWRP can mount /data and decrypt the user files if necessasry - this is also true for the "ugly" TWRP images created for the LineageOS based ROMs. And not to mention the other features of TWRP that are not part of the LineageOS recovery (e.g. a local terminal, the various functions of the twrp binary, etc).

Since I need these features to install and customize these ROMs for my development and testing purpose, and I do not want to manually create the TWRP image for each new OS version, I wrote a small Linux shell script to create a TWRP image for these ROMs:

./create_ugly_twrp_image.sh


create_ugly_twrp_image.sh uses the official TWRP image for the phone and the boot partition from the phone (or an image file with the boot partition) to create a TWRP image for that OS.


The usage for the script is:

[ OmniRom 14 Dev - xtrnaw7@t15g / ] $ /data/develop/android/scripts_on_linux/create_ugly_twrp_image.sh -h

 create_ugly_twrp_image.sh - "create" an TWRP image for an Android OS version not supporting TWRP (e.g an OS based on Lineage 20.x or newer)

 Usage:  create_ugly_twrp_image.sh [-h] [-v] [boot_partition|boot_partition_image_file] [noprop|-p]

[ OmniRom 14 Dev - xtrnaw7@t15g / ] $



Verbose usage

[ OmniRom 14 Dev - xtrnaw7@t15g / ] $ /data/develop/android/scripts_on_linux/create_ugly_twrp_image.sh -h -v

 create_ugly_twrp_image.sh - "create" an TWRP image for an Android OS version not supporting TWRP (e.g an OS based on Lineage 20.x or newer)

 Usage:  create_ugly_twrp_image.sh [-h] [-v] [boot_partition|boot_partition_image_file] [noprop|-p]

 Parameter:

 boot_partition - boot partition on the phone to be used for the TWRP image (default: use the boot partition of the active slot)

 boot_partition_image_file - image file with a boot partition on the PC to be used for the TWRP image

 noprop - do not copy the properties from the running OS

 This script must run on PC running the Linux OS; a working TWRP image for the phone is required and access via adb to the phone
 is required if the script should copy the boot partition for the TWRP image from the phone or change the properties in the ramdisk
 for the new TWRP image
 
 Environment variables used if set:

  MAGISKBOOT    - set this variable to the fully qualified namee of the magiskboot executable if it's not available via the PATH variable
                  (default: search the executable in the PATH)

  ADB           - set this variable to the fully qualified name of the adb executable if it's not available via the PATH variable
                  (default: search the executable in the PATH)

  ADB_OPTIONS   - additional options for adb (there is no default for this variable)

  TWRP_IMAGE    - fully qualified name of the TWRP image to be used to create the new TWRP image

  WORKDIR       - working directory (default: /tmp/create_twrp.$$)

  NEW_TWRP_FILE - name of the TWRP file to create (default: /tmp/twrp_boot.img)

  KEEP_WORK_DIR - set this variable to 0 to not delete the temporary directory at script end
                  (default: only keep the temporary directory if an error occured)

[ OmniRom 14 Dev - xtrnaw7@t15g / ] $



The script supports some environment variables - see the verbose usage above for details.


To be able to detect this TWRP image later in scripts, the script copies some properties from the current running OS to the new TWRP image; these properties are (as of 26.06.2024):

# properties for the TWRP image - the values for these properties are copied to the TWRP image if they exist in the running OS
#
PROPERTIES_TO_COPY_TO_THE_TWRP_IMAGE="
ro.lineage.build.version
ro.statix.version
ro.omni.version
ro.lmodroid.build_name
ro.build.description
ro.build.display.id
"

The properties to copy are hardcoded in the script; properties that are not defined in the running OS are ignored.


The script uses the executable magiskboot from Magisk to unpack and repack the TWRP images.

The magiskboot executable for x86 in the Magisk apk file is a static linked binary that can be executed on any of the modern Linux distributions for x86 PCs.


To get that executable download the Magisk apk file from https://github.com/topjohnwu/Magisk/releases and extract the executable magiskboot for x86 using the commands:

unzip -p  Magisk-v27.0.apk  lib/x86/libmagiskboot.so  >magiskboot && chmod 755 magiskboot


The script can be downloaded from here:  create_ugly_twrp_image.sh

Update 04.06.2025

Since version 2.0.0 the script supports compressed cpio archives in the used TWRP image; all compression formats supported by magiskboot are supported.



Test Environment

All tests were done on an ASUS Zenfone 8.

Tests were done with these ROMs:

/e/, tested with images files for versions 1.21 and 2.0

LineageOS 20, various OS image files

LineageOS 21, various OS image files (downloaded from https://github.com/mikooomich/android_device_asus_sake/releases)

LMODroid,  various OS image files

StatixOS,  various OS image files




History of this entry

26.06.2024

initial release

18.07.2024

the link to download the script did not work -- fixed

04.06.2025

added a hint about the new feature in version 2.0.0 of the script

19.07.2025

added the info that this method to create a TWRP image for LineageOS does not work anymore for LineageOS 22.x

23.07.2025

added the info about using OrangeFox instead of TWRP for creating the recovery for the LineageOS 22.x



How to compile the OrangeFox Recovery for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-orangefox-recovery-for-the-asus-zenfone-8.4692137/


How to compile the OrangeFox Recovery for the ASUS Zenfone 8

The OrangeFox Recovery (https://wiki.orangefox.tech/) is a recovery for Android phones based on TWRP. There is currently no official build of the OrangeFox recovery image for the ASUS Zenfone 8 (see https://orangefox.download/ for the list of officially supported phones) but it's quite simple to create an OrangeFox recovery image for the ASUS Zenfone 8.

There is a detailed guide on how to create an OrangeFox recovery image: https://wiki.orangefox.tech/en/dev/building. This guide is sufficient to create an OrangeFox recovery image for someone who knows how to build an Android ROM.

In this post, I document the steps I took to successfully compile an OrangeFox recovery image for the ASUS Zenfone 8 using the instructions from that page.


First create and init the repository for the OrangeFox recovery image using the instructions from the OrangeFox wiki:


cd /devpool001/develop/orangefox/

mkdir ./OrangeFox_sync
cd ./OrangeFox_sync

git clone https://gitlab.com/OrangeFox/sync.git

cd ./sync/

./orangefox_sync.sh --branch 12.1 --path  /devpool001/develop/orangefox/fox_12.1


The repositories for the OrangeFox recovery images are now in the directory /devpool001/develop/orangefox/fox_12.1.


Now we need the device tree for the ASUS Zenfone 8. Because there is already a TRWP image for the ASUS Zenfone 8 it's not necessary to create a device tree for that phone from scratch. The lunch command automatically downloads the device tree from the TWRP repositories for the phone.

Therefor to start the build use these commands:

cd /devpool001/develop/orangefox/fox_12.1

export ALLOW_MISSING_DEPENDENCIES=true

export FOX_BUILD_DEVICE=I006D

export LC_ALL="C"

# This variable is necessary for installing the recovery via zip file
#
export TARGET_DEVICE_ALT="gssi,ASUS_I006D"


source build/envsetup.sh

lunch twrp_I006D-eng

mka adbd bootimage



Example output
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ ls -l device/
total 1
drwxrwxr-x. 4 xtrnaw7 xtrnaw7 4 Sep 10 22:15 qcom
drwxrwxr-x. 2 xtrnaw7 xtrnaw7 2 Sep 10 22:19 xiaomi
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $

[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ export ALLOW_MISSING_DEPENDENCIES=true
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ export FOX_BUILD_DEVICE=I006D
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ export LC_ALL="C"
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ export TARGET_DEVICE_ALT="gssi,ASUS_I006D"
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ source build/envsetup.sh                 
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ lunch twrp_I006D-eng
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "twrp_I006D".
13:00:32 dumpvars failed with: exit status 1
Device I006D not found. Attempting to retrieve device repository from TeamWin Github (http://github.com/TeamWin).
Found repository: android_device_asus_I006D
Checking branch info
Calculated revision: android-12.1
Adding dependency:
Repository: android_device_asus_I006D
Branch: android-12.1
Remote: TeamWin
Path: device/asus/I006D

Syncing repository to retrieve project.
Fetching: 100% (1/1), done in 5.643s
repo sync has finished successfully.
Repository synced!
Looking for dependencies
Adding dependencies to manifest

Adding dependency:
Repository: android_device_asus_sm8350-common
Branch: android-12.1
Remote: TeamWin
Path: device/asus/sm8350-common

Syncing dependencies
Fetching: 100% (1/1), done in 2.980s
repo sync has finished successfully.
Looking for dependencies
device/asus/sm8350-common has no additional dependencies.
Done

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.10.8-100.fc39.x86_64-x86_64-Fedora-Linux-39-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=/devpool001/develop/orangefox/fox_12.1/out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $

[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ du -hs device/asus/*
20M    device/asus/I006D
19M    device/asus/sm8350-common
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $
[ OrangeFox DEV - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ mka adbd bootimage

build/make/core/soong_config.mk:194: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:195: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.10.8-100.fc39.x86_64-x86_64-Fedora-Linux-39-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=/devpool001/develop/orangefox/fox_12.1/out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
....


-


When done, you should get a success message:





IMHO this approach should work for any phone that is officially supported by TWRP.



Config files and data files used by OrangeFox on the ASUS Zenfone 8

OrangeFox for the ASUS Zenfone 8 uses the directory

/data/media/0/Fox 

for config and data files


Example:

ASUS_I006D:/tmp # find /data/media/0/Fox/
/data/media/0/Fox/
/data/media/0/Fox/logs
/data/media/0/Fox/logs/releaseinfo.json
/data/media/0/Fox/logs/lastrecoverylog.log
/data/media/0/Fox/logs/recovery_20250724_104539.log.zip
/data/media/0/Fox/logs/recovery_20250724_155807.log.zip
/data/media/0/Fox/.foxs
/data/media/0/Fox/Foxfiles
/data/media/0/Fox/Foxfiles/Magisk.zip
/data/media/0/Fox/Foxfiles/uninstall.zip
/data/media/0/Fox/Foxfiles/AromaFM
/data/media/0/Fox/Foxfiles/AromaFM/AromaFM.zip
/data/media/0/Fox/fox.bashrc
ASUS_I006D:/tmp #


The config file used to store the OrangeFox settings is

/data/media/0/Fox/.foxs

This is a binary file.


The directory

/data/media/0/Fox/Foxfiles

is used for the OrangeFox Addons.




Trouble Shooting



Depending on the device tree used, building the image may fail with this error message:

[ 78% 246/313] including bootable/recovery/Android.mk ...
FAILED:
In file included from bionic/tests/libs/Android.build.dlext_testzip.mk:102:
In file included from bootable/recovery/Android.mk:147:
bootable/recovery/orangefox.mk:665: error: 'TW_MAX_BRIGHTNESS' is not set! You must provide a value for 'TW_MAX_BRIGHTNESS' in your device tree.
07:13:23 ckati failed with: exit status 1

#### failed to build some targets (03:16 (mm:ss)) ####

To fix it, add the missing variable TW_MAX_BRIGHTNESS to the file BoardConfig.mk:

[xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1]$ diff device/asus/I006D/BoardConfig.mk device/asus/I006D/BoardConfig.mk.org
36c36
< TW_MAX_BRIGHTNESS := 255
---
>
[xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1]$

and restart the build command:

mka adbd bootimage




If the lunch command does not find the repositories with the device tree for the phone, add the repositories for the device tree manually, example:

To add the repositories with the device tree for the ASUS Zenfone 8 create the file ./.repo/local_manifests/roomservice.xml with the necessary repositories:

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $ cat .repo/local_manifests/roomservice.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project path="device/asus/I006D" remote="TeamWin" name="android_device_asus_I006D" revision="android-12.1" />
  <project path="device/asus/sm8350-common" remote="TeamWin" name="android_device_asus_sm8350-common" revision="android-12.1" />
</manifest>
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1 ] $


and start another sync:

repo sync


The repo sync command prints some error messages that can be ignored as far as I know. The result after the repo sync should look like this:

[ OmniRom 14 Dev - xtrnaw7@t15g /datapool001/develop/orangefox/fox_12.1 ] $ du -hs device/asus/*
20M    device/asus/I006D
20M    device/asus/sm8350-common
[ OmniRom 14 Dev - xtrnaw7@t15g /datapool001/develop/orangefox/fox_12.1 ] $


Now use the commands listed above to start the build process




If the installation of the ZIP file with the OrangeFox recovery fails with an error message about a mismatched product ID between the phone and the image in the ZIP file, add the product ID to the environment variable TARGET_DEVICE_ALT and create a new zip file.




Notes

see also How to compile TWRP for the ASUS Zenfone 8 

see also OrangeFox Recovery using the OrangeFox Recovery Builder 2024 for a method to build the OrangeFox recovery image on github.com


and How to use the OrangeFox addons when the phone is booted from the OrangeFox recovery image file


see also these OrangeFox recovery related Webpages:

    OrangeFox Recovery Home page: https://wiki.orangefox.tech/

    Build instructions for the OrangeFox recovery: https://wiki.orangefox.tech/en/dev/building

    Instruction to sync the OrangeFox recovery repos: https://gitlab.com/OrangeFox/sync

    List fo custom build variables for creating the OrangeFox recovery image: https://gitlab.com/OrangeFox/vendor/recovery/-/blob/master/orangefox_build_vars.txt


The initial repository for the OrangeFox recovery image requires about 22 GB disk space; after a build of the OrangeFox recovery image the repository requires about 28 GB disk space.


The installation the ZIP file created for the OrangeFox recovery works after booting from TWRP or from the OrangeFox recovery image.


Booting the phone from the image file with the OrangeFox recovery works; installing the OrangeFox recovery via the recovery GUI entry "Flash current OrangeFox" works also. This installation method does not install the OrangeFox addons.

To copy the OrangeFox addons manually to the phone, copy the directory ./vendor/recovery/FoxFiles/ from the OrangeFox repository to the directory /sdcard/Fox on the phone:

[xtrnaw7@t15g /devpool001/develop/orangefox_test/fox_12.1]$ ls -l ./vendor/recovery/FoxFiles/
total 21921
drwxrwxr-x. 2 xtrnaw7 xtrnaw7        3 Sep 10 22:20 AromaFM
-rwxrwxr-x. 1 xtrnaw7 xtrnaw7 11278270 Sep 10 22:20 Magisk.zip
-rwxrwxr-x. 1 xtrnaw7 xtrnaw7 11278270 Sep 10 22:20 Magisk_uninstall.zip
-rw-rw-r--. 1 xtrnaw7 xtrnaw7  1865207 Sep 10 22:20 OF_initd.zip
[xtrnaw7@t15g /devpool001/develop/orangefox_test/fox_12.1]$


The files are also in the OrangeFox recovery zip file :

qssi:/sdcard/Download # unzip -l OrangeFox-Unofficial-I006D.zip | grep sdcard/                                                                                                                       
 11278270  2008-02-29 03:33   sdcard/Fox/FoxFiles/Magisk_uninstall.zip
  1756712  2008-02-29 03:33   sdcard/Fox/FoxFiles/AromaFM/AromaFM.zip
 11278270  2008-02-29 03:33   sdcard/Fox/FoxFiles/Magisk.zip
      911  2008-02-29 03:33   sdcard/Fox/fox.bashrc
qssi:/sdcard/Download #

(see also How to use the OrangeFox addons when the phone is booted from the OrangeFox recovery image file)


To get the current release version for a running OrangeFox recovery use this command:

ASUS_I006D:/tmp # cat /data/media/0/Fox/logs/lastrecoverylog.log | grep Codebase
[Codebase]  : 32, 2025-06-23 (b1f342cd)
ASUS_I006D:/tmp #

The important part here is the hexcode : b1f342cd in this example.

To check the hexcode of the last commit in the source code in the repository use the command "git reflog" in the recovery directory, example:

[xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1/bootable/recovery]$ git reflog
b1f342cd (HEAD -> fox_12.1, origin/fox_12.1, origin/HEAD) HEAD@{0}: pull: Fast-forward
8a8b0ac6 HEAD@{1}: pull: Fast-forward
e9987dfb HEAD@{2}: pull: Fast-forward
91f3e589 HEAD@{3}: clone: from https://gitlab.com/OrangeFox/bootable/Recovery.git
[xtrnaw7@t15g /devpool001/develop/orangefox/fox_12


Note that in older releases the recovery log file was different:

Logfile usage in older builds
ASUS_I006D:/tmp # cat /data/media/0/recovery.log | grep Codebase
[Codebase]  : 32, 2024-11-06 (8a8b0ac6)
ASUS_I006D:/tmp #

The important part here is the hexcode : 8a8b0ac6 in this example.

To check the hexcode of the last commit in the source code in the repository use the command "git reflog" in the recovery directory, example:

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1/bootable/recovery ] $ git reflog
8a8b0ac6 (HEAD -> fox_12.1, origin/fox_12.1, origin/HEAD) HEAD@{0}: pull: Fast-forward
e9987dfb HEAD@{1}: pull: Fast-forward
91f3e589 HEAD@{2}: clone: from https://gitlab.com/OrangeFox/bootable/Recovery.git
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1/bootable/recovery ] $







An unofficial (!) OrangeFox recovery image for the ASUS Zenfone 8 is available for download on my webpage - see below.



History of this entry

11.09.2024

initial release

25.11.2024

added infos about how to get the release of a running OrangeFox recovery

24.07.2025

added infos about the config and data files used by the OrangeFox recovery

26.07.2025

Updated some minor infos


 
 

How to compile the OmniROM 15 for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-omnirom-15-for-the-asus-zenfone-8.4704406/


How to compile the OmniROM 15 for the ASUS Zenfone 8


Update 15.01.2025

Note that I have revised the instructions in this HowTo as the previous version of the HowTo was dependent on some not documented prerequisites and contained some typos.



This HowTo is about compiling the OmniROM 15 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile the other versions of the OmniROM for the ASUS Zenfone 8.


Readers who have already built an earlier version of OmniROM can skip most of this post, with the exception of the instructions for synchronizing repositories, as these instructions are different for OmniROM 15 than in previous OmniROM versions.

The commands in this HowTo are intended for the Linux operating system, but it should not be too difficult to convert them into commands for the Windows operating system.




Compiling the CustomROM OmniROM 15 from within Linux is again a very simple and straight forward process -- the developer for the OmniROM did once again a really amazing good job setting up the build environment for the OmniROM 15.

I'm repeating myself here - but it can't be said often enough.



Hardware requirements

Message from the repo tool:

"The minimum required amount of free memory is around 16GB, and even with that, some configurations may not work."

In my experience, the computer on which OmniROM is compiled should have at least 32 GB RAM and 4 CPU cores.
(The numbers in this document are for a PC with an Intel Core i7 with 16 cores and 128 GB RAM).

Note that the scripts used to create the OmniROM image start one workspace per CPU and each workspace requires about 4 GB of RAM. Plus about 2 GB RAM for the general tasks.

As of 15.01.2025, the repositories for OmniROM 15 occupy about 200 GB of disk space; the additional repositories for the hardware-specific repositories for the ASUS Zenfone 8 occupy about 20 GB of disk space.

The compile process will occupy additional 64 GB for the temporary output files.
In total, the repositories for OmniROM 15 require around 300 GB of storage space (the space occupied increases with every "repo sync")



Prerequisites

Some of the repositories for OmniROM 15 are on https://gitlab.com and the access to these repositories for the repository sync is done via ssh. Therefore, to sync these repositories a user account on gitlab.com with configured public ssh key is required. The user account on gitlab.com is free of charge and the public ssh key can be uploaded into the user profile on gitlab.com (see here: https://docs.gitlab.com/ee/user/ssh.html)

The repositories on http://github.com are currently accessed via https but that might change in the future. Therefor it's recommended to create a user on github.com and add the ssh public key to the profile of that user also.

Note:

To check how the access to the repositories is configured use this command

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ date
Wed Jan 15 09:53:04 AM CET 2025
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ grep fetch $( find .repo -maxdepth 2   -name "*xml"  )
.repo/local_manifests/local_manifest.xml:        fetch="https://github.com/DonkeyCoyote" />
.repo/manifests/omni-private.xml:           fetch="ssh://git@github.com/omnirom"
.repo/manifests/default.xml:           fetch="https://android.googlesource.com"
.repo/manifests/omni-aosp.xml:           fetch="https://github.com/" />
.repo/manifests/omni-aosp.xml:           fetch="ssh://git@gitlab.com/omnirom" />
.repo/manifests/omni-aosp.xml:           fetch="https://github.com/omnirom"
.repo/manifests/omni-caf.xml:           fetch="https://github.com/" />
.repo/manifests/omni-caf.xml:           fetch="https://github.com/omnirom"
.repo/manifests/omni-caf.xml:           fetch="https://git.codelinaro.org/clo/la"
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $



Use the commands

ssh git@github.com

ssh git@gitlab.com

to test the access via ssh and add the ssh hostkeys of the hosts github.com and gitab.com to the known_hosts file.


Or use

grep  "^gitlab.com"  ~/.ssh/known_hosts  || ssh-keyscan gitlab.com >>~/.ssh/known_hosts

grep  "^github.com"
  ~/.ssh/known_hosts || ssh-keyscan github.com >>~/.ssh/known_hosts

to add the ssh hostkeys of the repository server used to the local known_hosts file of the user used to retrieve the repositories.


It's recommended to start the ssh-agent and load the private ssh keys before starting the sync of the repositories, e.g. if no global ssh-agent is running use:

$( eval ssh-agent )
ssh-add

Use

ssh-add -l

to list the ssh keys already loaded by the ssh-agent.

Note

Example output for a working access:

[xtrnaw7@arcolinux OmniROM_15.0]$  ssh git@gitlab.com
PTY allocation request failed on channel 0
Welcome to GitLab, @bnsmb01!
Connection to gitlab.com closed.
[xtrnaw7@arcolinux OmniROM_15.0]$

[xtrnaw7@arcolinux OmniROM_15.0]$ ssh git@github.com
PTY allocation request failed on channel 0
Hi bnsmb! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
[xtrnaw7@arcolinux OmniROM_15.0]$



If you have not used git on this machine, you must set some global git variables:

git config --global user.email <your_email_address>

git config --global user.name <your name>






The tool repo is required to maintain the repositories for the OmniROM 15; you can download the tool "repo" from https://gerrit.googlesource.com/git-repo or download it with this command:

curl https://storage.googleapis.com/git-repo-downloads/repo > ./repo && chmod a+x ./repo  


The script repo should be added to a directory available via the environment variable PATH.

It's not necessary to install additional tools for creating an OmniROM 15 image -- all necessary tools to create the image are in the repositories for the OmniROM 15, with one exception:


If you are compiling the OmniROM image on a machine running Linux, the source code for some of the tools to create the OmniROM 15 image requires the header files and libraries for OpenSSL.

Under Fedora, these files can be installed using these commands:

sudo dnf install openssl openssl-libs openssl-devel

and additionally for distributions in which the OpenSSL engine is not part of the OpenSSL package anymore (as in Fedora 41):

sudo dnf install openssl-devel-engine




The repositories used for the OmniROM 15 use the git command line extension git lfs. At least in Fedora this extension is not installed by default while installing git. In Fedora git lfs can be installed using this command:

sudo dnf install git-lfs 


Use the command

git lfs install

to initialize git lfs extension.


Creating the local copies of the repositories for the OmniROM 15


Please note that the instructions for building OmniROM 15 differ from the instructions for building OmniROM 14.

Most (but not all) of the necessary steps to sync the repositories necessary to create an OmniROM 15 installation image are described in the section "Getting Started" here: https://github.com/omnirom/android/tree/android-15 but some instructions are missing the details.


To create a local copy of the repositories for OmniROM 15 these steps are required:


First create a new directory for the repositories and change the working directory to the new directory, e.g.:

mkdir /data/develop/android/OmniROM_15.0
cd /data/develop/android/OmniROM_15.0



Then init the local repositories using the command:

repo init -u https://github.com/omnirom/android.git -b android-15 --git-lfs


Note that the command repo init only creates a hidden directory called .repo.

Next sync the local repositories.


There are now two commands necessary to sync the repositories (the instructions below are copied from https://github.com/omnirom/android/tree/android-15):

"
Add this alias in your ~/.bashrc for an automatically sync :

alias repo-lfs="repo sync && repo forall -c git lfs pull"

Then reload your file with source ~/.bashrc in the terminal

Then to sync up with the lfs repo:

repo-lfs
"

Notes

Another useful alias for the repository sync is:

alias repo-lfs-force="repo sync --force-sync && repo forall -c git lfs pull"




The initial repository sync will download all repositories necessary to create the OmniROM 15 image except the hardware dependent repositories (these repos are different for the various phone models).

Therefor you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories after the download finished.

This should be done in the file .repo/local_manifests/local_manifest.xml (just create the directory .repo/local_manifests if it does not exist).

For the ASUS Zenfone 8 the file should look like this:

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ date
Sat Mar  8 09:57:54 AM CET 2025
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $


[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
    <remote  name="DonkeyCoyote"
        fetch="https://github.com/DonkeyCoyote" />
    <project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-15" />
    <project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-14.0" />
    <project path="vendor/images/asus" name="android_vendor_images_asus" remote="gitlab" revision="android-14.0" />
    <project path="vendor/gapps" name="android_vendor_gapps" remote="gitlab" revision="android-15" />
</manifest>
[ OmniRom 15 (devpool) - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $



Notes:

The repository android_prebuilts_prebuiltapks is only necessary for OmniROM 15 images that should include the MicroG packages.

The repository android_vendor_gapps is only necessary for OmniROM 15 images that should include the Google Apps.

Update 08.03.2025

The repository for the directory tree vendor/asus was moved from github to gitlab:

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ diff .repo/local_manifests/local_manifest.xml.org  .repo/local_manifests/local_manifest.xml
6c6
<     <project path="vendor/asus" name="proprietary_vendor_asus" remote="DonkeyCoyote" revision="android-15" />
---
>     <project path="vendor/asus" name="android_vendor_asus" remote="gitlab" revision="android-15" />
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $
 





The repositories configured in the file .repo/manifests/omni-private.xml are private repositories. To use these repositories, access to these repositories must be configured by the admin of the repositories (see https://github.com/omnirom/android). The packages installed using these repositories are only optional and OmniROM can be compiled without them.

To disable the private repositories comment or delete the lines starting with "<project path" in the file .repo/manifests/omni-private.xml -- but do NOT delete the file or remove the include statement for this file in the file .repo/manifests/omni-default.xml (as described here https://github.com/omnirom/android/tree/android-15):
 
The definition for the remote repository omnirom2 can be found in this file and omnirom2 is the default remote repository used to synchronize missing repositories in the python script roomservice.py.

Details


contents of the file .repo/manifests/omni-private.xml
[xtrnaw7@t15g /devpool001/develop/OmniROM_15.0]$ cat .repo/manifests/omni-private.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote  name="omnirom2"
           fetch="ssh://git@github.com/omnirom"
           review="gerrit.omnirom.org" />

  <!-- private OmniROM Projects -->
  <project path="packages/apps/OmniSwitch" name="android_packages_apps_OmniSwitch" remote="omnirom2" revision="android-14.0" />
  <project path="packages/services/OmniJaws" name="android_packages_services_OmniJaws" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniRemote" name="android_packages_apps_OmniRemote" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniControl" name="android_packages_apps_OmniControl" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniOta" name="android_packages_apps_OmniOta" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniWallpaper" name="android_packages_apps_OmniWallpaper" remote="omnirom2" revision="android-14.0" />
</manifest>



grep "default_rem |default_team_rem "  ../OmniROM_14.0/vendor/omni/build/tools/roomservice.py

[xtrnaw7@t15g /datapool001/develop/OmniROM_15.0]$ egrep "default_rem |default_team_rem "  ../OmniROM_14.0/vendor/omni/build/tools/roomservice.py
default_rem = "omnirom2"
default_team_rem = "omnirom2"
[xtrnaw7@t15g /datapool001/develop/OmniROM_15.0]$





After you have updated the file local_manifest.xml, run another

repo-lfs

to synchronize the added repositories. This time the download will be faster as only the additional repos will be downloaded.


Now you can start the build with these commands:

# optional:
#
# to build an OmniROM image with MicroG packages, set the environment variable ROM_BUILDTYPE to MICROG before starting the build
# (of course this only works if the repositories with MicroG are configured in the manifest files)
#
# to build an OmniROM image with GAPPS packages, set the environment variable ROM_BUILDTYPE to GAPPS before starting the build.
# (of course this only works if the repositories with GAPPS are configured in the manifest files)
#
export ROM_BUILDTYPE=MICROG

. build/envsetup.sh

lunch omni_zenfone8-ap4a-user

brunch omni_zenfone8-ap4a-user


in the directory with the downloaded repositories (Note: The command "breakast" to list all possible targets does not work in the repositories for OmniROM 15)

Be aware that the first time the compile process may take a long time (4 hours or more on my Notebook)


If everything is OK, there will be a ZIP file with your own custom OmniROM 15 image in the directory ./out/target/product/zenfone8/ when the compilation script is finished, e.g. for images with the MicroG packages:

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ ls -l out/target/product/zenfone8/omni-15-*zip
-rw-rw-r--. 2 xtrnaw7 xtrnaw7 1405496265 Nov 21 23:50 out/target/product/zenfone8/omni-15-20241121-zenfone8-MICROG.zip
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $
 


The image can now be installed on the ASUS Zenfone 8 with the LineageOS Recovery or TWRP.




Notes





Note that any new OmniROM 15 image created with brunch will overwrite the existing OmniROM 15 image (the name of the image is different, but the inodes used are the same for all zip files):

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ ls -il out/target/product/zenfone8/*zip
81841265 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1407118794 Nov 22 08:23 out/target/product/zenfone8/omni-15-20241121-zenfone8-MICROG.zip
81841265 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1407118794 Nov 22 08:23 out/target/product/zenfone8/omni-15-20241122-zenfone8-MICROG.zip
81841265 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1407118794 Nov 22 08:23 out/target/product/zenfone8/omni_zenfone8-ota.zip
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ cksum  out/target/product/zenfone8/*zip
3674363399 1407118794 out/target/product/zenfone8/omni-15-20241121-zenfone8-MICROG.zip
3674363399 1407118794 out/target/product/zenfone8/omni-15-20241122-zenfone8-MICROG.zip
3674363399 1407118794 out/target/product/zenfone8/omni_zenfone8-ota.zip
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $


You should therefore copy the existing zip file with the image to a new directory before building a new image.



Certificates for the OS images

For OS images that are to be used on the phone for daily use, I strongly recommend creating your own certificates for the operating system.

In the OmniROM development directory tree the necessary files, platform.pk8 and platform.x509.pem, are in the directory

./build/make/target/product/security

in your build tree for the CustomROM, e.g.

[ OmniROM 15 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $ ls -l ./build/make/target/product/security/platform.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1216 Nov 14 15:24 ./build/make/target/product/security/platform.pk8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1675 Nov 14 15:24 ./build/make/target/product/security/platform.x509.pem
[ OmniROM 15 Dev - xtrnaw7@t15g /data/develop/android/OmniROM_14.0 ] $


Replace these files with your own certificate files and recreate the image using the command brunch (see above).


See here https://source.android.com/devices/tech/ota/sign_builds for how to create your own certificate.

To manually create the certificate and keys use these commands:
To manually create the certificate and keys use these commands:


Android uses 2048-bit RSA keys with public exponent 3. You can generate certificate/private key pairs using the openssl tool from openssl.org:

# generate RSA key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl genrsa -3 -out temp.pem 2048
[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 4
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem


# create a certificate with the public part of the key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj  '/C=DE/ST=Hessen/L=Frankfurt am Main/O=Android/OU=Android/CN=Android/emailAddress=bnsmb01@gmail.com'
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
[xtrnaw7@t15g /data/develop/android/test1]$



# create a PKCS#8-formatted version of the private key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
[xtrnaw7@t15g /data/develop/android/test1]$



[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 12
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


# securely delete the temp.pem file

#
[xtrnaw7@t15g /data/develop/android/test1]$ shred --remove temp.pem
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$ 


From the documentation:

The openssl pkcs8 command given above creates a .pk8 file with no password, suitable for use with the build system. To create a .pk8 secured with a password (which you should do for all actual release keys), replace the -nocrypt argument with -passout stdin; then openssl will encrypt the private key with a password read from standard input. No prompt is printed, so if stdin is the terminal the program will appear to hang when it's really just waiting for you to enter a password. Other values can be used for the-passout argument to read the password from other locations; for details, see the openssl documentation.

The temp.pem intermediate file contains the private key without any kind of password protection, so dispose of it thoughtfully when generating release keys. In particular, the GNUshred utility may not be effective on network or journaled filesystems. You can use a working directory located in a RAM disk (such as a tmpfs partition) when generating keys to ensure the intermediates are not inadvertently exposed.



To view the certificates in the repository used to build the images use this command (for all of the .pem files in that directory!):

openssl x509 -in ./build/make/target/product/security/platform.x509.pem -text -noout


To view the certificate used for the installed OS on the phone use the command

unzip -p /system/etc/security/otacerts.zip *.pem | openssl x509 -text


Note:

The executable openssl is not part of the standard Android OS and also not part of the OmniROM. A Magisk Module with openssl is available on my website : see here

The openssl binary from that Magisk Module can also be used without installing the Magisk Module. For that download the ZIP file with the Magisk Module and extract the openssl binary:

unzip -p openssl_3.3.1-v1.1.0.zip  system/usr/bin/openssl >openssl


Or download the openssl binary for Android on arm64 CPUs from here

https://bnsmb.de/files/public/Android/binaries_for_arm64/openssl


Now copy the file openssl just created to the phone into the directory /data/local/tmp and make it executable:

chmod 755 /data/local/tmp/openssl



Updating the local repositories

To update the local repositories, change the working directory to the directory with the repositories for OmniROM 15 and execute

repo-lfs

(This only works if you have created the bash alias as described above)


After the synchronization is complete, create a new ROM image using the commands described above.

It is recommended to update the local repositories and create a new image at least once a month after the new security patches for Android are added to the repositories for OmniROM 15.


To view the date of the security patch in the source files for the OmniROM 15 the shell script print_security_patch can be used; example:

[xtrnaw7@t15g /devpool001/develop/OmniROM_15.0]$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/OmniROM_15.0" ...
The repository uses the new definitions
The current security patch is "2024-12-05"
The current build_id is "ap4a"
[xtrnaw7@t15g /devpool001/develop/OmniROM_15.0]$



To check if the new security patch has already been applied to the OmniROM repositories, check the Gerrit for OmniROM : https://gerrit.omnirom.org/q/status:merged


See How to apply the Android Security patches to a local repository for how to apply an Android Security patch to the local repository in case you want to manually add the Android security patch to your local repositories.



Moving the repositories to another directory

In case you want to move the repositories for OmniROM 15 to another directory or rename the directory with the repositories:

Be aware that the make scripts create some absolute links in the output directory; to list these absolute links use this command while in the directory with the repositories for OmniROM 15 :

find . -type l -ls | grep "$PWD"


e.g. there are currently still some absolute links in the output directory for OmniROM 15:

[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $  find . -type l -ls | grep "$PWD" | wc -l
8
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $


[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $  find . -type l -ls | grep "$PWD"
 84156629      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        93 Nov 21 10:42 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher-autorun/linux_glibc_x86_64/e0c56be2b0b4cd8e6040d6ad4670d513/py3-launcher-autorun -> /data/develop/android/OmniROM_15.0/prebuilts/build-tools/linux-x86/bin/py3-launcher-autorun64
 84157313      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        73 Nov 21 23:30 ./out/soong/.intermediates/prebuilts/build-tools/m4/linux_glibc_x86_64/m4 -> /data/develop/android/OmniROM_15.0/prebuilts/build-tools/linux-x86/bin/m4
 84156618      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        85 Nov 21 10:42 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher/linux_glibc_x86_64/e0c56be2b0b4cd8e6040d6ad4670d513/py3-launcher -> /data/develop/android/OmniROM_15.0/prebuilts/build-tools/linux-x86/bin/py3-launcher64
 93112008      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Nov 22 08:15 ./out/target/product/zenfone8/obj/DTBO_OBJ/source -> /data/develop/android/OmniROM_15.0/kernel/asus/sm8350
 92719408      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Nov 22 08:15 ./out/target/product/zenfone8/obj/DTB_OBJ/source -> /data/develop/android/OmniROM_15.0/kernel/asus/sm8350
 88787018      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Nov 22 08:17 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-gf532250e9298/source -> /data/develop/android/OmniROM_15.0/kernel/asus/sm8350
 88787020      4 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        77 Nov 21 23:46 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-gf532250e9298/build -> /data/develop/android/OmniROM_15.0/out/target/product/zenfone8/obj/KERNEL_OBJ
 88920483      0 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        53 Nov 22 08:15 ./out/target/product/zenfone8/obj/KERNEL_OBJ/source -> /data/develop/android/OmniROM_15.0/kernel/asus/sm8350
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $



Before starting another build after moving the directories with the repositories you must correct these links (or clean the directory ./out)



Log files

The verbose log of the compile script is always written to a compressed file in the output directory, e.g.:

ls -ltr /data/develop/android/OmniROM_15.0/out/verbose.log*
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ ls -ltr /data/develop/android/OmniROM_15.0/out/verbose.log.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 15784891 Nov 21 20:40 /data/develop/android/OmniROM_15.0/out/verbose.log.2.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7  8424003 Nov 21 23:51 /data/develop/android/OmniROM_15.0/out/verbose.log.1.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    54282 Nov 22 08:23 /data/develop/android/OmniROM_15.0/out/verbose.log.gz
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $




List available commands


To list all known commands for building the images use the alias hmm:

hmm
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ hmm

Run "m help" for help with the build system itself.

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch:      lunch <product_name>-<release_type>-<build_variant>
              Selects <product_name> as the product to build, and <build_variant> as the variant to
              build, and stores those selections in the environment to be read by subsequent
              invocations of 'm' etc.
- tapas:      tapas [<App1> <App2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
              Sets up the build environment for building unbundled apps (APKs).
- banchan:    banchan <module1> [<module2> ...] \
                      [arm|x86|arm64|riscv64|x86_64|arm64_only|x86_64only] [eng|userdebug|user]
              Sets up the build environment for building unbundled modules (APEXes).
- croot:      Changes directory to the top of the tree, or a subdirectory thereof.
- m:          Makes from the top of the tree.
- mm:         Builds and installs all of the modules in the current directory, and their
              dependencies.
- mmm:        Builds and installs all of the modules in the supplied directories, and their
              dependencies.
              To limit the modules being built use the syntax: mmm dir/:target1,target2.
- mma:        Same as 'mm'
- mmma:       Same as 'mmm'
- provision:  Flash device with all required partitions. Options will be passed on to fastboot.
- cgrep:      Greps on all local C/C++ files.
- ggrep:      Greps on all local Gradle files.
- gogrep:     Greps on all local Go files.
- jgrep:      Greps on all local Java files.
- jsongrep:   Greps on all local Json files.
- ktgrep:     Greps on all local Kotlin files.
- resgrep:    Greps on all local res/*.xml files.
- mangrep:    Greps on all local AndroidManifest.xml files.
- mgrep:      Greps on all local Makefiles and *.bp files.
- owngrep:    Greps on all local OWNERS files.
- rsgrep:     Greps on all local Rust files.
- sepgrep:    Greps on all local sepolicy files.
- sgrep:      Greps on all local source files.
- tomlgrep:   Greps on all local Toml files.
- pygrep:     Greps on all local Python files.
- godir:      Go to the directory containing a file.
- allmod:     List all modules.
- gomod:      Go to the directory containing a module.
- pathmod:    Get the directory containing a module.
- outmod:     Gets the location of a module's installed outputs with a certain extension.
- dirmods:    Gets the modules defined in a given directory.
- installmod: Adb installs a module's built APK.
- refreshmod: Refresh list of modules for allmod/gomod/pathmod/outmod/installmod.
- syswrite:   Remount partitions (e.g. system.img) as writable, rebooting if necessary.

Environment options:
- SANITIZE_HOST: Set to 'address' to use ASAN for all host modules.
- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.

Look at the source to view more functions. The complete list is:
adb addcompletions add_lunch_combo banchan build_build_var_cache check_type _complete_android_module_names cproj _croot croot destroy_build_var_cache enable_zsh_completion fastboot _get_abs_build_var_cached _get_build_var_cached get_host_prebuilt_prefix get_make_command _gettop_once godir gomod _lunch lunch _lunch_completion _lunch_meat _lunch_usage make printconfig print_lunch_menu runhat set_global_paths set_lunch_paths set_sequence_number set_stuff_for_environment should_add_completion showcommands source_vendorsetup tapas validate_current_shell
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $




Most of the commands used to build AOSP images are functions or aliases defined in the file ./build/envsetup. To check the source code for the commands, either read that file or use

typeset -f command




Trouble Shooting

see Some hints for repo sync troubleshooting for how to fix some common errors while executing the command "repo sync".

see Some hints for fixing errros building an Custom ROM Android image for how to fix some common errors while creating the image


Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image





History of this entry

22.11.2024

initial release

24.11.2024

added infos about how to view the certificate used for the OS currently installed on the phone

29.11.2024

corrected the branch used for the repository "proprietary_vendor_asus" from DonkeyCoyote

05.12.2024

corrected/added the infos about the repository necessary to create an OmniROM 15 image with GAPPS

15.01.2025

reworked the HowTo: added missing infos and fixed typos

08.03.2025

the repository for vendor/asus is now on gitlab.com

 


TWRP images for ASUS Zenfone 8 with /e/


URL:  https://xdaforums.com/t/twrp-images-for-asus-zenfone-8-running-e.4720737/


TWRP images for ASUS Zenfone 8 running /e/


WARNING

Do not use the TWRP images mentioned in this post if the OS installed on the phone is not the correct /e/ version!

If you have accidentally booted the wrong TWRP image and the phone only displays the ASUS logo, simply press the buttons for Volume down, Volume up, and Power simultaneously for at least 10 seconds to poweroff or reboot the phone.


These TWRP images should only be used to boot the phone using the fastboot command, example:

fastboot boot twrp-e-2.7-t-20250112460975-community-sake.img

Do NOT install this TWRP into the boot partition!

Use at your own risk!




The official TWRP images for the ASUS Zenfone 8 do not boot anymore if a LineageOS 20.x (or newer) based OS is installed on the phone.

The CustomROM /e/ is based on LineageOS. Therefor there is no official working TWRP image for /e/ on the ASUS Zenfone 8 (and the default LineageOS recovery is not very useful for maintenance tasks due to a lack of features)


To get around this limitation I have created ugly TWRP images for the ASUS Zenfone 8 with installed /e/:

TWRP image file
/e/ version
Comment
twrp-e-2.5-t-20241108446630-community-sake.img 2.5.1
Android 13
twrp-e-2.6.3-t-20241217455572-community-sake.img 2.6.3
Android 13
twrp-e-2.7-t-20250112460975-community-sake.img 2.7
Android 13
twrp-e-2.8-t-20250219470166-community-sake.img
2.8
Android 13
twrp-e-2.9-t-20250322478412-community-sake.img 2.9
Android 13
twrp-e-3.0-t-20250529496537-community-sake.img 3.0
Android 13
twrp-e-3.0.1-t-20250607498934-community-sake.img 3.0.1
Android 13
twrp-e-3.0.4-t-20250710507809-community-sake.img 3.0.4
Android 13


These TWRP images were created using the script

create_ugly_twrp_image.sh


and my enhanced TWRP image for the ASUS Zenfone 8.


(see How to create a TWRP image for LineageOS based ROMs using a script for details about the script; see also How to use TWRP if LineageOS 20.x is installed for details and why these images should only be used if necessary)


Using these TWRP images you can access the files in the /data partition while booted from the recovery image.

These TWRP images also support the decryption if the phone access is protected via PIN, password, or pattern.

Access to the phone via adb is possible if the phone has been booted from the TWRP image (even if adb access is not yet enabled in the phone's installed operating system).

Note that the TWRP GUI may not re-appear after it has been disabled due to the timeout. In this case, you can only use the phone via adb in this session.

To avoid this problem, deactivate the screen timeout in the TWRP settings.


Update 08.03.2025

To view the list of currently available TWRP images for /e/ please visit my github repository with TWRP images for /e/:

https://github.com/bnsmb/recovery-images-for-ASUS-Zenfone-8/tree/main/recovery_images/ugly_images

Update 15.03.2025

see here for instructions to build /e/ for the ASUS Zenfone 8  

Update 23.07.2025

see How to create a TWRP recovery image for LineageOS 22.x for instructions to create a TWRP image for the LineageOS 22.2 based version /e/ 3.0.4-a15.  




History of this entry

25.02.2025

initial release

08.03.2025

add the TWRP image for /e/ 2.8

15.03.2025

added the link to the instructions to build /e/ for the ASUS Zenfone 8 

23.07.2025

added the link to the section with instructions to create a TWRP image for /e/ 3.0.4-a15





Temporary fix for using the Google PlayStore in the OmniROM with_MicroG


URL: not yet published


Update 23.05.2025

The official fix for this issue is now in the source files in GitHub the repository for OmnROM. Therefor the fix described in this section is not necessary anymore.


Temporary fix for using the Google PlayStore in the OmniROM with MicroG



Update 30.03.2025

The maintainer for the OmniROM now created a much better fix for this issue. Unfortunately the server with the gerrit for the OmniROM is still down so no new patches can be applied to the source code in the official repositories for the OmniROM.




Since the maintainers of the repositories for OmniROM have made the necessary changes to re-enable signature spoofing after Google changed the rules for handling signatures (see https://github.com/microg/GmsCore/issues/2680)), replacing the FakeStore in OmniROM with MIcroG with the real Google Playstore no longer works.


Until this is fixed in the official repositories for OmniROM, this issue can be fixed in the source code in the local repositories for OmniROM with this patch:

patch_without_logging_for_ComputerEngine.java


To apply the patch, execute these commands in the top level of a repository for OmniROM:

[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ cp ./frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java./frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java.org
[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $

[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ patch -p1 </data/develop/android/patches/patch_without_logging_for_ComputerEngine.java

patching file frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java
[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $


Check the result:

 OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $ diff ./frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java.org./frameworks/base/services/core/java/com/android/server/pm/ComputerEngine.java
180a181,182
> import java.util.HashSet;
>
1530a1533
>
1544a1548
>    
1546c1550,1556
<                 packageInfo = mayFakeSignature(p, packageInfo, grantedPermissions);
---
> //                packageInfo = mayFakeSignature(p, packageInfo, grantedPermissions);
>
>                 Set<String> modifiedPermissions = new HashSet<>(grantedPermissions);
>                 modifiedPermissions.add("android.permission.FAKE_PACKAGE_SIGNATURE");
>
>                 packageInfo = mayFakeSignature(p, packageInfo, modifiedPermissions);       
>
[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_15.0 ] $





AFAIK it's not possible to work around this problem without creating a new OS image with the above mentioned patch.



Notes

The implementation for this fix in in the LineageOS is here: https://review.lineageos.org/c/LineageOS/android_frameworks_base/+/411386/5/services/core/java/com/android/server/pm/ComputerEngine.java#1593 

The problem does not exist in LineageOS based CustomROMs with the fix for the new signature handling

Hopefully this fix is only a temporary fix




History of this entry

08.03.2025

initial release

30.03.2025

added the infos about the "official patch" for this issue

23.05.2025

updated the infos about the official fix for this issue


 

Compiling /e/ for the ASUS Zenfone 8 using the docker image


URL: https://xdaforums.com/t/compiling-e-for-the-asus-zenfone-8-using-the-docker-image.4725317/


Compiling /e/ for the ASUS Zenfone 8 using the docker image


Update 28.07.2025

The instructions below are for compiling /e/ version based on Android 13.

See How to compile /e/ based on Android 15 for the ASUS Zenfone 8 for instructions to compile the /e/ version based on Android 15.



The official process for building /e/ is to use a Docker image provided by the company that maintains /e/. This is different from the build process for other CustomROMs but in the end also quite simple.

The build instructions for /e/ are described here:  https://doc.e.foundation/support-topics/build-e

I recommend to read the instructions on that page before continueing with this HowTo.

If you are running Docker on Linux, it is strongly recommended to add your non-root user to the group docker and run all Docker commands as that user.
(without this configuration all docker commands must be executed as user root)

To create an /e/ OS image for the ASUS Zenfone 8, these instructions can be used with a small correction:

To create an /e/ OS image for a phone, you need the device ID for that phone. According to the build instructions for /e/, the device ID can be determined with the command

adb shell getprop ro.product.device

for a phone connected via USB to the PC. But for the ASUS Zenfone 8 running /e/ this fails:


# running OS on the ASUS Zenfone 8 is  /e/ 2.8 for this example; but it's the same if running for example in the OmniROM
#
[xtrnaw7@t15g /data/develop]$ adb shell getprop ro.product.device
ASUS_I006D
[xtrnaw7@t15g /data/develop]$

ASUS_I006D is not the correct build id for the ASUS Zenfone 8; the build id to create an /e/ OS image for the ASUS Zenfone 8 is "sake"


If you want to create an /e/ OS image for another phone and are not sure which device ID to use, see the official device list of /e/:

https://doc.e.foundation/devices


Without using a special configuration for the device-dependent repositories, the scripts used to compile /e/ try to download the necessary files for the device from the LineageOS repositories if possible (see the /e/ build instructions for restrictions).
This works fine for the ASUS Zenfone 8 and in principle it should be possible to build /e/ with the build instructions from https://doc.e.foundation/support-topics/build-e for all phones supported by LineageOS.


The command to install the docker image used to create community or unofficial OS images for /e/ is:

docker pull registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community


After installing the docker image and creating the necessary directories for the build as described in the build instructions the build can be started by starting the docker image.

The command I used to create an /e/ OS image for the ASUS Zenfone 8 is:

docker run \
    -e "BRANCH_NAME=v2.8-t" \
    -e "DEVICE_LIST=sake" \
    -e "DEVICE=ASUS_I006D" \
    -e "SIGN_BUILDS=true" \
    -e "SIGNATURE_SPOOFING=true" \
    -e "WITH_SU=true" \
    -e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension" \
    -e "RELEASE_TYPE=UNOFFICIAL" \
    -e "CLEAN_OUTDIR=false" \
    -e "CLEAN_AFTER_BUILD=false" \
    -e "DELETE_OLD_LOGS=5" \
    -e "DELETE_OLD_ZIPS=5" \
    -v "/devpool001/develop/e/src:/srv/src" \
    -v "/devpool001/develop/e/zips:/srv/zips" \
    -v "/devpool001/develop/e/logs:/srv/logs" \
    -v "/devpool001/develop/e/tmp:/srv/tmp" \
    -v "/devpool001/develop/e/ccache:/srv/ccache" \
    -v "/devpool001/develop/e/keys:/srv/keys" \
    -v "/devpool001/develop/e/local_manifests:/srv/local_manifests" \
    -e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
    registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community



The first execution of this command will download the necessary repositories with the source code to build the /e/ OS Image.
As of 11.03.2025 the initial repositories for building /e/ for the ASUS Zenfone 8 occupy about 235 GB of disk space; the space occupied after building an /e/ OS image with cleanup of the temporary files is about 245 GB.
Without a cleanup after the build of the /e/ OS image, the directories with the source for /e/ on the ASUS Zenfone 8 occupy about 310 GB.
Therefore I recommend to calculate with 400 GB disk space for building the /e/ OS image for the ASUS Zenfone 8.


The /e/ OS image will be created in the directory <basedir>/zips; the format for the filenames is:

e-codeversionnumber-osversion-YYYYMMDDbuildid-UNOFFICIAL-devicename.zip

e.g.

[xtrnaw7@t15g /devpool001/develop/e]$ ls -l zips/sake/*ASUS*
-rw-r--r--. 1 root root 1490443619 Mar 15 21:08 zips/sake/e-2.8-t-20250315-UNOFFICIAL-ASUS_I006D.zip
-rw-r--r--. 1 root root        109 Mar 15 21:08 zips/sake/e-2.8-t-20250315-UNOFFICIAL-ASUS_I006D.zip.sha256sum
[xtrnaw7@t15g /devpool001/develop/e]$






The build process for /e/ creates two log files:

The file

<basedir>/logs/repo-<yyyymmdd>.log

contains the logs of the repo commands; the log file used while building the image is in the directory

<basedir>logs/<device_id>

(<basedir> is the base directory for the directories used to build the OS image -- /devpool001/develop/e in the example command above)

e.g.

root@androiddev:/data/develop/android/e# find logs -ls
       34      1 drwxr-xr-x   3 xtrnaw7  xtrnaw7         4 Mar 12 06:34 logs
        3      1 drwxr-xr-x   2 root     root            3 Mar 11 16:27 logs/sake
        4      4 -rw-r--r--   1 root     root         8087 Mar 12 00:35 logs/sake/eos-2.9-20250311-UNOFFICIAL-sake.log
      384    487 -rw-r--r--   1 root     root      1636168 Mar 11 16:12 logs/repo-20250311.log
root@androiddev:/data/develop/android/e#


Note that the log file for creating the image (eos*.log) is not very detailed. Therefor it's recommended to use something like tee or script to write the output of the build command also to log file.




Without additional parameter for the build command, the build scripts delete all temporary files after the build of the /e/ OS image is complete.

To avoid this, add these parameters to the build command:

    -e "CLEAN_OUTDIR=false" \
    -e "CLEAN_AFTER_BUILD=false" \

This is very useful if you want to create the image more than once.


Add the parameter

    -e "DELETE_OLD_LOGS=5" \
    -e "DELETE_OLD_ZIPS=5" \


to keep n old zips and/or log files (n=5 in this example)


To start the docker container with an interactive shell use this command:

docker run -it --rm --entrypoint /bin/bash -v "$(pwd)":/srv/src registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community

or

docker run \
    -it --rm --entrypoint /bin/bash  \
    -e "BRANCH_NAME=v2.8-t" \
    -e "DEVICE_LIST=sake" \
    -e "DEVICE=ASUS_I006D" \
    -e "SIGN_BUILDS=true" \
    -e "SIGNATURE_SPOOFING=true" \
    -e "WITH_SU=true" \
    -e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension" \
    -e "RELEASE_TYPE=UNOFFICIAL" \
    -e "CLEAN_OUTDIR=false" \
    -e "CLEAN_AFTER_BUILD=false" \
    -e "DELETE_OLD_LOGS=5" \
    -e "DELETE_OLD_ZIPS=5" \
    -v "/devpool001/develop/e/src:/srv/src" \
    -v "/devpool001/develop/e/zips:/srv/zips" \
    -v "/devpool001/develop/e/logs:/srv/logs" \
    -v "/devpool001/develop/e/tmp:/srv/tmp" \
    -v "/devpool001/develop/e/ccache:/srv/ccache" \
    -v "/devpool001/develop/e/keys:/srv/keys" \
    -v "/devpool001/develop/e/local_manifests:/srv/local_manifests" \
    -e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
    registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community


Update 30.06.2025

To update the repository for /e/ to a new version just change the value for BRANCH_NAME in the command to start the docker instance, e.g.

Change

    -e "BRANCH_NAME=v2.8-t" \

to

    -e "BRANCH_NAME=v2.9-t" \





Useful links for building /e/


URL
Contents
https://gitlab.e.foundation/e/os/releases/-/tags The list of defined tags for /e/ 
https://gitlab.e.foundation/e/os/releases/-/branches
The list of defined branches for /e/ 
https://doc.e.foundation/support-topics/docker-command-details   Important parameter for the docker command for buildling /e/ 
https://gitlab.e.foundation/e/os/docker-lineage-cicd/-/blob/master/Dockerfile.community The list of environment variables that can be used for the docker command to build /e/ 
https://community.e.foundation/c/e-devices/unofficial-builds/ The discussion forum for unofficial builds of /e/
https://gitlab.e.foundation/e
repositories with the source code for /e/  

The prebuild /e/ OS images for the ASUS Zenfone 8 are available here:  https://doc.e.foundation/devices/sake

see here for infos about ugly TWRP images for /e/ 


Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image




History of this entry

15.03.2025

initial release

19.03.2025

added the commands to start the docker container with an interactive shell

30.06.2025

Add infos about how to update the repo


 

How to compile LineageOS 22.x for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-lineageos-22-x-for-the-asus-zenfone-8.4726885/



Update 01.08.2025

see the section How to compile the official LineageOS 22.2 for the ASUS Zenfone 8 for instructions to compile the official LinaegeOS 22.2 for the ASUS Zenfone 8.




Update 23.07.2025


There are now official LineageOS 22.x images for the ASUS Zenfone 8 available:

https://download.lineageos.org/devices/sake/builds




How to compile LineageOS 22.x for the ASUS Zenfone 8


Notes:

The instructions in the original version of this HowTo only worked in my environment due to missing remnants from previous tests.
I updated the HowTo on 09.05.2025 with the support of the owner of the repositories used for device and manufacturer files, mikooomichael at gmail dot com.



Officially, the ASUS Zenfone 8 is no longer supported by the LineageOS and is no longer listed in the list of devices for the LineageOS: https://wiki.lineageos.org/devices/#asus.

However, the wiki pages for LineageOS on the ASUS Zenfone 8 are still directly accessable via these URLs:

https://wiki.lineageos.org/devices/sake/ Information about LineageOS for the ASUS Zenfone 8 
https://wiki.lineageos.org/devices/sake/build/ Instructions to build LineageOS for the ASUS Zenfone 8 


These wiki pages describe how to build the LineageOS up to version 20.x for the ASUS Zenfone 8 and are therefore not suitable for building the LineageOS 22.x for the ASUS Zenfone 8.


Nevertheless, LineageOS 22.x can also be build for the ASUS Zenfone 8 - - see for example this thread on XDA: https://xdaforums.com/t/unofficial-sake-lineageos.4641226/


I didn't find instructions on how to create a LineageOS 22.x image for the ASUS Zenfone 8, so I wrote this HowTo


This HowTo is for creating the image for LineageOS 22.2 - it may or may not work for other LineageOS 22.x versions (it does NOT work without additional steps for LineageOS 22.1)


First create the initial repository for LineageOS 22.2 using the repo tool as described on this page https://github.com/LineageOS/android:


repo init -u https://github.com/LineageOS/android.git -b lineage-22.2 --git-lfs --no-clone-bundle

repo sync -j$( nproc )

(The parameter -j defines the number of processors to be used by the repo command; the command nproc returns the number of installed CPUs in Linux)


Then add the repositories with the device dependent files for the ASUS Zenfone 8.

I recommend using the repositories from https://github.com/mikooomich, as the build works without errors with these repositories. To use these repositories, create the file local_manifests.xml like this:

[xtrnaw7@t15g /backup_pool001/data/develop/LineageOS_22.x]$ cat .repo/local_manifests/local_manifests.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>

   <project path="device/asus/sake"   name="mikooomich/android_device_asus_sake" remote="github" revision="lineage-22.2" />
    <project path="vendor/asus/sake"   name="mikooomich/proprietary_vendor_asus_sake" remote="github" revision="lineage-22.2" />
    <project path="kernel/asus/sm8350" name="mikooomich/android_kernel_asus_sm8350" remote="github" revision="lineage-22.2" />

</manifest>



and do another sync using the repo tool to retrieve the hardware dependent source files:


repo sync


Now start the build using the commands:


source build/envsetup.sh

lunch lineage_sake-ap4a-user


brunch lineage_sake-ap4a-user


As usual, the image file is then created in the directory out/target/product/sake.




To include the GAPPS from MindTheGapps add these definitions to the file local_manifests.xml:

    <remote  name="gitlab" fetch="ssh://git@gitlab.com" />

    <project path="vendor/gapps" name="MindTheGapps/vendor_gapps" remote="gitlab" revision="vic" />

and do another sync

repo sync MindTheGapps/vendor_gapps


You need a user account on gitlab.com and a public ssh key to use this repository via ssh; creating a user on gitlab.com is free of charge.

In principle, accessing the gitlab repository via https should also work - but in my tests it didn't work for this repository. To access the gitlab repository via https use this repo definition in the xml file:

    <remote  name="gitlab" fetch="https://gitlab.com" />


Then add the lines

#
# MindTheGapps
#
WITH_GAPPS ?= false

ifeq ($(WITH_GAPPS),true)
  $(call inherit-product-if-exists,  vendor/gapps/arm64/arm64-vendor.mk )
endif

to the file

device/asus/sake/device.mk


Now set the environment variable WITH_GAPPS to true before starting the build to create an image with the GAPPS from MindTheGapps:

WITH_GAPPS=true  brunch lineage_sake-ap4a-user




Update 30.05.2025

Since 30.05.2025 it's again possible to use the "original" repository for the files in vendor/asus/sake again . To use that repository replace

    <project path="vendor/asus/sake"   name="mikooomich/proprietary_vendor_asus_sake" remote="github" revision="lineage-22.2" />

with

    <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github"/>

in the file .repo/local_manifests/local_manifests.xml.



Update 01.08.2025

The perl binary in the repository for LineageOS needs an older libcrypt library.


If the library is required but missing, the build of the OS image will fail with error messages like these:

perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

perl: /lib64/libcrypt.so.1: version `GLIBC_2.2.5' not found (required by perl)


To check which libcrypt library is required by perl execute this command:

[xtrnaw7@t15g /devpool001/develop/LineageOS_22.2]$ ldd ./prebuilts/tools-lineage/linux-x86/bin/perl
    linux-vdso.so.1 (0x00007fd874449000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007fd87440b000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fd873f1a000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd874406000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fd873d26000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fd873cf0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fd87444b000)
[xtrnaw7@t15g /devpool001/develop/LineageOS_22.2]$

In most Linux distributions this version fo libcyrpt.so is not installed by default anymore. Therefor the package with the library must be installed manually. In Fedora this can be done using this command:

sudo dnf install libxcrypt-compat





Notes

see How to create a TWRP image for LineageOS based ROMs using a script for instructions to create a TWRP image for the LineageOS on the ASUS Zenfone 8.



Precompiled LineageOS 22.x images for the ASUS Zenfone 8 are available here: https://github.com/mikooomich/android_device_asus_sake/releases



To add GAPPS only for user and userdebug builds add these lines:

ifneq ($(TARGET_BUILD_VARIANT),eng)
  $(call inherit-product-if-exists, vendor/gapps/gapps.mk)
endif



Update 25.03.2025

see also How to change name of the ZIP file with the OS image while building a new image






History of this entry

24.03.2025

initial release

09.05.2025

corrected the instructions

30.05.2025

added the hint about the repository for vendor/asus/sake from TheMuppets

01.08.2025

added infos about required libcrypt.so for the perl binary from the repository for LineageOS




How to compile the OmniROM 16 for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-omnirom-13-for-the-android-zenfone-8.4518733/

 
How to compile the OmniROM 16 for the ASUS Zenfone 8



This HowTo is about compiling the OmniROM 16 for the ASUS Zenfone 8.

See How to compile the OmniROM for the ASUS Zenfone 8 for instructions to compile the other versions of the OmniROM for the ASUS Zenfone 8.


Readers who have already built an earlier version of OmniROM can skip most of this post.

New/changed in this HowTos are the information about the recoveries that can be used to install the OmniROM and the details about the build_id used for the lunch and brunch commands
And the list of hardware dependent repositories for the ASUS Zenfone 8, of course.


The commands in this HowTo are intended for the Linux operating system, but it should not be too difficult to convert them into commands for the Windows operating system.




Compiling the CustomROM OmniROM 16 from within Linux is again a very simple and straight forward process -- the developer for the OmniROM did once again a really amazing good job setting up the build environment for the OmniROM 6.

I'm repeating myself here - but it can't be said often enough.



Hardware requirements

Message from the repo tool:

"The minimum required amount of free memory is around 16GB, and even with that, some configurations may not work."

In my experience, the computer on which OmniROM is compiled should have at least 32 GB RAM and 4 CPU cores.


Note that the scripts used to create the OmniROM image start one workspace per CPU and each workspace requires about 4 GB of RAM. Plus about 2 GB RAM for the general tasks.

As of 17.07.2025, the repositories for OmniROM 16, MicroG, GAPPS, and the hardware-specific repositories for the ASUS Zenfone 8 occupy about 260 GB of disk space.

The compile process will occupy additional 65 GB for the temporary output files.
In total, the repositories for OmniROM 16 require around 400 GB of storage space (the space occupied increases with every "repo sync")



Prerequisites

Some of the repositories for OmniROM 16 are on https://gitlab.com and the access to these repositories for the repository sync is done via ssh. Therefore, to sync these repositories a user account on gitlab.com with configured public ssh key is required. The user account on gitlab.com is free of charge and the public ssh key can be uploaded into the user profile on gitlab.com (see here: https://docs.gitlab.com/ee/user/ssh.html)

The repositories on http://github.com are currently accessed via https but that might change in the future. Therefor it's recommended to create a user on github.com and add the ssh public key to the profile of that user also.

Note:

To check how the access to the repositories is configured use this command

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ date
Thu Jul 17 08:22:22 PM CEST 2025
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ grep fetch $( find .repo -maxdepth 2   -name "*xml"  )
.repo/manifests/default.xml:           fetch="https://android.googlesource.com"
.repo/manifests/omni-aosp.xml:           fetch="https://github.com/" />
.repo/manifests/omni-aosp.xml:           fetch="ssh://git@gitlab.com/omnirom" />
.repo/manifests/omni-aosp.xml:           fetch="https://github.com/omnirom"
.repo/manifests/omni-aosp.xml:           fetch="ssh://git@github.com/omnirom"
.repo/manifests/omni-caf.xml:           fetch="https://github.com/" />
.repo/manifests/omni-caf.xml:           fetch="https://git.codelinaro.org/clo/la"
.repo/manifests/omni-private.xml:           fetch="ssh://git@github.com/omnirom"
.repo/local_manifests/local_manifest.xml:        fetch="https://github.com/DonkeyCoyote" />
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ 



Use the commands

ssh git@github.com

ssh git@gitlab.com

to test the access via ssh and add the ssh hostkeys of the hosts github.com and gitab.com to the known_hosts file.


Or use

grep  "^gitlab.com"  ~/.ssh/known_hosts  || ssh-keyscan gitlab.com >>~/.ssh/known_hosts

grep  "^github.com"
  ~/.ssh/known_hosts || ssh-keyscan github.com >>~/.ssh/known_hosts

to add the ssh hostkeys of the repository server used to the local known_hosts file of the user used to retrieve the repositories.


It's recommended to start the ssh-agent and load the private ssh keys before starting the sync of the repositories, e.g. if no global ssh-agent is running use:

$( eval ssh-agent )
ssh-add

Use

ssh-add -l

to list the ssh keys already loaded by the ssh-agent.

Note

Example output for a working access:

[xtrnaw7@arcolinux OmniROM_15.0]$  ssh git@gitlab.com
PTY allocation request failed on channel 0
Welcome to GitLab, @bnsmb01!
Connection to gitlab.com closed.
[xtrnaw7@arcolinux OmniROM_15.0]$

[xtrnaw7@arcolinux OmniROM_15.0]$ ssh git@github.com
PTY allocation request failed on channel 0
Hi bnsmb! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
[xtrnaw7@arcolinux OmniROM_15.0]$



If you have not used git on this machine before, you must set some global git variables:

git config --global user.email <your_email_address>

git config --global user.name <your name>




The tool repo is required to maintain the repositories for the OmniROM 16; you can download the tool "repo" from https://gerrit.googlesource.com/git-repo or download it with this command:

curl https://storage.googleapis.com/git-repo-downloads/repo > ./repo && chmod a+x ./repo  


The script repo should be added to a directory available via the environment variable PATH.

It's not necessary to install additional tools for creating an OmniROM 16 image -- all necessary tools to create the image are in the repositories for the OmniROM 16, with one exception:


If you are compiling the OmniROM image on a machine running Linux, the source code for some of the tools to create the OmniROM 16 image requires the header files and libraries for OpenSSL.

Under Fedora, these files can be installed using these commands:

sudo dnf install openssl openssl-libs openssl-devel

and additionally for distributions in which the OpenSSL engine is not part of the OpenSSL package anymore (as in Fedora 41):

sudo dnf install openssl-devel-engine




The repositories used for the OmniROM 16 use the git command line extension git lfs. At least in Fedora this extension is not installed by default while installing git. In Fedora git lfs can be installed using this command:

sudo dnf install git-lfs 


Use the command

git lfs install

to initialize git lfs extension.



Creating the local copies of the repositories for the OmniROM 16


Most (but not all) of the necessary steps to sync the repositories necessary to create an OmniROM 16 installation image are described in the section "Getting Started" here: https://github.com/omnirom/android/tree/android-16 but some instructions are missing the details.


To create a local copy of the repositories for OmniROM 16 these steps are required:


First create a new directory for the repositories and change the working directory to the new directory, e.g.:

mkdir /data/develop/android/OmniROM_16.0

cd /data/develop/android/OmniROM_16.0



Then init the local repositories using the command:

repo init -u https://github.com/omnirom/android.git -b android-16 --git-lfs


Note that the command repo init only creates a hidden directory called .repo.

Next sync the local repositories.

There are now two commands necessary to sync the repositories (the instructions below are copied from https://github.com/omnirom/android/tree/android-16):

"
Add this alias in your ~/.bashrc for an automatically sync :

alias repo-lfs="repo sync && repo forall -c git lfs pull"

Then reload your file with source ~/.bashrc in the terminal

Then to sync up with the lfs repo:

repo-lfs
"

Notes

Another useful alias for the repository sync is:

alias repo-lfs-force="repo sync --force-sync && repo forall -c git lfs pull"




The initial repository sync will download all repositories necessary to create the OmniROM 16 image except the hardware dependent repositories (these repos are different for the various phone models).

Therefor you must add the repositories for the vendor and device tree for your phone to the manifests in the local repositories after the download finished.

This should be done in the file .repo/local_manifests/local_manifest.xml (just create the directory .repo/local_manifests if it does not exist).

For the ASUS Zenfone 8 the file should look like this:

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ date
Thu Jul 17 08:25:35 PM CEST 2025
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ cat .repo/local_manifests/local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>

<manifest>
    <remote  name="DonkeyCoyote"
        fetch="https://github.com/DonkeyCoyote" />
    <project path="vendor/asus" name="android_vendor_asus" remote="gitlab" revision="android-16" />
    <project path="vendor/microg" name="android_prebuilts_prebuiltapks" remote="omnirom" revision="android-15" />
    <project path="vendor/images/asus" name="android_vendor_images_asus" remote="gitlab" revision="android-14.0" />
    <project path="vendor/gapps" name="android_vendor_gapps" remote="gitlab" revision="android-15" />
</manifest>
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $



Notes:

The repository android_prebuilts_prebuiltapks is only necessary for OmniROM 16 images that should include the MicroG packages.

The repository android_vendor_gapps is only necessary for OmniROM 16 images that should include the Google Apps.




The repositories configured in the file .repo/manifests/omni-private.xml are private repositories. To use these repositories, access to these repositories must be configured by the admin of the repositories (see https://github.com/omnirom/android). The packages installed using these repositories are only optional and OmniROM can be compiled without them.

To disable the private repositories comment or delete the lines starting with "<project path" in the file .repo/manifests/omni-private.xml -- but do NOT delete the file or remove the include statement for this file in the file .repo/manifests/omni-default.xml (as described here https://github.com/omnirom/android/tree/android-16):
 
The definition for the remote repository omnirom2 can be found in this file and omnirom2 is the default remote repository used to synchronize missing repositories in the python script roomservice.py.

Details


contents of the file .repo/manifests/omni-private.xml
  OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ date
Thu Jul 17 08:28:11 PM CEST 2025
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ cat .repo/manifests/omni-private.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote  name="omnirom2"
           fetch="ssh://git@github.com/omnirom"
           review="gerrit.omnirom.org" />

  <!-- private OmniROM Projects -->
  <project path="packages/apps/OmniSwitch" name="android_packages_apps_OmniSwitch" remote="omnirom2" revision="android-14.0" />
  <project path="packages/services/OmniJaws" name="android_packages_services_OmniJaws" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniRemote" name="android_packages_apps_OmniRemote" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniControl" name="android_packages_apps_OmniControl" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniOta" name="android_packages_apps_OmniOta" remote="omnirom2" revision="android-15" />
  <project path="packages/apps/OmniWallpaper" name="android_packages_apps_OmniWallpaper" remote="omnirom2" revision="android-15" />
</manifest>
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $




grep "default_rem |default_team_rem "  ../OmniROM_14.0/vendor/omni/build/tools/roomservice.py

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $  egrep "default_rem |default_team_rem "  ../OmniROM_14.0/vendor/omni/build/tools/roomservice.py

default_rem = "omnirom2"
default_team_rem = "omnirom2"
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $




After you have updated the file local_manifest.xml, run another

repo-lfs

to synchronize the added repositories. This time the download will be faster as only the additional repos will be downloaded.


Now you can start the build with these commands:

# optional:
#
# to build an OmniROM image with MicroG packages, set the environment variable ROM_BUILDTYPE to MICROG before starting the build
# (of course this only works if the repositories with MicroG are configured in the manifest files)
#
# to build an OmniROM image with GAPPS packages, set the environment variable ROM_BUILDTYPE to GAPPS before starting the build.
# (of course this only works if the repositories with GAPPS are configured in the manifest files)
#
export ROM_BUILDTYPE=MICROG

. build/envsetup.sh

lunch omni_zenfone8-bp2a-user

brunch zenfone8 bp2a user


in the directory with the downloaded repositories (Note: The command "breakast" to list all possible targets does not work in the repositories for OmniROM 16)

Be aware that the first time the compile process may take a long time (4 hours or more)


Note that the build_id, bp2a in this example, is patchset dependent; bp2a is the value for the patchset 2025-06-05. To get the current build_id used in the repository use the script print_security_patch, e.g.

[xtrnaw7@t15g /devpool001/develop/OmniROM_16.0]$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/OmniROM_16.0" ...
The repository uses the new definitions
The current security patch is "2025-06-05"
The current build_id is "bp2a"
[xtrnaw7@t15g /devpool001/develop/OmniROM_16.0]$

(The list of known build-ids is available here: https://source.android.com/docs/setup/reference/build-numbers)


If everything is OK, there will be a ZIP file with your own custom OmniROM 16 image in the directory ./out/target/product/zenfone8/ when the compilation script is finished, e.g. for images with the MicroG packages:

[ OmniRom 16 - xtrnaw7@t15g /data/develop/android/OmniROM_16.0 ] $  ls -i -l out/target/product/zenfone8/omni-16-*zip
97953082 -rw-rw-r--. 1 xtrnaw7 xtrnaw7 1426897040 Jul 17 19:16 out/target/product/zenfone8/omni-16-20250717-zenfone8-MICROG.zip
97953086 -rw-rw-r--. 3 xtrnaw7 xtrnaw7 1672061231 Jul 18 18:43 out/target/product/zenfone8/omni-16-20250718-zenfone8-GAPPS.zip
[ OmniRom 16 - xtrnaw7@t15g /data/develop/android/OmniROM_16.0 ] $ 


The image can now be installed on the ASUS Zenfone 8 with the LineageOS 18 Recovery or TWRP. You can also use the OrangeFox Recovery for the ASUS Zenfone 8 to install the OS image.
( see How to compile the OrangeFox Recovery for the ASUS Zenfone 8 for instructions to create an OrangeFox recovery for the ASUS Zenfone 8 or download the OrangeFox Recovery image fro the ASUS Zenfone 8 from here:
http://bnsmb.de/files/public/Android/OrangeFox-R11.3-Unofficial-I006D-2025-07-13.img)




Notes





Note that any new OmniROM 16 image created with the command brunch for the same ROM buildtype (e.g. MICROG or GAPPS) will overwrite the existing OmniROM 16 image (the name of the image is different, but the inodes used are the same for all zip files):

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ ls -li out/target/product/zenfone8/*zip
5869545 -rw-rw-r--. 6 xtrnaw7 xtrnaw7 1426896732 Jul 24 18:58 out/target/product/zenfone8/omni-16-20250717-zenfone8-MICROG.zip
5869545 -rw-rw-r--. 6 xtrnaw7 xtrnaw7 1426896732 Jul 24 18:58 out/target/product/zenfone8/omni-16-20250719-zenfone8-MICROG.zip
5869545 -rw-rw-r--. 6 xtrnaw7 xtrnaw7 1426896732 Jul 24 18:58 out/target/product/zenfone8/omni-16-20250724-zenfone8-MICROG.zip
5869545 -rw-rw-r--. 6 xtrnaw7 xtrnaw7 1426896732 Jul 24 18:58 out/target/product/zenfone8/omni_zenfone8-ota.zip
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ cksum out/target/product/zenfone8/*zip
1710878806 1426896732 out/target/product/zenfone8/omni-16-20250717-zenfone8-MICROG.zip
1710878806 1426896732 out/target/product/zenfone8/omni-16-20250719-zenfone8-MICROG.zip
1710878806 1426896732 out/target/product/zenfone8/omni-16-20250724-zenfone8-MICROG.zip
1710878806 1426896732 out/target/product/zenfone8/omni_zenfone8-ota.zip
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $


You should therefore copy the existing zip file with the image to a new directory before building a new image.



Certificates for the OS images

For OS images that are to be used on the phone for daily use, I strongly recommend creating your own certificates for the operating system.

In the OmniROM development directory tree the necessary files, platform.pk8 and platform.x509.pem, are in the directory

./build/make/target/product/security

in your build tree for the CustomROM, e.g.

[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ ls -l ./build/make/target/product/security/platform.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1219 Jul 17 16:43 ./build/make/target/product/security/platform.pk8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1460 Jul 17 16:43 ./build/make/target/product/security/platform.x509.pem
[ OmniRom 15 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $


Replace these files with your own certificate files and recreate the image using the command brunch (see above).

Please note that there is more than one certificate in the directory  ./build/make/target/product/security. Which one is used depends on the type of ROM to be created (e.g. user, user-eng, debug). You should therefore replace all certificates in this directory with your own certificates.


See here https://source.android.com/devices/tech/ota/sign_builds for how to create your own certificate.

To manually create the certificate and keys use these commands:
To manually create the certificate and keys use these commands:


Android uses 2048-bit RSA keys with public exponent 3. You can generate certificate/private key pairs using the openssl tool from openssl.org:

# generate RSA key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl genrsa -3 -out temp.pem 2048
[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 4
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem


# create a certificate with the public part of the key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj  '/C=DE/ST=Hessen/L=Frankfurt am Main/O=Android/OU=Android/CN=Android/emailAddress=bnsmb01@gmail.com'
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
[xtrnaw7@t15g /data/develop/android/test1]$



# create a PKCS#8-formatted version of the private key
#
[xtrnaw7@t15g /data/develop/android/test1]$
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
[xtrnaw7@t15g /data/develop/android/test1]$



[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 12
-rw-------. 1 xtrnaw7 xtrnaw7 1704 Nov 14 13:24 temp.pem
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$


# securely delete the temp.pem file

#
[xtrnaw7@t15g /data/develop/android/test1]$ shred --remove temp.pem
[xtrnaw7@t15g /data/develop/android/test1]$


[xtrnaw7@t15g /data/develop/android/test1]$ ls -ltr
total 8
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1456 Nov 14 13:25 releasekey.x509.pem
-rw-------. 1 xtrnaw7 xtrnaw7 1218 Nov 14 13:25 releasekey.pk8
[xtrnaw7@t15g /data/develop/android/test1]$ 


From the documentation:

The openssl pkcs8 command given above creates a .pk8 file with no password, suitable for use with the build system. To create a .pk8 secured with a password (which you should do for all actual release keys), replace the -nocrypt argument with -passout stdin; then openssl will encrypt the private key with a password read from standard input. No prompt is printed, so if stdin is the terminal the program will appear to hang when it's really just waiting for you to enter a password. Other values can be used for the-passout argument to read the password from other locations; for details, see the openssl documentation.

The temp.pem intermediate file contains the private key without any kind of password protection, so dispose of it thoughtfully when generating release keys. In particular, the GNUshred utility may not be effective on network or journaled filesystems. You can use a working directory located in a RAM disk (such as a tmpfs partition) when generating keys to ensure the intermediates are not inadvertently exposed.



To view the certificates in the repository used to build the images use this command (for all of the .pem files in that directory!):

openssl x509 -in ./build/make/target/product/security/platform.x509.pem -text -noout


To view the certificate used for the installed OS on the phone use the command

unzip -p /system/etc/security/otacerts.zip *.pem | openssl x509 -text


Note:

The executable openssl is not part of the standard Android OS and also not part of the OmniROM. A Magisk Module with openssl is available on my website : see here

The openssl binary from that Magisk Module can also be used without installing the Magisk Module. For that download the ZIP file with the Magisk Module and extract the openssl binary:

  unzip -p openssl_*.zip  system/usr/bin/openssl >openssl


Or download the openssl binary for Android on arm64 CPUs from here

https://bnsmb.de/files/public/Android/binaries_for_arm64/openssl


Now copy the file openssl just created to the phone into the directory /data/local/tmp and make it executable:

chmod 755 /data/local/tmp/openssl



Updating the local repositories

To update the local repositories, change the working directory to the directory with the repositories for OmniROM 16 and execute

repo-lfs

(This only works if you have created the bash alias as described above)


After the synchronization is complete, create a new ROM image using the commands described above.

It is recommended to update the local repositories and create a new image at least once a month after the new security patches for Android are added to the repositories for OmniROM 16.


To view the date of the security patch in the source files for the OmniROM 16 the shell script print_security_patch can be used; example:

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ date
Thu Jul 17 08:32:57 PM CEST 2025
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/OmniROM_16.0" ...
The repository uses the new definitions
The current security patch is "2025-06-05"
The current build_id is "bp2a"
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $




To check if the new security patch has already been applied to the OmniROM repositories, check the Gerrit for OmniROM : https://gerrit.omnirom.org/q/status:merged


See How to apply the Android Security patches to a local repository for how to apply an Android Security patch to the local repository in case you want to manually add the Android security patch to your local repositories.



Moving the repositories to another directory

In case you want to move the repositories for OmniROM 16 to another directory or rename the directory with the repositories:

Be aware that the make scripts create some absolute links in the output directory; to list these absolute links use this command while in the directory with the repositories for OmniROM 16 :

find . -type l -ls | grep "$PWD"


e.g. there are currently still some absolute links in the output directory for OmniROM 16:

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ find . -type l -ls | grep "$PWD" | wc -l
7
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $

[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $ find . -type l -ls | grep "$PWD"
  3880508      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        83 Jul 17 08:21 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher/linux_glibc_x86_64/py3-launcher -> /devpool001/develop/OmniROM_16.0/prebuilts/build-tools/linux-x86/bin/py3-launcher64
  3880266      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        91 Jul 17 08:21 ./out/soong/.intermediates/prebuilts/build-tools/prebuilt_py3-launcher-autorun/linux_glibc_x86_64/py3-launcher-autorun -> /devpool001/develop/OmniROM_16.0/prebuilts/build-tools/linux-x86/bin/py3-launcher-autorun64
  5836264      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        51 Jul 17 19:08 ./out/target/product/zenfone8/obj/DTBO_OBJ/source -> /devpool001/develop/OmniROM_16.0/kernel/asus/sm8350
  5838361      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        51 Jul 17 19:08 ./out/target/product/zenfone8/obj/KERNEL_OBJ/source -> /devpool001/develop/OmniROM_16.0/kernel/asus/sm8350
  5837427      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        51 Jul 17 19:10 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g240d49fe1088/source -> /devpool001/develop/OmniROM_16.0/kernel/asus/sm8350
  5835666      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        75 Jul 17 15:00 ./out/target/product/zenfone8/obj/PACKAGING/kernel_modules_intermediates/lib/modules/5.4.147-Omni-qgki-perf-g240d49fe1088/build -> /devpool001/develop/OmniROM_16.0/out/target/product/zenfone8/obj/KERNEL_OBJ
  5836865      2 lrwxrwxrwx   1 xtrnaw7  xtrnaw7        51 Jul 17 19:08 ./out/target/product/zenfone8/obj/DTB_OBJ/source -> /devpool001/develop/OmniROM_16.0/kernel/asus/sm8350
[ OmniRom 16 - xtrnaw7@t15g /devpool001/develop/OmniROM_16.0 ] $



Before starting another build after moving the directories with the repositories you must correct these links (or clean the directory ./out)



Log files

The verbose log of the compile script is always written to a compressed file in the output directory, e.g.:

ls -ltr  ./out/verbose.log*
[xtrnaw7@t15g /devpool001/develop/OmniROM_16.0]$ ls -ltr out/verbose.log.*
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    18181 Jul 17 07:13 out/verbose.log.4.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 37965773 Jul 17 15:01 out/verbose.log.3.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    40313 Jul 17 15:10 out/verbose.log.2.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    71617 Jul 17 16:59 out/verbose.log.1.gz
-rw-rw-r--. 1 xtrnaw7 xtrnaw7    55089 Jul 17 19:16 out/verbose.log.gz
[xtrnaw7@t15g /devpool001/develop/OmniROM_16.0]$





List available commands


To list all known commands for building the images use the function hmm:

hmm
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $ hmm

Run "m help" for help with the build system itself.

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch:      lunch <product_name>-<release_type>-<build_variant>
              Selects <product_name> as the product to build, and <build_variant> as the variant to
              build, and stores those selections in the environment to be read by subsequent
              invocations of 'm' etc.
- tapas:      tapas [<App1> <App2> ...] [arm|x86|arm64|x86_64] [eng|userdebug|user]
              Sets up the build environment for building unbundled apps (APKs).
- banchan:    banchan <module1> [<module2> ...] \
                      [arm|x86|arm64|riscv64|x86_64|arm64_only|x86_64only] [eng|userdebug|user]
              Sets up the build environment for building unbundled modules (APEXes).
- croot:      Changes directory to the top of the tree, or a subdirectory thereof.
- m:          Makes from the top of the tree.
- mm:         Builds and installs all of the modules in the current directory, and their
              dependencies.
- mmm:        Builds and installs all of the modules in the supplied directories, and their
              dependencies.
              To limit the modules being built use the syntax: mmm dir/:target1,target2.
- mma:        Same as 'mm'
- mmma:       Same as 'mmm'
- provision:  Flash device with all required partitions. Options will be passed on to fastboot.
- cgrep:      Greps on all local C/C++ files.
- ggrep:      Greps on all local Gradle files.
- gogrep:     Greps on all local Go files.
- jgrep:      Greps on all local Java files.
- jsongrep:   Greps on all local Json files.
- ktgrep:     Greps on all local Kotlin files.
- resgrep:    Greps on all local res/*.xml files.
- mangrep:    Greps on all local AndroidManifest.xml files.
- mgrep:      Greps on all local Makefiles and *.bp files.
- owngrep:    Greps on all local OWNERS files.
- rsgrep:     Greps on all local Rust files.
- sepgrep:    Greps on all local sepolicy files.
- sgrep:      Greps on all local source files.
- tomlgrep:   Greps on all local Toml files.
- pygrep:     Greps on all local Python files.
- godir:      Go to the directory containing a file.
- allmod:     List all modules.
- gomod:      Go to the directory containing a module.
- pathmod:    Get the directory containing a module.
- outmod:     Gets the location of a module's installed outputs with a certain extension.
- dirmods:    Gets the modules defined in a given directory.
- installmod: Adb installs a module's built APK.
- refreshmod: Refresh list of modules for allmod/gomod/pathmod/outmod/installmod.
- syswrite:   Remount partitions (e.g. system.img) as writable, rebooting if necessary.

Environment options:
- SANITIZE_HOST: Set to 'address' to use ASAN for all host modules.
- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.

Look at the source to view more functions. The complete list is:
adb addcompletions add_lunch_combo banchan build_build_var_cache check_type _complete_android_module_names cproj _croot croot destroy_build_var_cache enable_zsh_completion fastboot _get_abs_build_var_cached _get_build_var_cached get_host_prebuilt_prefix get_make_command _gettop_once godir gomod _lunch lunch _lunch_completion _lunch_meat _lunch_usage make printconfig print_lunch_menu runhat set_global_paths set_lunch_paths set_sequence_number set_stuff_for_environment should_add_completion showcommands source_vendorsetup tapas validate_current_shell
[ OmniRom 15 - xtrnaw7@t15g /data/develop/android/OmniROM_15.0 ] $





Most of the commands used to build AOSP images are functions or aliases defined in the file ./build/envsetup. To check the source code for the commands, either read that file or use

typeset -f command




Trouble Shooting

see Some hints for repo sync troubleshooting for how to fix some common errors while executing the command "repo sync".

see Some hints for fixing errros building an Custom ROM Android image for how to fix some common errors while creating the image

see also How to change name of the ZIP file with the OS image while building a new image




 
 
History of this entry

17.07.2025

initial release

24.07.2025

updated the infos about the recoveries that can be used to install the OmniROM image
fixed some minor typos


 

How to create a TWRP recovery image for the ASUS Zenfone 8 running a LineageOS 22.x based OS


URL: https://xdaforums.com/t/how-to-create-a-twrp-recovery-image-for-the-asus-zenfone-8-running-a-lineageos-22-x-based-os.4751520/


How to create a TWRP recovery image for the ASUS Zenfone 8 running a LineageOS 22.x based OS

Since LineageOS 20 the official TWRP image for the ASUS Zenfone 8 does not boot anymore if a LineageOS 20 or later based OS is installed on the phone.

To get around this limitation I documented instructions to manual create a TWRP image for the ASUS Zenfone 8 that can be used if a LineageOS 20 or later based OS is installed on the phone --
see How to use TWRP if LineageOS 20.x is installed and How to create a TWRP image for LineageOS based ROMs using a script .


Since LineageOS 22.x, the TWRP images created with these instructions and the original TWRP image for the ASUS Zenfone 8 no longer work - the created recovery image still boots, but can no longer be used.


However, the instructions still create a usable TWRP image if you use the OrangeFox Recovery image version R11.3 or later instead of the TWRP recovery image .

(OrangeFox is a recovery for phones running the Android OS based on TWRP)


There is no official OrangeFox recovery image for the ASUS Zenfone 8, so you must create that image yourself. But that's a very simple and straight forward task :

See the instructions to create an OrangeFox recovery image for the ASUS Zenfone 8 (or any other phone supported by TWRP) : How to compile the OrangeFox Recovery for the ASUS Zenfone 8


I have tested this approach with

the official LineageOS 22.2 for the ASUS Zenfone 8 (which is Android 15)

and the

/e/ 3.0.4-a15 which is based on LineageOS 22.2



Notes

An unofficial OrangeFox R11.3 recovery image for the ASUS Zenfone 8 is available here: OrangeFox-R11.3-Unofficial-I006D-2025-07-23.img

An unofficial recovery image based on OrangeFox R11.3 for /e/ 3.0.4-a15 on the ASUS Zenfone 8 is available here:  orangefox_e-3.0.4-a15-20250712508365-community-sake.img 

The recovery images are also available in a github repository:  https://github.com/bnsmb/recovery-images-for-ASUS-Zenfone-8  

see also How to use the OrangeFox addons when the phone is booted from the OrangeFox recovery image file

see How to compile /e/ based on Android 15 for the ASUS Zenfone 8 for instructions to compile an Android 15 based version of /e/ for the ASUS Zenfone 8.  



History of this entry

23.07.2025

initial release





How to use the OrangeFox addons when the phone is booted from the OrangeFox recovery image file


URL: https://xdaforums.com/t/guide-how-to-use-the-orangefox-addons-when-the-phone-is-booted-from-the-orangefox-recovery-image-file.4751590/


How to use the OrangeFox addons when the phone is booted from the OrangeFox recovery image file

The OrangeFox Addons are only included in the ZIP file with the OrangeFox Recovery Image (*.zip) - not in the boot image file (*.img). Therefore, these addons cannot be used if the phone is booted from the OrangeFox Recovery image and the ZIP file with the OrangeFox Recovery has not been installed beforehand


To use the OrangeFox Addons even if the phone is only booted from the OrangeFox Recovery Image, follow these instructions on the PC while the phone is booted into the Android OS or the OrangeFox recovery:

# extract the addons from the OrangeFox recovery ZIP file
#
unzip -t /devpool001/develop/orangefox/fox_12.1/out/target/product/I006D/OrangeFox-R11.3-Unofficial-I006D.zip "sdcard/*"

# create the necessary directories on the phone
#
adb shell "mkdir -p /sdcard/Fox/Foxfiles"

# copy the OrangeFox addons to the phone

adb push sdcard/Fox/ /sdcard


Now you can reboot the phone from the OrangeFox recovery image and use the OrangeFox addons, e.g.:

adb reboot bootloader

fastboot boot /data/backup/ASUS_ZENFONE8/e/e-3.0.4-a15/orangefox_e-3.0.4-a15-20250712508365-community-sake.img


Notes

Some of the OrangeFox addons are also available in the repositories with the source code for OrangeFox in this directory:

./fox_12.1/vendor/recovery/FoxFiles/

However, at least in the source code for OrangeFox R11.3 this directory does not contain all addons anymore:

[xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1]$ date
Thu Jul 24 10:10:16 AM CEST 2025
[xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1]$

[xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1]$ ls  -l ./vendor/recovery/FoxFiles/

total 1825
drwxrwxr-x. 2 xtrnaw7 xtrnaw7       3 Sep 10  2024 AromaFM
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 1865207 Sep 10  2024 OF_initd.zip
[xtrnaw7@t15g /devpool001/develop/orangefox/fox_12.1]$


In the repository for OrangeFox the directory with the addons is:

https://gitlab.com/OrangeFox/vendor/recovery/-/tree/fox_12.1/FoxFiles?ref_type=heads




History of this entry

24.07.2025

initial release





How to compile /e/ based on Android 15 for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-e-based-on-android-15-for-the-asus-zenfone-8.4752311/


How to compile /e/ based on Android 15 for the ASUS Zenfone 8

 
There is now a new /e/ version for the ASUS Zenfone 8 based on LineageOS 22.x which is Android 15 available:  https://images.ecloud.global/community/sake/


To compile that /e/ version for the ASUS Zenfone 8 these instructions can be used:

# create a new directory for /e/ and change the working directory to that directory:
#
mkdir /datapool001/develop/e_a15

cd /datapool001/develop/e_a15


# init the repositories for /e/
#
repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/v3.0.4-a15


# sync the repositories for /e/
#
repo sync -j$( nproc ) ; repo forall -c 'git lfs pull'


# create the manifest file for the repositories in vendor/asus/sake necessary for the ASUS Zenfone 8
#
mkdir -p
.repo/local_manifests

cat >>.repo/local_manifests/local_manifests.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" revision="lineage-22.2" clone-depth="1" />
</manifest>
EOT

# sync the repository for the vendor files for the ASUS Zenfone 8
#
repo sync TheMuppets/proprietary_vendor_asus_sake

# init the environment
#
source build/envsetup.sh

# retrieve the repositories with the device files for the ASUS Zenfone 8 if necessarry and start the build
#
brunch sake


The ZIP file is then located in the directory out/target/product/sake, e.g:

[xtrnaw7@t15g /devpool001/develop/e/a15]$ ls -l out/target/product/sake/e-3.0.4-a15-*zip

-rw-rw-r--. 2 xtrnaw7 xtrnaw7 1512967634 Jul 29 16:13 out/target/product/sake/e-3.0.4-a15-20250729-UNOFFICIAL-sake.zip

[xtrnaw7@t15g /devpool001/develop/e/a15]$



Trouble Shooting

To fix an error message like this:

vendor/asus/sake/Android.mk:9: error: vendor/asus/sake/radio/abl.img SHA1 mismatch (b2c1c0e44ab421d525a7448e4c51eb6caa95a847 != 46f6d4535c45132c118279d805418cc5b5a6ab71).

Correct the sha1 values for the file abl.img in the file vendor/asus/sake/Android.mk, example:

[xtrnaw7@t15g /devpool001/develop/e/a15]$ diff vendor/asus/sake/Android.mk.org vendor/asus/sake/Android.mk
9c9
< $(call add-radio-file-sha1-checked,radio/abl.img,46f6d4535c45132c118279d805418cc5b5a6ab71)
---
> $(call add-radio-file-sha1-checked,radio/abl.img,b2c1c0e44ab421d525a7448e4c51eb6caa95a847)
[xtrnaw7@t15g /devpool001/develop/e/a15]$



In my tests with a repo sync done on 28.07.2025 all sha1 values in that file were incorrect. To create entries with correct sha1 values for all .img files for the file vendor/asus/sake/Android.mk this command can be used:

(cd vendor/asus/sake && sha1sum radio/*.img | awk '{ print "$(call add-radio-file-sha1-checked,"$2","$1")" }' )



Example
[xtrnaw7@t15g /datapool001/develop/e_a15]$ (cd vendor/asus/sake && sha1sum radio/*.img | awk '{ print "$(call add-radio-file-sha1-checked,"$2","$1")" }' )
$(call add-radio-file-sha1-checked,radio/abl.img,b2c1c0e44ab421d525a7448e4c51eb6caa95a847)
$(call add-radio-file-sha1-checked,radio/aop.img,810facb082733ed8c2607eef0c8ad44b26735bb1)
$(call add-radio-file-sha1-checked,radio/bluetooth.img,fdf8b5e5c8ae71a9b53d9d5f33ac4ba910495be8)
$(call add-radio-file-sha1-checked,radio/cpucp.img,4d369f26e6a98324f6cc6eeb9a7da22fc4b3f2a4)
$(call add-radio-file-sha1-checked,radio/devcfg.img,a4f4b4e833d345586de28e21d70202c3a1e4453b)
$(call add-radio-file-sha1-checked,radio/dsp.img,2893b36ce2f575326b75816b54cdb9b444e38e49)
$(call add-radio-file-sha1-checked,radio/featenabler.img,0a25e72de96a80c8439a79aa108eb8807bf18f16)
$(call add-radio-file-sha1-checked,radio/hyp.img,bb4bf7f97d71777f59097017273942ec80695473)
$(call add-radio-file-sha1-checked,radio/keymaster.img,17e759e31181c78d65e0efa0851d1ddf4983fa9e)
$(call add-radio-file-sha1-checked,radio/modem.img,4bf3ab6e54d74e4291a6cfee49c5ce19ca3e5bd0)
$(call add-radio-file-sha1-checked,radio/multiimgoem.img,a2a132a396a62019740548f256554b32aced505d)
$(call add-radio-file-sha1-checked,radio/qupfw.img,a524b40e82b27234ff7cfe52b23bab7cfe9b402e)
$(call add-radio-file-sha1-checked,radio/qweslicstore.img,53b7e8408020a1b30e3f3bf0bb4b4f70579a059d)
$(call add-radio-file-sha1-checked,radio/shrm.img,6d74454a364672853f3257fd8b124dfde1b73b1b)
$(call add-radio-file-sha1-checked,radio/tz.img,80f63ce00bc7260f95a84fd8195cba6250b6df04)
$(call add-radio-file-sha1-checked,radio/uefisecapp.img,921762d5c36762815189cc4f7b48b08c60f9ae70)
$(call add-radio-file-sha1-checked,radio/xbl_config.img,9df19e35ce264c114b3d9cfdf353d3d77c97e365)
$(call add-radio-file-sha1-checked,radio/xbl.img,1f4d6f807ee5c6484bda4c55acd840fdff197a18)
$(call add-radio-file-sha1-checked,radio/xrom.img,491e5c554126ae23c6947848b9490861ea6a6fb9)
[xtrnaw7@t15g /datapool001/develop/e_a15]$ 



Notes

As of 28.07.2025 the initial size of the repositories for /e/ for the ASUS Zenfone 8 is about 160 GB.


As of 28.07.2025, v3.0.4-a15 is the current tag used to create the OS for the ASUS Zenfone 8.

To get the current tag or branch to use, check the repository in a browser:

https://gitlab.e.foundation/e/os/releases.git

Or check the list of branches and tags in the repository using git:

git ls-remote --refs https://gitlab.e.foundation/e/os/releases.git


In most cases, the branch or tag to use is included in the name of the OS image available here https://images.ecloud.global/community/sake/, e.g.

The tag used to create the image

e-3.0.4-a15-20250712508365-community-sake.zip

is

v3.0.4-a15


The syntax to sync a tag is

repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/<tag>


the syntax to sync a branch  is


repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/heads/<branch>

or

repo init -u https://gitlab.e.foundation/e/os/releases.git -b <branch>

A "tag" marks a fixed release; a "branch" is work in progress.



see How to create a TWRP recovery image for LineageOS 22.x  for how to create a TWRP image for this version of /e/ (which is LineageOS 22.x based)

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based CustomROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.

see Compiling /e/ for the ASUS Zenfone 8 using the docker image for how to compile the Android 13 based /e/ version for the ASUS Zenfone 8.



Update 13.09.2025

To compile the /e/ OS version 3.1.1-a15 for the ASUS Zenfone 8, the above instructions can be used with the following changes:

The repo command to init the repository is

repo init -u https://gitlab.e.foundation/e/os/releases.git -b refs/tags/v3.1.1-a15

Before running the “brunch” command, you must remove references to parts that no longer exist in LineageOS from the file

device/asus/sake/lineage_sake.mk

To do this, simply delete the following lines in that file:

# LiveDisplay (deprecated since LOS 21+)
# PRODUCT_PACKAGES += \
#     vendor.lineage.livedisplay-service.sdm \
#     vendor.lineage.livedisplay-service.sysfs

Note that the sha1 check sums in the file vendor/asus/sake/Android.mk are still invalid in this release and the correction specified above must be applied

----

History of this entry

28.07.2025

initial release

13.09.2025

added instructions to compile /e/ OS 3.1.1-a15





How to compile the official LineageOS 22.2 for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-official-lineageos-22-2-for-the-asus-zenfone-8.4752867/


How to compile the official LineageOS 22.x for the ASUS Zenfone 8

Since July 2025 there are now official LineageOS 22.x images for the ASUS Zenfone 8 available:

https://download.lineageos.org/devices/sake/builds


To compile the LineageOS 22.2 for the ASUS Zenfone 8 the instructions from the LineageOS wiki

https://wiki.lineageos.org/devices/sake/build/

can be used, but with a few small changes:


The proprietary blobs for the ASUS Zenfone 8 are already in repositories known by the build scripts for the LineageOS. Therefore, the brunch command copies the necessary repositories for the ASUS Zenfone 8 if they are missing in the local repository tree.


To add the vendor repositories for the ASUS Zenfone 8, add this local manifest

xtrnaw7@t540p:/devpool001/develop/LineageOS_22$ cat .repo/local_manifests/local_manifests.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
   <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github"/>
</manifest>
xtrnaw7@t540p:/devpool001/develop/LineageOS_22$


either before the first repo sync or after the repo sync. In the latter case, perform a new repo sync after you have added the local manifest.


The parameter for the lunch and brunch commands are also different

So, the commands to create the repositories and compile LineageOS 22.2 for the ASUS Zenfone 8 are (assuming the repo tool and the necessary OS tools are already installed):


# create the directory for the LineageOS 22.2 repositories

mkdir /devpool001/develop/LineageOS_22

cd
/devpool001/develop/LineageOS_22


# init the repositories for LineageOS 22.2
#
repo init -u https://github.com/LineageOS/android.git -b lineage-22.2 --git-lfs --no-clone-bundle


# add the required repositories for the vendor files of the ASUS Zenfone 8
#
mkdir -p  .repo/local_manifests/

cat >.repo/local_manifests/local_manifests.xml  <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
   <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" remote="github"/>
</manifest>
EOT


# download the repositories (-c = only download the current branch; -j4 = use 4 processes in parallel)
#
repo sync -j4 -c


# init the environment

source build/envsetup.sh


# prepare the build
#
lunch lineage_sake-bp1a-user


# start the build
#
brunch lineage_sake-bp1a-user


Notes:

bp1a is the build_id to be used for the build; as of 01.08.2025 this is bp1a for the LineageOS 22.2The build_id may change after applying a patchset to the repositories with the LineageOS.

The build_id to be used can be retrieved from the repositories after the repo sync command is done:

Execute the script print_security_patch in the directory with the repositories for LineageOS 22.2 to print the build_id to be used:

xtrnaw7@t540p:/devpool001/develop/LineageOS_22$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/LineageOS_22" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/LineageOS_22


Note that the breakfast command does not work anymore when building the LineageOS 22.2 OS image.




Trouble Shooting

The perl binary in the repository for LineageOS 22.2 requires the library: libcrypt.so.1.

If this library is missing in the current Linux installation, the build of the LineageOS image will fail with error messages like these:

perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

or

perl: /lib64/libcrypt.so.1: version `GLIBC_2.2.5' not found (required by perl)


To check which libcrypt library is required by perl, run this command; if the required library version exists, the output should look like this:

[xtrnaw7@t15g /devpool001/develop/LineageOS_22.2]$ ldd ./prebuilts/tools-lineage/linux-x86/bin/perl
    linux-vdso.so.1 (0x00007fd874449000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007fd87440b000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fd873f1a000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd874406000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fd873d26000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fd873cf0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fd87444b000)
[xtrnaw7@t15g /devpool001/develop/LineageOS_22.2]$


In most Linux distributions, this version of libcyrpt.so is no longer installed by default. Therefore, the package with the library must be installed manually. In Fedora this can be done using this command:

sudo dnf install libxcrypt-compat



Notes

see the section How to compile LineageOS 22.x for the ASUS Zenfone 8 for instructions to compile the LineageOS 22.2 for the ASUS Zenfone 8 using some other repositories

see the section How to compile /e/ based on Android 15 for the ASUS Zenfone 8 for instructions to compile another LineageOS 22.2 based Custom ROM for the ASUS Zenfone 8

see the section How to compile the crDroid CustomROM for the ASUS Zenfone 8 for instructions to compilie another LineageOS 22.x based Custom ROM for the ASUS Zenfone 8 

see the section How to create a TWRP recovery image for LineageOS 22.x for instructions to create OrangeFox (= TWRP) recovery image for the LineageOS 22.2 running on the ASUS Zenfone 8.

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based CustomROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.


History of this entry

01.08.2025

initial release





How to compile the crDroid CustomROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-crdroid-customrom-for-the-asus-zenfone-8.4753097/

 
How to compile the crDroid CustomROM for the ASUS Zenfone 8

crDroid is another LineageOS based CustomROM for Android phones. The ASUS Zenfone 8 is not officially supported by crDroid, but it is not that difficult to compile a crDroid OS image for the ASUS Zenfone 8.

To compile the crDroid 11.x CustomROM for the ASUS Zenfone 8 these commands are necessary:


# create the directory for the repositories with crDroid
#
mkdir /devpool001/develop/crdroid11

cd /devpool001/develop/crdroid11


# init the repository tree
#
repo init -u https://github.com/crdroidandroid/android.git -b 15.0 --git-lfs

# synchronise the repositories
#
repo sync


# Add the necessary repositories for the ASUS Zenfone 8
#

mkdir -p .repo/local_manifests

cat >.repo/local_manifests/roomservice.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-22.2" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-22.2" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-22.2" />

</manifest>
EOT


# sync the repositories for the ASUS Zenfone 8
#
repo sync LineageOS/android_device_asus_sake

repo sync LineageOS/android_kernel_asus_sm8350

repo sync TheMuppets/proprietary_vendor_asus_sake


# correct some files in the repositories
#

# replace "armv8-a" with "armv8-2a"
#
cp device/asus/sake/BoardConfig.mk device/asus/sake/BoardConfig.mk.org
sed  -i -e  "s/armv8-a/armv8-2a/g" device/asus/sake/BoardConfig.mk

# remove duplicate paths
#
if [ ! -r device/asus/sake/sepolicy/vendor/genfs_contexts.org ] ; then
  cp device/asus/sake/sepolicy/vendor/genfs_contexts device/asus/sake/sepolicy/vendor/genfs_contexts.org
  sed -i \
      -e "s|^genfscon sysfs /devices/platform/soc/17300000.qcom,lpass/wakeup|# genfscon sysfs /devices/platform/soc/17300000.qcom,lpass/wakeup|g" \
      -e "s|^enfscon sysfs /devices/platform/soc/188101c.qcom,spss/wakeup|# enfscon sysfs /devices/platform/soc/188101c.qcom,spss/wakeup|g" \
      -e "s|^enfscon sysfs /devices/platform/soc/5c00000.qcom,ssc/wakeup|# enfscon sysfs /devices/platform/soc/5c00000.qcom,ssc/wakeup |g" \
      device/asus/sake/sepolicy/vendor/genfs_contexts
fi

# init the environment
#
source build/envsetup.sh

# prepare the environment
#
lunch lineage_sake-bp1a-user

# start the build
#
brunch lineage_sake-bp1a-user


Check the result

xtrnaw7@t540p:/devpool001/develop/crdroid11$ ls -ltr out/target/product/sake/*zip
-rw-r--r--. 1 xtrnaw7 xtrnaw7 1334328430 Aug  3 12:20 out/target/product/sake/crDroidAndroid-15.0-20250803-sake-v11.7.zip
xtrnaw7@t540p:/devpool001/develop/crdroud11$




I have successfully installed the image on an ASUS Zenfone 8:





Notes

To get the build_id for the lunch and brunch command, bp1a in the examples above, use the script print_security_patch, e.g.:

xtrnaw7@t540p:/devpool001/develop/crdroid11$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/crdroid11" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/crdroid11


I have done some basic tests but I have not thoroughly tested the crDroid image for the ASUS Zenfone 8 - this is more or less just a proof of concept and an example of creating a LineageOS based CustomROM for a phone that is supported by the LineageOS but, not the by LineageOS based CustomROM.


see the section How to compile the OmniROM for the ASUS Zenfone 8 for HowTos to compile the OmniROM for the ASUS Zenfone 8.

see the section How to compile other CustomROMs for the ASUS Zenfone 8 for a list of sections with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.


see How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU for instructions to add KernelSU-Next to the OS image (the instructions in that HowTo also work for the crDorid ROM)

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based CustomROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.


History of this entry

03.08.2025

initial release


 


How to compile the evolutionX Custom ROM for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-the-evolutionx-custom-rom-for-the-asus-zenfone-8.4753244/


How to compile the evolutionX Custom ROM for the ASUS Zenfone 8

evolutionX is another LineageOS based CustomROM for Android phones. The ASUS Zenfone 8 is not officially supported by evolutionX, but it is not that difficult to compile a evolutionX OS image for the ASUS Zenfone 8.

To compile the evolutionX CustomROM for the ASUS Zenfone 8 these commands are necessary (see also the evolutionX wiki):


# create the directory for the repositories for evolutionX
#
mkdir /devpool001/develop/evolutionX

cd /devpool001/develop/evolutionX


# init the repositories for evolutionX  (vic = Android 15)
#
repo init -u https://github.com/Evolution-X/manifest -b vic --git-lfs


# create the manifest file with the repositories for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >.repo/local_manifests/asus_sake.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <project path="device/asus/sake"   name="LineageOS/android_device_asus_sake" remote="github" revision="lineage-22.2" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github"/>

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-22.2" />

</manifest>
EOT


# synchronize the repositories
#
repo sync -c -j4 --force-sync --no-clone-bundle --no-tags


# prepare the build environment
#
lunch lineage_sake-bp1a-userdebug


# start the build
#
m evolution


Check the result

[xtrnaw7@t540p evolutionX]$ ls -l out/target/product/sake/EvolutionX-*zip
-rw-r--r--. 1 xtrnaw7 xtrnaw7 2362271330 Aug  5 06:59 out/target/product/sake/EvolutionX-15.0-20250804-sake-10.7-Unofficial.zip
[xtrnaw7@t540p evolutionX]




I have successfully installed the image on an ASUS Zenfone 8:




ASUS_I006D:/ $ getprop | egrep -i "evol|fingerprint"
[persist.sys.pihooks_FINGERPRINT]: [google/panther_beta/panther:16/BP31.250523.010/13667654:user/release-keys]
[ro.bootimage.build.fingerprint]: [asus/twrp_I006D/I006D:99.87.36/SP2A.220405.004/xtrnaw707262051:eng/test-keys]
[ro.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.build.version.preview_sdk_fingerprint]: [REL]
[ro.evolution.build.version]: [EvolutionX-15.0-20250804-sake-10.7-Unofficial]
[ro.evolution.device]: [sake]
[ro.evolution.display.version]: [v10.7-20250804]
[ro.evolution.version]: [15.0]
[ro.evolutionlegal.url]: [https://evolution-x.org/legal.php]
[ro.hardware.fingerprint]: [goodixfp]
[ro.odm.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.product.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.system.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.system_ext.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.vendor.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
[ro.vendor_dlkm.build.fingerprint]: [asus/WW_I006D/ASUS_I006D:13/TKQ1.220807.001/33.0210.0210.332:user/release-keys]
ASUS_I006D:/ $



Notes

see the Evolution WIki for the supported build flags. To use a build flag, simply export the flag as environment variable before starting the build, e.g

to disable GAPPS use

export WITH_GMS=false


Note that I do not know why the security patch in the EvolutionX GUI on the phone is 1. July 2025. Google did not release a new patchset in July 2025. The patchset info in the source code is:

xtrnaw7@t540p:/devpool001/develop/evolutionX$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/evolutionX" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/evolutionX$


Note that the script print_security_patch also prints the build_id that must be used in the parameter for the lunch and brunch commands ( bp1a in this example)


I have done some basic tests but I have not thoroughly tested the evolutionX image for the ASUS Zenfone 8 - this is more or less just a proof of concept and an example of creating a LineageOS based CustomROM for a phone that is supported by the LineageOS but, not the by LineageOS based CustomROM.


see the section How to compile the OmniROM for the ASUS Zenfone 8 for HowTos to compile the OmniROM for the ASUS Zenfone 8.

see the section How to compile other CustomROMs for the ASUS Zenfone 8 for a list of HowTos with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.


Note that the OS image for the ASUS Zenfone 8 created with these instructions does not contain KernelSU.

see How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU for instructions to add KernelSU-Next to the OS image.

see How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for instructions to create an OrangeFox recovery for LineageOS based CustomROMs for the ASUS Zenfone 8 using the OrangeFox Recovery Builder on github.com.
 



History of this entry

04.08.2025

initial release





How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU


URL: https://xdaforums.com/t/how-to-compile-the-evolutionx-custom-rom-for-the-asus-zenfone-8-with-kernelsu.4754054/


How to compile the evolutionX Custom ROM for the ASUS Zenfone 8 with kernelSU

The section How_to_compile_the_evolutionX_Custom_ROM_for_the_ASUS_Zenfone_8 contains the instructions to compile the evolutionX custom ROM for the ASUS Zenfone 8.
The OS image created with these instructions does not contain kernelSU, unlike the official builds for evolutionX for other phones.


To compile the evolutionX for the ASUS Zenfone 8 with kernelSU, these instructions can be used:


The repositories for kernelSU can not be used to add kernelSU to the evolutionX image for the ASUS Zenfone 8 because the current kernelSU sources no longer support the kernel version used on this phone.

Therefore, Instead of the original kernelSU source, we use the source for KernelSU-Next: KernelSU-Next supports the old kernel versions out of the box.

To add KernelSU-Next to the OS image, change the working directory to the top directory with the repositories for evolutionX and then execute these commands (see also https://kernelsu-next.github.io/webpage/pages/installation.html)

(These commands only need to be executed once to add the KernelSU-Next repository to the repositories for evolutionX)


# change the current working directory to the kernel source directory
#
cd ./kernel/asus/sm8350

# retrieve the setup script for KernelSU-Next and execute it (the script installs and configures the KernelSU-Next repository)
#
curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -


# add the necessary compile flag for KernelSU-Next to the Makefile
#
cp drivers/kernelsu/Makefile  drivers/kernelsu/Makefile.org

( echo "ccflags-y += -DKSU_NEXT" ; cat drivers/kernelsu/Makefile.org ) >drivers/kernelsu/Makefile


The build the image for the boot partition:

# init the build environment (if not already done)
#
source build/envsetup.sh


# create the boot image
#
mka clobber; mka bootimage



If the build of the boot image is successfull, the boot image is in the file

out/target/product/sake/boot.img


To test the boot image (assuming evolutionX is currently installed on the phone):

adb reboot bootloader ;  fastboot boot out/target/product/sake/boot.img


This command boots the phone from the just created boot partition image into the OS installed on the phone.


To check if KernelSU-Next is working, download and install the KernelSU-Next app from https://github.com/KernelSU-Next/KernelSU-Next/releases/:

KERNELSU_NEXT_APK="KernelSU_Next_v1.0.9_12797-release.apk"

# download the apk to the PC
#
wget -O "${KERNELSU_NEXT_APK}"  "https://github.com/KernelSU-Next/KernelSU-Next/releases/download/v1.0.9/${KERNELSU_NEXT_APK}"

# install the apk on the phone using "adb shell" on the PC (or copy the apk to the phone and install it using the Android GUI)
#
cat "${KERNELSU_NEXT_APK}" | adb shell pm install -S echo $( stat -c "%s"  "${KERNELSU_NEXT_APK}" )


If everything is okay, the app should look like this:




Now simply create a new OS image with KernelSU-Next using the standard build commands:

# init the environment (if not already done)
#
source build/envsetup.sh

lunch lineage_sake-bp1a-userdebug

m evolution


Notes

To build an OS image without KernelSU-Next, delete the line

ccflags-y += -DKSU_NEXT

in the file

./kernel/asus/sm8350/drivers/kernelsu/Makefile

and recreate the image.

Please note that the environment variables in the session where the build is started are not inherited by the process executing make to compile the kernel.


To change the name of the ZIP file with the OS image for builds with enabled KernelSU-Next add the lines

ifeq ($(WITH_KSU_NEXT),true)
EVO_VERSION := ${EVO_VERSION}-ksu
endif

to the file

./vendor/lineage/config/version.mk

before the line starting with

LINEAGE_VERSION :=

and define the environment variable

WITH_KSU_NEXT=true

before starting the build (The string -ksu can be replaced with any other string).



The boot.img file created for the evolutionX Custom ROM can also be used to add KernelSU-Next to other ROMs for the ASUS Zenfone 8 based on LineageOS 22.2 that are using the same kernel sources (like crDroid 11.7)

As of 09.08.2025 the current version of the KernelSU-Next app is 1.0.9 - it's recommended to check https://github.com/KernelSU-Next/KernelSU-Next/releases/ for a newer version of the apk (use the link "Show all n assets" on that page to see the apks)

There is no pre-compiled kernelSU image for the kernel used in the evolutionX Custom ROM (kernelSU only supplies precompiled kernels for Linux Kernel 5.10 or newer).

To create a kernel without kernelSU, delete the line

ccflags-y += -DKSU_NEXT

in the file drivers/kernelsu/Makefile and recreate the kernel


TroubleShooting

To stop or start the KernelSU-Next app in a shell, these commands can be use:

# stop the KernelSU-Next app
#
am force-stop com.rifsxd.ksunext

# start the KernelSU-Next app
#
am start -n com.rifsxd.ksunext/.ui.MainActivity


If KernelSU-Next is not working at all or not working as expected you can enable kernel debug messages:

To compile the kernel with debug code add the statements

CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_KERNEL=y
CONFIG_KSU_DEBUG=y


to the kernel config file and recompile the kernel. In the source for the ASUS Zenfone 8 the file with the kernel config is:

/devpool001/develop/OmniROM_16.0/kernel/asus/sm8350/arch/arm64/configs/vendor/zf8_defconfig

The final kernel config used to compile the kernel is in the file:

/devpool001/develop/OmniROM_16.0/out/target/product/zenfone8/obj/KERNEL_OBJ/.config


If the kernel was built with the options

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y

the config is available while the kernel is booted:

cat /proc/config.gz | gzip -d > kernel.config


To enable the filesystem

/sys/kernel/debug

add the option

CONFIG_DEBUG_FS=y

to the kernel config.

Note that in my tests the kernel from the OmniROM 16 for the ASUS Zenfone 8 did not boot a kernel compiled with this setting


----


History of this entry

09.08.2025

initial release

11.08.2025

added trouble shooting infos






How to create a OrangeFox Recovery using the OrangeFox Recovery Builder 2024

 
URL: https://xdaforums.com/t/guide-how-to-create-a-orangefox-recovery-using-the-orangefox-recovery-builder-2024.4755242/


How to create a OrangeFox Recovery using the OrangeFox Recovery Builder 2024

For those who do not have the resources to build the OrangeFox recovery locally, an OrangeFox Recovery Builder is available on Github:

https://github.com/kinguser981/OrangeFox-Recovery-Builder-2024


The workflow in this repository can be used to create OrangeFox recoveries on the github server without using any local resources.

The workflow can also be used to create an OrangeFox recovery for phones, that are supported by TWRP but not official supported by OrangeFox.

I used the OrangeFox Recovery Builder 2024 for building an OrangeFox recovery image for the ASUS Zenfone 8 and it worked pretty cool (the ASUS Zenfone 8 is not official supported by the OrangeFox recovery).


Just follow the instructions from the readme in that repository.

To create an OrangeFox recovery image for the ASUS Zenfone 8 enter these values in the dialog:


field description
value
OrangeFox Branch 12.1

As of 30.10.2025 the OrangeFox branch 14.1 is not ready for use!

Custom Recovery Tree https://github.com/TeamWin/android_device_asus_I006D
Custom Recovery Tree Branch android-12.1
Specify your device path device/asus/I006D
Specify your Device Codename I006D
Specify your Build Target boot
Path of blobs to check system/bin/qseecomd


In principle, that's it.

But to create an OrangeFox recovery image for the ASUS Zenfone 8, an additional entry in the .yml File for the builder (OrangeFox-Recovery-Builder.yml) is required (the file can be edited in the github Web GUI):

Add the block

    - name: Ensure TW_MAX_BRIGHTNESS is set
      run: |
        pwd ; ls -l && \
        grep -q 'TW_MAX_BRIGHTNESS' ${GITHUB_WORKSPACE}/OrangeFox/fox_12.1/device/asus/I006D/BoardConfig.mk || \
        echo 'TW_MAX_BRIGHTNESS := 255' >> ${GITHUB_WORKSPACE}/OrangeFox/fox_12.1/device/asus/I006D/BoardConfig.mk

After the block

    - name: Clone Device Tree
      run: |
        cd ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
        git clone ${{ github.event.inputs.DEVICE_TREE }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
        cd ${{ github.event.inputs.DEVICE_PATH }}
        echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV


Please note that the syntax in yml files is very strict (and trial and error using the builder takes some time ...)

(see https://github.com/bnsmb/OrangeFox-Recovery-Builder-2024/blob/OrangeFox/.github/workflows/OrangeFox-Recovery-Builder.yml)


Or use the workflow

OrangeFox - Build for ASUS Zenfone 8

in my clone of the OrangeFox Recovery Builder 2024 with default values for the ASUS Zenfone 8 :

https://github.com/bnsmb/OrangeFox-Recovery-Builder-2024


I'm pretty sure the OrangeFox Recovery Builder can also be used to create OrangeFox recoveries for other phones as a long as the device tree and the kernel sources are available in a git repository.


And the best part is that this github.com feature can be used with a free GitHub account.


Notes

see this HowTo for instructions to compile the OrangeFox recovery locally


The workflow

OrangeFox - Build for ASUS Zenfone 8 with LineageOS

in my clone of the OrangeFox Recovery Builder 2024 can be used to create an "ugly" OrangeFox recovery for the ASUS Zenfone 8 -- see
How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024 for the documentation for this workflow.




Update 19.08.2025

There is also a Recovery Builder to create TWRP recovery images available at github.com: https://github.com/kinguser981/TWRP-Recovery-Builder-2024 

This Recovery Builder can be used to create a TWRP recovery image for the ASUS Zenfone 8 using the values listed above for the dialog. The additional step of defining TW_MAX_BRIGHTNESS is not necessary for creating the TWRP recovery image.

A TWRP Recovery builder with default values for the ASUS Zenfone 8 is available here:

https://github.com/bnsmb/TWRP-Recovery-Builder-2024/





History of this entry


20.08.2025

add the link to the documentation to use the OrangeFox Recovery Builder to create an "ugly" OrangeFox Recovery


19.08.2025

added infos about the TWRP Recovery builder


18.08.2025

initial release





How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024


URL: https://xdaforums.com/t/how-to-create-a-orangefox-recovery-for-lineageos-22-x-or-newer-on-the-asus-zenfone-8-using-the-orangefox-recovery-builder-2024.4755586/


How to create a OrangeFox Recovery for LineageOS 22.x or newer on the ASUS Zenfone 8 using the OrangeFox Recovery Builder 2024

My clone of the OrangeFox Recovery Builder 2024 :

https://github.com/bnsmb/OrangeFox-Recovery-Builder-2024

now also contains a workflow to build an "ugly" OrangeFox recovery for the ASUS Zenfone 8 with installed LineageOS 22.x or newer (or any other Custom based on LineageOS 22.x or newer):

OrangeFox - Build for ASUS Zenfone 8 with LineageOS

The configurable fields for this workflow are:





With the default settings, this workflow builds the OrangeFox recovery for the ASUS Zenfone 8, which can be used with the original ASUS Android, the OmniROM (any version), and the LineageOS version 19.x and older.

It also creates an "ugly" OrangeFox recovery for the ASUS Zenfone 8 running the LineageOS version 22.x or newer (or any other CustomROM based on the LineageOS 22.x or newer, such as for example /e/), which is configured in the workflow dialog box.

The workflow can create an "ugly" OrangeFox recovery for any CustomROM as long as the boot.img file with the kernel file for that CustomROM is available via http or https.

I tested the "ugly" OrangeFox recovery images only for the ASUS Zenfone 8, but in principle this approach should work for other phones also


To use the workflow, just follow the instructions from the readme in the repository.


The default settings configured for this workflow specify that a standard OrangeFox recovey for the ASUS Zenfone 8 and an "ugly" OrangeFox recovery for the LineageOS 22.2 on the ASUS Zenfone 8 should be created:

field description
default value
Comment
OrangeFox Branch 12.1 this is the OrangeFox branch to use
Custom Recovery Tree https://github.com/TeamWin/android_device_asus_I006D the URL to the repository with the device tree for the ASUS Zenfone 8 
Custom Recovery Tree Branch android-12.1 this is the branch in the repository with the device tree for the ASUS Zenfone 8 to be used
LineageOS Boot image file (URL)
https://mirrorbits.lineageos.org/full/sake/20250812/boot.img
This is the URL for the boot.img file of the CustomROM for which the recovery should be created
(see https://download.lineageos.org/devices/sake/builds)
LineageOS version
LineageOS_22.2
This string is used in the name of file with the "ugly" OrangeFox Recovery and in the name for the release
Specify your device path device/asus/I006D device settings for the ASUS Zenfone 8
Specify your Device Codename I006D device settings for the ASUS Zenfone 8
Specify your Build Target boot the result should be a boot.img file -- do not change this value
Magisk Version to use
v29.0
This is the Magisk version used by the Workflow to retrieve the magiskboot executable to unpack and repack the boot image file.

As long as the Magisk version v29.0 is available in the githbub repository for Magisk (https://github.com/topjohnwu/Magisk/releases) it's not necessary to change this value

Path of blobs to check
system/bin/qseecomd
do not change this value


Details

The workflow creates the standard OrangeFox recovery like the workflow from the original OrangeFox Recovery Builder 2024 with my changes for the ASUS Zenfone 8.

It then creates a new boot image file with the ramdisk from the OrangeFox recovery just created and the kernel from the LineageOS boot image file, as implemented in the script create_ugly_twrp_image.sh (see the How to create a TWRP image for LineageOS based ROMs using a script for details)

The workflow use the Magisk binary magiskboot to unpack and repack the boot images; the magiskboot binary is extracted from the Magisk apk file, which is available in the github repository for Magisk .


The default values for the dialog in this workflow create an "ugly" OrangeFox recovery for the LineageOS version

lineage-22.2-20250812-nightly-sake-signed.zip

from https://download.lineageos.org/devices/sake/builds for the ASUS Zenfone 8.


When the workflow was successfully executed, there is a new release in the repository with these files:




Note: This is the result when running the workflow with the default values.

The file boot.img is the "original" OrangeFox recovery; the file OrangeFox_recovery_I006D_LineageOS_22.2.img is the "ugly" OrangeFox recovery.

The file OrangeFox_recovery_version.txt contains the values of the variables used to create these recoveries, e.g.:

[xtrnaw7@t15g /data/download]$ cat OrangeFox_recovery_version.txt

OrangeFox recovery for I006D LineageOS_22.2 created at Wed Aug 20 10:24:26 UTC 2025 with these values

DEVICE_TREE:         https://github.com/TeamWin/android_device_asus_I006D
DEVICE_TREE_BRANCH:  android-12.1
DEVICE_PATH:         device/asus/I006D
LOS_BOOT_IMAGE:      https://mirrorbits.lineageos.org/full/sake/20250812/boot.img
LOS_VERSION:         LineageOS_22.2
DEVICE_NAME:         I006D
BUILD_TARGET:        boot
MAGISK_VERSION:      v29.0
LDCHECK:             system/bin/qseecomd

[xtrnaw7@t15g /data/download]$


The file OrangeFox_recovery.txt contains only a short description :

[xtrnaw7@t15g /data/download]$ cat OrangeFox_recovery.txt
Creating an ugly boot image for LineageOS_22.2 using the boot image https://mirrorbits.lineageos.org/full/sake/20250812/boot.img 
[xtrnaw7@t15g /data/download]$


Please note that in my tests the workflow took between 1 and 2 hours to complete.



Example

To create an "ugly" OrangeFox recovery image for /e/ 3.0.4 on the ASUS Zenfone 8 (e-3.0.4-a15-20250712508365-community-sake.zip) use the values for the dialog listed above with these changes:

field description
value
comment
LineageOS Boot image file (URL) https://images.ecloud.global/community/sake/recovery-e-3.0.4-a15-20250712508365-community-sake.img
URL to the boot image for that /e/ version
(the recovery image is the boot image for this CustomROM)
LineageOS version e_3.0.4-a15
this is a free text field but do not use blanks



Trouble Shooting

If the workflow ends with an error, check the raw log of the workflow in the github GUI.



Notes

Please note that the "ugly" OrangeFox recovery ceated with this workflow will only boot if the CustomROM for which the recovery was created is installed on the phone.

This workflow can also be used to create an "ugly" OrangeFox recovery for LineageOS 20.x or 21.x (or any CustomROM based on these LineageOS versions) on the ASUS Zenfone 8.


See the sections

How to use TWRP if LineageOS 20.x is installed

How to create a TWRP recovery image for LineageOS 22.x

for the limitations of the "ugly" OrangeFox / TWRP recovery images


The description for the workflow

OrangeFox - Build for ASUS Zenfone 8

in this repository is here:

How to create a OrangeFox Recovery using the OrangeFox Recovery Builder 2024


The yml file used for this workflow is also available for download here : OrangeFox-Recovery-LOS-Builder.yml 




History of this entry

21.08.2025

initial release



 


How to compile LMODroid 6.x for the ASUS Zenfone 8


URL: https://xdaforums.com/t/how-to-compile-lmodroid-6-x-for-the-asus-zenfone-8.4762570/


How to compile LMODroid 6.x for the ASUS Zenfone 8

LMODroid is another LineageOS based Custom ROM.

AFAIK the LMODroid images for the ASUS Zenfone 8 were discontinued in 2023.

But now, October 2025, there are new OS images with LMODroid for the ASUS Zenfone 8 available.

The LMODroid OS images can be downloaded from here:

https://get.libremobileos.com/devices/sake/builds


As of 05.10.2025 the latest version of LMODroid for the ASUS Zenfone 8 is 6.2 -- this is Android 15.



To compile LMODroid 6.x yourself, follow these instructions:

# init the repositories with LMODroid

repo init -u https://git.libremobileos.com/LMODroid/manifest.git -b fifteen-qpr2 --git-lfs

# add the repositories for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >>.repo/local_manifests/local_manifests.xml  <<EOT
<manifest>

    <remote  name="github"
        fetch="ssh://git@github.com" />

  <project path="device/asus/sake"   name="LMODroid-Devices/device_asus_sake" remote="github" revision="fifteen-qpr2" />

  <project path="vendor/asus/sake"   name="TheMuppets/proprietary_vendor_asus_sake"  remote="github" revision="lineage-22.2" />

  <project path="kernel/asus/sm8350" name="LineageOS/android_kernel_asus_sm8350" remote="github" revision="lineage-22.2" />

</manifest>
EOT

# sync the repositories
#
repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags

# setup the build environment
#
source build/envsetup.sh

# prepare the build
#
lunch lmodroid_sake-bp1a-user

# build the OS
#
brunch lmodroid_sake-bp1a-user




Notes:

Use the script print_security_patch to get the release version for the lunch and brunch commands, e.g:

xtrnaw7@t540p:/devpool001/develop/LMODroid_6.x$ print_security_patch
Retrieving the security patch level for the repository at "/devpool001/develop/LMODroid_6.x" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
xtrnaw7@t540p:/devpool001/develop/LMODroid_6.x$
 
How to create an LMODroid 6.x image with MicroG for instructions to create an LMODroid image with MicroG.

See How to build a Custom ROM with GAPPS for instructions to add GAPPS to the OS image with LMODroid 
The repository with device dependent files for LMODroid is here: https://git.libremobileos.com/LMODroid-Devices

The gerrit for LMODroid is here:  https://gerrit.libremobileos.com/q/status:open+-is:wip

see the section How to compile other CustomROMs for the ASUS Zenfone 8 for a list of HowTos with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.




History of this entry

05.10.2025

initial release





How to create an LMODroid 6.x image with MicroG


URL: not yet published

Note: As of 06.10.2025 this section is still work in progress

How to create an LMODroid image with MicroG
Building an LMODroid OS image with MicroG included is quite simple because the MicroG packages are already located in the repositories for LMODroid but are not included in the OS image by default.

To add the MicroG packages on request to the LMODroid OS image, add the config lines

#
# MicroG
#
WITH_MICROG ?= false

ifeq ($(WITH_MICROG),true)

PRODUCT_SOONG_NAMESPACES += \
        packages/modules/microG

PRODUCT_PACKAGES += \
        GmsCoreMicrog \
        FakeStore \
        GsfProxy \
        default-permissions-com.google.android.gms.xml \
        microg.xml \
        privapp-permissions-com.google.android.gms.xml \
        sysconfig-com.google.android.gms.xml \
        default-permissions-com.android.vending.xml \
        privapp-permissions-com.android.vending.xml \
        com.libremobileos.microg
endif

to the file device.mk for your phone.

(For the ASUS Zenfone 8 this is the file ./device/asus/sake/device.mk


To change the name of the ZIP file with the OS image when MicroG is enabled, add these lines

### --- definition for images with MicroG -- start

# add the string "-MicroG" to the name of the ZIP file when the value of the environment variable WITH_MICROG is "true"
#
ifeq ($(WITH_MICROG),true)
       LMODROID_BUILD_NAME := $(LMODROID_BUILD_NAME)-MicroG
endif

### --- definition for images with MicroG -- end

after the line

LMODROID_BUILD_NAME := $(LMODROID_NAME)-$(LMODROID_VERSION)-$(BUILD_DATE)-$(LMODROID_BUILDTYPE)-$(LMODROID_BUILD)


in the file

/vendor/lmodroid/cust/build/version.mk



As of 05.10.2025 the definition for the FakeStore in the fiile packages/modules/microG/Android.bp in the LMDroid repository is incomplete;

android_app_import {
    name: "FakeStore",
    owner: "microg",
    apk: "GmsCore/com.android.vending.apk",
    presigned: true,
    privileged: true,
    required: [
        "default-permissions-com.android.vending.xml",
        "privapp-permissions-com.android.vending.xml",
    ],
    apex_available: [
        "//apex_available:platform",
        "com.libremobileos.microg",
    ],
}

Missing is the definition for optional libraries:

    optional_uses_libs: [
        "androidx.window.extensions",
        "androidx.window.sidecar",
    ],

Either add the missing definitions to that file or set the environment variable RELAX_USES_LIBRARY_CHECK to true before starting the build process:


 export RELAX_USES_LIBRARY_CHECK=true



Then, to create a LMODroid image with MicroG enabled, simply set the variable WITH_MICROG to true before starting the build:

WITH_MICROG=true  brunch lmodroid_sake-bp1a-user


Notes
 
set MicroG packages in the LMODroid repositories are in the directory ./packages/modules/microG,

see How to compile LMODroid 6.x for the ASUS Zenfone 8 for instructions to compile the LMODroid 6.x for the ASUS Zenfone 8.




History of this entry

05.10.2025

initial release





How to compile the iodeOS 4.x for the ASUS Zenfone 8



URL: https://xdaforums.com/t/how-to-compile-the-iodeos-4-x-for-the-asus-zenfone-8.4767607/

How to compile the iodeOS 4.x for the ASUS Zenfone 8

iodeOS is another LineageOS based Custom ROM that does not support the ASUS Zenfone 8 but can be easily build for the ASUS Zenfone 8.


The official instructions to build the iodeOS are here

https://gitlab.iode.tech/os/public/manifests/android



To build an iodeOS 4.x image (based on LineageOS 20 = Android 13) for the ASUS Zenfone 8 execute these steps:

# define some variables

# branch to use (v4 is LineageOS 20 = Android 13)
#
BRANCH="v4-staging"

LINEAGE_VERSION="
lineage-20"

LOCAL_DIR="
/datapool001/develop/iodeos/4.x"


# create a new directory for the iodeOS repositories
#
mkdir -p "${LOCAL_DIR}"

cd "${LOCAL_DIR}"


# init the iodeOS repositories
#
repo init -u https://gitlab.iode.tech/os/public/manifests/android.git -b ${BRANCH}


mkdir -p .repo/local_manifests

# ignore the repositories for the emulator
#
cat >.repo/local_manifests/remove-bloat.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
    <remove-project name="device/generic/mini-emulator-arm64" />
    <remove-project name="device/generic/mini-emulator-x86" />
    <remove-project name="device/generic/mini-emulator-x86_64" />
</manifest>
EOT


# add the repositories necessary for building an OS image for the ASUS Zenfone 8
#
cat >.repo/local_manifests/local_manifests.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" revision="${
LINEAGE_VERSION}" clone-depth="1" />
</manifest>
EOT


# download the repositories with the source code for the iodeOS
#
repo sync --force-sync

# download the Git LFS stored objects

cd "${LOCAL_DIR}"/vendor/extra

git lfs pull iode ${BRANCH}

cd
"${LOCAL_DIR}"


# prepare the build environment
#
source build/envsetup.sh


# the lunch command downloads the missing repositories for the ASUS Zenfone 8

#
lunch lineage_sake-user




# start the build
#
time brunch lineage_sake-user



Notes

There is also a docker image for building the iodeOS :

https://github.com/petefoth/IodeBuild

Te docker image can also be used to build an image for an unsupported device but I did not test that yet.

see the section How to compile other CustomROMs for the ASUS Zenfone 8 for a list of HowTos with instructions to compile other custom ROMs for the ASUS Zenfone 8 (e.g. LineageOS 22.x, /e/, crDroid, evolutionX, etc)
The entry also contains a list of sections with instructions to create TWRP or OrangeFox recovery images for the various custom ROMs.

see How to compile the iodeOS 6.x for the ASUS Zenfone 8 for instructions to compile iodeOS 6.x for the ASUS Zenfone 8.





----


History of this entry

11.11.2025

initial release


----


How to compile the iodeOS 6.x for the ASUS Zenfone 8


How to compile the iodeOS 6.x for the ASUS Zenfone 8
How_to_compile_the_iodeOS_6.x_for_the_ASUS_Zenfone_8

URL: not yet published

How to compile the iodeOS 6.x for the ASUS Zenfone 8

iodeOS is another LineageOS based Custom ROM that does not support the ASUS Zenfone 8 but can be easily build for the ASUS Zenfone 8.


The official instructions to build the iodeOS are here

https://gitlab.iode.tech/os/public/manifests/android



To build an iodeOS 6.x image (= LineageOS 21 = Android 14) for the ASUS Zenfone 8 execute these steps:


# define some variables

# branch to use
(v6 is LineageOS 21 = Android 14)
#
BRANCH="v6.9"

LINEAGE_VERSION="
lineage-22.2"

LOCAL_DIR="
/datapool001/develop/iodeos/6.x"


# create a new directory for the iodeOS repositories
#
mkdir -p "${LOCAL_DIR}"

cd "${LOCAL_DIR}"


# init the iodeOS repositories
#
repo init -u https://gitlab.iode.tech/os/public/manifests/android.git -b ${BRANCH}


# download the repositories with the source code for the iodeOS
#
repo sync --force-sync

# download the Git LFS stored objects

cd "${LOCAL_DIR}"/vendor/extra

git lfs pull iode ${BRANCH}

cd
"${LOCAL_DIR}"


# add the repositories necessary for building an OS image for the ASUS Zenfone 8
#
mkdir -p .repo/local_manifests

cat >.repo/local_manifests/local_manifests.xml <<EOT
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="TheMuppets/proprietary_vendor_asus_sake" path="vendor/asus/sake" revision="${
LINEAGE_VERSION}" clone-depth="1" />
</manifest>
EOT


# download the LineageOS repositories for vendor/asus
#
repo sync TheMuppets/proprietary_vendor_asus_sake


# cleanup the local repositories
#
# When testing the build of iodeOS 6.x on my PC, I had to clean up the local repositories with the following commands  these commands:

# disable duplicate package
#
if [ -d packages/apps/OpenEUICC -a -d vendor/extra/prebuilts/OpenEUICC ] ; then
   mv vendor/extra/prebuilts/OpenEUICC/Android.mk vendor/extra/prebuilts/OpenEUICC/Android.mk.org
fi

# correct the SHA1 checksum for the image files for the ASUS Zenfone 8
# (this is a general "error" in the vendor repositories for the ASUS Zenfone8 version 22.2)
#
cp vendor/asus/sake/Android.mk vendor/asus/sake/Android.mk.org

cat >vendor/asus/sake/Android.mk.test <<EOT
#
# Automatically generated file. DO NOT MODIFY
#

LOCAL_PATH := \$(call my-dir)

ifeq (\$(TARGET_DEVICE),sake)
$(cd vendor/asus/sake && sha1sum radio/*.img | awk '{ print "$(call add-radio-file-sha1-checked,"$2","$1")" }' )
endif
EOT


# prepare the build environment
#
source build/envsetup.sh

# the lunch command downloads the missing repositories for the ASUS Zenfone 8
#
lunch lineage_sake-bp1a-user


# start the build
#
time brunch lineage_sake-bp1a-user


Notes

Use the script print_security_patch to get the build ID for the lunch and brunch commands ("bp1a" in this example), e.g.:

[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$ print_security_patch
Retrieving the security patch level for the repository at "/datapool001/develop/iodeos/6.x" ...
The repository uses the new definitions
The current security patch is "2025-05-05"
The current build_id is "bp1a"
[xtrnaw7@t15g /datapool001/develop/iodeos/6.x]$


There is also a docker image for building the iodeOS :

https://github.com/petefoth/IodeBuild

Te docker image can also be used to build an image for an unsupported device but I did not test that yet.

see How to compile the iodeOS 4.x for the ASUS Zenfone 8 for instructions to compile iodeOS 4.x for the ASUS Zenfone 8.

----



History of this entry

12.11.2025

initial release


----

-----
 

Links

  

Files mentioned in the HowTos


Show or Hide Table
xxx

----



 

Other Android related files


Show or Hide Table
The recovery images listed here also available in a GitHub repository:

https://github.com/bnsmb/recovery-images-for-ASUS-Zenfone-8  

     
 
File
Content
Comment
twrp-3.7.0_12-0-I006D-with_Android14_support.img unofficial (!) TWRP image for the ASUS Zenfone 8 with support for Android 14


Use at your own risk!
The source for this TWRP image was checked out on 25.11.2023.

There are additional properties defined in this image:

additional properties in the image
ASUS_I006D:/ # getprop  | grep android_version
[ro.product.bootimage.supported_android_version]: [14]
[ro.product.odm.supported_android_version]: [14]
[ro.product.product.supported_android_version]: [14]
[ro.product.system_ext.supported_android_version]: [14]
[ro.product.vendor.supported_android_version]: [14]
ASUS_I006D:/ # 

Update 10.01.2024

There is now an official new TWRP version for ASUS Zenfone 8 with Android 14 support: TWRP version 3.7.0.12-1

twrp-3.7.0_12-0-I006D-with_Android14_support_and_tools.img
unofficial (!) TWRP image for the ASUS Zenfone 8 with support for Android 14 and additional binaries

Use at your own risk!
this is the TWRP image twrp-3.7.0_12-0-I006D-with_Android14_support.img with these additional binaries:

list of additional binaries
ASUS_I006D:/ # ls -l /system/bin/ed system/bin/gawk /system/bin/gdisk /system/bin/parted /system/bin/sqlite3 /system/bin/vi/system/xbin
-rwxrwxrwx 1 root root  744128 2023-11-26 09:08 /system/bin/ed
-rwxrwxrwx 1 root root  680612 2023-11-26 09:08 /system/bin/gdisk
-rwxrwxrwx 1 root root  470788 2023-11-26 09:08 /system/bin/parted
-rwxrwxrwx 1 root root 1714720 2023-11-26 09:08 /system/bin/sqlite3
-rwxrwxrwx 1 root root 4127280 2023-11-26 09:09 /system/bin/vi
-rwxrwxrwx 1 root root 1777096 2023-11-26 09:08 system/bin/gawk

/system/xbin:
total 4500
-rwxrwxrwx 1 root root  938296 2023-11-26 09:06 cpio
-rwxrwxrwx 1 root root  960496 2023-11-26 09:06 find
-rwxrwxrwx 1 root root 1486120 2023-11-26 09:06 grep
-rwxrwxrwx 1 root root 1216256 2023-11-26 09:06 tar
ASUS_I006D:/ #


This image also defines these two new properties:

additional properties
ASUS_I006D:/ # getprop ro.product.type
enhanced
ASUS_I006D:/ #

ASUS_I006D:/ # getprop ro.source_checkout_date
2023-11-25
ASUS_I006D:/ #



twrp-3.7.0_12-1-I006D-enhanced.img unofficial (!) TWRP image for the ASUS Zenfone 8 with support for Android 14


Use at your own risk!
this is a copy of the official twrp-3.7.0_12-1-I006D.img with some additional files:

list of additional binaries
ASUS_I006D:/system/bin # pwd
/system/bin
ASUS_I006D:/system/bin # ls -l bootctl* lp* ed gawk gdisk parted sqlite3 vi* /system/xbin

-rwxr-x--- 1 root root   34112 2024-01-10 19:54 bootctl
-rwxr-x--- 1 root root   19832 2024-01-10 19:54 bootctl.bin
-rwxr-xr-x 1 root root  744128 2024-01-10 19:54 ed
-rwxr-xr-x 1 root root 1777096 2024-01-10 19:54 gawk
-rwxr-xr-x 1 root root  680612 2024-01-10 19:54 gdisk
-rwxr-xr-x 1 root root   19872 2024-01-10 19:54 lpdump
-rwxr-xr-x 1 root root   31424 2024-01-10 19:54 lpdumpd
-rwxr-xr-x 1 root root  100712 2024-01-10 19:54 lptools
-rwxr-xr-x 1 root root  470788 2024-01-10 19:54 parted
-rwxr-xr-x 1 root root 1714720 2024-01-10 19:54 sqlite3
-rwxr-xr-x 1 root root 4127280 2024-01-10 19:54 vi

/system/xbin:
total 4500
-rwxr-xr-x 1 root root  938296 2024-01-10 19:54 cpio
-rwxr-xr-x 1 root root  960496 2024-01-10 19:54 find
-rwxr-xr-x 1 root root 1486120 2024-01-10 19:54 grep
-rwxr-xr-x 1 root root 1216256 2024-01-10 19:54 tar
ASUS_I006D:/system/bin #  

see How to add additional files to an TWRP image for how to add additional files to a TWRP image





twrp_3.7.0_12-0-I006D_for_lineageOS20-2024.img
26.04.2024

Looks like this dirty created image only works for a specific LineageOS build. Therefor I removed the file.

If you need this kind of TWRP image please create it yourself using the instructions from this post:

How to use TWRP if LineageOS 20.x is installed

(see also How to create a TWRP image for LineageOS based ROMs using a script)



twrp_3.7.1.12-1_ASUS_Zenfone8_2024-12-02_extended.img unofficial (!) TWRP image for the ASUS Zenfone 8 with additional binaries

Use at your own risk
The source for this TWRP image was checked out on 10.09.2024.

Additional binaries and files in the image are:

list of additional binaries and files

-rwxr-xr-x 1 root   root    628616 2024-08-12 09:20 system/bin/bmore
-rwxr-xr-x 1 root   root    824328 2024-08-12 09:20 system/bin/bvi
-rwxr-xr-x 1 root   root     99160 2024-09-07 00:15 system/bin/dmctl
-rwxr-xr-x 1 system system  744128 2024-08-10 01:30 system/bin/ed
-rwxr-xr-x 1 system system 1777096 2024-08-10 01:30 system/bin/gawk
-rwxr-xr-x 1 system system  680612 2024-08-10 01:30 system/bin/gdisk
-rwxr-xr-x 1 root   root    999064 2022-08-18 11:41 system/bin/lpadd
-rwxr-xr-x 1 root   root   1907128 2022-08-18 11:45 system/bin/lpdump
-rwxr-xr-x 1 root   root    969144 2022-08-18 11:45 system/bin/lpmake
-rwxr-xr-x 1 root   root    606704 2023-01-25 04:31 system/bin/make_ext4fs
-rwxr-xr-x 1 system system  470788 2024-08-10 01:30 system/bin/parted
-rwxr-xr-x 1 system system 1714720 2024-08-10 01:30 system/bin/sqlite3
lrwxrwxrwx 1 root   root         5 2024-08-12 09:21 system/bin/vi -> ./vim
lrwxrwxrwx 1 root   root         5 2024-08-12 09:21 system/bin/vi -> ./vim
lrwxrwxrwx 1 root   root         5 2024-08-12 09:21 system/bin/view -> ./vim
-rwxr-xr-x 1 root   root        59 2024-09-10 10:52 system/bin/vim
lrwxrwxrwx 1 root   root         5 2024-08-12 09:21 system/bin/vimdiff -> ./vim
-rw-r--r-- 1 root   root    387592 2024-08-10 07:34 system/lib64/libncursesw.so.6
-rw-rw-rw- 1 root   root         0 2024-08-10 07:44 system/usr/share/vim/vim91/defaults.vim
-rwxr-xr-x 1 system system  938296 2024-08-10 01:31 system/xbin/cpio
-rwxr-xr-x 1 system system  960496 2024-08-10 01:31 system/xbin/find
-rwxr-xr-x 1 system system 1486120 2024-08-10 01:31 system/xbin/grep
-rwxr-xr-x 1 system system 1216256 2024-08-10 01:31 system/xbin/tar



This image also defines these new properties:


additional properties ASUS_I006D:/ # getprop ro.product.type
enhanced
ASUS_I006D:/ #

ASUS_I006D:/ # getprop ro.source_checkout_date
2024-09-10
ASUS_I006D:/ #

ASUS_I006D:/ # getprop ro.image_create_date
2024-12-02
ASUS_I006D:/ #


Check https://gerrit.twrp.me/ for a list of changes in the source code

twrp_3.7.1.12-1_ASUS_Zenfone8_2025-02-21_extended.img unofficial (!) TWRP image for the ASUS Zenfone 8 with additional binaries

Use at your own risk
The source for this TWRP image was checked out on 10.09.2024.

Additional binaries and files in the image are:

list of additional binaries and files

GNU ed 1.18
GPT fdisk (gdisk) version 1.0.3
parted (GNU parted) 3.2
sqlite3 3.39.3 2022-09-05
VIM - Vi IMproved 9.1 Included patches: 1-672
GNU Awk 5.2.0, API 3.2, PMA Avon 7
cpio (GNU cpio) 2.12
dd (coreutils) 9.5.58-83ec7
find (GNU findutils) 4.9.0
grep (GNU grep) 3.8
gsed (GNU sed) 4.8
gzip 1.13
less 643 (POSIX regular expressions)
tar (GNU tar) 1.34
GNU bash, version 5.2.0(1)-release (aarch64-unknown-linux-gnu)

bvi 1.4.1
bmore  1.4.1

dmctl
lpadd
lpdump
lpmake

make_ext4fs

system/bin/lputil (from https://www.temblast.com/lputil.htm)

Please note that the new versions of the binary files already present in the TWRP image are located in the directory /system/xbin:

ASUS_I006D:/ # ls -l /system/xbin/
total 6136
-rwxrwxrwx 1 root   root    938296 2022-10-03 06:29 cpio
-rwxrwxrwx 1 root   root    189328 2025-02-01 08:37 dd
-rwxrwxrwx 1 root   root    960496 2022-10-03 06:29 find
-rwxr-xr-x 1 system system 1486120 2024-08-10 01:31 grep
-rwxrwxrwx 1 root   root    795936 2025-02-01 05:54 gsed
-rwxrwxrwx 1 root   root    193288 2024-12-13 06:27 gzip
-rwxrwxrwx 1 root   root    486456 2024-02-19 05:09 less
-rwxrwxrwx 1 root   root   1216256 2025-01-20 12:25 tar
ASUS_I006D:/ #


This image also defines these new properties:


additional properties ASUS_I006D:/ # getprop ro.product.type
enhanced
ASUS_I006D:/ #

ASUS_I006D:/ # getprop ro.source_checkout_date
2024-09-10
ASUS_I006D:/ #

ASUS_I006D:/ # getprop ro.image_create_date
2025-02-21
ASUS_I006D:/ #
 

Check https://gerrit.twrp.me/ for a list of changes in the source code


OrangeFox-Unofficial-I006D-2024-09-12.img
OrangeFox-Unofficial-I006D-2024-09-12.zip
unofficial (!) OrangeFox Recovery for the ASUS Zenfone 8


Use at your own risk!
The source for the OrangeFox recovery sources was checked out 10.09.2024.

The image was compiled with these custom build vars:

Custom build vars
export FOX_REPLACE_BUSYBOX_PS=1
export FOX_REPLACE_TOOLBOX_GETPROP=1
export FOX_USE_TAR_BINARY=1
export FOX_USE_SED_BINARY=1
export FOX_USE_ZIP_BINARY=1
export FOX_USE_NANO_EDITOR=1
export FOX_USE_BASH_SHELL=1

export OF_USE_MAGISKBOOT=1
export OF_USE_MAGISKBOOT_FOR_ALL_PATCHES=1
export FOX_DISABLE_APP_MANAGER=0

export FOX_DELETE_AROMAFM=1

export TARGET_DEVICE_ALT="gssi,ASUS_I006D"


see https://gitlab.com/OrangeFox/vendor/recovery/-/blob/master/orangefox_build_vars.txt for a description of the custom build vars

see https://wiki.orangefox.tech for infos about the OrangeFox recovery

see How to compile the OrangeFox Recovery for the ASUS Zenfone 8 for instructions to create the image

OrangeFox-R11.3-Unofficial-I006D-2025-07-23.img
OrangeFox-R11.3-Unofficial-I006D-2025-07-23.zip
unofficial (!) OrangeFox Recovery for the ASUS Zenfone 8


Use at your own risk!


The source for the OrangeFox recovery sources was checked out 23.07.2025.

The image was compiled with these custom build vars:

Custom build vars
export FOX_USE_TAR_BINARY=1
export FOX_USE_SED_BINARY=1
export FOX_USE_LZ4_BINARY=1
export FOX_USE_ZSTD_BINARY=1
export FOX_USE_DATE_BINARY=1
export FOX_USE_BASH_SHELL=1

export TARGET_DEVICE_ALT="gssi,ASUS_I006D"


see https://gitlab.com/OrangeFox/vendor/recovery/-/blob/master/orangefox_build_vars.txt for a description of the custom build vars

see https://wiki.orangefox.tech for infos about the OrangeFox recovery

see How to compile the OrangeFox Recovery for the ASUS Zenfone 8 for instructions to create the image
 

twrp-e-3.0.4-t-20250710507809-community-sake.img
twrp-e-3.0.1-t-20250607498934-community-sake.img
twrp-e-3.0-t-20250529496537-community-sake.img
twrp-e-2.9-t-20250322478412-community-sake.img
twrp-e-2.8-t-20250219470166-community-sake.img
twrp-e-2.7-t-20250112460975-community-sake.img
twrp-e-2.6.3-t-20241217455572-community-sake.img
twrp-e-2.5-t-20241108446630-community-sake.img

unofficial (!) TWRP image for the ASUS Zenfone 8 running /e/ (Android 13 based)

Do not use this TWRP image if the OS installed on the phone is NOT the /e/ version used in the name of the file! 


Do NOT install this TWRP in the boot partition!

Use at your own risk!

see here for details about this image
orangefox_e-3.0.4-a15-20250712508365-community-sake.img
unofficial (!) OrangeFox recovery image for the ASUS Zenfone 8 running /e/ 3.0.4-a15 or later (Android 15 based)

Do not use this OrangeFox recovery image if the OS installed on the phone is NOT the /e/ version used in the name of the file! 


Do NOT install this OrangeFox recovery in the boot partition!

Use at your own risk!


This recovery image can also be used if the LineageOS image


is installed (see https://download.lineageos.org/devices/sake/builds)

It might also work for other LineageOS 22.2 images for the ASUS Zenfone 8.

(see also How to create a TWRP recovery image for LineageOS 22.x)
 
 

 

Links for the ASUS Zenfone 8


Show or Hide Table
URL
Content
Comment
https://www.asus.com/de/Mobile/Phones/ZenFone/Zenfone-8/HelpDesk_BIOS/
ASUS Zenfone 8 Firmware Download

As of 17.08.2023 ASUS removed all image files with OS images for the Zenfone 8 from their website

https://www.firmware27.info/2023/03/asus-zenfone-8-zs590ks-flash-file.html
inofficial page to download ASUS Zenfone 8 Firmware
17.08.2023

Most of the download links on this page are links to the original firmware page from ASUS and do not work anymore.
The last two links are links to other webserver and still work as of 17.08.2023. See the section ASUS Zenfone 8 FIrmware Download with my comments regarding the image files from this page.

https://xdaforums.com/t/zenfone-8-firmware-ota-collection.4620171/
XDA Forum for ASUS Zenfone 8 Firmware Download Collection




https://twrp.me/asus/zenfone8.html
official TWRP for the ASUS Zenfone 8
Note that as of 09.01.2024 the official TWRP 3.7.0_12 for the ASUS Zenfone 8 does not support mouting the /data partition from Android 14 based OSse
https://build.twrp.me/twrp-3.7.0_12-1_TEST-I006D.img
TWRP for the ASUS Zenfone 8 with support for mounting /data in Android 14 based OSes
link checked at 09.01.2024; successfully mounted in the /data partition of Omnirom 14 booting this image



https://zentalk.asus.com/en/discussion/27136/unlock-relock-bootloader-unofficially-for-zenfone-3
Instructions to unlock the ASUS Zenfone 8

https://xdaforums.com/f/asus-zenfone-8.12291/ XDA Forums for the ASUS Zenfone 8

https://xdaforums.com/t/recovery-twrp-for-zenfone-8.4329139/
XDA Forum for TWRP for the ASUS Zenfone 8

https://xdaforums.com/t/full-recover-to-stock-if-things-went-really-bad.4337467/
Instructions to install the Android raw image from ASUS on the ASUS Zenfone 8

https://www.asus.com/Content/Android-13-Beta/
Android 13 Beta and a raw image for Android 12
The image for Android 13 Beta is also a raw image.
As of 17.08.2023 ASUS removed all image files with OS images for the Zenfone 8 from their website
https://www.asus.com/Content/Android-12-Beta/
Android 12 Beta and a raw image for Android 11 As of 17.08.2023 ASUS removed all image files with OS images for the Zenfone 8 from their website
https://dl.omnirom.org/zenfone8/ OmniROM Images for the ASUS Zenfone 8
https://xdaforums.com/t/recovery-twrp-for-zenfone-8.4329139/
XDA Support thread for TWRP for ASUS Zenfone 8

https://gist.github.com/shakalaca/bbc439916f389a7275083f90539059de
fastboot oem comands for the ASUS ROG Phone II
Most of the also work for the ASUS Zenfone 8

https://xdaforums.com/t/cant-unlock-bootloader-failed-to-unlock-your-device-please-try-again-later-24803.4586429/
XDA Thread about unlocking ASUS phones without using the ASUS unlock tool
As of 23.09.2023 there is not yet a solution to unlock an ASUS phone without the ASUS unlock tool
https://www.pentestpartners.com/security-blog/breaking-the-android-bootloader-on-the-qualcomm-snapdragon-660/
Breaking the Android Bootloader on the Qualcomm Snapdragon 660

https://worthdoingbadly.com/qcomxbl/
Comparing Qualcomm's XBL UEFI bootloaders on Snapdragon 820, 835, and 845
A blog entry about the bootloader for Android devices with Qualcomm CPUs



https://xdaforums.com/t/unofficial-bootloader-unlocking-2024-01-06-without-asus-server-q3-2023-muhahahaha.4649465/#post-89260224

https://xdaforums.com/t/unlocking-the-bootloader-and-rooting.4649239/post-89258039

https://mitmproxy.org/
XDA threads about how to unlock an ASUS phone now that the original apk and webserver used to official unlock the phone is not available anymore




Distributions for the ASUS Zenfone 8


Show or Hide Table
URL
Content
Comment
https://omnirom.org/ OmniROM 

https://lineageos.org/ LineageOS Homepage
https://lineage.microg.org/
LineageOS with MicroG Homepage

https://download.lineageos.org/devices/sake/builds Images and Recoveries for LineageOS 
LineageOS is a Custom ROM for devices using Android; the Lineage Recovery image can be used to install the OmniROM on an Android phone
https://wiki.lineageos.org/devices/sake/install? Instructions to install the Recovery from the LineageOS 

https://doc.e.foundation/
https://doc.e.foundation/devices/sake
/e/ 
sake is a code name for the ASUS Zenfone 8 
https://xdaforums.com/t/rom-preview-sake-13-statixos-v6-0.4500497/
StatiXOS 
development stopped in July 2024; last release Android 14 with patchlevel 07/2024 -- see https://xdaforums.com/t/closed-rom-upsidedowncake-sake-14-statixos-v7-10.4500497/#post-87515011
https://github.com/StatiXOS/android_manifest
Manifests and instructions to build the StatixOS




https://download.lineage.microg.org/sake/
LineageOS with MircoG for the ASUS Zenfone 8

https://github.com/mikooomich/android_device_asus_sake/releases
un-official LineageOS 21.x and LineageOS 22.x images for the ASUS Zenfone 8 

https://libremobileos.com/
LMODroid 

https://arrowos.net/
ArrowOS 
support is discontinued; latest release is Android 11 based from 01/2022 



    


back top top