[ROM] LineageOS 17.1/18.1 UNOFFICIAL - (Update: 2022-05-05)

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

  • Total voters
Search This thread


Senior Member
Jul 26, 2013
Sony Xperia XZ1 Compact
I tried that months ago and it worked flawlessly (also re-installed gapps on top). But no dirty downgrade.
@lossen1 I'd also think it should always work to upgrade and that likely gapps is the only issue, as there are different versions for Android 10 and 11, so maybe that (and something similar) are the only difficulties.
If I get really bored I'll try a dirty downgrade with reinstall of gapps and see if that works on the test phone (and also verify the dirty upgrade, but yeah, that seems to work).
But well, HD audio is next on my list first.
  • Like
Reactions: sieghartRM


Jul 12, 2010
Dirty flashed latest 18.1 and works nicely, thank you! But since 18.1 Gabeldorsche bluetooth stack from Developers options is not working for me (I said once it worked, but I lied by accident). Could someone try it out ? It gives faster connections.

Pasting here stack trace, as didn't found anything related in Google:

[12-07 20:22:12.874 5603:5645 F/libc]
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20 in tid 5645 (bt_stack_manage), pid 5603 (droid.bluetooth)

pid: 5603, tid: 5645, name: bt_stack_manage  >>> com.android.bluetooth <<<

      #02 pc 0000000000677830  /system/lib64/libbluetooth.so (bluetooth::os::Handler::Post(base::OnceCallback<void ()>)+36) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #03 pc 000000000066b824  /system/lib64/libbluetooth.so (bluetooth::security::pairing::ClassicPairingHandler::NotifyUiDisplayYesNo()+232) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #04 pc 0000000000672860  /system/lib64/libbluetooth.so (bluetooth::security::pairing::ClassicPairingHandler::OnReceive(bluetooth::hci::UserConfirmationRequestView)+3872) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #05 pc 000000000063bb4c  /system/lib64/libbluetooth.so (void bluetooth::security::internal::SecurityManagerImpl::HandleEvent<bluetooth::hci::UserConfirmationRequestView>(bluetooth::hci::UserConfirmationRequestView)+1524) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #06 pc 000000000063519c  /system/lib64/libbluetooth.so (bluetooth::security::internal::SecurityManagerImpl::OnHciEventReceived(bluetooth::hci::EventPacketView)+2564) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #07 pc 000000000066b464  /system/lib64/libbluetooth.so (bluetooth::security::channel::SecurityManagerChannel::OnHciEventReceived(bluetooth::hci::EventPacketView)+272) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #08 pc 000000000066ae40  /system/lib64/libbluetooth.so (void base::internal::FunctorTraits<void (bluetooth::security::channel::SecurityManagerChannel::*)(bluetooth::hci::EventPacketView), void>::Invoke<void (bluetooth::security::channel::SecurityManagerChannel::*)(bluetooth::hci::EventPacketView), bluetooth::security::channel::SecurityManagerChannel*, bluetooth::hci::EventPacketView>(void (bluetooth::security::channel::SecurityManagerChannel::*)(bluetooth::hci::EventPacketView), bluetooth::security::channel::SecurityManagerChannel*&&, bluetooth::hci::EventPacketView&&)+164) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #09 pc 000000000066ad64  /system/lib64/libbluetooth.so (base::internal::Invoker<base::internal::BindState<void (bluetooth::security::channel::SecurityManagerChannel::*)(bluetooth::hci::EventPacketView), base::internal::UnretainedWrapper<bluetooth::security::channel::SecurityManagerChannel> >, void (bluetooth::hci::EventPacketView)>::Run(base::internal::BindStateBase*, bluetooth::hci::EventPacketView&&) (.cfi)+60) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #10 pc 00000000005140c4  /system/lib64/libbluetooth.so (void base::internal::FunctorTraits<base::RepeatingCallback<void (bluetooth::hci::EventPacketView)>, void>::Invoke<base::RepeatingCallback<void (bluetooth::hci::EventPacketView)>, bluetooth::hci::EventPacketView>(base::RepeatingCallback<void (bluetooth::hci::EventPacketView)>&&, bluetooth::hci::EventPacketView&&)+176) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #11 pc 00000000006776e0  /system/lib64/libbluetooth.so (bluetooth::os::Handler::handle_next_event()+276) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #12 pc 0000000000678b08  /system/lib64/libbluetooth.so (bluetooth::os::Reactor::Run()+536) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #13 pc 00000000006795b8  /system/lib64/libbluetooth.so (bluetooth::os::Thread::run(bluetooth::os::Thread::Priority)+176) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

      #14 pc 000000000067962c  /system/lib64/libbluetooth.so (void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (bluetooth::os::Thread::*)(bluetooth::os::Thread::Priority), bluetooth::os::Thread*, bluetooth::os::Thread::Priority> >(void*) (.cfi)+68) (BuildId: a4dab97adc9f09d6aff0e7f11bca33ab)

