[Sony Xperia XZ Premium ROMs, Kernels, Recoveries, ] AKmatiAK:
Hi. I installed it yesterday and it works well, except there is a problem with apps running in the background, battery optimization causes them to not work properly. Even if I disable all battery restrictions on one app (Threema) it is still blocked by system. I receive notifications only when I enter this app. On stock ROM it worked without problem. I have read about it and it's problem with battery restrictions (that's written in articles on developer site).

I'm not advanced enough to tell if services.jar is the same for everyone using this ROM, but if it doest't contain personal or sensitive data and will work for others I can share my patched magisk module for spoofing. I have dual sim model (G8142).

EDIT: Don't install nanodroid - it's better to manualy install apps included in nanodroid, as it's outdated (nope, I just downloaded outdated version...) and removing unwanted apps is complicated when installed by nanodroid. Also, I recommend to not install Smart Pack Kernel Manager - I'm currently testing was it cause of my notifications issue, and I found it not useful for average user, but it's your decision of course.

RESULT: It was not kernel manager. Damn, it's really annoying, I don't have notifications from app I use the most :/

SOLVED: I had to enable google cloud messaging in microG settings and now it works.

Also here's my noob easy step-by-step tutorial to make private system:

download lineageos from this thread

download twrp 3.5.2 for maple or maple dualsim (dsds)

download adb platform-tools 26.0.2 and newest (26.0.2 for unlocking bootloader as newer versions doesn't work)

download latest magisk.zip, optionally fakestore2playstore if you need in-app purchases

enable developer mode by clicking 7 times compilation number in settings -> informations/about

enable usb debugging and oem unlocking in programmist settings

install drivers - this is complicated part - download them from:

https://developer.sony.com/file/download/xperia-xz-premium-driver/ - it's driver for adb

http://akmatiak.hoste.pl/usb_driver_r13-windows_sony_fastboot.zip - fastboot driver (merged by me from google usb driver and sony fastboot driver, you can make it by yourself if you don't trust me)

to install adb driver plug phone to computer, enter devices manager, there will be android in unknown devices, click update drivers, update manually and navigate to unpacked zip of adb driver and install.

to install fastboot driver you first need to enter fastboot mode

unpack platform-tools 26

unpack platform-tools newest

go to newest version platform-tools folder, click shift+right mouse and "open terminal here"

adb devices to check is connection estabilished, and accept key request on your phone

write adb reboot bootloader

now you're in fastboot mode. go to device manager, unknown android is now your phone in fastboot mode, click update driver, select from drive, and navigate to unpacked zip with fastboot driver

now go to platform-tools 26 and open terminal

https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/ get bootloader unlock code

WARNING!!! NEXT STEP WILL FORMAT ALL YOUR DATA (AND DELETE DRM IF U CARE ABOUT IT)

in terminal: fastboot.exe -i 0x0fce oem unlock 0xKEY (of course replace key with obtained unlock code...)

now copy magisk.zip, lineage.img, twrp.img to newest adb folder

command: adb reboot bootloader

wait to reboot

fastboot flash recovery twrp.img

wait until it finishes

to enter recovery: vol- and power button

after recovery loads swipe to allow modifications, check in mount is system mounted

then go to wipe and wipe everything except internal storage

go to advanced -> adb sideload

in cmd: adb sideload lineage.img

wait till the end

wipe cache/dalvik (idk is it neccesary but i did it)

reboot to system

go through configuration, then enable developer mode in android, enable usb debugging, root usb debugging

command: adb push magisk.zip (or just copy magisk.zip to your device)

command: adb reboot recovery

install magisk and reboot to system

now you can flash packages in magisk app if you need to

download simple apps (that orange) from f-droid

switch default stock system apps: music, phone - to simple phone I recommend, SMS - to QKSMS, gallery - to simple gallery

disable stock crap

go to magisk and search microg installer revived from repository, install it, reboot

download fakestore2playstore and flash it by magisk and reboot

download aurora services zip for magisk, flash, reboot (idk if neccesary, go to next step first and check in settings -> apps is it already installed after downloading aurora)

download aurora store from f-droid

flash signature spoofing patches (create them as mentioned earlier in this thread or if it possible I share ready packages)

may be useful: to reset when stuck in loading screen - vol+ + power

after that to enter recovery vol- + power

I performed my installation from windows 7 64, and created signature spoofing patch in xubuntu 18.04 64

happy bricking 😜