[Xperia Z5 Compact Original Android Development] nilezon:
TWRP for Z5 Compact E5823

Credits first

Most of the ideas and some of the code are kang'd from [MENTION=5971873]dl12345[/MENTION] and his TWRP v2.8.7.0 for Sony Z3+

The first release of this recovery was based on Zombie b1 by [MENTION=5243932]Tommy-Geenexus[/MENTION]

Known problems

Colors are a bit distorted - but I think it looks good (fixed)

Not working with encrypted phone (unconfirmed)

How to build

Not for beginners

Please contribute to my repositories by creating pull requests if you manage to fix any bugs

First, sync omnirom sources:

repo init -u git://github.com/omnirom/android.git -b android-5.1
repo sync

Waaaaaiiiiiit.

Create a local manifest:

mkdir .repo/local_manifests/
nano .repo/local_manifests/twrp.xml

Manifest contents:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="sony" fetch="git://github.com/sonyxperiadev/" />
<remote name="jackfagner" fetch="git://github.com/jackfagner/" />
<project path="device/sony/kitakami" name="twrp-device-sony-kitakami" groups="device" remote="jackfagner" revision="TWRP" />
<project path="device/sony/suzuran" name="twrp-device-sony-suzuran" groups="device" remote="jackfagner" revision="TWRP" />
<project path="kernel/sony/kitakami" name="twrp-kernel-sony-kitkami" groups="device" remote="jackfagner" revision="TWRP" />
<project path="vendor/sony/system/dtbtool" name="twrp_vendor_sony_system_dtbtool" groups="device" remote="jackfagner" revision="TRWP-28.0.A.8.251" />
<project path="vendor/sony/system/mkivybootimg" name="twrp_vendor_sony_system_mkivybootimg" groups="device" remote="jackfagner" revision="TRWP-28.0.A.8.251" />
<project path="vendor/sony/system/thermanager" name="thermanager" groups="device" remote="sony" revision="master" />
<project path="vendor/sony/system/macaddrsetup" name="macaddrsetup" groups="device" remote="sony" revision="master" />
<project path="vendor/sony/system/timekeep" name="timekeep" groups="device" remote="sony" revision="master" />
</manifest>

Sync again.

repo sync

Download Sony binaries and unzip inside repo dir:

unzip SW_binaries_for_Xperia_AOSP_L_MR1_v12.zip

Setup your environment variables (ARCH and CROSS_COMPILE), then build as usual:

source build/envsetup.sh && lunch
make -j 4 recoveryimage

Binary download

Current (kernel and recovery):

TWRP for Z5C, based on kernel 32.0.A.6.152 (v2) (10.11.15)

GDrive mirror for all you MEGA haters

Old versions:

TWRP for Z5C, based on kernel 32.0.A.6.152 (v1) (07.11.15)

TWRP for Z5C, based on kernel 32.0.A.5.32 (29.10.15)

TWRP for Z5C, first release (28.10.15) - recovery only

Instructions

Boot using:

fastboot boot recovery.img

Or, better yet, flash to your phone (will replace your kernel):

fastboot flash recovery recovery.img
fastboot flash boot boot.img

When you see an amber LED, press volume buttons a few times to boot to TWRP.

Instructions to kernel developers (I'm looking at you [MENTION=5243932]Tommy-Geenexus[/MENTION])

Like most Sony phones, the Z5/Z5C cannot boot from the recovery (FOTAKernel) partition.

This is "solved" by letting the kernel boot image chain load the recovery ramdisk.

I was looking around for a nice script to do this, but - no offence - they were all pretty bad.

So I wrote a less bad one:

https://github.com/jackfagner/twrp-sony-recovery-boot-script