uid=1002(bluetooth) crash_dump64 identical 2 lines

[12-07 20:22:13.513 861:861 E/Diag_Lib]
BluetoothDeathRecipient: Calling HAL close

[12-07 20:22:13.513 861:861 W/[email protected]_hci]

[12-07 20:22:13.514 1455:3166 W/BluetoothManagerService]
Profile service for profile: ComponentInfo{com.android.bluetooth/com.android.bluetooth.hfp.HeadsetService} died.

[12-07 20:22:13.515 1455:1774 I/ActivityManager]
Process com.android.bluetooth (pid 5603) has died: psvc PER

[12-07 20:22:13.515 1455:1455 D/BluetoothManagerService]
BluetoothServiceConnection, disconnected: com.android.bluetooth.btservice.AdapterService

[12-07 20:22:13.515 1455:1455 D/BluetoothManagerService]
BluetoothServiceConnection, disconnected: com.android.bluetooth.gatt.GattService

[12-07 20:22:13.515 1455:1500 E/BluetoothManagerService]

[12-07 20:22:13.516 1455:1774 W/ActivityManager]
Scheduling restart of crashed service com.android.bluetooth/.gatt.GattService in 1000ms for connection


Senior Member
Jul 24, 2015
Dirty flashed over old 17.1 version and works flawlessly. Thank you for supporting this aging device!


New member
Aug 6, 2010
My cheesy experience report 🧀🧂

ROM version: 18.1
Update: 2021-11-29

My phone was really getting old, and slow. My battery drained quickly, and I needed to reboot often to get it back to being speedy.

I wanted to install a new ROM for a long time, but was scared of having no phone. I was afraid to forget to backup stuff.

Then I had a good day. I said to myself, now I confront that anxiety!

So I set forth, and unlocked my bootloader. I got my phone into fastboot mode, only to find that I got greeted with a black screen and a blue LED lighting up. I was afraid - does it not work, did I do something wrong? But it was normal, that's how fastboot shows itself on this particular communicator.

So I unlocked, with old Sony's instructions, telling them my IMEI and getting an unlock code in return. I told the magic number to "fastboot oem unlock", only to find, it responded with silence.
I waited impatiently. Should I reboot the phone, should I pull the plug? I did not, and was rewared for my patience, with an acknowledgement after about 4 minutes. The phone was free.

I flashed the most recent TWRP recovery, and replied with an enthusiastic "success". The TWRP quest giver said, "this recovery might get replaced upon reboot!". I got afraid. I rebooted my phone, and saw, oh no, I can't boot my old installation anymore, it was the old nefarious stock ROM, reset to factory defaults!

There's no way back now I concluded.

Happily, I found that my phone does not replace its recovery upon reboot. I got into recovery by turning off my phone, and pressing the volume down and power levers of my magic telecommunicator.

Only to find that, now how do I get the ROM and gapps on the phone? Trying to get "adb" to work inside TWRP, I got greeted with a "no permissions" error. I concluded, this can't be a problem on Linux' part, as adb did work before with my old ROM.

The hardware method it was, swapping in and out the phone's microSD card, while being glad that this ancient phone still supports this technology.

It worked, it booted, I put the gapps zip file on the phone, rebooted into noble TWRP, installed gapps, rebooted. Only to find myself with permission errors from google services, which I could not grant.

