Development [ROM][13.0][UNOFFICIAL] LineageOS 20.0 for Xiaomi MIX 4

Search This thread

Inkypen

Senior Member
Aug 19, 2018
500
1,524
London
Samsung Galaxy Note 4
Xiaomi Mi 5s
2okPze5.png

LineageOS is a free, community built, aftermarket firmware distribution of Android 12 (S), which is designed to increase performance and reliability over stock Android for your device.

Code:
#include <std_disclaimer.h>

/*
* Your warranty is now void.
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/

LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. You will need to provide your own Google Applications package (gapps). LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.

Base source code is available in the LineageOS Github repo. And if you would like to contribute to the project, please visit our Gerrit Code Review.

GPL compliance:
yG18r6g.png


Working:
Almost everything

Broken:
You tell me :)

Downloads:
https://sourceforge.net/projects/xiaomi-odin/files/13/LineageOS
https://sourceforge.net/projects/xiaomi-odin/files/12/LineageOS
https://sourceforge.net/projects/xiaomi-odin/files/11/LineageOS

Installation:
Reboot to recovery
Copy LineageOS zip to internal storage
Install LineageOS zip package
Install [optional] a Google Apps package of your choice
Format data (wiping is not sufficient, formatting requires you to type "yes")
Reboot

Important notes:
GApps can only be flashed on clean installs.
Formatting data (all user data is wiped, including internal storage) is a must if MIUI was previously installed and device was encrypted.

Contributors
Inkypen
ROM OS Version: Android 12
ROM Kernel: Linux 5.4
Based On: AOSP
 
Last edited:

Inkypen

Senior Member
Aug 19, 2018
500
1,524
London
Samsung Galaxy Note 4
Xiaomi Mi 5s
Official TWRP thread:

TWRP Notes:
Currently the official TWRP has issues installing on custom ROMs. It can be permanently installed on with MIUI but any AOSP based ROM causes it to hang. Until this gets fixed the only way into TWRP is to use the fastboot boot method. Also the official TWRP currently has some bugs (sideload not working, boot slot selection not working, vibration not working) which I have fixed. I've submitted these fixes to the official channels so the next official build should have these problems fixed. My unofficial TWRP build is available here:

Extra Installation Notes:
 
Last edited:

WMWLT

New member
Jan 22, 2022
3
1
I've heard that the selfie cam of MIX 4 doesn't work with LineageOS on telegram.Did this bug fixed??
 

er453r

Senior Member
Jan 1, 2012
60
10
@Inkypen I have managed to install this with OpenGapps pico and everything seems to look good - except for SIM cards :p None of the SIM slots are recognized... so uninstalling it now, since I need my phone :) BUT other than that I am super pumped - finally something other than MIUI and my beloved Lineage! Throwing you thank yous via PayPal in a moment :) Keep up the good work!
 

Inkypen

Senior Member
Aug 19, 2018
500
1,524
London
Samsung Galaxy Note 4
Xiaomi Mi 5s
@Inkypen I have managed to install this with OpenGapps pico and everything seems to look good - except for SIM cards :p None of the SIM slots are recognized... so uninstalling it now, since I need my phone :) BUT other than that I am super pumped - finally something other than MIUI and my beloved Lineage! Throwing you thank yous via PayPal in a moment :) Keep up the good work!
Flash it again. I've discovered that if you flash to slot A you won't have SIM cards or sensors working but everything works properly when flashed to slot B. I have a feeling it's related to TWRP, for example it's currently a bit broken and can't be permanently installed on AOSP based ROMs.
 

er453r

Senior Member
Jan 1, 2012
60
10
@Inkypen just tried both B and A (in that order) and still no SIM detected. I am using your TWRP from that thread :/

Also, how to change SELinux status? Lineage Trust app complains about it.
 
Last edited:

shulfei

Member
May 10, 2010
9
0
Great work. Thank you.
Cts profile failed, selinux off. And safety tests not passing.
Any idea how fix it?
 

Inkypen

Senior Member
Aug 19, 2018
500
1,524
London
Samsung Galaxy Note 4
Xiaomi Mi 5s
@Inkypen just tried both B and A (in that order) and still no SIM detected. I am using your TWRP from that thread :/

Also, how to change SELinux status? Lineage Trust app complains about it.
Not sure what is wrong here, or if it's even the same issue I have when flashing to slot A. I'll need logs to investigate. Also you can turn off the SELinux warning in Trust settings.
Great work. Thank you.
Cts profile failed, selinux off. And safety tests not passing.
Any idea how fix it?
CTS profile and Safetynet failures are both related to SELinux. There is a hack to hide SELinux status from Google services but I forgot to add it in (although I did add in the hack for the unlocked bootloader check). It's possible to add the SELinux hack onto a running phone but it's complicated. Good news is I'm wokring on SE policy in order to get it fully enforcing.

Don't try to force enable SELinux to enforcing, your phone will quite likely stop working properly until you set it back to permissive.
 

shulfei

Member
May 10, 2010
9
0
I might be the one user, who is mostly excited with the prospect of leaving MIUI behind. :)
Buti have to ask,what kind of procedure, did you use to flash the LOS-Build? I tried it like the way described but, it did not go well. Btw, i come from MIUI 13.
Reboot phone to fastboot mode.
Boot to twrp (get Inkypen version twrp-odin.img) via command
"""
fastboot boot twrp-odin.img
"""
Wipe all data how wrote Inkypen:
"""
Formatting data (all user data is wiped, including internal storage) is a must if MIUI was previously installed and device was encrypted.
Format data (wiping is not sufficient, formatting requires you to type "yes")
"""
Install LineageOS.
Install gapps arm64.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hey everyone, for some reason I don't always get a notification that someone has posted here. Not just this thread but most threads on XDA.

    In any case I've still been working on this ROM, I have a new update for testing. It's been updated to use the new MIUI 14 vendor and I've removed a whole bunch of Xiaomi services that don't work under AOSP. MIUI 14 firmware is also included in the ROM.

    Although flashing over an existing install is perfectly fine (tested by myself) I'm not going to push this build to the OTA system as it could be considered a "beta" build.


    A few people have commented about bugs with the camera/media, I'm not able to reproduce anything on my end. If I can't reproduce it and nobody sends me a log then there is zero chance of it getting fixed.

    Also the thing with the camera dot sometimes being on the wrong side, my java skills are terrible so if anyone wants to volunteer to fix it then go ahead :)
    1
    hey @Inkypen is there any other forum/place where you are communicating about your ROMs? just asking since there is little activity here and I see you're still doing the work on sourceforge and github - kudos to that! - I just would like to help testing / reporting issues

    anyways - I've tried the newest January Lineage / PixelExperience ROMS - and they are both functionally flawless, but there are still 2 issues (in both ROMs) that still make me go back to Xiaomi.eu
    1. Battery drain - the phones dies overnight if I forget putting it on charger - and battery stats show blank for that time - on xiaomi.eu I can easily last 2-3 days on moderate usage
    2. Media/Camera handling - it is like others here report - camera sometimes is not able to connect, sometimes media can not play as if it was busy in another app
    Other from that everything is miles and beyond better than anything on xiaomi.eu

    Thank you again for your great work!
    Consolidating some errors from this post and me as well

    1. Battery: while mine doesn't die overnight, battery could be better
    2. Sometimes ANX camera can't connect to the camera, but this only happens to ANX
    3. Auto screen punch hole during selfies sometimes rotates 90* (leaving the hole on the left side of the screen)
    4. Sometimes phone would reboot randomly, I had this for like 2 per week,
  • 15
    2okPze5.png

    LineageOS is a free, community built, aftermarket firmware distribution of Android 12 (S), which is designed to increase performance and reliability over stock Android for your device.

    Code:
    #include <std_disclaimer.h>
    
    /*
    * Your warranty is now void.
    *
    * We are not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed. Please
    * do some research if you have any concerns about features included in this ROM
    * before flashing it! YOU are choosing to make these modifications, and if
    * you point the finger at us for messing up your device, we will laugh at you.
    *
    */

    LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. You will need to provide your own Google Applications package (gapps). LineageOS does still include various hardware-specific code, which is also slowly being open-sourced anyway.

    Base source code is available in the LineageOS Github repo. And if you would like to contribute to the project, please visit our Gerrit Code Review.

    GPL compliance:
    yG18r6g.png


    Working:
    Almost everything

    Broken:
    You tell me :)

    Downloads:
    https://sourceforge.net/projects/xiaomi-odin/files/13/LineageOS
    https://sourceforge.net/projects/xiaomi-odin/files/12/LineageOS
    https://sourceforge.net/projects/xiaomi-odin/files/11/LineageOS

    Installation:
    Reboot to recovery
    Copy LineageOS zip to internal storage
    Install LineageOS zip package
    Install [optional] a Google Apps package of your choice
    Format data (wiping is not sufficient, formatting requires you to type "yes")
    Reboot

    Important notes:
    GApps can only be flashed on clean installs.
    Formatting data (all user data is wiped, including internal storage) is a must if MIUI was previously installed and device was encrypted.

    Contributors
    Inkypen
    ROM OS Version: Android 12
    ROM Kernel: Linux 5.4
    Based On: AOSP
    6
    New builds are up:
    • June security patch
    • Kernel upstreamed to 5.4.197 and latest lahaina CAF tag
    • LHDC Bluetooth codec added (untested as I don't have a BT device that supports this)
    • Some ANX tweaks (should start a little bit faster)
    Regarding the conversation about the visible camera hole at maximum brightness, that's a hardware limitation. You must have seen Xiaomi's promotional image of the pixel array above the front facing camera showing the smaller pixels allowing light to pass through to the image sensor. A smaller pixel will not be able to shine as brightly as a larger one hence the slightly darker view on max brightness. MIUI gets around this flaw by displaying a sun symbol over the camera hole at max brightness. On a couple of builds I tried limiting the max brightness by about 15% so this wasn't noticeable but I had a few people in sunny areas complain about the change, so I reverted back. If it bothers you just turn the brightness down a little bit.

    Are there any plans to fix the widevine level from l3 to l1? I know that the China/eu Rom habe l1,so it should not be impossible to fix
    I've had L1 support since before I even released any builds. Download any media codec info app from play store and check for yourself.
    5
    New build is out, fixes seedvault among other things. Check changelog here: https://github.com/Inkypen79/OTA/commit/15f3c51b1ca99eaea2c026a47a6d0a02d3f5f583

    Turns out seedvault is a bug in Lineage, I used the main seedvault repo instead of the Lineage one and it's all working. This was fairly straight forward to fix but for future reference please, please, please provide build version and logs when giving a bug report.

    @subject4 Thanks for your suggestion. Nikgapps is actually what I would personally recommend if someone needed a gapps package, but unfortunately it can only be flashed on top of an installed ROM and is not suitable to integrate into a build from source.
    5
    New test build is up. It has a new version of minimal gapps installed and it also passes safetynet from clean flash without the need of root or any additional patches or modules. OK Google detection is now working with the screen switched off. Biggest change is a much improved ANX camera experience. There are no more crashes when using certain camera modes, the only thing not working is slow motion. I'm considering making ANX the default camera for all future builds (gapps and non gapps) and I would appreciate any feedback about this change.

    Build is here: https://sourceforge.net/projects/xi...220426-UNOFFICIAL-gapps-anx-odin.zip/download
    4
    @Inkypen Thank you so much... you're the best. So, if ANX is (sadly) not included, there might be a chance, it will go "official"-status eventually, right?
    Sorry to say that the chances of Lineage becoming official are exactly zero. The requirements to go official are unbelievably strict and very restrictive. For example, I wouldn't be allowed to patch the source code to make the ROM pass safetynet or I wouldn't be allowed to extract drivers/firmware from a Qualcomm dump if I needed to. I just don't have the time/energy to jump through their hoops. Besides, the only upside to official builds are OTA updates which I've added to my builds :)

    I am currently working on getting stock MIUI Camera to function correctly on AOSP based ROMS as I have discovered that ANX depends on a framework called Frida that is not currently compatible with A13.