[Sony Cross-Device General] Johncoool:
The below details should work on Windows 7, 8.1, 10.Read the above post before continuing with this one.

Use Emma Sony flash tool to restore any bricked Sony Xperia device, all it requires is the program and the cable and internet connection. If it does not restore the phone to the same version of android that you had before then after restoring the phone with the Emma program then Use the "Sony mobile flash tool by Androxyde" program. This will require to download the Stock version of your device that you want and then flashing it.

Make sure to install the drivers for the Xperia Z5 compact before starting this process and make sure that you can access it.

Emma flash tool link: https://developer.sony.com/develop/open-devices/get-started/flash-tool/download-flash-tool/

Sony mobile flash tool by Androxyde link: https://sonymobileflasher.com/

Unlocking bootloader is required for this to work, to unlock any Xperia booloader (It will delete all phone data) link: https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/

Custom ROM for Z5c link: https://theunlockr.com/roms/android-roms/sony-roms/sony-xperia-z5-compact-roms/

Drivers for E5803 link: https://developer.sony.com/file/download/xperia-z5-compact-driver/

TWRP recovery that worked for me (The one from this thread was unable to detect my SD card) link (Only some of them work well from this link): https://www.dropbox.com/sh/lficbbcj7qbb1uc/AAAgvVuHaLxm6cbqi-21ue0Ca/Z5 Compact (Suzuran)?dl=0&subfolder_nav_tracking=1

To Root the custom recovery then use Magisk from the link (Read the details to do it correctly): https://magiskmanager.com/

* If the phone won't turn back on then it might have overheated and just wait for it to cool down.

* If the touch screen has dead zones, then connect a wired PC mouse to the OTG connection before turning it on. It will also work in TWRP recovery mode.

1- Copy the files from the TWRP recovery and paste them into the ADB tools folder.

2- Copy the custom ROM and place it on the SD card.

3- Open the ADB tools folder and type CMD in the folder address bar and press enter to open the ADB console.

4- Turn phone off then press on the volume up key and connect the phone with a micro USB connection until the notification light goes to blue.

5-Enter the below command:

fastboot flash boot "Use same name as the copied TWRP".img

6- Enter the below command:

fastboot flash recovery "Use same name as the copied TWRP".img

7- Then switch on you phone normally or press the volume down key and power it on. Either one will start the TWRP recovery.

8- Flash the new ROM from the SD card.

9- To root the device then refer to the link about rooting that is added in this post above.

* There are 4 TWRP recoveries from the download link. At least 2 of them should work for this method. So try them until you find the one that works for you.

* To force shut off the phone if it is stuck then press the volume up key with the power button for a short while.

The Flashed boot with the TWRP will be deleted after flashing the ROM and then the phone will work normally and TWRP recovery will start using the same methods that work on other Android devices.

If a custom ROM does not work then go to wipe in TWRP recovery and format data.