[ROM][10.0][Xiaomi Mi 9][UNOFFICIAL]LineageOS 17.1 CLEAN, STOCK [2020-07-10]

Search This thread


Senior Member
Oct 19, 2011
I have been running this latest build from the OP as my daily diver for a few months now and I have not noticed the app swapping mentioned in the previous post. I have not noticed any instance where one app replaces another when the screen turns on.

Has anyone else noticed this?

:highfive: Looking forward to LOS18 :)


Dec 10, 2007

Hi friends!

Seems like image is gone from mega.nz.
Anyone still got this file or a mirror for it?

Highly appreciated!


Top Liked Posts

  • There are no posts matching your filters.
  • 9
    ** Standard Disclaimer: Unlocking your Bootloader will Void your Warranty. I take no responsibility for this or for any bricked devices. These thing should go without saying at this point, but there they are. If you are here, I assume you are familiar with LineageOS, TWRP, and moving from MIUI to AOSP-based ROMs**

    **Download Link Updated to build 2020-07-10**

    This is a Clean, Stock LineageOS Build for Xiaomi Mi 9 (cepheus) that does NOT include any GApps, MicroG, or Signature Spoofing.
    What you choose to add/modify after installing this ROM is entirely up to you.

    I wanted to distance myself from Google as much as possible, so I decided to build LineageOS from the source.
    I used the LineageOS source they provide via GitHub, available here.
    I also use the Proprietary Blobs for the Cepheus Device Tree from Demon000's GitHub, available here.
    To get current version to build, I also needed to add the LineageOS/android_hardware_xiaomi source to my local manifest and use the repopicks Cozzymy13 includes in the OP of his ROM's thread. [Thanks k1l for and Cozzymy13 for pointing out these additions!]

    The result is a stock build of LineageOS 17.1 for the Cepheus device. In the spirit of LineageOS, this does not include Signature Spoofing. You will need to use Xposed or some other method if you desire that functionality.

    This also does not include MicroG or any other additional applications. This is pure LineageOS, built on 2020-07-10.

    NanoDroid patcher works well for anyone who wants to add MicroG support. You will still need to use Xposed or similar if you want Signature Spoofing as NanoDroid does not offer a patch for Android 10 as of this build.

    Feel free to provide download mirrors.

    What Works:
    Pretty much everything from what I can tell
    Fingerprint Sensor it working like a champ so far.
    NFC Seems to be working but I don't have a device to test against

    Known Issues:
    You tell me...

    From TWRP:
    1) Wipe Date (standard wipe)
    2) Flash lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
    3) Format Data (Wipe -> Format Data -> type "yes"
    3b) - OPTIONAL - Flash Magisk Zip for Root
    4) Reboot to system

    Alternate Install Steps for Full MicroG with Signature Spoofing:
    From TWRP:
    1) Wipe Date (standard wipe)
    2) Flash lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
    3) Format Data (Wipe -> Format Data -> type "yes"
    3b) - OPTIONAL - Flash Magisk Zip for Root
    4) Reboot to system (ignore any errors about missing Google Services)
    5) Reboot to TWRP
    6) Flash NanoDroid Patcher (either the Full package or you can customize per the instructions in the NanoIx link below)
    7) Reboot
    8) Install the Magisk Module for Xposed Framework and the EDXposed.ZIP as per the instructions in the Xposed link below)
    9) Reboot to activate the new Module
    10) Within the EDXposed App, Install the FakeGApps Module
    11) Reboot to activate the new Module

    As everything I really care about is working in this build, I do not plan to devote much, if any, time to "supporting" this release. I just thought I'd share my clean 17.1 LineageOS in case anyone else is interested.

    LineageOS 17.1 Unofficial (Built: 2020-07-10) md5sum: 1c340fc16a6fbc7586d0a856acb9c600
    NanoDroid Patcher (optional): NanoIx
    Magisk Root (optional): Magisk
    XPosed for Android 10 - Magisk Module (optional): Xposed
    It's working after root and Hide in Magisk Manager. I was confused because it was showing up as "Incomaptible with device" in google play store, after rooting it's installed. Thanks!
    Could you send commands which you used to compile ROM? I have some free space on my home server, maybe I could set up Jenkins with auto building. Is it possible to get auto update working?

    ThePiGuy already has a great overview of building for unsupported/unofficial devices here
    You'll need to install all the base requirements on your build distro before you proceed. This includes the adb and fastboot tools, the build packages, and the java versions as mentioned in this LineageOS build guide for one of their other Xiaomi "supported" devices.

    What I post here is basically my method of pulling the relevant info from the two build guides above to get a successful build for the Xiaomi Mi 9 (cepheus).

    I will say as for the Requirements, it really needs to be 16GB of RAM. I tried building in a VM with 8GB multiple times and it failed due to running out of memory. This could just be because I run on SSDs and do not use SWAP space/files...

    When it comes to your Proprietary Blobs, I pulled mine from Demon000's Github Source
    You will need these repos, and we will cover these steps further down:

    When performing the "ccache -M $G" command I used:
    ccache -M 50G

    Now let's create your base folder where you want to make all the magic happen. Be sure to have plenty of storage available. In my case, I needed about 200GB.
    mkdir -p ~/android/lineage
    cd ~/android/lineage

    When performing your repo init commands, reference branch 17.1:
    repo init -u https://github.com/LineageOS/android.git -b lineage-17.1

    Sync the repo to your current working directory, in this case the lineage folder you created above (which should still be your working directory):
    repo sync

    This will pull down 100+GB of files, so this takes quite some time.

    Following along, you should be in your folder called "lineage" where you ran your repo init and repo sync commands. In my case this is:

    Attached is my manifest file called "cepheus.xml" that references the Demon000 github source.
    Place this cepheus.xml file here:
    (creating the local_manifests folder if necessary)

    Now you need to complete the build of your device tree.
    You will clone each of the four repositories above into their respective locations in the device tree:
    vendor_xiaomi -> ~/android/lineage/vendor/xiaomi/
    kernel_xiaomi_sm8150 -> ~/android/lineage/kernel/xiaomi/sm8150
    device_xiaomi_cepheus -> ~/android/lineage/device/xiaomi/cepheus
    device_xiaomi_sm8150_common -> ~/android/lineage/device/sm8150_common

    Note: Be sure to check each of those four locations and make sure the contents of the repository are in those folders, not, for example: ~/android/lineage/device/sm8150_common/device_xiaomi_sm8150_common. You don't want the repo contents within that extra subfolder...
    In my case, I created the necessary directory structure and changed to that directory, then cloned the repo and moved the contents from the subfolder created by the clone operation into the correct location.

    mkdir -p ~/android/lineage/vendor/xiaomi/
    cd ~/android/lineage/vendor/xiaomi
    git clone https://github.com/Demon000/vendor_xiaomi.git
    mv vendor_xiaomi/* .
    rm -r vendor_xiaomi

    mkdir -p ~/android/lineage/kernel/xiaomi/sm8150
    cd ~/android/lineage/kernel/xiaomi/sm8150
    git clone https://github.com/Demon000/kernel_xiaomi_sm8150.git
    mv kernel_xiaomi_sm8150/* .
    rm -r kernel_xiaomi_sm8150

    mkdir -p ~/android/lineage/device/xiaomi/cepheus
    cd ~/android/lineage/device/xiaomi/cepheus
    git clone https://github.com/Demon000/device_xiaomi_cepheus.git
    mv device_xiaomi_cepheus/* .
    rm -r device_xiaomi_cepheus

    mkdir -p ~/android/lineage/device/xiaomi/sm8150_common
    cd ~/android/lineage/device/xiaomi/sm8150_common
    git clone https://github.com/Demon000/device_xiaomi_sm8150_common.git
    mv device_xiaomi_sm8150_common/* .
    rm -r device_xiaomi_sm8150_common

    Now return to your base lineage folder:
    cd ~/android/lineage

    Now that you have init'd and synced your repo and pulled your proprietary blobs into their respective folders, you are ready to build with the brunch command:
    export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
    export USE_CCACHE=1
    ccache -M 50G
    source build/envsetup.sh 
    brunch lineage_cepheus-userdebug

    For me, I have no idea how long this took to complete as I left it running overnight. I would imaging at least 4 hours on my i5 device. Once it's done, you should have a TWRP-flashable zip and an OTA zip in the ~/android/lineage/out folder.

    Note: If after compiling for some time, the process fails with errors, it should provide you with information on how to track down the error. In my case, I ended up with it stopping with a failure a couple times, but I just re-ran the above brunch command and it picked up where it left off, eventually completing successfully. YMMV

    I'm sure there are cleaner, simpler ways of going about this, but I'm just getting my feet wet with current Android source. I haven't really done any sort of Android "development" since the days of KitKat...
    BTW, to skip all the manual downloading of Demon000's device repo's, use this for your cepheus.xml local manifest:

        <project path="vendor/xiaomi" name="Demon000/vendor_xiaomi" remote="github" revision="lineage-17.1" />
        <project path="kernel/xiaomi/sm8150" name="Demon000/kernel_xiaomi_sm8150" remote="github" revision="lineage-17.1" />
        <project path="device/xiaomi/cepheus" name="Demon000/device_xiaomi_cepheus" remote="github" revision="lineage-17.1" />
        <project path="device/xiaomi/sm8150-common" name="Demon000/device_xiaomi_sm8150-common" remote="github" revision="lineage-17.1" />

    "repo sync" will pull those down into the right locations.
    That said, I cannot even get updated builds to compile using the Markakash or Demon000 sources that I used in the first couple of builds I did. And my day job and homestead upkeep in my "downtime" does not afford me much opportunity to look into issues.

    Look at the OP from Cozzmy13, he mentioned there what repos to use and what repopicks he uses. I stumbled over the hardware repo, too.
    I am stuck at fastboot or bootloop after following the installation step
    I have tried several times here what I do
    boot to fastboot then flash TWRP_V3.4.0.0
    then reboot to recovery and Flash the VBMETA PATCHER
    then reboot to recovery and wipe data, cache, system then flash
    if I reboot to system now I get bootloop on mi logo
    and if I did all the above with the extra step
    to Format Data then reboot to system
    i stuck in fastboot again and I have to unbrick with MiFlash &
    I have tried three times till now
    first time was cumming from miui 12 global
    the other two from

    do I have to flash V11.0.2.0.QFAMIXM from fastboot or Recovery at first?

    You should be starting with your device running MIUI V11.0.6 if you have not yet run an AOSP-based ROM on it.

    Then you flash the VBMETA and TWRP both from Fastboot. I'm not sure of a VBMETA patcher that you would be flashing in TWRP.

    Once you flash both of those in FASTBOOT, then boot into TWRP and do a base Wipe Data.

    Flash the LineageOS build

    Then go BACK into Wipe Data in TWRP and click the "Format Data" button. This will then require you to type 'yes' to continue.
    If you miss this step, you WILL get bootloops.

    Now you should be able to reboot system.

    From TWRP:
    1) Wipe Date (standard wipe)
    2) Flash lineage-17.1-20200710-UNOFFICIAL-cepheus.zip
    3) Format Data (Wipe -> Format Data -> type "yes"
    3b) - OPTIONAL - Flash Magisk Zip for Root
    4) Reboot to system