yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Ungewiss:
Very good, this will help a lot of people who are new into this!

---------- Post added at 14:00 ---------- Previous post was at 14:00 ----------

NFC works on my XZ2C dual.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] lba810701:
Here works NFC on dual too
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Tom 23:
Hi, does nfc also work for nfc payments in your case?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Ungewiss:
I have never tried, since my Bank does not offer a service of their own and I will not use Google or Apple stuff.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] z1c-me:
Did some more testing with other documents and this worked! So NFC is functioning for me.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Olivier:
Sorry, there were some typos in the OP. Please check the instructions again, they should be correct now. Also make sure to remove .repo/local_manifests/roomservice.xml. There's no need to manually clone the vendor repo, it should be synced automatically.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Ungewiss:
Just use [TAB] for filename completion. Or use "ls".

Just use "lunch". It will present you all the options. In this case its "lineage_xz2c-userdebug"
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Olivier:
Sorry again, made a little mistake when working on the SELinux policies last night. Should be fine now:

repo sync device/sony/tama-common
mka bacon
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Markus-E:
No worries, thank you for your work and the very fast support!

Package Complete: out/target/product/xz2c/lineage-17.1-20200531-UNOFFICIAL-xz2c.zip
#### build completed successfully (02:30:11 (hh:mm:ss)) ####

:)
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] mmvv80@yahoo.com:
xz2c - SO-05K model

Hello,

Thanks for your work end effort.

Can you please tell me if this is good also for SO-05K model (I think is a Japanese model exclusevely for NTT Docomo)
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
thanks for your precise instructions (at #34). I followed it and it worked without any mistakes. thanks a lot for the lineage rom and the stock cam port (by olivier), it works like a charm.

i can say, that the quality of the cam is like stock. this was one of my crucial points...

so i am not very familiar with the lineage recovery, used twrp at the z3compact till now. is there any possibility for backups like in twrp? is the adb backup working, anyone with experience here?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
Hi strauchjam, the positive info about working instruction and good camera makes me curious on Lineage. Are there any issues for daily use? Everything is working? Fingerprint too? And very important - how about battery life? On stock rom the situation is still annoying...

I want to be sure that it makes sense to change to a custom rom, because I am still on stock rom to keep warrenty...

Thanks for any hints
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
Hi odiad, i use it as a daily driver and have no complains until now. battery life is good, for my normal usage it lasts for a day. i use battery charge limit and always stop at 90%. its nearly the same situation like on my old z3c. fingerprint works fine, what else... i bought a used phone so far t the warranty.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
Hi strauchjam - that's sounds good for me, and I will try at the weekend. Have you rooted your mobile, and where found you supersu? I could not find for Lineage 17.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
Yes, i have rooted my mobile. i used super from here: https://supersu.dev/download/supersu-zip/ but then i installed magisk 20 as well. this works togehther. i think you need not both of it.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] JimmyTheFirst:
Use the included recovery to flash the latest Magisk. Works fine for me. ?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Olivier:
A new build is up, please check the changelog in the OP.

If anyone wants to join our Lineage telegram group: here's an invitation link.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
Hi Olivier, can I flash the update over the version from 25th, or do I need to make a clean install? And when I flash just over the existing rom do I need to flash Magisk, Sony cam, and Opengapps again?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Ungewiss:
Is there a specific reason why you replaced the AOSP calendar with Etar? I was a bit suprised by that. Etar also does not come with any widget.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
Hi. Has anybody problems with the app Android setup? After flashing rom and gapps the Android setup app starts to finalize installation (e.g. to restore/recover data from cloud). After some moments a failure message system-ui has crashed stops the process. And all the time Android setup starts again that the message, that installation is not finished, does not disappear from notification menu. To avoid that I deactivated the app.

I had this problem with LOS from 25th and also with the new one.

Any chance to have a correct working Android setup app?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
Hi, you have to install gapps bevor the first boot (Instruction#34)!
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
yes I did, or better I have to say I tried. I flashed all first time. LOS, Gapps, Magisk, and Sony Cam. But I flashed from SD card and not via adb.

So I flashed all, but after starting the phone gapps didn't appear, and I needed to flash gapps again.

So what was the failure? Is flashing from SD card not possible? Or is it necessary to flash just LOS and Gapps, and Makisk later?

EDIT: I am just flashing again. I never just sideload, thats why I installed from SD card. But adb sideload is just working. Hope it will work :)

EDIT 2: Okay it works now. Following exactly the instruction works. Maybe flashing from SD Card would also work, but I did not rebooted into recovery again before I flashed gapps and Magisk the first time. But at least I am happy now :)
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
Good Luck! One thing is importend, after installing LOS restart into recovery (from the menu), then install gapps and other stuff with the same procedere then boot....
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Olivier:
We dropped the AOSP calendar app because it has been pretty much unmaintained for a while (just like a few other AOSP apps). Etar was chosen because it's an open-source, actively maintained and nice-looking alternative.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] lba810701:
Yes, after upgraded, flash magisks patched boot.img then gapps again. Or, only los recovery start.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] z1c-me:
Successfull update LineageOS 17.1

