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

antoniu200

Senior Member
Oct 3, 2016
77
8
Zalău
I'm back with my last questions before installing this ROM.

I know the volume keys no longer control the ringtone by default. Is this option implemented? If not, is it possible you implement a toggle in the Settings app for it?

Also, the settings shortcut from the notification menu only appears after pulling on it twice, just like in Android 5 and 6. In Android 7 and 8, it appeared in the first pulldown. Is there any way to change that to the way it used to be? That feature was very useful to me.

Edit: Regarding the volume keys, I'd rather use a native solution that VolFix, since that shows 2 volume controls at the same time and needs to start up alongside the OS, making the boot process slower.
 

PhobiaSoft

Senior Member
Aug 6, 2015
81
35
www.youtube.com
I may have found a solution for the display brightness. However that may affect notification light. Does anyone know a good app to test the notification light? I.e. different colors, blinking, ...
Before I had LineageOS, I used to use this app to manage the LED light, it does let you test colors/brightness without the need of an actual notification present if I remember correctly.
 

claudiobar

Senior Member
Oct 21, 2014
127
30
I have just discovered that the newest version of modded Gcam Go (by Darkness, available on celsoazevedo) works pretty well with LOS17.1 and - judging by my XZ2c - probably with 18.1 as well. So if I decide to make the jump to 18.1 on XZ1c, are there still clear benefits?

I remember battery was palpably better on 18 (and that's important to me), but what about the rest of the benefits? Conversely, any things I will miss (except for the stock camera).
Hi there, I'm interested in installing Google cam so I wanted to try this, but I can't find such a modder in the page.. if gcam is working well on your phone, could you provide a link or more data about the version you installed?
Any clear advantages/disadvantages Vs opencamera or snap? (Or, any other camera that you've tried works better than these ones?)
Thanks in any case, regards!
 

landsome

Senior Member
May 4, 2015
445
115
Hi there, I'm interested in installing Google cam so I wanted to try this, but I can't find such a modder in the page.. if gcam is working well on your phone, could you provide a link or more data about the version you installed?
Any clear advantages/disadvantages Vs opencamera or snap? (Or, any other camera that you've tried works better than these ones?)
Thanks in any case, regards!
I does not work on LOS 10 and 11. Try some of the SODP mods on XDA, it might (still) work on some of them.
 
  • Like
Reactions: claudiobar

paulquappe

Member
Apr 24, 2018
19
2
I may have found a solution for the display brightness. However that may affect notification light. Does anyone know a good app to test the notification light? I.e. different colors, blinking, ...
You can also test the led in the phones settings (at least in 17.1) but it is well hidden.
Go to "Apps & Benachrichtigungen" > "Benachrichtigungen" > "Benachrichtigungs-LED" or simply search for LED in settings. Then activate "App-Anpassungen", go on the + in the top right corner and choose any App. Now you can tap on the chosen app on the bottom of the menu and test different colors and blinking speeds and durations while the LED is showing your settings.

Actually I've been there a lot because I always had issues with the dimming of the LED not working at all. So I used some custom colors with lots of black to make the led dimmer...
 

oppenbot

Member
Oct 16, 2017
6
2
Thanks alot for keeping this phone alive, Flamefire. I flashed 17.1-20211219 some days ago and everything is working fine so far despite VoWiFi: I enabled the "IMS Features" from the Xperia Parts menu and after a reboot, it grabbed the telekom_germany_volte_wowifi_tar.mbn modem which sounded just about right to me. But when trying to call, it says I have to connect to WiFi although I definitely am.

Could this have anything to do with my firmware "Customized CE1_47.2.A.11.228-R1C"? Is something like "Telekom.de DE_47.2.A.11.228-R3C" required instead?
 

[email protected]

Senior Member
Jul 26, 2019
69
59
Did somebody sucessfully unpack the boot image?

I made a backup of /boot using TWRP resulting in boot.emmc.win. Then unpacked the latter via $(unpack_bootimg boot.emmc.win) from community/android-tools, resulting in two files kernel and ramdisk. ramdisk is a cpio image which can be extracted via $(cpio --extrac --file ramdisk), resulting in some empty directories and an 1.8MB init file, which I can't extract any further.
 

Flamefire

Senior Member
Jul 26, 2013
184
344
Sony Xperia XZ1 Compact
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)
 

[email protected]

Senior Member
Jul 26, 2019
69
59
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)
Wow, that's really cool! Thanks a lot!

Would you explain how you implemented your LED driver and button? On a usual Linux distribution, I'd think of a daemon running with elevated hardware permissions and a client script that asks it via dbus to set a certain brightness. But since Android doesn't run systemd, I'd have no idea where to start, haha. Awesome!

Btw, applying a filter on LCD devices reduces overall screen brightness but actually increases power consumption, since an LCD pixels needs more power the darker it becomes. A12 probably targets OLED devices, that become darker and save energy at the same time. Anyway, your approach is much better and reasonable on both kind of devices, I think.
 

Flamefire

Senior Member
Jul 26, 2013
184
344
Sony Xperia XZ1 Compact
Would you explain how you implemented your LED driver and button? On a usual Linux distribution, I'd think of a daemon running with elevated hardware permissions and a client script that asks it via dbus to set a certain brightness. But since Android doesn't run systemd, I'd have no idea where to start, haha. Awesome!
I actually implemented a HAL, not a driver. That is already there and in the kernel. Only the interface to control that driver from Android needed to be written. But the difference is only technically, so sorry for the simplification. You can have a look at it at https://github.com/Flamefire/android_device_sony_yoshino-common/pull/20
 

antoniu200

Senior Member
Oct 3, 2016
77
8
Zalău
My noob questions again.

It seems like if I try and force the SD Card into private adoptable storage, apps, like the Camera and Google Play Store, do not have access to the Internal Memory, except for the File Manager and Settings app. I have used an flashable zip to disable forced encyption and encryption is disabled. I also tried reformatting the /data partition as f2fs, but it doesn't help.

Is there any way to get over this issue? I kinda need to have the extra storage, as it helps when storing big apps, the like of games.


EDIT: To be more clear, what I mean by Google Play not being able to access the Internal Memory is that it installs all new apps to the SD Card, regardless of the set-install-location value.
 
Last edited:

Flamefire

Senior Member
Jul 26, 2013
184
344
Sony Xperia XZ1 Compact
EDIT: To be more clear, what I mean by Google Play not being able to access the Internal Memory is that it installs all new apps to the SD Card, regardless of the set-install-location value.
TBH: I don't know. But I found something which says, that all this setting does is set a preference, not a setting: https://android.stackexchange.com/questions/43517/installing-to-sdcard-by-default
So yeah, it might simply not work. You can check `adb logcat` if there are any actual error messages pointing to a particular issue.
 

Trigger1112

Member
Jan 27, 2016
13
4
Hi, this might not be the right place but I've had no luck in the Magisk forum.

I'm trying to get the santander app working on LineageOS 17.1 on an Xperia XZ1 Compact with Magisk v23. Usually it detects that the phone isn't secure within a second or 2 of starting but by using MagiskHide, Momohider with all config files, hiding Magisk and freezing it (I used Ice Box), I can get to the screen where it asks for my ID. After entering it, THEN it detects the phone isn't secure.

Any solutions?
 

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