How To Guide [GUIDE] Install LineageOS 19.1 with gapps

Search This thread

C0rn3j

Senior Member
Jan 22, 2016
103
63
Xiaomi 12

Notes:​

* I am not a developer.
* I did all of this on Arch Linux, you shouldn't have trouble doing this on either Linux or Windows.
* See the Telegram group if you have issues - search for "Xiaomi 12 OFFICIAL" on TG, unfortunately cannot link directly to it on XDA.
* This is an unofficial version of LineageOS
* Thanks to @gr0ndpa whose writeup I based this guide on.
* Massive thanks to @ArianK16a who actually made LOS work on Xiaomi 12, despite Xiaomi breaking GPL licensing and not providing full kernel sources for Android 12

Prerequisites:​

* Your bootloader must be unlocked. This thread does not cover this.
* You should use latest platform tools on Windows.
* Your device should be charged above 50%. Well, it doesn't have to be, but this is just for your phone's safety.
* Download 4 required .img files - boot, vendor_boot, dtbo and recovery from the latest build that has them all - rest miss recovery/vendor_boot, linking latest one at the time of writing for convenience
* Download latest ROM of your choosing (GMS=with gapps, VANILLA=no gapps) from arian-ota/ota
* If you intend to root the device with Magisk, also download latest boot.img
* Make a proper backup if needed and push it to another storage.

First steps:​

* After you have unlocked the bootloader, device will reboot automatically. Finish the setup, enable developer settings and finally enable USB-Debugging in developer settings.
* In Windows open the folder in which you have unzipped the platform tools.
* Hold left shift and press right click, click "open powershell window here"
* Connect the phone via USB
* Execute the following in Windows Terminal and grant the permissions for this PC on your device:
Code:
adb devices
* Execute the following to either reboot to fastboot or fastbootd. Flashing works from either, I used fastbootd:
Code:
adb reboot fastboot # fastbootd
adb reboot bootloader # fastboot

The flashing procedure:​

* Flash boot, vendor_boot, dtbo and recovery by executing the following in Windows Terminal:
Code:
fastboot flash boot lineage-19.1-20220618-UNOFFICIAL-cupid-boot.img
fastboot flash vendor_boot lineage-19.1-20220618-UNOFFICIAL-cupid-vendor_boot.img
fastboot flash dtbo lineage-19.1-20220618-UNOFFICIAL-cupid-dtbo.img
fastboot flash recovery lineage-19.1-20220618-UNOFFICIAL-cupid-recovery.img
* Finally execute the following, or reboot to recovery by holding VOLUME UP and POWER buttons until you see Mi logo on your device's screen:
Code:
fastboot reboot recovery # or bootloader
* If you get MIUI recovery, reboot back to fastboot, you should hopefully get LOS fastbootd now and be able to redo the steps and get LOS recovery next

Sideload the ROM from LOS recovery:​

* ALL DATA WILL BE ERASED WITH THE NEXT STEP
* Go to Factory reset and perform Format data / Factory reset
* Go to Apply update, followed by Apply from ADB
* Execute the following Windows Terminal:
Code:
adb sideload lineage-19.1-20220810-UNOFFICIAL-GMS-cupid.zip
* Reboot your device

Rooting:​

* Follow this thread but use the latest boot.img you downloaded earlier instead of the one from stock ROM.

Certification:​

* If you won't fake the build prop to get certified status, you should at least follow Alphabet's instructions to make sure your device does not potentially get blacklisted from Play services

* Certification is required to run some apps - i.e. Netflix, Revolut, ...
* You can view certification state in Play store -> Profile -> Settings -> About -> Play Protect certification. This will cache the status. For a while, how to force the check again is shown down below
* Your device will not be certified on this ROM because it does not attempt to fake build props
* To get known good props for security update date and device fingerprint, you need either a rooted device with MIUI you want to extract the values from by executing the following in root adb shell:
Code:
grep -e fingerprint -e security_patch /system/build.prop
Or you can download latest recovery .zip from the download thread and open the file located in it from /META-INF/com/android/metadata in the archive
* Here's an example of the two values needed for my EEA device I got from the recovery zip:
Code:
2022-07-01
Xiaomi/cupid_eea/cupid:12/SKQ1.211006.001/V13.0.19.0.SLCEUXM:user/release-keys
* Install the following module through Magisk https://github.com/Magisk-Modules-Repo/MagiskHidePropsConf
* Run the following:
Code:
adb shell
su
props
1 # Set the fingerprint to the one you obtained
5 # Add a custom prop with the name ro.build.version.security_patch, it should already exist, but it is most likely wrong
* Install the following module through Magisk
* After the final reboot, remove storage of "Google Play Store" app to refresh the cache manually, open Play store and check the status, you should be in the green now