Only later I realized, I need to install gapps before the first boot.

So I did. Hence it was recommended, "stock gapps" was what the decision fell on. Only to find that I got greeted with a black screen and only a back button during the first endeavour to provide the search giant with my data (maybe something like this).

I tried with gapps nano, I think, but my memory is covered in mist. I got greeted with a Wifi chooser, and only a non-working speech input and no other keyboard available. I could not provide the secret passphrase.

I tried again, wiping, flashing this worthy ROM, flashing gapps, this time pico. I tried these four steps a lot of times, swapping the microSD card in and out.

It worked.

I could provide the mighty "no longer don't be evil" giant all my belongings, as I usually do, and was presented with a way to restore my data and to access the Play merchant.

So now I needed to restore all my backups. This all worked. Mostly. Not really. But at least some of the time.

Whatsapp shouted: "I don't see your backup!". So I can't restore it. Fear set in. Will I lose years of message logs?

So I deleted Whatsapp again. And asked the "no longer don't be evil" giant for help, for one little-noticed result to explain, why the backed up data couldn't be found on Android 11 (https://android.stackexchange.com/a/241647).

It worked. The backup was discovered. Everything worked. Apart from spell checking. My phone is new again.

TLDR: thanks a lot to all the creators of this ROM! Paying with NFC is working. Battery life has improved. Everything feels a lot faster. I have a lot of fun using my old phone again, with Android 11, without putting a strain on the environment. Also I did not have to spend money to buy a new phone, to get security updates that are newer than 2019, for phone that was first released in 2017.
  • Like
Reactions: fr_jr and moofesr


Senior Member
Jul 26, 2013
Sony Xperia XZ1 Compact
Quick update on HD audio: It works with no modifications required!

The new android and/or LOS has "Mono-Audio" in the accessibility options enabled by default. This disables the direct output of HD sounds and forces it to use the "deep buffer" which only supports 48k sound.
Solution: Disable that in accessibility options. Done.


Senior Member
Nov 16, 2017
Quick update on HD audio: It works with no modifications required!

The new android and/or LOS has "Mono-Audio" in the accessibility options enabled by default. This disables the direct output of HD sounds and forces it to use the "deep buffer" which only supports 48k sound.
Solution: Disable that in accessibility options. Done.
Where i can found accessibility options?


Jul 3, 2015
Basically a failed cherry-pick of the WFD changes from 18.1 to 17.1 branch. It simply does not apply there and leads to bootloops for reasons I didn't further investigate. As derfelot confirmed that those are not required for 17.1 I stopped there.
The other issue was caused by my patches for SafetyNet which lead to a mismatch of the security dates leading to the system unable to decrypt data which made it stop booting.

On 18.1 there were issues with WFD on yoshino-phones which derfelot fixed. Also the EAS sheduler relies on "power hints" to know how much power for which information is required. Some of those were decimal instead of hexadecimal, i.e. to high maybe leading to slightly higher battery consumption.
Thank you very much for your detailed reply. I confess that a lot of this is over my head, however it's still interesting to read/research about.

As always, many thanks for continuing to update and improve this great little phone!

Seasons greetings to you!
December patches are out, update is in work, currently testing 17.1, looks good so far.
Will also check for the gabeldorsche issue on 18.1 and I have a little extra change in preparation. I hope I get that working... ;)
First of all, Thank you for keeping building roms!

I have a lilac laying around which I don't need as my daily driver ATM, so if it helps I could test something for you.

By the way I am very excited in los 19 ;-).

Thanks in advance


May 8, 2016
Hello, i'm running the September version of 18.1 LOS for this device. Now i want to update with the November or December version. I can't do an online update with the "Updater" in settings. Do i have to flash with TWRP or is there an easier possibility to update?


Senior Member
Aug 6, 2015
Hello, i'm running the September version of 18.1 LOS for this device. Now i want to update with the November or December version. I can't do an online update with the "Updater" in settings. Do i have to flash with TWRP or is there an easier possibility to update?
Yeah, you need to flash the new .zip with TWRP, but you don't have to wipe anything. Its perfectly fine to flash the .zip over your current build and you shouldn't lose any data.

