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

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


  • Total voters
    161
Search This thread

Flamefire

Senior Member
Jul 26, 2013
209
448
Sony Xperia XZ1 Compact
LineageOS 17.1/18.1 for Sony Xperia XZ1 Compact

logo.png


RELEASE

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.

FEATURES
  • 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)

DOWNLOAD

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

IMPORTANT:
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

INSTALLATION

IMPORTANT:
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.

SUPPORT

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.

Contributors
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
 
Last edited:

Flamefire

Senior Member
Jul 26, 2013
209
448
Sony Xperia XZ1 Compact
CHANGELOG


2022-05-16

  • May security patches
  • Fix mic volume issue with wired headsets
  • Known issue: OpenGapps after 15/2 result in bootloop
2022-05-03
  • 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)
2022-03-20
  • 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
2022-02-20
  • 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)
2022-01-23
  • January security patches
  • Kernel 4.4.299
  • Wireguard v1.0.20211208
  • Enhanced display brightness range
  • Experimental Ultra-Dim mode
2021-12-19
  • December security patches
  • Kernel 4.4.295
  • QCom driver updates
  • Fix some permission issues
  • Reset phone ID to XZ1C
2021-11-29
  • November security patches
  • Kernel 4.4.291
  • Fix IMS on 17.1
  • Fix/enhance Wifi-Display
  • Fix some power hints
  • Update APNs
2021-10-19
  • October security patches
  • Kernel 4.4.288
2021-09-18
  • 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
2021-08-11
  • 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
2021-07-20
  • July security patches
  • Kernel 4.4.275
2021-07-03
  • June security patches
  • Update to Linux Kernel 4.4.272
  • Updated APNs
 
Last edited:

Dean F

Senior Member
Sep 12, 2016
176
86
Taipei
Sony Xperia XZ1 Compact
Thank you so much!! Can anyone report to me if flashing the new 18.1 directly over the previous version of 18.1 works?

I would test myself, but right now I cant afford to need to totally reset my phone if it doesn't work.
 

landsome

Senior Member
May 4, 2015
487
121
Thank you so much!! Can anyone report to me if flashing the new 18.1 directly over the previous version of 18.1 works?

I would test myself, but right now I cant afford to need to totally reset my phone if it doesn't work.
All I can say dirty flashing works well over the latest/previous 17.1 by Flamefire, which in turn works well over the latest modpunk (1.7). So it's worth a try.

More generally, although these ROMs are hardly as well tested as HavocOS, there are satisfied reports over on the original LOS17.1/18.1 thread.
 
  • Like
Reactions: MilesBHuff

rez78

Senior Member
Nov 16, 2017
135
27
Thank you so much!! Can anyone report to me if flashing the new 18.1 directly over the previous version of 18.1 works?

I would test myself, but right now I cant afford to need to totally reset my phone if it doesn't work.
Dirty flash from 17.1 to 18.1 and all work fine!
 

landsome

Senior Member
May 4, 2015
487
121
Updated with the July security patches.
Note: AndroidFileHost was quite quirky today, so use the md5sum files to verify the integrity of the files
Thanks. Tried it for a couple of hours - dirty flashed over the 0702 version - and it works just as well so far.

I had one brief moment of panic: upon first boot the phone was stuck right on hitting the desktop for some 10 seconds (did not happen on the many previous dirty flashes); but then everything proceeded well.

Again, great work.
 

7alvoo

Senior Member
Jul 18, 2019
155
50
@Flamefire Regarding the information to TWRP: There is an official TWRP version (maintained by @modpunk & @derf elot ): https://twrp.me/sony/sonyxperiaxz1compact.html :)
Maybe you can update the information in your header.
Your suggestion would be valuable if you share your experience:
- encrypted partition mount and decryption compatibility with LineageOS 17.1/18.1
- partition backup / restore - single / batch - with / without password protection
- other version differential bug report
 
Last edited:

Dean F

Senior Member
Sep 12, 2016
176
86
Taipei
Sony Xperia XZ1 Compact
Im running 18.1 ROM now and its working great. It works so much better than the previous January release, because the network connects properly now after restarting. There is no need to fiddle in the settings to switch to 3G, then switch back to 4G.

I really like it.
 
  • Like
Reactions: andacro and rez78

xenonism

Senior Member
Dec 20, 2010
172
52
Sony Xperia XZ1 Compact
Ok, I was bored and I made a mess, I could use some help. :(

I was on the latest and last 17.1 by modpunk. I updated TWRP to the latest official one. I tried to flash the latest 18.1 by Flamefire (I had to disable zip signature verification. I know :censored:). Upon reboot it spends about a minute on the LOS animated logo then reboots to TWRP. I then downgraded TWRP to the latest by modpunk and flashed his latest 18.1 from January. This bootloops to recovery without ever reaching the LOS logo.

I know this is my fault. This said, what's my best chance (if any) not to have to wipe everything? I read in a post above that downgrading from 18.1 to 17.1 won't work, otherwise that would be my next idea.

Thanks in advance to anyone replying! :)

