[ROM] LineageOS 17/18/19 UNOFFICIAL - (Update: 2023-08-26)

Shall F-Droid be included in the ROM(s)?

  • Total voters
Search This thread


Feb 21, 2022
First of all thanks and congratulations to every contributor on the Lineage OS mod for XZ1C; I really like this device so having the chance to keep it updated is great.

I'm wondering if anyone in this thread can give me some advice: yesterday I flashed Lineage OS 19.1 (in particular the build lineage-19.1-20230120-UNOFFICIAL-lilac) together with GApps (MindTheGapps-12.1.0-arm64-20220605_112439), which seems to be working fine. But I have just installed a few things and was thinking on moving to the MICROG build, so: any suggestion on how to proceed?

Based on what's said on the first post I guess the way to go is wiping everything from TWRP and flashing the mod, does it make sense? I'm unclear if I need to use a specific TWRP version and if so, which one.

On top of that not sure what could be the procedure for going back, I guess again wiping everything and flashing LineageOS and MindTheGapps...

Sorry for the questions but as I've mentioned last year, I'm totally newbie on these matters. Thanks in advance


Jan 29, 2017
I have a problem with NikGapps.

Been using HavocOS until recently (latest v4.19) and now switching over to LOS 18.1. Mostly because I read Android Auto for some people works on LOS and also wanted to try it out and HOS hasn't been updated in a while.

I flashed the latest 18.1 build and the lates NikGapps, however, during he initial setup when trying to restore my Google backup, the restore crashes and goes back to WiFi selection screen. I tried with all NikGapps that have Google Backup, and I get the same issue.

When trying with OpenGapps and MindTheGapps, I don't get this issue, but Android Auto also doesn't work for me with them.

Has anyone encountered this issue?

Last edited:


Jan 29, 2017
Forgot to mention, I tried with LOS 17.1 as well. At the initial copy apps & data screen I get the same issue. However, if I skip that and skip adding an account, add the account in Backup settings afterwards and then go to "Finish Setup", it works and I am able to restore my backed-up data. Unfortunately this workaround isn't successful on 18.1...


Senior Member
Dec 12, 2015
Whaley Bridge
Sony Xperia Z3 Compact
Based on what's said on the first post I guess the way to go is wiping everything from TWRP and flashing the mod, does it make sense?