Known issues:​

* Face recognition libraries are not included due to legal reasons, if one is interested in adding them, see the discussion starting here
* Minimum brightness is too bright. This can be mitigated by adding the "Extra Dim" card in the notification menu and long-pressing it to configure your desired intensity.
* When Smooth Display (120Hz) is enabled, screen flashes/redraws when it changes to and from 90Hz. This is more noticeable with lower brightness and no light in the room, and not really noticeable in daylight. Can be triggered by opening settings and typing a word and waiting half a second.
* Netflix(and only Netflix) is not available from the Play store on GSM ROM even with certification. Netflix provides an APK on their website, but that still gives me an unsupported device message. https://help.netflix.com/en/node/57688
 
Last edited:

genan42

Member
May 22, 2009
15
2
Thanks for the great guide. I was able to install it without any issues whatsoever.
 

Piotrekk

Senior Member
Sep 2, 2009
211
113
So is everything (including Fingerprint, all cameras, stereo speakers, BT, WiFi, Dual-SIM, VoLTE, VoWiFi, Fast charging) working?
 

曲彦朋

New member
Jan 3, 2017
2
1
Xiaomi 12
除了人脸识别之外,一切都很好。
Translation: Everything is fine except for the face recognition.

Hi,
As a "one time" courtesy, I have translated your post to this thread and because it was not a spam
Please be respectful and observant of XDA Rule #4
for all of your future posts.

4. Use the English language.
We understand that with all the different nationalities, not everyone speaks English well, but please try. If you're really unable to post in English, use an online translator. You're free to include your original message in your own language, below the English translation. (This rule covers your posts, profile entries and signature). You could try :- https://translate.google.com/ or https://www.babelfish.com/ or use one of your choice.

Thank you for your cooperation, and enjoy your stay on XDA.
Regards
Sib64 - Moderator
 

Attachments

  • 微信截图_20220819092127.png
    微信截图_20220819092127.png
    71.8 KB · Views: 680
  • 微信图片_20220819092411.jpg
    微信图片_20220819092411.jpg
    137.1 KB · Views: 681
  • 微信截图_20220819092106.png
    微信截图_20220819092106.png
    78.2 KB · Views: 678
Last edited by a moderator:
  • Like
Reactions: Kolinyoung

HD_Lutze

Senior Member
Dec 10, 2009
85
14
xiaomi cam is not working on LOS ... you have to use gcam etc ...
read carefully ... you have to use these 4 files from 20220618 release and only the gms rom image from 20220810 ...
 
  • Like
Reactions: immerzu2

schmidt93

Member
Sep 20, 2022
5
3
Installed last night. Cant use Wallet, Google Play Store is not certified, SMS receiving problems sometimes. Google Assistant says it isn't available for this language, but it is set to english.
Can i somehow get google play certified and wallet working? Tried to register play sotre id on google site but that didnt help.
 

Paolo83

Senior Member
Aug 30, 2013
485
76
Novara
Installed last night. Cant use Wallet, Google Play Store is not certified, SMS receiving problems sometimes. Google Assistant says it isn't available for this language, but it is set to english.
Can i somehow get google play certified and wallet working? Tried to register play sotre id on google site but that didnt help.
i'm waiting to... if wallet dosent work, i stay on .eu
 

NOSS8

Recognized Contributor
Installed last night. Cant use Wallet, Google Play Store is not certified, SMS receiving problems sometimes. Google Assistant says it isn't available for this language, but it is set to english.
Can i somehow get google play certified and wallet working? Tried to register play sotre id on google site but that didnt help.
You can try to root the phone with Magisk and use Magisk hide.
 

SonicGold

Member
Jun 10, 2016
12
6
Xiaomi 12

Notes:​

* I am not a developer.
* I did all of this on Arch Linux, you shouldn't have trouble doing this on either Linux or Windows.
* See the Telegram group if you have issues. - Edit Moderation -
* This is an unofficial version of LineageOS
* Thanks to @gr0ndpa whose writeup I based this guide on.
* Massive thanks to @ArianK16a who actually made LOS work on Xiaomi 12, despite Xiaomi breaking GPL licensing and not providing full kernel sources for Android 12

Prerequisites:​

