[Xperia Z5 Compact General] Dean F:
I rooted my phone following the guide from user "smartphone-tester". I wanted to update his post as there were 1 or 2 mistakes, and shorten in to make rooting seem a little less scary. His original post is here: http://xdaforums.com/z5-compact/general/summary-tutorial-root-sony-xperia-z5-t3360515

STEP 1 Backup your device

Move everything you want to keep onto the SD card or your PC. Your phone will be completely wiped.

STEP 2 Downgrade to exploitable firmware release

2.1 Download XperiFirm from http://xdaforums.com/crossdevice-dev/sony/pc-xperifirm-xperia-firmware-downloader-t2834142

2.2 In XperiFirm - download firmware build 32.0.A.6.200 with XperiaFirm (E5823_StoreFront_1299-6910_32.0.A.6.200_R2B)

2.3 Download flashtool from http://www.flashtool.net/index.php(get latest version)

2.4 In Flashtool - Create FTF file. Select Tools->Bundles->Create

2.5 In FlashTool - Flash the FTF in flashmode. Make sure to select the checkboxes under Wipe. (Takes 10 minutes)

STEP 3 TA / DRM Keys Backup and root current firmware

3.1 Download Ivy Root http://xdaforums.com/crossdevice-dev/sony/iovyroot-temp-root-tool-t3349597

3.2 Connect your phone in ADB mode, in a command window run:

adb push "root/iovyroot" "/data/local/tmp/iovyroot"

adb push "root/backup.sh" "/data/local/tmp/backup.sh"

open shell: adb shell

chmod 777 /data/local/tmp/iovyroot

chmod 777 /data/local/tmp/backup.sh

mkdir /data/local/tmp/tabackup

/data/local/tmp/iovyroot /data/local/tmp/backup.sh

exit

adb pull "/data/local/tmp/tabackup/"

STEP 4 UPGRADE TO LASTEST ANDROID (6.01)

4.1 In XperiFirm - download firmware 32.2.A.6.224 (get the build for your model, mine is E5823_Customized TW_1298-7315_32.2.A.0.224_R9C)

4.2 In Flashtool - create FTF file from E5823_Customized TW_1298-7315_32.2.A.0.224_R9C and flash in flashmode.

4.3 In your phones setting, under develop options - select "Enable OEM Unlock"

4.4 Unlock your bootloader by following these steps excactly :http://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader/

STEP 5 ROOT ANDROID 6.01

5.1 Download SuperSu 2.74 or greater. Copy the zip file onto your Z5 Compacts internal storage https://download.chainfire.eu/964/SuperSU/BETA-SuperSU-v2.74-2-20160519174328.zip

5.2 In Flashtool -> Tools -> SIN Editor , then extract the kernel from kernel.sin in the directory created by XperiFirm when you downloaded 32.2.A.6.224. It creates an .elf file

5.3 Download rootkernal tool from http://xdaforums.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605 extract the zip into a folder, then copy the .elf file into the folder

5.4 In a cmd window go into your extracted rootkernal folder, run the command: rootkernel kernel.elf kernel-patched.elf

5.5 When rootkernel is running, select Disable Sony RIC, install TWRP, install busybox, install DRM fix

5.6 Put your phone into fastboot mode (Turn off phone, hold volume up and plug in USB)

5.7 Flash your patched Kernel to your phone with this command: fastboot flash boot kernel-patched.elf

5.8 Go Into TWRP(unplug usb, turn phone on, then keep hitting volume up until phone goes into TWRP)

5.9 Install SuperSu : Select Install, Select SuperSU zip --> systemless mode

STEP 6

6.1 Restart your Device and your done!

DRM KEYS: While we did make a backup for the TA partition containing the DRM keys, this tutorial did not explain how to restore that because in STEP 5 when patching the kernel we selected to use the DRM Fix. This DRM Fix should be good enough - as everything on my phone is working 100%, but should you ever need to restore your TA partition in the future you have your backup.