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

[ROM][11] LineageOS 18.1 [OFFICIAL]

Search This thread

jontis

Member
Jul 1, 2015
12
2
I got a little further on the vowifi part. I realised there was a preference to set to chose if it would go wifi over mobile. When I set it to wifi, the error message change to "connect to a wireless" Problem is that it was connected to wireless and it worked great for other data, so I guess something else in the connection to carrier through ip data did not work. Looking into IMS and APNs now. Has your data ever worked?
 
  • Like
Reactions: RelaxIamOnlyAghost

Amunhateb

Member
Oct 11, 2017
5
0
Sony Xperia XZ2 Compact
Hello guys. I am facing an issue with charger. When I am unplugging my xz2c from 12V QC3 charger the device may become unresponsive. Black screen with no possibility to turn it on. I can see that some processes are working(can receive some alerts soundwise). But bluetooth and other connectivities are dropped down. I can only force reboot by pressing power + volume down(up) to force reboot it. Same issue was on LOS 17.1.

Not sure that logcat is related but the timing is seems really close to when I faced issue the last time.

--------- beginning of crash
09-30 10:32:04.210 5675 5675 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000040-1632987122651-014c9adb-a0ef-ada1-b75d-2d8b5ea8a80a/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 10:33:09.550 14000 14000 E AndroidRuntime: FATAL EXCEPTION: main
09-30 10:33:09.550 14000 14000 E AndroidRuntime: Process: ru.filit.mvideo.b2c, PID: 14000
09-30 10:33:09.550 14000 14000 E AndroidRuntime: java.lang.RuntimeException: Unable to create application ru.filit.mvideo.b2c.app.MvideoApp: com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6724)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at android.app.ActivityThread.access$1300(ActivityThread.java:237)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at android.os.Looper.loop(Looper.java:223)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7664)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: Caused by: com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at com.google.crypto.tink.shaded.protobuf.y.I(GeneratedMessageLite.java:10)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at com.google.crypto.tink.shaded.protobuf.y.F(GeneratedMessageLite.java:2)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.g.b.a.y.c0.V(Keyset.java:1)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.g.b.a.v.a.d.b(SharedPrefKeysetReader.java:1)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.g.b.a.b.a(CleartextKeysetHandle.java:1)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.g.b.a.v.a.a$b.e(AndroidKeysetManager.java:4)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.g.b.a.v.a.a$b.f(AndroidKeysetManager.java:1)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.g.b.a.v.a.a$b.d(AndroidKeysetManager.java:3)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at w.r.a.a.a(EncryptedSharedPreferences.java:7)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.k.a.d.d.a.i(BasePreferences.kt:2)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.k.a.d.d.a.<init>(BasePreferences.kt:2)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.k.a.d.d.b.a.<init>(Preferences.kt:1)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.k.a.f.b.g.f(EyezonBusinessSDK.kt:5)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.k.a.f.b.g.b(EyezonBusinessSDK.kt:1)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at y.k.a.f.b.g$a.b(EyezonBusinessSDK.kt:2)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at ru.filit.mvideo.b2c.app.MvideoApp.l(MvideoApp.kt:2)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at ru.filit.mvideo.b2c.app.MvideoApp.onCreate(MvideoApp.kt:17)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6719)
09-30 10:33:09.550 14000 14000 E AndroidRuntime: ... 8 more
09-30 10:33:18.742 15842 15842 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000041-1632987197243-12c81d4e-b794-9729-7ffb-829206a1d892/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 10:54:38.560 20500 20500 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000042-1632988475235-4c1563fe-a4eb-8973-4f3f-e8ee99df26f8/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 11:40:37.226 23814 23814 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000043-1632991236678-f8b49be0-9082-f7a8-0567-08df1b8f9fcc/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 11:44:10.349 32406 32406 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000044-1632991449682-a5f7ed4a-867f-cc66-3f81-cab1fe9109b1/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 11:50:22.344 4190 4190 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000045-1632991821131-cd370fc5-f5d6-1c7f-53c8-3612f02d980e/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 11:56:41.170 7392 7392 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000046-1632992199951-8f9f49e2-263e-2d29-b525-2a4ab2812838/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 11:59:39.536 10527 10527 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000047-1632992378101-fa2e3059-5636-ed36-8993-ae0ea3114eaa/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 12:07:35.301 15546 15546 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000048-1632992854406-3ffa215b-4f26-e674-2d83-da97097095f0/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 12:36:14.933 24785 24785 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000049-1632994572446-1dbe4eef-de1f-58f7-2227-3c04828b3454/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
09-30 12:53:16.222 27797 27797 F linker : CANNOT LINK EXECUTABLE "/data/data/com.facebook.katana/app_errorreporting/sess__000000050-1632995595205-84e20e0b-a3fa-cf3b-6614-29df39ebdb37/nightwatch.txt": library "libclang_rt.xray.so" not found: needed by main executable
--------- beginning of system
 