* Your bootloader must be unlocked. This thread does not cover this.
* You should use latest platform tools on Windows.
* Your device should be charged above 50%. Well, it doesn't have to be, but this is just for your phone's safety.
* Download 4 required .img files - boot, vendor_boot, dtbo and recovery from the latest build that has them all - rest miss recovery/vendor_boot, linking latest one at the time of writing for convenience
* Download latest ROM of your choosing (GMS=with gapps, VANILLA=no gapps) from arian-ota/ota
* If you intend to root the device with Magisk, also download latest boot.img
* Make a proper backup if needed and push it to another storage.

First steps:​

* After you have unlocked the bootloader, device will reboot automatically. Finish the setup, enable developer settings and finally enable USB-Debugging in developer settings.
* In Windows open the folder in which you have unzipped the platform tools.
* Hold left shift and press right click, click "open powershell window here"
* Connect the phone via USB
* Execute the following in Windows Terminal and grant the permissions for this PC on your device:
Code:
adb devices
* Execute the following to either reboot to fastboot or fastbootd. Flashing works from either, I used fastbootd:
Code:
adb reboot fastboot # fastbootd
adb reboot bootloader # fastboot

The flashing procedure:​

* Flash boot, vendor_boot, dtbo and recovery by executing the following in Windows Terminal:
Code:
fastboot flash boot lineage-19.1-20220618-UNOFFICIAL-cupid-boot.img
fastboot flash vendor_boot lineage-19.1-20220618-UNOFFICIAL-cupid-vendor_boot.img
fastboot flash dtbo lineage-19.1-20220618-UNOFFICIAL-cupid-dtbo.img
fastboot flash recovery lineage-19.1-20220618-UNOFFICIAL-cupid-recovery.img
* Finally execute the following, or reboot to recovery by holding VOLUME UP and POWER buttons until you see Mi logo on your device's screen:
Code:
fastboot reboot recovery # or bootloader
* If you get MIUI recovery, reboot back to fastboot, you should hopefully get LOS fastbootd now and be able to redo the steps and get LOS recovery next

Sideload the ROM from LOS recovery:​

* ALL DATA WILL BE ERASED WITH THE NEXT STEP
* Go to Factory reset and perform Format data / Factory reset
* Go to Apply update, followed by Apply from ADB
* Execute the following Windows Terminal:
Code:
adb sideload lineage-19.1-20220810-UNOFFICIAL-GMS-cupid.zip
* Reboot your device

Rooting:​

* Follow this thread but use the latest boot.img you downloaded earlier instead of the one from stock ROM.

Certification:​

* If you won't fake the build prop to get certified status, you should at least follow Alphabet's instructions to make sure your device does not potentially get blacklisted from Play services

* Certification is required to run some apps - i.e. Netflix, Revolut, ...
* You can view certification state in Play store -> Profile -> Settings -> About -> Play Protect certification. This will cache the status. For a while, how to force the check again is shown down below
* Your device will not be certified on this ROM because it does not attempt to fake build props
* To get known good props for security update date and device fingerprint, you need either a rooted device with MIUI you want to extract the values from by executing the following in root adb shell:
Code:
grep -e fingerprint -e security_patch /system/build.prop
Or you can download latest recovery .zip from the download thread and open the file located in it from /META-INF/com/android/metadata in the archive
* Here's an example of the two values needed for my EEA device I got from the recovery zip:
Code:
2022-07-01
Xiaomi/cupid_eea/cupid:12/SKQ1.211006.001/V13.0.19.0.SLCEUXM:user/release-keys
* Install the following module through Magisk https://github.com/Magisk-Modules-Repo/MagiskHidePropsConf
* Run the following:
Code:
adb shell
su
props
1 # Set the fingerprint to the one you obtained
5 # Add a custom prop with the name ro.build.version.security_patch, it should already exist, but it is most likely wrong
* Install the following module through Magisk
* After the final reboot, remove storage of "Google Play Store" app to refresh the cache manually, open Play store and check the status, you should be in the green now

Known issues:​

* Face recognition libraries are not included due to legal reasons, if one is interested in adding them, see the discussion starting here
* Minimum brightness is too bright. This can be mitigated by adding the "Extra Dim" card in the notification menu and long-pressing it to configure your desired intensity.
* When Smooth Display (120Hz) is enabled, screen flashes/redraws when it changes to and from 90Hz. This is more noticeable with lower brightness and no light in the room, and not really noticeable in daylight. Can be triggered by opening settings and typing a word and waiting half a second.
* Netflix(and only Netflix) is not available from the Play store on GSM ROM even with certification. Netflix provides an APK on their website, but that still gives me an unsupported device message. https://help.netflix.com/en/node/57688