See post #35 for the fresh installation, which I did a few weeks ago.

I did strike out the steps I skipped from that procedure, to do only the update:

1. For XZ2 Compact Dual Sim (H8324-Apollo)

2. Used Rom 2020-xx-xx by Olivier

3. Used boot image from Olivier

a. This has “Lineage Recovery” not “TWRP”.

b. Functions better for A/B devices, less bricked devices expected

4. Installed zips by adb sideload:

a. Image from Olivier

b. https://opengapps.org arm64, android 10, nano

5. Download and install adb + fastboot (version from platform google, not the old 15 second installer)

6. Download and install Sony XZ2 compact drivers for fastboot situation

7. Enable USB debugging at phone

8. Unlock bootloader

9. To get into fastboot mode: Press + hold volume down when connect usb cable in phone (and pc)

10. In Windows cmd:

a. adb devices –> use at every use of adb to check connection with phone (winusb drivers needed)

b. adb reboot bootloader

c. fastboot devices –> use at every use of fastboot to check connection with phone (sony drivers needed)

d. fastboot flash boot boot.img

11. Installing LineageOS from recovery:

a. If you are not in recovery, reboot into recovery:

1. With the device powered off, hold Volume Down + Power and choose Recovery Mode.

b. Now tap Factory Reset, then Format data / factory reset and continue with the formatting process. This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).

c. Return to the main menu.

d. Sideload the LineageOS .zip package:

1. adb devices –> use at every use of adb to check connection with phone

2. On the device, select “Apply Update”, then “Apply from ADB” to begin sideload.

3. On the host machine, sideload the package using: adb sideload filename.zip

(takes a while after counter stops at 47%…)

Follow progress at phone screen.

4. (Optionally): If you want to install any additional add-ons, click Advanced, then Reboot to Recovery, then when your device reboots, click Apply Update, then Apply from ADB, then adb sideload filename.zip those packages in sequence.

5. Note: If you want Google Apps on your device, you must follow this step before booting into LineageOS for the first time!

12. Once you have installed everything successfully, click the back arrow in the top left of the screen, then “Reboot system now”.

13. (Warning: Depending on which recovery you use, you may be prompted to install additional apps and services. We strongly advise you to opt out of installing these, as they may cause your device to bootloop, as well as attempt to access or corrupt your data.)

Screen dump from cmd at pc:

D:\platform-tools>adb devices

List of devices attached

XXXXXXXXXX sideload

D:\platform-tools>adb sideload lineage-17.1-2020xxxxxxxxx-xz2c.zip

Total xfer: 1.00x

D:\platform-tools>adb devices

List of devices attached

XXXXXXXXXX sideload

D:\platform-tools>adb sideload open_gapps-arm64-10.0-nano-2020xxxx.zip

Total xfer: 1.00x
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
Random reboot: I am using latest LOS-update (clean installed including opengapps and magisk) since 2 days without problems, but today the phone was suddenly off. I used the phone the whole day, and last two hours with Google maps and music via Bluetooth,

. The phone was on the charger - and battery had after the boot more than 80%. So empty battery was not the reason.

Had anybody else a sudden off or random reboot?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Markus-E:
What work would I have to do in order to build LineageOS 16.0 for the xz2c: Could it be done with just a few adjustments of configuration files to the 17.1-sources mentioned in the OP, or would I have to dig deeper and change the source code itself?

I already tried and adjusted git-branches but I am getting Errors of the form >vendor/sony/akari/Android.bp:22:1: unrecognized module type "android_app_import"< which led me to stackoverflow.com/questions/59658280/erro-unrecognized-module-type-android-app-import-when-building-aosp-10-r20 but I found no help about how to resolve these errors.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
Hi teostar. for me the fingerprint sensor works fine. But it doesn't vibrate when it wake up the phone. I just miss this vibration.

---------- Post added at 08:04 ---------- Previous post was at 07:58 ----------

Random reboot 2: yesterday I had the second time a random reboot. Again in car listening music via Bluetooth. This time screen was of. No use of Google maps in parallel.