EDIT: Silly me. I had just forgotten to flash 11.0 gApps. All is well with the dirtiest flash ever. :p
 
Last edited:

baboon23

Senior Member
Apr 9, 2020
149
38
OUTSTANDING!
Thanks for bringing life to this amazing work, you are the best!
Much appreciated.
 

mstrnemo

Senior Member
Feb 1, 2021
146
15
@Flamefire

Im confused so u continue with updating the security patches every month correct ?
Im confused about the 18.1 u also only update it with securitypatches or also other stuf like making stable and fixing problems orwhatnot ?

Thank you for keeping our trusty xz1 compact alive a little longer.
 

7alvoo

Senior Member
Jul 18, 2019
155
50
It was not possible to boot LOS 17.1 with TWRP version from first post. (fresh flash, etc... ) However when using latest official twrp https://twrp.me/sony/sonyxperiaxz1compact.html everything works well.
Does it respond to volume up button presses and in special system restart recovery mode? Prompts for a pin/pattern during login and successfully mount and decrypt the partition? So far no one else has reported using it and so far we knew 17.1 / 18.1 requires a different version. Your experience will help us a lot please share as much experience as possible about the new twrp.
 
Last edited:
Does it respond to volume up button presses and in special system restart recovery mode? Prompts for a pin/pattern during login and successfully mount and decrypt the partition? So far no one else has reported using it and so far we knew 17.1 / 18.1 requires a different version. Your experience will help us a lot please share as much experience as possible about the new twrp.
i forgot to mention - i'm using lineage-17.1-20210702-UNOFFICIAL-lilac.zip build (not the latest ..20210720..)
TWRP version 3.5.2_9.0
Magisk 20.4 -> 23
Entering recovery works well, pwr+vol down, vol up after pwr, or when set in Developer submenu - advanced reboot. I have active pin and fingerprint. When entering recovery, twrp asks for password for user 0, using my pin works and twrp decrypts FBE. i can mount and read user data by File Manager in twrp.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    @MarkMRL Update 20220516 is out which should also fix the headset issue. Reproduced, found and fixed it as far as I can tell.
    4
    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 ;)
    4
    @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 ;-)
    2
    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
    1
    Do You have any plans to make Android Auto working?
    I haven't tried it but maybe a solution for this can be flamegapps in a separate addons package solution.
  • 49
    LineageOS 17.1/18.1 for Sony Xperia XZ1 Compact

    logo.png


    RELEASE

    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.

    FEATURES
    • 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)

    DOWNLOAD

    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

    IMPORTANT:
    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

    INSTALLATION

    IMPORTANT:
    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.

    SUPPORT

    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.

    Contributors
    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
    19
    CHANGELOG


    2022-05-16

    • May security patches
    • Fix mic volume issue with wired headsets
    • Known issue: OpenGapps after 15/2 result in bootloop
    2022-05-03
    • 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)
    2022-03-20
    • 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
    2022-02-20
    • 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)
    2022-01-23
    • January security patches
    • Kernel 4.4.299
    • Wireguard v1.0.20211208
    • Enhanced display brightness range
    • Experimental Ultra-Dim mode
    2021-12-19
    • December security patches
    • Kernel 4.4.295
    • QCom driver updates
    • Fix some permission issues
    • Reset phone ID to XZ1C
    2021-11-29
    • November security patches
    • Kernel 4.4.291
    • Fix IMS on 17.1
    • Fix/enhance Wifi-Display
    • Fix some power hints
    • Update APNs
    2021-10-19
    • October security patches
    • Kernel 4.4.288
    2021-09-18
    • 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
    2021-08-11
    • 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
    2021-07-20
    • July security patches
    • Kernel 4.4.275
    2021-07-03
    • June security patches
    • Update to Linux Kernel 4.4.272
    • Updated APNs
    14
    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...
    12
    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!
    11
    Currently uploading the new builds. Gonna take a bit...
    The 18.1 version seemingly works, passes SafetyNet etc. but as usual, I don't really test that version although I can now say that it flashes clean over the previous release and boots fine. Thanks to the test phone by @landsome
    I tested the 17.1 version the same way: Flash over previous release, boot and SafetyNet is working. However I'll flash that on my own phone tomorrow and test it a bit more "in production". Hence you'll find that in the "Testing Only" folder on AFH until I verified it a bit more. No time left for that today but if you want to give it a try feel free.
    As mentioned I fixed the IMS bug on 17.1 and on my phone (October build with only that patch applied) VoLTE and VoWIFI work fine.

    As for GPS: The XZ1C has known hardware issues with the GPS antenna. The ROM if flashed correctly works ok although I noticed that GPS is shaky too. Some users reported that squeezing the left edges often helps...

    I'll tackle the HD audio stuff later. That needs some more work to do it properly.

    Donations: See the initial post and my profile (About section). Always welcome and keeps me motivated to put in a bit of extra effort :) Please note that I often integrate changes from others, like modpunk/derfelot, linckandrea etc. On Github you can usually see that as "authored by X, committed by Flamefire" as I try to keep the author unchanged. So others deserve credit (and donations) too.