Thanks @C0rn3j for the banger guide , and thanks @ArianK16a for the ROM, feels awesome to ditch this absolute cancer that is MIUI !

Performance and battery life is much better on LOS, a few features are missing but I guess we'll get them in a few weeks/months.

Much love ❣
 

Marmalux

Senior Member
May 15, 2012
252
71
Bucharest
Nokia 8 Sirocco
LG V50 ThinQ
Installed it two weeks ago, no root
- Camera not working but fixed after OTA update
- SMS issue (can send but cannot receive), fixed with firmware update
- missing calls (phone never rings...) applied firmware update, still testing
- Battery drain very high - fixed with disabling AOD (or at a glance...)
- Tethering (wifi and USB) not working, phone UI freezes
- Still having issues with Auto-brightness
 
  • Like
Reactions: Kolinyoung

Paolo83

Senior Member
Aug 30, 2013
485
76
Novara
Installed it two weeks ago, no root
- Camera not working but fixed after OTA update
- SMS issue (can send but cannot receive), fixed with firmware update
- missing calls (phone never rings...) applied firmware update, still testing
- Battery drain very high - fixed with disabling AOD (or at a glance...)
- Tethering (wifi and USB) not working, phone UI freezes
- Still having issues with Auto-brightness
Hotspot Is not working and the dev Is not working on It for now. It Is a big issue in my opinion. Have you try to get gpay working?
 

Marmalux

Senior Member
May 15, 2012
252
71
Bucharest
Nokia 8 Sirocco
LG V50 ThinQ
Hi