So it could be a Bluetooth issue. And it is a bit annoying.

I am using Corona warning app here in Germany. This app scans all the time Bluetooth signals from other mobiles to analyse if somebody was closer to Corona infected persons. I don't know if this maybe had also to reboots. But I want keep this app.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
Hi odiad, i never had random reboots and use the Rom since end of may. I use Corona warning app as well and therefor bluetoth is always on.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
Hi Strauchjam - okay - that means there is a chance to have no problems. After a third sudden reboot while car driving I went back from June-version to May version to check if problems will disappear. On Wednesday I'll be again on the highway, listening music via bluetooth for some hours to see if everything work now.... If everything is okay maybe I will try June version again.

If everything fails and I want to change Rom:

- how to go back to Stock? (sony companion software repair does not work with open bootloader)

- Can I use LOS-recovery to install other Roms ? And if yes - for all or only Android 10-Roms?

Thanks in advance for answers/explanantions

Greetings Odiad
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] pumikachu:
for me this does not answer the question, as it was a simple yes/no question targeted to a specific device/rom without any need for a general explanation of safetynet........which is was happens in this blogpost.

or is your answer basically "no it does not pass and we (lineageos) wont do anything about it"?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
stock firmware should go with xperifirm tool and newflasher. i never did it, but this might be the right tool.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] &(*):
Simple answer, pumikachu: if SELinux is set to "Disabled || Permissive", safety-net will fail validation and not allow installs of apps that require encrypted keys that authenticate with a server; or something similar to the integrity of your system has been tampered with. You can either try the other build of 17.1 and setenforce=1 via terminal or maybe try it on this one (which is a debug version and will more than likely break). I've had mixed results with the command in the past and it depends on if data is being encrypted or not.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] pumikachu:
Ah thanks, you are absolutely right I completely overlooked this SE Linux remark :eek:
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] BabeAn:
I got my xz2 compact from a friend. The bootloader already unlocked (as attached).

When I boot up, it shows the screen "Your device can't be checked for corruption...".

My phone is now in Feb security update and can't receive any other updates. Firmware now 52.1.A.0.618.

The problem is I can't boot into recovery. Turn off device and hold power + volume down doesn't work. It just boots up like normal. Using adb reboot recovery also doesn't work. Screen just turns black with no LED indicator.

Question is: how can I boot to recovery now? Your help is highly appreciated. This is my first sony device. Thanks.

UPDATE:. got it worked via twrp. After installing twrp 3.4 got stuck in recocery loop. The "Fix recovery bootloop" in twrp didn't work so I just proceeded to sideload the rom. After sideloading phone booted to "Lineage Recovery" and I sideloaded the rest from the. Enjoying my first Lineage OS now :).
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] BabeAn:
I assume it would take a few days for the battery usage to stable as it is my first day with this rom. How is your battery experience so far?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
I formated my sd-card (200GB) with exfat (tryed at pc and mac) to have the ability of larger the 4GB files. After restart, android wants to reformat the sdcard, otherwise it wont be able to mount it. But then i only get the vfat-format and there is a limitation of filesize <4GB. Does anyone have a clue how to handle this, maybe there is an thirdparty app...? Thanks for the help and yes the sdcard works, for now with vfat...
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] pumikachu:
Would be formatting in ext4 an option?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
i did not tryed it, but assume it would work (the system ist formatet ext4). but then i can not easily change files from the card over cardreaders on pc or mac.

on my former mobile z3c with lineage it wasnt a problem to insert exfat card, so i thought it should work here, but it doesnt. Maybe a kernel driver is needed?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] juancho0703:
a query someone else has problems with the automatic brightness and with the gyroscope of the cell phone and they can tell me if there is any update :crying:
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Ungewiss:
It's very good. In the evening the phone usually is at 70%, so I recharge to 80-90% and that's it. No gapps, though. That might make a difference ;)
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] odiad:
Hi Ungewiss. To complete this information I like to say that with gapps, what is for me more usual, the battery life is similar like stock rom. At least it is similar for me with gapps and all other apps that I have installed...
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] shajk-00:
Is it possible to install TWRP once I flashed the rom?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] strauchjam:
No, it is not. I tried it and failed. Look at #260 here: https://xdaforums.com/xperia-xz2/development/recovery-twrp-3-3-1-0-t4074305/page26

---------- Post added at 11:34 AM ---------- Previous post was at 11:28 AM ----------

