• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

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

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


  • Total voters
    128
Search This thread

Flamefire

Senior Member
Jul 26, 2013
184
344
Sony Xperia XZ1 Compact
After updating to the September 18th version of 18.1 I've found that Chromecast no longer works on this device. The Cast device search works correctly but hangs upon actually trying to connect. Tried with an original release Chromecast and a Chromecast Ultra, and they both exhibit the same issue. It was working on the August 11th version of 18.1.

Can anyone reproduce this issue? Is Casting working for you on the September 18th version of 17.1 @Flamefire ? In any other situation, I would just downgrade, but my retinas are very grateful that the Sony logo is dimmed on the phone's startup now and I don't know if I can go back lol
I don't have a chromecast to test and no idea where to start looking for the issue... Is there anything in the logcat that may hint at the issue? Maybe compare the output for the working and broken version to see if that turns up anything.

In any case I just built the October update for 17.1 which caused some trouble with getting CTS/Safetynet to pass. Trying the same on the 18.1 build now and will upload that later. Would need someone to test the 18.1 version anyway to check if safetynet passes there as well. And maybe the chromecast issue is also resolved there already. Could be something from Lineage upstream which they may have fixed there.
 

PhobiaSoft

Senior Member
Aug 6, 2015
81
35
www.youtube.com
I don't have a chromecast to test and no idea where to start looking for the issue... Is there anything in the logcat that may hint at the issue? Maybe compare the output for the working and broken version to see if that turns up anything.

In any case I just built the October update for 17.1 which caused some trouble with getting CTS/Safetynet to pass. Trying the same on the 18.1 build now and will upload that later. Would need someone to test the 18.1 version anyway to check if safetynet passes there as well. And maybe the chromecast issue is also resolved there already. Could be something from Lineage upstream which they may have fixed there.
Excellent! I'd be happy to test both Casting and Safetynet for the October version of 18.1 for you. Sounds like I may be re-flashing August anyway if I can't get this worked out, so its not like I'm risking much :p Shouldn't be a problem to dirty-flash a version with an earlier build date, right? I wouldn't think TWRP would care.

In terms of the Chromecast issue, this is my only device running LineageOS, so there is a possibility that Google pushed an update to Chromecast devices that make them incompatible with this ROM in some way, that coincidentally took place around the time I updated to September. I hope I'm wrong of course, but since these things have to be connected to Wi-fi to function, they are constantly auto-updating. Point being, it may have nothing to do with any changes made between August and September, and everything to do with Google's own agenda. Regardless, I'll come back and update this post after trying to Cast on both October's and August's version, and hopefully narrow down the issue.

(Feel free to send me an email or DM with your beta version of October 18.1, if you don't want to release the untested verion publically yet @Flamefire and I'll test Safetynet immediately)


EDIT: Reflashing the September 18th version of 18.1 fixed the issue, so it was likely a TWRP error of some kind that caused my problem, and not anything wrong with this version of the ROM. All is well now :)
 
Last edited:

jmbattle

Member
Jul 3, 2015
18
3
After updating to the September 18th version of 18.1 I've found that Chromecast no longer works on this device. The Cast device search works correctly but hangs upon actually trying to connect. Tried with an original release Chromecast and a Chromecast Ultra, and they both exhibit the same issue. It was working on the August 11th version of 18.1.

Can anyone reproduce this issue? Is Casting working for you on the September 18th version of 17.1 @Flamefire ? In any other situation, I would just downgrade, but my retinas are very grateful that the Sony logo is dimmed on the phone's startup now and I don't know if I can go back lol
I'm also using the September 18th build of 18.1, however I don't have any problems casting to my Chromecast with Google TV or Google Home Mini.
 

PhobiaSoft

Senior Member
Aug 6, 2015
81
35
www.youtube.com
I'm also using the September 18th build of 18.1, however I don't have any problems casting to my Chromecast with Google TV or Google Home Mini.
I should clarify. I'm specifically trying to Cast screen mirroring via the quick-settings notification pulldown to dedicated Chromecast devices (those little $50 things that hang out of HDMI ports). Unfortunately I don't have a Google TV or Google Home to test with. Does screen mirroring work for you in this case?