That may not be necessary. I would try backing up your apps and data (using TWRP and Android Backup and Restore Tools project. Then try dirty flashing the microG version

If the dirty flash desn't work, then format data, clean flash, boot, then restore your apps and data. Detailed instructions in the last part of this /e/OS forums post


Senior Member
Mar 14, 2013
Caltagirone (Catania)
Hi all,
I'm using LOS 17,1 latest version just flashed, and my need is to have Android Auto working (Peugeot e-208)

At the First i used opengapps with no luck, then wiped everything and tried NikGApps core for android 10 + NikGApps Android Auto Add-on.
Also no luck.

Tried different cables which I used successfully before (also LOS 17 but coming from older releases)
car keep saying Android Auto Error `check equipment which may be not compatible'.

Do you have any suggestion? Anyone with similar issue and who have managed to solve?


Senior Member
Jul 26, 2013
Sony Xperia XZ1 Compact
But I have just installed a few things and was thinking on moving to the MICROG build, so: any suggestion on how to proceed?

Based on what's said on the first post I guess the way to go is wiping everything from TWRP and flashing the mod, does it make sense? I'm unclear if I need to use a specific TWRP version and if so, which one.
You can try to only wipe system and install the MICROG build. But I guess the data stuff from the other GApps won't be compatible so you may need to wipe data too (factory reset).
In any case wiping cache&dalvik is a good idea.
If all fails just flash the stock ROM and then the MICROG build. Of course you (also) loose your data but that should always work.
I'm using LOS 17,1 latest version just flashed, and my need is to have Android Auto working (Peugeot e-208)
Do you have any suggestion? Anyone with similar issue and who have managed to solve?
derfelot has found something which may fix this. I'll likely add this to the February builds if I get to that. I can't test that though as I don't have an Android Auto device/car.
Anyway when I include that stuff I'll mention it in the changelog, so keep an eye there


Feb 21, 2022
Thanks @petefoth and @Flamefire for your replies and advices.
I ended up wiping everything (I've already lost most of the stuff few weeks ago) so was no big deal.

The only thing to remark is that on first boot I got a message that factory reset was needed and inmediately reboot into recovery. I wiped it again and from then on, everything went fine.


Senior Member
Jul 18, 2019
Completely smooth update, thank you very much!
my setup:
lineage-18.1-20230120-UNOFFICIAL-lilac --> lineage-18.1-20230225-UNOFFICIAL-lilac
NikGapps-core-arm64-11-20220908-signed --> NikGapps-core-arm64-11-20230218-signed


Senior Member
Sep 11, 2016
Hey, could someone use the Momo detection app and show the results? I'm curious if it detects custom rom using this rom.


Senior Member
Sep 30, 2017
Hey thanks! Hide the magisk app and it should be fixed.
But do you get "The device is running a custom rom" and "Init.rc is modified" in Momo
it is hidden already
using LSPosed with magisk zygisk deny list


  • Screenshot_20230226-173126_Momo.png
    62 KB · Views: 17
  • Screenshot_20230226-173137_Momo.png
    87.8 KB · Views: 17
Last edited:


Senior Member
Sep 11, 2016
it is hidden already
using LSPosed with magisk zygisk deny list
Ah I see. I get the same results with Los20, that's why I'm asking. If you want to hide Magisk and su/zygisk use ether Shamiko or MagiskHide/Magisk Delta by HuskyG. Problem is, my bank account detects I'm running a custom rom and I think it has something to do with what Momo is showing.


New member
Feb 27, 2023
Hi! First of all, thanks Flamefire and everyone else for putting in the effort to keep the XZ1 alive :)

I've finally found a reason to sign up to these forums, but sadly not a pleasant one: After installing this build, I need to restore my TWRP backup, but even though it includes all partitions, I can only boot the phone if I format `Data`. I have redundancy for my photos, but formatting Data loses all my apps, messages, etc, so I'm looking for a way to recover. Shouldn't Data be restorable even after a format?

Here's what I did:
  • Starting situation: Custom LOS with MicroG 18.1 (built myself from the whatawurst repositories)
    • I created a full backup from TWRP 3.5 from this using `adb backup --twrp`
  • Dirty-flashed Flamefire's 18.1+MicroG builds from January
  • Dirty-flashed Flamefire's 19.1+MicroG builds from January
  • Dirty-flashed Flamefire's 19.1+MicroG builds from February
    • I created *another* full backup from TWRP *3.6* from this using `adb backup --twrp`
Up until this point, almost everything worked fine. 4G wasn't working in the 19.1 builds though (happy to debug another day), so I decided to restore my backup. Here's where things went south:
  • Restoring my first backup was very unreliable and I had to manually patch up the `archive.ab` file to skip the oem.ext4 and cache.ext4 backups. After restore, the phone boots back to recovery until I format Data
  • Restoring my *second* backup worked more reliably, but again my phone boots back to recovery unless I format Data

I have *some* redundancy in case this Data partition is forever lost, but I really wonder what's going on here. Am I out of luck or is there something I'm missing?

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Vacation season, so updates were a bit slow especially as I had to wait for LOS to release to 18.1 version so I could start backporting it to 17.1

    However I was able to add the Sony camera app from https://gitlab.com/xperiance/camera to the 18.1 & 19.1 builds in addition to the Snap camera. It seems to work but has flaws (e.g. with slow-motion) which I won't fix (I just take what is provided by that repo and include it in the ROMs so Magisk isn't required to install it)
    Let me hear your feedback as it isn't fully decided that this will be kept, e.g. if it causes other issues/incompatibilities which I didn't notice as I'm still on 17.1 on my main phone.
    Thank you so much for regular updates.
    Just one thing - is this a typo or a reuploaded July build? Just to be sure
    Damn. Uploaded the wrong files. 6 builds a 2 files keeping the previous version cluttered the folder so much I selected the wrong pair of the 17.1 files. And I had to leave before the upload finished so couldn't double check after uploading yet.
    So yeah, reupload. Removed and uploading the correct 17.1 files. Thanks for the notification!
    Thank you so much for regular updates.
    Just one thing - is this a typo or a reuploaded July build? Just to be sure
    @Flamefire is the Man. Amazing job.
    Quick question - What does it mean"Increased headset volume" in the latest release?
    I had an issue during phone calls that the other side heard my voice very low.
    Does this fix improve that?
    Likely not, I just noticed that I often had to turn up the volume of my (wired) headset to max in some apps and it was (only) just enough, so I increased that (output) volume a bit.
    maybe it's just my impression, but it seems to me that sony camera takes better pictures with lineageos 17.1 rather than with 18.1 and 19.1....
    I'd actually expect that because there is some tight system integration of the Sony camera on 17.1 which isn't possible on 18+ anymore (which is why it was excluded) and the port seemingly just gets the app itself back without the full integration
    But now finally my bank supports registering a browser, and that all works fine on my xz1c! So I don't need the banking app anymore, and can use my phone perfectly fine for everything I want!
    FWIW the basic & CTS attestation (aka SafetyNet) works on the ROM which seems to be enough for most banking apps and at least Google Pay/Wallet. But I guess you already tried that it isn't enough for your banks app so I'm happy you found a workaround at least.
    I wanted to make a donation/ beer but no link for that? Even if you do it for fun, it's nice to get some appreciation so you can actually get that nice triple beer right? So, is there a place to donate?
    I had only added the links to my profiles about page so far, but now added it also to the OP.
    And yes I do appreciate the couple donations I received so far from various people as while it is fun it is also quite some work, especially with the backports to 17.1 and the occasional feature addition
  • 56
    LineageOS 17/18/19 for Sony Xperia XZ1 Compact



    This is an alternative ROM for the Sony Xperia XZ1 Compact.

    Creating this to honor the great work of modpunk and derf elot from https://forum.xda-developers.com/t/rom-lineageos-18-1-unofficial-2-0-update-2021-01-20.4047763/ which seems to be discontinued. Posting an own thread to keep the latest versions visible, I'm NOT claiming authorship over the ROM.
    I basically just build the ROM using the latest changes from upstream LineageOS/Google and kernel updates (usually incorporated by derf elot ) See my post.

    • Signed with dev keys
    • EAS kernel
    • Passes SafetyNet out of the box (thanks Rooted_Ansh, Havoc-OS Team and kdrag0n)
    • Seedvault (Video)
    • IMS support (thanks to Rooted_Ansh and also Shujath)
    • 17.1 has stock Sony camera (not possible on 18+)


    You can download the latest release here.
    HINT: Download both the ZIP and md5sum file so TWRP can check the consistency of the upload/download.
    Make sure you download the right version, vanilla LineageOS is named lineage-*UNOFFICIAL-lilac.zip while the MicroG version is named lineage-*-MICROG--lilac.zip

    REQUIRED FIRMWARE: 47.2.A.11.228

    I only test the 17.1 releases myself. The 18.1/19.1 are build from mostly the same sources and hopefully work. I only test them roughly.
    Backup download


    Magisk seems to cause issues (bootloops) on update, so remove it first and reinstall if required. Note that Magisk is usually not required unless you want root.
    1. Put the zip file of the ROM on your SD card or internal store and boot into recovery.
    2. When coming from stock ROM, do a full wipe (i.e. factory reset) via "Wipe". You don't need to wipe system. When flashing the stock ROM you can select to not keep user data which is equivalent to this step.
    3. Go to "Install", select the zip file and add optionally the gapps zip. Then flash it.
    4. After updates you may now wipe cache&dalvik (option after install)
    I suggest to use modpunks TWRP recovery. Again: Don't forget the md5sum file!
    TWRP 3.3.1-0 by modpunk / derf elot
    Or use the latest TWRP for 17.1/18.1 or TWRP for 19.1.
    3.7.0 Seems to work well with latest updates (decryption working) but LineageOS 19.1 (Android 12) requires the ones with "_12" suffix, e.g. 3.6.2_12.

    For ease of use I suggest to flash this recovery (only required once):
    1. Boot in Fastboot mode: Hold "Volume Up" while connecting the USB cable to phone and PC
    2. Flash TWRP by running this on the PC: fastboot flash recovery twrp-3.3.1-0-lilac-android10-1.img
      (adjust the filename if necessary)
    3. From now you can boot TWRP by turning on the phone with "Volume Down" + Power
    I heavily recommend to make a full backup before any installation so you can go back in case of issues. Flashing an older ROM usually helps to recover bootloops etc.

    Upgrades between versions​

    Dirty-flashing (e.g. from 17.1 to 18.1) works well but you have to also flash a GApps version matching the Android version or the device will bootloop.
    For the upgrade to 19.1 you may need to fully remove OpenGapps by wiping /system and install e.g. MindTheGapps.


    There is NONE. If you have any issues or question ask in the thread so maybe someone else knows the answer.
    I'm just providing the ROM (Lineage 17.1 variant) I use myself for others to try to and just build the Lineage 18.1 ROM without much testing.
    If you prefer to use a more well-tested Android 11 ROM, I suggest to look at Havoc-OS.
    Contributions to the sources are welcome and likely get integrated into the next release.

    modpunk, derf elot, Rooted_Ansh, Flamefire, linckandrea
    Source Code: https://github.com/Flamefire/android_device_sony_lilac, Original: https://github.com/whatawurst/

    If you want to buy me a coffee/beer, I'll appreciate it but it is not necessary.
    Also please consider donating to the original authors too or to local charities as requested by @modpunk

    Special thanks to landsome for donating a test phone for bug hunting and development.

    ROM OS Version: Android 10/11/12
    ROM Kernel: Linux 4.4.x
    Based On: LineageOS
    GApps: None included, except for the MICROG builds. Recommended is OpenGApps for 17/18 and MindTheGapps for 19.


    • September security patches (backports from 18.1 to 17.1)
    • Kernel updates (CIP tag -st44)
    • August security patches (backports from 18.1 to 17.1)
    • Kernel updates (CIP tag -st43)
    • Increased headset volume
    • Add Sony camera app to 18 & 19 (files copied from xperiance)
    • July security patches (backports from 18.1 to 17.1)
    • Kernel updates (CIP tag -st42)
    • June security patches (backports from 18.1 to 17.1)
    • Kernel updates (CIP tag -st41)
    • Fix noise when calling with a headset
    • Configurable fingerprint sensor when screen is off (Settings->Lockscreen)
    • Fix Play Integrity checks --> Google Wallet works
    • Minor improvements that were missed earlier
    • May security patches (backports from 18.1 to 17.1)
    • Kernel updates (CIP tag -st40)
    • April security patches (backports from 18.1 to 17.1)
    • Kernel updates (CIP tag -st39)
    • March security patches (backports from 18.1 to 17.1)
    • Kernel updates (CIP tag -st38)
    • Fix possible camera issues on 18.1
    • February security patches
    • Kernel updates (e.g. CIP tag -st37, also add some missing patches to 19.1 kernel)
    • Use newer compiler (Clang 12.0.7) for kernel, possibly improving performance/battery life
    • Add "Re-apply Modem" setting to XperiaParts to help with connection/modem-crash issues
    • Clear some space on /system & /vendor partitions by removing files no longer needed
    • Fix Android Auto connection
    • January security patches
    • Kernel updates
    • MicroG builds added (build date 31st Jan, but same sources)
    • December security patches
    • AGPS fix (using Google servers)
    • Kernel updates (e.g. Wireguard v1.0.20220627, improved security against stack attacks)
    • November security patches
    • WLAN driver update
    • Huge APN update
    • October security patches
    • Kernel update
    • APN for DIGI HU
    • Option to switch temporarily to 2G on boot
    • September security patches
    • Kernel update
    • APN update
    • August security patches
    • Kernel update (CIP st20)
    • July security patches
    • Kernel update
    • June security patches
    • Kernel update
    • Backport fix for CVE-2021-39686
    • Workaround fixing bootloop with recent OpenGapps (20220503 tested)
    • May security patches
    • Fix mic volume issue with wired headsets
    • Known issue: OpenGapps after 15/2 result in bootloop
    • April security patches
    • Kernel update (CIP st5-tag)
    • Removed LineageOS updater (unused application here)
    • Added Sony identification packages (Compatibility for some Sony apps from other sources)
    • March security patches
    • Updated some carrier configs (mostly Indian&Chinese) for IMS (VoLTE...)
    • Better support for flip covers
    • Allow disabling battery optimizations for the SMS app
    • February security patches
    • Kernel 4.4.302 (final LTS kernel)
    • Re-enable VoLTE toggle switch (there were reports of modem crashes when VoLTE is disabled, can't reproduce this, hence added the setting back)
    • January security patches
    • Kernel 4.4.299
    • Wireguard v1.0.20211208
    • Enhanced display brightness range
    • Experimental Ultra-Dim mode
    • December security patches
    • Kernel 4.4.295
    • QCom driver updates
    • Fix some permission issues
    • Reset phone ID to XZ1C
    • November security patches
    • Kernel 4.4.291
    • Fix IMS on 17.1
    • Fix/enhance Wifi-Display
    • Fix some power hints
    • Update APNs
    • October security patches
    • Kernel 4.4.288
    • September security patches
    • Include some more security patches from AOSP
    • Clang 11 for LOS 17.1 version (same as 18.1, improved optimizations)
    • Misc bugfixes backported from Android 11 to Android 10
    • Kernel 4.4.283
    • August security patches
    • Fix bug with switch 3G->4G in XperiaParts not working on slow boot
    • Include some more security patches from AOSP
    • Kernel 4.4.279
    • July security patches
    • Kernel 4.4.275
    • June security patches
    • Update to Linux Kernel 4.4.272
    • Updated APNs
    I'm happy to announce the June update. Took a lot more work as I backported quite a bit to our kernel to fix CVE-2021-39686 although I'm not sure we were ever really affected by that. Anyway the backport fixes that hole and a few potential others making the device a bit safer!
    April updates are out, enjoy! Again I had to backport every security patch from 18.1 to 17.1 so it really seems to be dying...
    I might switch to building LOS 20 though as derfelot doesn't seem to be providing updates anymore. And especially the battery charge/protection service that might be coming there looks promising...

    Could you provide LineageOS recovery for this device?

    Sorry no. I'd need to research how to create that recovery and maintaining 3/6 different ROM versions is already enough work especially with the hugely increased time/effort to keep LOS 17, so I can't afford to do even more.
    @MarkMRL Update 20220516 is out which should also fix the headset issue. Reproduced, found and fixed it as far as I can tell.