yesterday i updated the july-version 20200708... of the rom through recovery adb sideload. when i booted the system, sadly it endet up with an error of recognizing the system and i had to do a factory reset... lost all the settings and progs. i dont know why, last time it worked easyly. is anything different now?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] lba810701:
I updated the system too, and I haven't got any error. Just, when sideloaded the zip, my first download from the usa server was corrupt. Stops the sideload and, it asked from me am i really want to sideload it or not. I redownload from another server, then it was good. ( No error during the process ).

After that i reboot from los to los recovery again, flashed gapps again, reboot from los recovery to fastboot, and flashed magisk patched boot again. Everything was good.

Just the double sim card mamagement is different a little. Until the last update, if i take the phone to airplane mode and after i switch it off, its asked both sim pin, and i must set up the sim cards again.. and sometimes the phone reboot... So i dont use the airplane mode.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] shajk-00:
BUG REPORT: H8324

* Automatic brightness adjustment that doesn't seem to work right.

* proximity sensor also, since when listening to audios or when in a call, it doesn't shut off the screen automatically

* Gyroscope
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Danj1:
Hi [MENTION=4329876]Olivier[/MENTION],

sorry to bother, but are you gonna release a new version related to firmware version 52.1.A.3.49?

Thanks in advance
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Olivier:
Sure, I've been running a test build with the new blobs and SELinux set to enforcing. I'll upload a new build tonight.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] brod56:
Is this rom stable enough for daily usage yet, or do you recommend waiting a few more weeks?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Ungewiss:
It is definitely stable enough. I have been using it for more than two months.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Olivier:
A new build is up, please check the OP.

NOTE: SELinux has been set to enforcing (we'll go official soon). Please test thoroughly and report bugs as always (don't forget to attach logs).

That being said, Sony stock camera app is now broken (unless you set SELinux to permissive, which is not recommended) and will be fixed later -- I currently don't have enough time to debug add-ons; core functionality is more important.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] shajk-00:
Thank you this is much appreciated, is there any news about the issues with gyroscope and brightness sensor?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] logan123456:
touch issue

does this rom fix the notification scrolling down the touch issue
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] brod56:
Going official means we'll have OTA updates? :)

I will give this a try next weekend.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] shajk-00:
So I solved the issues I had with gyroscope and brightness sensor by flashing a clean official firmware again. The problem I have now is that with the last lineage os build the system doesn't properly detect the sim cards that I have. I tried downgrading to the previous one (708) and no issues so far. So I guess this could be a bug or something, since I've tried again with a clean flash and everything but nothng worked with the last build
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Danj1:
Hi,

I installed the new build and faced some shutdown issues once I reset the device. It happens either by resetting via "recovery -> factory reset" and or also "fastboot -w". I had seen also some "com.android.phone" app exception before the device shuts down itself. After a second boot I can configure the device. Not sure if this is related to LineageOS or Android itself. I attached the logcat created with "adb logcat -d > logcat.txt".

Kind regards
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Olivier:
I'll probably upload a new build with SELinux set to permissive because enforcing causes several issues (as expected). Nevertheless, I'd still strongly encourage everyone to test the experimental build and upload logs (logcats, dmesg, ...) so that all critical SELinux denials (which cause the new set of "bugs" and weird behavior) can be addressed.

Also note that most of the time, you the data partition doesn't have to be wiped after flashing a new build -- just flash an older (properly working) build.

I... don't think this was ever an issue?

Yes.

Thanks for the logs, but I can't seem to download them (getting a 404 response) - can you please upload them elsewhere?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Danj1:
Hi, here you go: https://drive.google.com/file/d/1z8YKhDbbTj3JM5sGoGIOHGujRMkr7GFh/view?usp=sharing
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] shajk-00:
flashing a newer build over a previous one causes Gapps to erase?
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] JimmyTheFirst:
Yes. Simply flash the new build, reboot to recovery (don't skip this step!) and flash your gapps and Magisk if you want to.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] Olivier:
I've uploaded a new build -- all critical SELinux denials should be addressed now.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] brod56:
I'm having trouble accessing internal storage. Gallery cannot even open; cannot take screenshots ("not enough space").

Twrp recovery (sideload) flashed to slot B. Could this be related to the issue? Or lacking permissions?

------

Edit 1: Logcat: https://1drv.ms/t/s!ArhHUW8jinH3iYAj8X2-1o3PjQFIPg

------

Edit 2: I solved the issue by erasing user data via lineage recovery. I'm still gonna leave the logcat in case you want to have a look.
[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] zynexiz:
Is there any additional steps needed to install Magisk? I have tried to sideload the zip file, and patched boot.img provided from the first page without any success. When trying to sideload the zip in los recovery, it just reboot to fastboot. When tring to patch boot.img it got stuck on Sony logo.