EDIT: Reflashing the September 18th version of 18.1 fixed the issue, so it was likely a TWRP error of some kind that caused my problem, and not anything wrong with this version of the ROM. All is well now :)
 
Last edited:

jmbattle

Member
Jul 3, 2015
18
3
I should clarify. I'm specifically trying to Cast screen mirroring via the quick-settings notification pulldown to dedicated Chromecast devices (those little $50 things that hang out of HDMI ports). Unfortunately I don't have a Google TV or Google Home to test with. Does screen mirroring work for you in this case?
Yes, I tried screen mirroring, playing audio, and showing images in Google Photos - basically, all of the cast functions work fine on my XZ1C.

I do have an older 1st gen Chromecast somewhere, if you'd like me to test it.
 

PhobiaSoft

Senior Member
Aug 6, 2015
81
35
www.youtube.com
Yes, I tried screen mirroring, playing audio, and showing images in Google Photos - basically, all of the cast functions work fine on my XZ1C.

I do have an older 1st gen Chromecast somewhere, if you'd like me to test it.
That would be really helpful if you don't mind. Not sure where to start troubleshooting but it would be nice for this project if this problem is somehow exclusive to me.


EDIT: Reflashing the September 18th version of 18.1 fixed the issue, so it was likely a TWRP error of some kind that caused my problem, and not anything wrong with this version of the ROM. All is well now :)
 
Last edited:
  • Like
Reactions: jmbattle

Flamefire

Senior Member
Jul 26, 2013
184
344
Sony Xperia XZ1 Compact
Excellent! I'd be happy to test both Casting and Safetynet for the October version of 18.1 for you. Sounds like I may be re-flashing August anyway if I can't get this worked out, so its not like I'm risking much :p Shouldn't be a problem to dirty-flash a version with an earlier build date, right? I wouldn't think TWRP would care.


(Feel free to send me an email or DM with your beta version of October 18.1, if you don't want to release the untested verion publically yet @Flamefire and I'll test Safetynet immediately)
I uploaded the new versions. If you could give the 18.1 a try and check if safetynet passes it would be great. If it does not send me the output of `adb shell getprop` and I'll rebuild with a fix as required.
See https://androidfilehost.com/user/?w=settings-dev-files&flid=327069 for the download
 

rez78

Senior Member
Nov 16, 2017
111
22
Hi. I've updated to latest build,but "terminal" app is disappeared from developer option! Why?
 

PhobiaSoft

Senior Member
Aug 6, 2015
81
35
www.youtube.com
I uploaded the new versions. If you could give the 18.1 a try and check if safetynet passes it would be great. If it does not send me the output of `adb shell getprop` and I'll rebuild with a fix as required.
See https://androidfilehost.com/user/?w=settings-dev-files&flid=327069 for the download

Gave the October build of 18.1 a test tonight, and everything passed with flying colors @Flamefire !

It also fixed Chromecasting for me. Obviously this made me suspicious that the September build of the ROM was in fact ever my problem. Between that and @jmbattle 's reports that Casting was working for him on the Sept build, I became curious and decided to also reflash the Sept build of 18.1 as a test, and suddenly I had no problems Casting either. So clearly it was some sort of flashing mistake on my part and nothing wrong with your build. I apologize for wasting your time, I should have tested a reflash of the same build first and foremost. I've edited all of my posts discussing my Casting issue to reflect the new information, and for the benefit of anyone else who may have the problem in the future.

(I even make sure to always use the md5sum file when I flash, go figure)

Anyway, here's some screenshots of the October 18.1 build passing SafetyNet correctly! I tested it with a tester app, and also with Pokemon Go, which I've always found to be particularly strict. Looks like you're got another successful build on your hands, my friend. Thanks again.

Screenshot_20211020-181928_Updater.png Screenshot_20211020-182004_SafetyNet_Test.png Screenshot_20211020-181847_Pokémon_GO.png Screenshot_20211020-181914_Pokémon_GO.png
 
Last edited:
  • Like
Reactions: jmbattle

paulquappe

Member
Apr 24, 2018
19
2
I just noticed that it says in the settings "android security patch level 1 September 2019". I checked that for September and October build an it is for both the case.
Is it just showing the wrong security patch level?
I can remember that in earlier builds, it showed the correct date of the month before the build, it was already something like "July 2021".
 

