[Xperia Z1 Compact General] derf elot:
Encryption is still a bit of a mystery to me sometimes. Been trying to get decryption working in TWRP with my latest CM build, but it's not even asking for a password/pin anymore right now (even though I have set all the TW flags that were enough to get it to work in LP and MM). I will try some more at a later time.

Here's my manifest to build TWRP:

<?xml version="1.0" encoding="UTF-8"?>
<!--Please do not manually edit this file-->
<manifest>
<!-- This xml is project for make sony targets work with AOSP hardware -->
<!-- CM stuff -->

<remove-project name="CyanogenMod/android_bootable_recovery" />
<remove-project name="CyanogenMod/android_hardware_qcom_audio" />
<remove-project name="CyanogenMod/android_hardware_qcom_display" />
<remove-project name="CyanogenMod/android_hardware_qcom_fm" />
<remove-project name="CyanogenMod/android_hardware_qcom_media" />
<remove-project name="CyanogenMod/android_packages_apps_FMRadio" />

<project name="derfelot/android_bootable_recovery" path="bootable/recovery" remote="github" revision="android-7.1" />
<project name="sonyxperiadev/packages-apps-FMRadio" path="packages/apps/FMRadio" remote="github" revision="master" />

<!-- common -->
<project name="derfelot/android_device_sony_common" path="device/sony/common" remote="github" revision="cm-14.1" />

<!-- rhine -->
<project name="SonyCM/android_device_sony_rhine" path="device/sony/rhine" remote="github" revision="cm-14.1" />
<project name="derfelot/android_device_sony_amami" path="device/sony/amami" remote="github" revision="cm-14.1-twrp" />

<!-- sony sepolicy -->
<project name="sonyxperiadev/device-sony-sepolicy" path="device/sony/sepolicy" remote="github" revision="n-mr0" />

<!-- kernel 3.10 -->
<project name="sonyxperiadev/kernel" path="kernel/sony/msm" remote="github" revision="aosp/LA.BR.1.3.3_rb2.14" />

<!-- qcom hardware -->
<project name="SonyCM/android_hardware_qcom_audio" path="hardware/qcom/audio/default" remote="github" revision="cm-14.1" />
<project name="SonyCM/android_hardware_qcom_display" path="hardware/qcom/display" remote="github" revision="cm-14.1" />
<project name="sonyxperiadev/vendor-qcom-opensource-fm" path="hardware/qcom/fm" remote="github" revision="master" />
<project name="SonyCM/android_hardware_qcom_media" path="hardware/qcom/media" remote="github" revision="cm-14.1" />

<!-- sony hardware -->
<project name="derfelot/android_hardware_sony_camera" path="hardware/sony/camera" remote="github" revision="cm-14.1" />
<project name="sonyxperiadev/thermanager" path="hardware/sony/thermanager" remote="github" revision="master" />
<project name="sonyxperiadev/timekeep" path="hardware/sony/timekeep" remote="github" revision="master" />
<project name="sonyxperiadev/macaddrsetup" path="hardware/sony/macaddrsetup" remote="github" revision="master" />
<project name="sonyxperiadev/device-sony-common-init" path="hardware/sony/init" remote="github" revision="master" />
<project name="sonyxperiadev/vendor-qcom-opensource-dataservices" path="hardware/sony/dataservices" remote="github" revision="master" />

<!-- vendor -->
<project name="SonyAosp/vendor_nxp" path="vendor/nxp" remote="github" revision="android-7.0" />
<project name="SonyAosp/vendor_qcom" path="vendor/qcom" remote="github" revision="android-7.0" />
<project name="SonyAosp/vendor_sony" path="vendor/sony" remote="github" revision="android-7.0" />
<project name="SonyAosp/vendor_qcom_firmware" path="vendor/qcom/firmware" remote="github" revision="android-7.0" />
</manifest>

You will also need a busybox, I got the one from omnirom

<project name="omnirom/android_external_busybox" path="external/busybox" remote="github" revision="android-7.1" />

I have forked some SonyCM stuff to merge updates from sonyxperiadev. Also, the android_bootable_recovery from omnirom needed a little tweak.

You could try to comment out the the key that says "key xxx POWER" and replace the CAMERA in "key xxx CAMERA" to POWER. It might work, not sure though.

I have uploaded a new CM14.1 build, now based on Android 7.1.1. Some upstream changes from sonyxperiadev are in there too. You can grab it here:

https://www.androidfilehost.com/?fid=673368273298916137