[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] ordam:
Thanks Martin ... very nice work!

Got twrp and magisk working :D

i wrote me down the steps i did

... perhaps for people like me it give a few more details how and what to do:

My device Xperia XZ2C Dual -> H8324

installed software 52.0.A.8.25 (1313-6204_R2B)

take some photos and videos

install driver at Windows 10

Xperia_XZ2_driver.zip

developer.sony.com...im not allowed to post urls because Im a newbe at the formum​

connect mobile device

device manager

usb devices

windows already detect a ADB interace

update driver with the one of the zip file

-> Sony sa0118 ADB Interface Driver

in case of windows 10 64 bit​

unzip platform-tools_r28.0.3-windows.zip

enable usb debugging on mobile device

optional: enable developer options on mobile device

settings>about

tap on "build number" 7 times​

settings>system>developer options

enable OEM unlock

enable usb debugging​

check connection

open cmd

browse to unziped platform-tools folder

> adb devices

C:\Users\pbr\AA_Work\platform-tools>adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
BH90XXXXBZ device

> adb reboot bootloader

device should start in fastboot mode

driver doesnt not get recoginized from windows 10

chose manualy the "sony sa0118 ADB interface driver"

(group ??? mobile devices ??? check name again!)​

restart windows

open cmd

> adb reboot bootloader

device start in fastboot mode (led blue)​

> adb devices

List of devices attached

-> adb not working because of fastboot​

> fastboot devices

BH90XXXXBZ fastboot

extract 2019-04-24_14-09-09_sony_stock_twrp_xz2c_52.0.A.8.25.tar.gz	to fastboot-folder

files:

Magisk-v18.1.zip

MagiskManager-v7.1.1.apk

permissive.zip

twrp-xz2c.img

vbmeta.img

[Pie]Camera_fix_by_MartingX3.zip

[Pie][Magisk]Camera_fix_by_Serajr.zip
​

cmd

> fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

Sending 'vbmeta' (4 KB) OKAY [ 0.000s]
Writing 'vbmeta' OKAY [ 0.000s]
Finished. Total time: 0.034s

> fastboot boot twrp-xz2c.img

Sending 'boot.img' (34144 KB) OKAY [ 0.767s]
Booting OKAY [ 5.617s]
Finished. Total time: 6.450s

device screen show "Your device software cann't check for corruption. Please lock the bootloader."

device screen show [TWRP]

TWRP

Mount Decrypt Data

-> ask for password

> 1234 (enter password to unlock device)​

Unmodifed System Partition

-> keep system read only?

> allow to modify​

cmd

> adb push twrp-xz2c.img /sdcard/

twrp-xz2c.img: 1 file pushed. 35.8 MB/s (34963456 bytes in 0.932s)

TWRP

Advanced menu > install recovery ramdisk > chose /sdcard/twrp-xz2c.img

> checkmark "Back up existing image first"

> swipe to install

Updating partition details...
...done
Full SELinux support is present.
Data successfully decrypted
Updating partition details...
...done
Unpacking Boot...
Backing up Boot...
Unpacking /sdcard/twrp-xz2c.img...
Repacking Boot...
[IMAGE FLASH STARTED]
Image to flash '{tmp/repackorig//new-boot.img'
Calculation restore details...
[IMAGE FLASH COMPLETED]

> cancel

> Reboot > Recovery

already checkmarked

Prompt to install TWRP app if not installed

Install as a System App​

> swipe to install TWRP app​

Device is rebooting to TWRP

TWRP

enter passwort again​

cmd

> adb push Magisk-v18.1.zip /sdcard/

Magisk-v18.1.zip: 1 file pushed. 34.6 MB/s (4362466 bytes in 0.120s)

TWRP

Install > chose /sdcard/Magisk-v18.1.zip

> swipe to confirm flash

Updating partition details...
...done
Data successfully decrypted
Updating partition details...
...done
Full SELinux support is present.
MTP Enabled
Installing zip file '/sdcard/Magisk-v18.1.zip'
Checking for Digest file...
************************
* Magisk v18.1 Installer
************************
- Current boot slot: _b
- Mounting /system, /vendor
- Using system_root_image, keep dm/avb-verity
- Encryped data detected, keep forceencrpt
- Target image: /dev/block/sda46
- DTBO image: /dev/block/sda49
- Device platform: arm64
- Constructing enviroment
- Unpacking boot image
- Checking ramdisk status
- Stock boot image detected
- Backing up stock boot image
- Patching ramdisk
- Repacking boot image
- Flashing new boot image
- Unmounting partitions
- Done
Updating partition details...
...done

> reboot system​

device boot stock rom

RSA key need to be confirmed

msg: TWRP App Update Required Please update the TWRP App!​

download Magisk Manager v7.1.2

cmd

> adb install MagiskManager-v7.1.2.apk

Performing Streamed Install
Success

device

start Magisk Manager app​

take photo

... but now i come to my issue. I hope one of you is much more expierenced and can advice me.