7alvoo

Senior Member
Jul 18, 2019
138
40
I just noticed that it says in the settings "android security patch level 1 September 2019". I checked that for September and October build an it is for both the case.
Is it just showing the wrong security patch level?
I can remember that in earlier builds, it showed the correct date of the month before the build, it was already something like "July 2021".
All date perfect, no any mistake.
 
  • Like
Reactions: PhobiaSoft

lossen1

Member
Jul 23, 2009
10
1
Hi, is dirty flashing from 17.1 to 18.1 still possible? For example from 17.1-20210918 to 18.1-20211019.
 

Flamefire

Senior Member
Jul 26, 2013
184
344
Sony Xperia XZ1 Compact
I just noticed that it says in the settings "android security patch level 1 September 2019". I checked that for September and October build an it is for both the case.
Is it just showing the wrong security patch level?
I can remember that in earlier builds, it showed the correct date of the month before the build, it was already something like "July 2021".
You are looking at the security patch level for the vendor. This is basically the level of updates from the Sony ROM which we use to access the hardware etc. And as Sony stopped updating in 2019 the vendor security patch level is correctly1 Sept, 2019. The Android security patch level is that of the release and basically includes the patches for Android itself and the kernel. That is updated to the most recent with every release. Obviously we cannot update the vendor security patch level as we don't have the sources for the Sony blobs.
So there are 2 patch levels in the options and one is 1 September 2019 and the other 1 October 2021
 
  • Like
Reactions: sieghartRM

Flamefire

Senior Member
Jul 26, 2013
184
344
Sony Xperia XZ1 Compact
Hi all, just a quick info from me and a question: As I already wrote I'm still using LOS 17.1/Android 10 as it allows using the Sony camera which Android 11 does not and the benefits of Android 11 compared to 10 are not worth the switch for me.
However with the recent release of Android 12 switching to that becomes worth it due to various improvements over those 2 versions.
However porting a new LOS to a that device isn't easy and requires quite some testing (and I can't even promise I'll succeed)
So in order to keep supporting multiple LOS/Android versions I'd need a spare device for testing.

Hence I'm asking if anyone would be able to donate an XZ1C to me for that. Maybe someone knows someone who has an unused phone, maybe with cracked screen but otherwise working or one which isn't used anymore. Again: I can't promise anything in exchange and I know the XZ1C is still such a good phone that prices aren't exactly low. So this is really meant as an outreach to the community in case anyone has somehow access to an unused phone which I can use for testing and see what I can do with that.
Of course you can tell me which LOS version you use yourself and I'll try and take a bit of extra effort to support that as long as I can.