Last edited:
has anyone else been having touch issues recently? I've been getting lots of ghost touches since the last week or so, or the screen becoming completely unresponsive at times, and I'm not sure if it's a software or a hardware issue.

edit: I found a video that shows something very similar to what I'm experiencing:

since they're running stock software, I assume it's hardware then :/
 
has anyone else been having touch issues recently? I've been getting lots of ghost touches since the last week or so, or the screen becoming completely unresponsive at times, and I'm not sure if it's a software or a hardware issue.

edit: I found a video that shows something very similar to what I'm experiencing:

since they're running stock software, I assume it's hardware then :/
It's not that uncommon for xz2c users to have touch issues. I'm afraid it's on hardware side.
 

zpunout

Senior Member
Aug 26, 2015
94
14
Samsung Galaxy S5
Moto G5 Plus
I've had ghost touches on my XZ2c H8324. To see better what was happening, I activated the "show touches" setting in Developer Options. I noticed that by cleaning around the edges, especially where the groove is makes it better for a while.
 

zpunout

Senior Member
Aug 26, 2015
94
14
Samsung Galaxy S5
Moto G5 Plus
Q̶u̶e̶s̶t̶i̶o̶n̶ ̶r̶e̶g̶a̶r̶d̶i̶n̶g̶ ̶L̶O̶S̶1̶8̶.̶1̶ ̶a̶b̶i̶l̶i̶t̶y̶ ̶t̶o̶ ̶d̶r̶a̶w̶ ̶g̶r̶a̶p̶h̶i̶c̶s̶ ̶c̶o̶m̶p̶a̶r̶e̶d̶ ̶t̶o̶ ̶S̶o̶n̶y̶ ̶X̶Z̶2̶ ̶C̶o̶m̶p̶a̶c̶t̶ ̶s̶t̶o̶c̶k̶ ̶O̶S̶:̶ ̶ ̶T̶h̶e̶r̶e̶'̶s̶ ̶a̶ ̶m̶a̶r̶i̶n̶e̶ ̶c̶h̶a̶r̶t̶s̶ ̶a̶p̶p̶ ̶i̶n̶ ̶P̶l̶a̶y̶S̶t̶o̶r̶e̶/̶A̶u̶r̶o̶r̶a̶ ̶c̶a̶l̶l̶e̶d̶ ̶N̶a̶v̶i̶o̶n̶i̶c̶s̶ ̶w̶h̶i̶c̶h̶ ̶I̶ ̶t̶h̶i̶n̶k̶ ̶w̶o̶r̶k̶s̶ ̶b̶y̶ ̶d̶r̶a̶w̶i̶n̶g̶ ̶g̶r̶a̶p̶h̶i̶c̶s̶ ̶b̶a̶s̶e̶d̶ ̶o̶n̶ ̶2̶D̶ ̶v̶e̶c̶t̶o̶r̶ ̶d̶r̶a̶w̶i̶n̶g̶.̶ ̶I̶ ̶n̶o̶t̶i̶c̶e̶d̶ ̶a̶ ̶v̶e̶r̶y̶ ̶d̶e̶g̶r̶a̶d̶e̶d̶ ̶p̶e̶r̶f̶o̶r̶m̶a̶n̶c̶e̶ ̶i̶n̶ ̶d̶r̶a̶w̶i̶n̶g̶ ̶t̶h̶e̶ ̶c̶h̶a̶r̶t̶s̶ ̶w̶h̶e̶n̶ ̶z̶o̶o̶m̶i̶n̶g̶/̶s̶c̶r̶o̶l̶l̶i̶n̶g̶ ̶a̶r̶o̶u̶n̶d̶ ̶o̶n̶ ̶L̶O̶S̶ ̶(̶1̶8̶.̶1̶)̶ ̶c̶o̶m̶p̶a̶r̶e̶d̶ ̶t̶o̶ ̶t̶h̶e̶ ̶s̶t̶o̶c̶k̶ ̶O̶S̶ ̶(̶b̶o̶o̶t̶l̶o̶a̶d̶e̶r̶ ̶u̶n̶l̶o̶c̶k̶e̶d̶)̶.̶ ̶I̶ ̶o̶r̶i̶g̶i̶n̶a̶l̶l̶y̶ ̶t̶h̶o̶u̶g̶h̶t̶ ̶t̶h̶i̶s̶ ̶c̶o̶u̶l̶d̶ ̶b̶e̶ ̶a̶ ̶S̶o̶n̶y̶ ̶D̶R̶M̶ ̶i̶s̶s̶u̶e̶,̶ ̶b̶u̶t̶ ̶t̶h̶e̶ ̶p̶e̶r̶f̶o̶r̶m̶a̶n̶c̶e̶ ̶i̶s̶ ̶r̶e̶s̶t̶o̶r̶e̶d̶ ̶w̶h̶e̶n̶ ̶u̶s̶i̶n̶g̶ ̶s̶t̶o̶c̶k̶ ̶O̶S̶ ̶(̶b̶o̶o̶t̶l̶o̶a̶d̶e̶r̶ ̶u̶n̶l̶o̶c̶k̶e̶d̶ ̶a̶n̶d̶ ̶D̶R̶M̶ ̶k̶e̶y̶s̶ ̶l̶o̶s̶t̶)̶.̶ ̶T̶h̶i̶s̶ ̶l̶e̶a̶d̶s̶ ̶m̶e̶ ̶t̶o̶ ̶b̶e̶l̶i̶e̶v̶e̶ ̶t̶h̶e̶r̶e̶ ̶i̶s̶ ̶a̶ ̶d̶i̶f̶f̶e̶r̶e̶n̶t̶ ̶r̶e̶a̶s̶o̶n̶ ̶f̶o̶r̶ ̶t̶h̶e̶ ̶d̶e̶g̶r̶a̶d̶e̶d̶ ̶p̶e̶r̶f̶o̶r̶m̶a̶n̶c̶e̶,̶ ̶p̶o̶s̶s̶i̶b̶l̶y̶ ̶w̶i̶t̶h̶i̶n̶ ̶t̶h̶e̶ ̶N̶a̶v̶i̶o̶n̶i̶c̶s̶ ̶a̶p̶p̶ ̶o̶r̶ ̶a̶n̶ ̶i̶s̶s̶u̶e̶ ̶r̶e̶l̶a̶t̶e̶d̶ ̶t̶o̶ ̶L̶O̶S̶ ̶(̶1̶8̶.̶1̶)̶.̶ ̶ ̶
I̶ ̶h̶a̶v̶e̶n̶'̶t̶ ̶t̶e̶s̶t̶e̶d̶ ̶t̶h̶e̶ ̶a̶p̶p̶ ̶i̶n̶ ̶L̶O̶S̶ ̶1̶7̶.̶1̶ ̶y̶e̶t̶,̶ ̶b̶u̶t̶ ̶I̶'̶l̶l̶ ̶r̶e̶p̶o̶r̶t̶ ̶b̶a̶c̶k̶ ̶h̶e̶r̶e̶ ̶a̶f̶t̶e̶r̶ ̶I̶ ̶d̶o̶.̶ ̶[̶e̶d̶i̶t̶:̶ ̶P̶e̶r̶f̶o̶r̶m̶a̶n̶c̶e̶ ̶i̶s̶s̶u̶e̶ ̶d̶o̶e̶s̶n̶'̶t̶ ̶e̶x̶i̶s̶t̶ ̶f̶o̶r̶ ̶L̶O̶S̶1̶7̶.̶1̶]̶ ̶ ̶J̶u̶s̶t̶ ̶w̶o̶n̶d̶e̶r̶i̶n̶g̶ ̶i̶f̶ ̶a̶n̶y̶o̶n̶e̶ ̶h̶e̶r̶e̶ ̶m̶i̶g̶h̶t̶ ̶k̶n̶o̶w̶ ̶w̶h̶a̶t̶ ̶t̶h̶e̶ ̶t̶e̶c̶h̶n̶i̶c̶a̶l̶ ̶r̶e̶a̶s̶o̶n̶ ̶i̶s̶ ̶f̶o̶r̶ ̶t̶h̶e̶ ̶d̶e̶g̶r̶a̶d̶e̶d̶ ̶p̶e̶r̶f̶o̶r̶m̶a̶n̶c̶e̶.̶
[edit2: Issue found to not be related to LOS but instead app compatibility with Android 11 in general]
 
Last edited:

hxss

Member
Feb 24, 2017
5
0
Is there a way to return stock media volume?
Sound is coming from bottom speaker only.
Vibrations from the speaker are felt during playback.
 

shezy14

Member
Aug 28, 2014
33
2
Redmi Note 10
Pls how can I return to stock firmware from lineage 18.1 I have downloaded firmware from xperifirm but flashing failed with newflasher and flashtool
 

Attachments

  • Screenshot 2021-10-15 080051.png
    Screenshot 2021-10-15 080051.png
    44.5 KB · Views: 26
  • flashtool_2021-10-15_08-16-12.log
    1.8 KB · Views: 6
Last edited:
Which frequency bands are being used by China Unicorn? Maybe the answer can be found by looking at that?
Yesterday I asked China Unicom to replace my SIM card since I suspect it might be faulty, and enabled a service called "visited place access" (translated from Chinese via DeepL), without that my IP is where this card belongs to but apparently I'm far away from that city, and now I can get the IP from the city I'm at right now. And after replacing the card, my LTE connection seems fine now. @jontis maybe you should also try a SIM card replacement.
 
  • Like
Reactions: zpunout

TheeWolf

Senior Member
Oct 8, 2011
889
190
Hi,

I updated the ROM using the updater in the system settings. I then lost my Magisk root.
I was wondering if in order to get root again, I would need to again extract the boot image from the zip, patch it and install it in Magisk, or if I can use the previous boot image (from two weeks ago).

Also, I'm pretty sure it's Android 11 related but I'll ask here anyway - how do I disable that feature that auto plays what I last played when I re-connect my Bluetooth headphones?

Thanks!
 

lba810701

Senior Member
Jul 8, 2010
126
42
Budapest
OnePlus 2
LG G5
Hi,

I updated the ROM using the updater in the system settings. I then lost my Magisk root.
I was wondering if in order to get root again, I would need to again extract the boot image from the zip, patch it and install it in Magisk, or if I can use the previous boot image (from two weeks ago).

Also, I'm pretty sure it's Android 11 related but I'll ask here anyway - how do I disable that feature that auto plays what I last played when I re-connect my Bluetooth headphones?

Thanks!
Hi! Extract the payload file from the los zip, then you could extract the boot.img, system.img, vbmeta...etc from it with payload dumper. After it copy that boot.img file to your phone and patch it with magisk then copy back the patched boot img to your pc then after you updated the system with updater turn phone off ( dont restart the phone ), boot to fastboot mode and flash the newest patched boot.img.

About the bluetooth i don't known what player are you using, because, I'm using poweramp and there you could set it up on the player's headphone/bluethoot settings.
 
Hi
I've been using this ROM in my XZ2c for a while now and only recently experienced a battery charging issue: the charge level will go up to 98% and then the phone gets warm and starts to slowly discharge. If I disconnect and reconnect the cable the battery will eventually get to 100%; Also, if I charge the phone while it's off it charges normally. This didn't happen in builds older than ~2 weeks ago.

Could this be related to LOS? Is there such an issue already identified?

Thank you
 

zpunout

Senior Member
Aug 26, 2015
94
14
Samsung Galaxy S5
Moto G5 Plus
Hi
I've been using this ROM in my XZ2c for a while now and only recently experienced a battery charging issue: the charge level will go up to 98% and then the phone gets warm and starts to slowly discharge. If I disconnect and reconnect the cable the battery will eventually get to 100%; Also, if I charge the phone while it's off it charges normally. This didn't happen in builds older than ~2 weeks ago.

Could this be related to LOS? Is there such an issue already identified?

Thank you
I don't know if this will fix your issue, but I had a charge level issue of the phone switching off after only 8 hours which I think was due to battery calibration. What I did to fix it was to let the phone run out of battery then keep trying to switch it on as the screen flashed an empty battery symbol. I put a rubber band around the phone to keep the power button in and the screen keeps flashing the empty battery symbol. Eventually, after an hour the screen flashing stopped so I plugged in a charger. After about 1 minute I could switch on the phone and let it charge to 100% while the system is running. Since then, the battery charge level appears to be more accurate.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    There might be something available for that variant posted on XDA. There may also be a trick such as trying to first install H8314 Sony firmware onto an SO-05K device before installing LineageOS. But I haven't tried it myself for an XZ2c.
    I did manage to do a similar thing on an older Z3 D6683 Hong Kong variant by first installing D6633 firmware (must first delete fwinfo.xml file). After that step, the D6683 worked with LineageOS for D6633. You'll read more about it in the Z3 section.
    thanks for the response! I am sadly not well-versed in all of this... as someone who mainly worked on PCs for the last 20 years, I just keep thinking "why can't I just format the internal memory and install whatever I like" - in short, the convoluted way smartphones work are still a mystery to me... So I can understand what you are telling me, but cannot quite translate it into action, yet.
    I have unlocked the bootloader of my phone, which should make things easier, though I wouldn't quite know where to find said fwinfo.xml, or which information from the z3 thread is actually useful to my case :/ (at least I think i read through the correct thread?)
    could you give me a little bit more to go on?
    1
    For me it is really urgent that WiFi calling is working well because there is no mobile connection at my home. Does anybody know an alternative ROM for XZ2C where WiFi calling is working well?
    Stock firmware I guess. Assuming Wi-fi calling is supported on stock.
    I am not used to use Telegram groups or even searching for them. I don't find anything.
    Here's a screenshot of the group as it appears in the Telegram FOSS app
  • 10
    The first official 18.1 build is up, enjoy: https://download.lineageos.org/xz2c
    10
    A new build is up, please check the OP. Feel free to test and report bugs - we'd like to enable official 18.1 weekly builds soon.
    7
    http%3A%2F%2Fi.imgur.com%2F2okPze5.png


    LineageOS is a free, community built, aftermarket firmware distribution of Android 10, which is designed to increase performance and reliability over stock Android for your device.

    Code:
    /*
    * Your warranty is now void.
    *
    * I am not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed. Please
    * do some research if you have any concerns about features included in this ROM
    * before flashing it! YOU are choosing to make these modifications, and if
    * you point the finger at me for messing up your device, I will laugh at you.
    */

    NOTE
    Should you ever face any issues, capture logs. I also need to know what build you're on (build number or at least a date).
    Hint: "It doesn't work" is not a bug report and posts like this will be ignored.


    KNOWN ISSUEs
    • The Sony stock camera does not work at the moment.

    INFO
    This ROM does not use the device trees/kernel from sonyxperiadev (aka SODP). The device tree was made from scratch, and the stock kernel (based off 52.1.A.x.y) has been used.

    DOWNLOAD
    Official builds

    NOTE: Since the official builds are signed, you can't simply upgrade from my unofficial builds -- you can either migrate to an official build using a script or do a clean install.

    All unofficial builds

    INSTRUCTIONS
    Just flash the builds as usual. Make sure to be on the latest stock firmware.

    SOURCE
    LineageOS
    Kernel
    4
    CHANGELOG
    20210516:
    - fixed WiFi display/screen casting
    - addressed performance issues and lags

    20210515:
    - updated to 18.1
    - fixed remaining most of the bugs
    - set SELinux to enforcing

    20201128:
    - fixed NFC

    20201127:
    - initial public release.
    3
    After a LOT of trial and error I am making a description, how to get a running LOS on your SONY XZ2 Compact Single SIM (and probably Dual SIM). This is not a description for people, who got it running the easy way. It's for people that tried everything, and can't get it running, and are in desperation and lost.

    General description first: The SONY XZ2 Compact is a phone with 2 slots. These phones don't have a recovery partition, so you cannot meaningfully boot into a recovery partition like on old phones. It now has a boot partition (2 of them - slot A and slot B), and you can boot an operating system from these slots. These slots are completely separate, you can boot an operating system in slot A and another separate one in slot B. These slots (from a user perspective) are separate, and there is very little interchange between them (or more or less none).

    Prerequisits: TWRP, I used the Version from MartinX 2020-06-14_21-07-37_twrp_apollo.tar.gz , link is here: https://androidfilehost.com/?w=files&flid=306949
    Use a STOCK TWRP
    Extract the .img files with 7-zip (7-zip.org), until you have the .img file separate.

    Newflasher:
    I used v42, probably newer versions work, too, try not to use an older version

    Booting into fastboot: hold Volume-UP and then plugging a USB cable to the computer. The blue light should be lit, if fastboot is active, screen stays blank.

    Booting into flash mode: hold Volume-DOWN and then plugging a USB cable to the computer. The green light should be lit, if flash mode is active, screen stays blank.

    Now let's get to the process of flashing LOS:

    Step 1 - Flash an original working SONY image into Slot A:
    Boot into fastboot mode, so the blue light is on.
    Type:
    fastboot reboot bootloader
    (Sometimes the computer doesn't recognise the phone after this command, then just unplug the USB, wait until the phone is off, and try again beginning Step 1. It can fail a couple of times, but it will also work in between).

    fastboot --set-active=a
    fastboot reboot bootloader

    You can check that Slot A is active by typing the command
    fastboot getvar all
    in the output check the line current slot active: a

    Run Newflasher (how to use Newflasher is beyond the scope of this post, google it) to flash an original stock SONY image. You need to be in flash mode for Newflasher with the green light lit.

    Answer the first question what to do when done with Newflasher with 'p'=Power Off, and all others with 'n'=No.

    When Newflasher completes, check the last few lines output, it should say setting slot A active and OKAY. That confirms that you flashed the original SONY image in Slot A.

    You now have a fully working operating system in Slot A. However there is a bug in Newflasher and that bug destroys the boot process in Slot B, which means you'll be only able to boot Slot A, booting Slot B will fail.

    Should you decide to boot the operating system (you don't have to), make sure you don't set up authentication (pin code, fingerprint), skip setting that up, so your data partition doesn't get encrypted.

    Step 2 - Flash an original working SONY image into Slot B:
    Boot into fastboot mode, so the blue light is on.
    Type (similar to Step 1):
    fastboot reboot bootloader
    fastboot --set-active=b
    fastboot reboot bootloader

    You can check that Slot B is active by typing the command
    fastboot getvar all
    in the output check the line current slot active: b

    WARNING: DO NOT BOOT Slot B, as it will fail 2-3 times (you'll notice the phone vibrating upon crash and reboot), because the phone will then put you back on Slot A, and you'll flash Slot A again. Make sure YOU DON'T BOOT the operating system in Slot B, or you'll end up in Slot A again.

    Run Newflasher (how to use Newflasher is beyond the scope of this post, google it) to flash an original stock SONY image. You need to be in flash mode for Newflasher with the green light lit.

    Answer the first question what to do when done with Newflasher with 'p'=Power Off, and all others with 'n'=No.

    When Newflasher completes, check the last few lines output, it should say setting slot B active and OKAY. That confirms that you flashed the original SONY image in Slot B.

    You now have a fully working operating system in Slot B. However there is a bug in Newflasher and that bug destroys the boot process in Slot A, which means you'll be only able to boot Slot B.

    At this point in time, if you would try to boot into Slot A, it will boot up to the SONY logo, and then crash, and reboot up to the SONY logo, and then crash. Should you get stuck in that loop, insert a USB cable and hold Volume-UP, it'll catch the crashing loop, and you'll end up in fastboot.

    Step 3 - Boot the original SONY image up to the home screen where the apps show:

    Actually you should be in Slot B already, but if you are not:
    Boot into fastboot mode, so the blue light is on.
    Type (similar to Step 2):
    fastboot reboot bootloader
    fastboot --set-active=b
    fastboot reboot bootloader

    You can check that Slot B is active by typing the command
    fastboot getvar all
    in the output check the line current slot active: b

    Boot the phone's operating original stock image in Slot B, until you are at the home screen with the apps. This sets up all the defaults for your phone, and updates any ROM images in the chips (like modem etc.).

    Make sure you don't set up authentication (pin code, fingerprint), skip setting that up, so your data partition doesn't get encrypted.

    Power off your phone.

    Step 4 - Flash twrp into Slot B

    Type (similar to Step 2):
    fastboot reboot bootloader
    fastboot --set-active=b
    fastboot reboot bootloader

    fastboot flash boot twrp.img

    This will flash TWRP as boot in Slot B. Make sure in the screen output it was flashed in boot_b.

    Should you make an error here, start with Step 1. The reason here is, we want LOS in Slot A, and not TWRP.

    Boot your TWRP in Slot B.

    WARNING: DO NOT flash VBMETA, it'll break the boot process, and you can start from Step 1.


    Step 5 - Flash LOS into Slot A

    Once TWRP is running, go to Wipe.

    WARNING: DO NOT perform factory reset.

    Go to Advanced Wipe, and ONLY WIPE 'Data' and 'Dalvic Cache'

    WARNING: DO NOT WIPE System or Internal Storage. You'll loose mount points under Linux, and the LOS image flash will fail.

    Go back to TWRP home screen.

    From there go to Advanced and from there to ADB Sideload.

    From the computer start installing your LOS image (sideload).

    On the computer type:

    adb sideload <Your LOS image>.zip.

    ATTENTION: During flashing, the phone will show, which slot it flashes. It should flash and show: "flashing inactive Slot A". If you accidentally flash Slot B, start from the beginning Step 1.

    Best results I had with the image from the LOS homepage https://download.lineageos.org/xz2c

    Download the zip file, don't unpack it, use adb sideload to upload the zip file.

    Forget about the Recovery image on the LOS homepage. You don't need it.

    When flashing completes, you can wipe Delvic Cache.

    WARNING: DO NOT WIPE 'cache', since a 2 slot phone doesn't have a cache partition, and it will fail to wipe it.

    Do NOT install the TWRP app, skip this step.

    Reboot

    Step 6 - Boot LOS

    LOS is in Slot A, TWRP is in Slot B.

    You can alternate between the slots from fastboot.

    fastboot reboot bootloader
    fastboot --set-active=a
    fastboot reboot bootloader

    A reboot should boot LOS.

    ATTENTION: When the LOS image has finished booting and you get to the date/time screen, the LOS will hang a while (30s). Just let it do it's job, I think (not sure), it's creating the data in the user partition. After 30s or so use the back key, and try setting the time again. This only happens on the very first boot.

    Let me know as feedback, if I can clarify better or if this description is ok.