Since i have done the OTA i`m very cautious on what kernel to patch, i did not had time to check and double check.
But once i will root i will install the Magisk props and emulate a proper fingerprint, that should do the trick (it worked on my Xperia 5)
 
Jun 17, 2010
22
7
probably a stupid question but:
is faking a fingerprint possible without magisk, for example by editing a with adb pulled build.prop?
 

DankDeuxez

Senior Member
Jan 13, 2020
68
11
Xiaomi 12
Are things like fingerprint working with this? Pretty sad how small the custom rom community for this device is. Great phone but really sucks with MIUI. Hoping to flash this when i have time.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11

    Notes:​

    * I am not a developer.
    * I did all of this on Arch Linux, you shouldn't have trouble doing this on either Linux or Windows.
    * See the Telegram group if you have issues - search for "Xiaomi 12 OFFICIAL" on TG, unfortunately cannot link directly to it on XDA.
    * This is an unofficial version of LineageOS
    * Thanks to @gr0ndpa whose writeup I based this guide on.
    * Massive thanks to @ArianK16a who actually made LOS work on Xiaomi 12, despite Xiaomi breaking GPL licensing and not providing full kernel sources for Android 12

    Prerequisites:​

    * Your bootloader must be unlocked. This thread does not cover this.
    * You should use latest platform tools on Windows.
    * Your device should be charged above 50%. Well, it doesn't have to be, but this is just for your phone's safety.
    * Download 4 required .img files - boot, vendor_boot, dtbo and recovery from the latest build that has them all - rest miss recovery/vendor_boot, linking latest one at the time of writing for convenience
    * Download latest ROM of your choosing (GMS=with gapps, VANILLA=no gapps) from arian-ota/ota
    * If you intend to root the device with Magisk, also download latest boot.img
    * Make a proper backup if needed and push it to another storage.

    First steps:​

    * After you have unlocked the bootloader, device will reboot automatically. Finish the setup, enable developer settings and finally enable USB-Debugging in developer settings.
    * In Windows open the folder in which you have unzipped the platform tools.
    * Hold left shift and press right click, click "open powershell window here"
    * Connect the phone via USB
    * Execute the following in Windows Terminal and grant the permissions for this PC on your device:
    Code:
    adb devices
    * Execute the following to either reboot to fastboot or fastbootd. Flashing works from either, I used fastbootd:
    Code:
    adb reboot fastboot # fastbootd
    adb reboot bootloader # fastboot

    The flashing procedure:​

    * Flash boot, vendor_boot, dtbo and recovery by executing the following in Windows Terminal:
    Code:
    fastboot flash boot lineage-19.1-20220618-UNOFFICIAL-cupid-boot.img
    fastboot flash vendor_boot lineage-19.1-20220618-UNOFFICIAL-cupid-vendor_boot.img
    fastboot flash dtbo lineage-19.1-20220618-UNOFFICIAL-cupid-dtbo.img
    fastboot flash recovery lineage-19.1-20220618-UNOFFICIAL-cupid-recovery.img
    * Finally execute the following, or reboot to recovery by holding VOLUME UP and POWER buttons until you see Mi logo on your device's screen:
    Code:
    fastboot reboot recovery # or bootloader
    * If you get MIUI recovery, reboot back to fastboot, you should hopefully get LOS fastbootd now and be able to redo the steps and get LOS recovery next

    Sideload the ROM from LOS recovery:​

    * ALL DATA WILL BE ERASED WITH THE NEXT STEP
    * Go to Factory reset and perform Format data / Factory reset
    * Go to Apply update, followed by Apply from ADB
    * Execute the following Windows Terminal:
    Code:
    adb sideload lineage-19.1-20220810-UNOFFICIAL-GMS-cupid.zip
    * Reboot your device

    Rooting:​

    * Follow this thread but use the latest boot.img you downloaded earlier instead of the one from stock ROM.

    Certification:​

    * If you won't fake the build prop to get certified status, you should at least follow Alphabet's instructions to make sure your device does not potentially get blacklisted from Play services

    * Certification is required to run some apps - i.e. Netflix, Revolut, ...
    * You can view certification state in Play store -> Profile -> Settings -> About -> Play Protect certification. This will cache the status. For a while, how to force the check again is shown down below
    * Your device will not be certified on this ROM because it does not attempt to fake build props
    * To get known good props for security update date and device fingerprint, you need either a rooted device with MIUI you want to extract the values from by executing the following in root adb shell:
    Code:
    grep -e fingerprint -e security_patch /system/build.prop
    Or you can download latest recovery .zip from the download thread and open the file located in it from /META-INF/com/android/metadata in the archive
    * Here's an example of the two values needed for my EEA device I got from the recovery zip:
    Code:
    2022-07-01
    Xiaomi/cupid_eea/cupid:12/SKQ1.211006.001/V13.0.19.0.SLCEUXM:user/release-keys
    * Install the following module through Magisk https://github.com/Magisk-Modules-Repo/MagiskHidePropsConf
    * Run the following:
    Code:
    adb shell
    su
    props
    1 # Set the fingerprint to the one you obtained
    5 # Add a custom prop with the name ro.build.version.security_patch, it should already exist, but it is most likely wrong
    * Install the following module through Magisk
    * After the final reboot, remove storage of "Google Play Store" app to refresh the cache manually, open Play store and check the status, you should be in the green now

    Known issues:​

    * Face recognition libraries are not included due to legal reasons, if one is interested in adding them, see the discussion starting here
    * Minimum brightness is too bright. This can be mitigated by adding the "Extra Dim" card in the notification menu and long-pressing it to configure your desired intensity.
    * When Smooth Display (120Hz) is enabled, screen flashes/redraws when it changes to and from 90Hz. This is more noticeable with lower brightness and no light in the room, and not really noticeable in daylight. Can be triggered by opening settings and typing a word and waiting half a second.
    * Netflix(and only Netflix) is not available from the Play store on GSM ROM even with certification. Netflix provides an APK on their website, but that still gives me an unsupported device message. https://help.netflix.com/en/node/57688
    1
    除了人脸识别之外,一切都很好。
    Translation: Everything is fine except for the face recognition.

    Hi,
    As a "one time" courtesy, I have translated your post to this thread and because it was not a spam
    Please be respectful and observant of XDA Rule #4
    for all of your future posts.

    4. Use the English language.
    We understand that with all the different nationalities, not everyone speaks English well, but please try. If you're really unable to post in English, use an online translator. You're free to include your original message in your own language, below the English translation. (This rule covers your posts, profile entries and signature). You could try :- https://translate.google.com/ or https://www.babelfish.com/ or use one of your choice.

    Thank you for your cooperation, and enjoy your stay on XDA.
    Regards
    Sib64 - Moderator
    1
    xiaomi cam is not working on LOS ... you have to use gcam etc ...
    read carefully ... you have to use these 4 files from 20220618 release and only the gms rom image from 20220810 ...
    1
    Installed it two weeks ago, no root
    - Camera not working but fixed after OTA update
    - SMS issue (can send but cannot receive), fixed with firmware update
    - missing calls (phone never rings...) applied firmware update, still testing
    - Battery drain very high - fixed with disabling AOD (or at a glance...)
    - Tethering (wifi and USB) not working, phone UI freezes
    - Still having issues with Auto-brightness
    1
    hey is it good for a daily driver? any issues? I'm talking about the LOS 20 I see in the github