Thank you all for your support and the nice words here which motivate me to put in that extra effort to provide you with a ROM that works on more than only my device and even one I don't even use myself!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    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...
    7
    The value is not persistent, though, and resets after reboot. @Flamefire do you have an idea how to set it at boot time? (I used to run a script as root, but since my banking app disallows root I don't use Magisk anymore).
    I'm adding a quick settings tile for that. This will basically toggle between normal brightness and reduced brightness (basically scaling the value of the brightness slider)
    I found Android 12 has a similar setting called "Extra Dim" which basically applies a filter to reduce brightness. So I'm reusing their icon and calling it "Ultra-Dim" ;-) If you got a better name, tell me. Will be in the next release together with a self-written LED driver that uses the whole range of the LCD brightness, i.e. it can go lower than stock even without that setting. But not as much as Ultra-Dim does (which likely also saves more battery than the "Extra Dim" from A12)
    5
    Let us know if you manage to work this into the ROM. It seems weird to me that you have a maximum setting that also changes the lower value, since everything is proportional to the max value. Maybe you can set currentStepPercent to go over 100%, or so some other hack so the whole range can be set by the slider. (If I understand this correctly.)
    Checked everything and I don't really see a way. It is quite complicated already. What I found: `echo 1 > /sys/class/leds/wled/brightness` can set the brightness lower than android, which for some reason uses 34 as the minimum but I can't find where this comes from. The config files and everything look good.
    This is still brighter than with fs_curr_ua=5000, but at least doesn't limit the max brightness. And no, fs_curr_ua is a hardware maximum. So no way to turn it to 11 ;) I see if I can add an option to turn down overall brightness, but I don't think it is a good idea.
    Also, I actually found a bug I think, because the reader is also activated on pressing the power button to turn OFF the screen. Just before turning off the display it activates the fingerprint reader, seeing by all kinds of messages from libfingerprint_core.
    I think this is caused by the setting which is left to "on". I guess one of the potential issues of having this enabled (and in the kernel) could be that locking the phone with the power button could unlock it again. Another reason not to do that...
    3
    For now I think it would be great for virtually endless support if we could get something like this working (LineageOS GSI by @AndyYan). Or otherwise the release by @phhusson here on which the former is based. Perhaps then just add the requirement of flashing some patches based on the current release from this thread for the XZ1C's idiosyncrasies and we're good to go?!

    Any thoughts about this? Especially from @Flamefire?
    FWIW: A while ago I updated my device tree repo with literal step-by-step instruction how to build this ROM. The `repo sync` will pull in all LOS changes (i.e. framework/core-Android updates) automatically. Only issues will be changed things related to vendor blobs, like e.g. the camera app that stopped working on 18.1 due to changes in framework. (BTW: I'm currently working on this. If I could only understand how to make a single app use a different VNDK version I could make the camera app work on 18.1). Other issues can occur due to SELinux changes and such, but all of my work is open source, even the patches I developed. So if I get hit by a meteor someone else can take over providing updates ;-)
    Of course updating the Kernel and CAF modules is still something that needs to be done manually when updating the ROM.

    About the GSIs: Not fully sure how they work. I guess they basically replace the /system partition while leaving /vendor untouched. Hence I assume everything copied from Stock to /system will be removed which is the reason for the issues you see. I.e. everything listed in `proprietary-files.txt` got to be checked and things to be kept for GSIs moved to the vendor partition so it "survives" GSI updates. Might be possible, but I'd need confirmation that this will be really enough before doing that work.
    Also note that all the added goodies from this ROM will be gone, e.g. SNet fix, and would need other methods to achieve that.
    3
    Screen brightness
    The value in the file
    Code:
    /sys/devices/soc/800f000.qcom,spmi/spmi-0/spmi0-03/800f000.qcom,spmi:qcom,[email protected]:qcom,[email protected]/leds/wled/fs_curr_ua
    sets the LED current in uA of the background illumination. It defaults to 17500.

    By writing a lower value, one can achieve a decreased minimal brightness, which is easier on the eyes when reading at night. I found a value of 5000 to be fine:
    adb shell "echo $VALUE > $FILE"

    The maximum brightness with this setting also is sufficient when outside, I think.

    The value is not persistent, though, and resets after reboot. @Flamefire do you have an idea how to set it at boot time? (I used to run a script as root, but since my banking app disallows root I don't use Magisk anymore).

    Beware that values below 2500 turn the LEDs off, so without an adb connection, you'd need to hard reboot the phone.
    To be correct: It sets the maximum current in µA of the LEDs, as can be seen by in the kernel sources
    So the currently used current (and hence brightness) is then (likely, the code is hard to follow): `currentStepPercent * fs_curr_ua` where `currentStepPercent` is the percentage of the current brightness step, i.e. where the slider is proportional to the max value and likely capped to a min-value. There doesn't seem to be a way to control this setting from Android as it seems the brightness level is (fully) kernel controlled.
    So changing this setting will yield an overall reduced brightness! I'll double check if I can maybe extend a setting or otherwise change the minimum brightness only.

    Anyway: This issue has made me find an actual bug in the kernel code which I resolved. Probably nothing major or noticeable at all, but still a bug ;)

    Oh and if you want to change it manually persisting reboots (but not updates), see https://forum.xda-developers.com/t/lower-the-default-minimum-brightness.3938897/ which looks like it will work to me.
  • 42
    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

    Put the zip file of the ROM on you sdcard or internal store and boot into recovery.
    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.

    KNOWN ISSUES
    • UnifiedNlp doesn't work with LineageOS 18.1 yet
    • Spell checking doesn't switch if you change keyboards
    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
    16
    CHANGELOG


    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
    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.
    9
    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...