That being said, this build is incredibly stable and has been for years. Is there anything we can do to get the XZ1C officially supported on the LineageOS website (https://download.lineageos.org/) so the built-in update feature could work as intended? They currently have both the Z3 Compact and the XZ2 Compact listed as "officially" supported. The XZ1C deserves a spot on that list as well!

  • Like
Reactions: jmbattle


Senior Member
Jul 26, 2013
Sony Xperia XZ1 Compact
Getting the device officially supported comes with a few rules. Eg a commitment to support it for a while and not messing with stuff related to eg safetynet.
As I initially wrote I can't promise how long I'll be able to support it and for me being able to use GPay is a must as I guess is for quite some others too. Official LOS will never pass safetynet without extra tools. And I think they will only build one version anyway... So likely only 18.1. Also some of my patches to fix a few tricky things will likely also not be accepted.
So just having the In-build updater and the entry in some list isn't really worth giving up the freedom (and features) I have now ;)
So yeah, manual download and install via twrp. If you flashed twrp then this is really easy. :)


May 8, 2016

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    @MarkMRL Update 20220516 is out which should also fix the headset issue. Reproduced, found and fixed it as far as I can tell.
    I noticed that the gpu driver which the rom comes with it is fairly old- version 332(or somewhere around these numbers) from 2018. Is there any reason why it comes with that exact version? I manually updated it to 472 and it seems to work normally(also tried 490 but screen recording was broken on it).
    TBH: Not really sure which driver you refer to. Where did you get the version from and how exactly did you update it?

    I mostly rely on the LineageOS stuff and previous work by modpunk (list of proprietary blobs...) and just keep an eye on the ASBs to make sure at least the open-source patches are included. Hard enough already ;)
    @MaRtYy01 As for the driver: Yes it seems we have one with OpenGL [email protected] from 2018. I found some v9a binary blobs directly from Sony (for their open-source efforts) with [email protected] from Sept. 2019. Not sure if a newer driver is worth risking issues. I mean: What could be gained by that? But I may try that for the May builds if I got time.
    I finally got around to do the April updates and am uploading them now. So not changing that ;-)
    From here, installing it is systemless with magisk so it was worth a shot I guess. Tried all 4 versions for sd835 and none works without bugs so yeah.. it was worth a shot I guess. Idk, maybe the sony camera requires the driver that comes with the rom.
    It probably has something to do with the stock sony camera. Im using 19.1 and have no issues with the latest driver.

    Edit:taking photos doesnt work
    I went back to 19.1 in the meantime, but yesterday I also tried 18.1, and it had the same issue. Can I test the same thing by flashing the boot.img from 18.1 on 19.1?
    I can at least reproduce the "hearing own voice", will check if it happens on the older version too and then try to find what caused it. Not sure if that is possible though.
    Anyway: The 18.1 kernel does not work on 19.1, so NO don't try ;-)
  • 49
    LineageOS 17.1/18.1 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.1)


    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.
    REQUIRED FIRMWARE: 47.2.A.11.228

    I only test the 17.1 releases myself. The 18.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". Do not 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 for LineageOS 17.1
    TWPR 3.5.0-0 by derf elot for LineageOS 18.1
    Or use the latest TWRP from https://twrp.me/sony/sonyxperiaxz1compact.html.

    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.


    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
    ROM Kernel: Linux 4.4.x
    Based On: LineageOS


    • 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 updated the ROM with the January security patches. I also included the "Ultra Dim" QuickSettings tile to reduce the screen brightness (overall). But that is experimental. I'm thinking about including that in the range of the brightness, i.e. make the lowest brightness levels less. Problem is that there are only 255 values possible so I have to define a switch-over point somehow and distribute those 255 values over effectively 2 distinct ranges. Let's see...

    I also added Google Drive downloads temporarily as a backup if AFH fails again...
    @MarkMRL Update 20220516 is out which should also fix the headset issue. Reproduced, found and fixed it as far as I can tell.
    Updates are out!
    Gabeldorsche seemingly works on my test phone, so maybe some upstream change already fixed it.

    Anyway, wish you all an (early) Merry Christmas and Happy New Year!