I was able to take ONE photo and than the camera app opened a "allow or deny access screen" but i was clicking fast at the camera and did not realized what i denied. Anyway after this the camera app is crashing with a unknown error. I checked as well the permissions of the app and set all to allow the access, but it does not change anything. If i start the camera app with the front camera I'm still able to take pictures but as soon i want to use the back camera the app is crashing.

The msg i get is "Error Unknown error." or "Error Cannot start camera. Restart camera or device.". For sure i tried to restart the mobile and the camera app but the behaviour stays.

H8324:/ # cat /sys/devices/dsi_panel_driver/panel_id
4

H8324:/ # ls -lha /vendor/lib/modules/
total 8.8M
drwxr-xr-x 2 root shell 4.0K 2019-03-22 10:27 .
drwxr-xr-x 13 root shell 16K 2019-03-22 10:27 ..
-rw-r--r-- 1 root root 301K 2019-03-22 10:27 bu520x1nvx.ko
-rw-r--r-- 1 root root 1.2M 2019-03-22 10:27 clearpad_core.ko
-rw-r--r-- 1 root root 261K 2019-03-22 10:27 clearpad_i2c.ko
-rw-r--r-- 1 root root 298K 2019-03-22 10:27 clearpad_rmi_dev.ko
-rw-r--r-- 1 root root 307K 2019-03-22 10:27 fpc1075_platform.ko
-rw-r--r-- 1 root root 269K 2019-03-22 10:27 ldo_vibrator.ko
-rw-r--r-- 1 root root 33K 2019-03-22 10:27 llcc_perfmon.ko
-rw-r--r-- 1 root root 2.0K 2019-03-22 10:27 modules.alias
-rw-r--r-- 1 root root 2.4K 2019-03-22 10:27 modules.dep
-rw-r--r-- 1 root root 30K 2019-03-22 10:27 mpq-adapter.ko
-rw-r--r-- 1 root root 179K 2019-03-22 10:27 mpq-dmx-hw-plugin.ko
-rw-r--r-- 1 root root 42K 2019-03-22 10:27 nxp_pn553_nfc.ko
-rw-r--r-- 1 root root 16K 2019-03-22 10:27 pinctrl-wcd.ko
-rw-r--r-- 1 root root 7.7M 2019-03-22 10:27 qca_cld3_wlan.ko
-rw-r--r-- 1 root root 26K 2019-03-22 10:27 rdbg.ko
-rw-r--r-- 1 root root 285K 2019-03-22 10:27 sim_detect.ko
-rw-r--r-- 1 root root 239K 2019-03-22 10:27 snd-soc-sdm845.ko
-rw-r--r-- 1 root root 128K 2019-03-22 10:27 snd-soc-wcd-mbhc.ko
-rw-r--r-- 1 root root 46K 2019-03-22 10:27 snd-soc-wcd-spi.ko
-rw-r--r-- 1 root root 711K 2019-03-22 10:27 snd-soc-wcd934x.ko
-rw-r--r-- 1 root root 133K 2019-03-22 10:27 snd-soc-wcd9xxx.ko
-rw-r--r-- 1 root root 80K 2019-03-22 10:27 snd-soc-wsa881x.ko
-rw-r--r-- 1 root root 646K 2019-03-22 10:27 sony_camera.ko
-rw-r--r-- 1 root root 57K 2019-03-22 10:27 swr-wcd-ctrl.ko
-rw-r--r-- 1 root root 542K 2019-03-22 10:27 synaptics_tcm_core.ko
-rw-r--r-- 1 root root 306K 2019-03-22 10:27 synaptics_tcm_device.ko
-rw-r--r-- 1 root root 287K 2019-03-22 10:27 synaptics_tcm_diagnostics.ko
-rw-r--r-- 1 root root 284K 2019-03-22 10:27 synaptics_tcm_i2c.ko
-rw-r--r-- 1 root root 296K 2019-03-22 10:27 synaptics_tcm_recovery.ko
-rw-r--r-- 1 root root 423K 2019-03-22 10:27 synaptics_tcm_reflash.ko
-rw-r--r-- 1 root root 397K 2019-03-22 10:27 synaptics_tcm_testing.ko
-rw-r--r-- 1 root root 310K 2019-03-22 10:27 synaptics_tcm_touch.ko
-rw-r--r-- 1 root root 353K 2019-03-22 10:27 tcs3490.ko
-rw-r--r-- 1 root root 1.0M 2019-03-22 10:27 texfat.ko
-rw-r--r-- 1 root root 288K 2019-03-22 10:27 tof_sensor.ko
-rw-r--r-- 1 root root 78K 2019-03-22 10:27 tspp.ko
-rw-r--r-- 1 root root 213K 2019-03-22 10:27 wcd-core.ko
-rw-r--r-- 1 root root 40K 2019-03-22 10:27 wcd-dsp-glink.ko

i have a logcat where just start the app and it crashes but it is too long for posting as well i guess i cannot attach it here because im a newbe in the forum.

I guess the issue regarding the camera here of the post are usually different, because i was able to take a picture once. But perhaps someone can advice me what to do. Perhaps i should post it somewhere else? Or just flash the stock software again? Or something else?