[Sony Xperia XZ1 Compact Questions & Answers] Raz0Rfail:
This is a Tutorial about patching XperiFix from Storm// to use it with new Firmwares.

It's not officially provided or allowed by him!

At first I have to be clear at the following points:

The Patch has the same requirements as XperiFix itself (without the old firmwares)

Your Device must have a unlocked bootloader.

With unlocking your bootloader, you will loose your DRM Keys for this phone forever!

The XperiFix is only simulating DRM-Keys, so the camera and other things can be used again.

You should have installed the correct drivers for bootloader and USB-Debugging

Get Software

Download and install XperiFix first on your PC:

https://www.xperifix.com/download/xperifix-latest/ Version2.2

For patching XperiFix download DnSpy on Github(https://github.com/0xd4d/dnSpy/releases/tag/v4.5.3)

Get TWRP for your FW: https://androidfilehost.com/?w=files&flid=232371 (current for .145 FW is twrp-3.2.1-0-lilac-10-patchlevel-2018-04-05.img)

Get and install Firmware

At first you need the Current firmware on your Device.

I use FlashTool to download and flash the Firmware: http://www.flashtool.net/downloads.php

Download new XZ1c-Firmware trough XperiFirm inside FlashTool.

After the download close XperiFirm to create the new FTF-file from FlashTool automaticly.

In FlashTool click Flash --> Flashmode --> Select new Firmware (don't change anything at wiping or excluding), execute the flash.

After flash reboot phone into system, it needs time just wait!

If reboot is from Android needed to finish upgrade, let the phone do it.

Patch XperiFix

Extract DnSpy from zip-file.

open DnSpy.exe, Open XperiFix.exe under File --> Open (C:\XperiFix\XperiFix.exe).

In "Assembly Explorer" switch to XperiFix (2.2.0.0) --> XperiFix.exe--> (XperiFix (Yellow Color) --> Form1 in tree structure.

Right Click on public Form1(), "edit Method".

In the new Window, you are able to change the source code.

replace the following variable

this.validfw = new List<string>

{

"47.1.A.8.49",

"47.1.A.12.34",

"47.1.A.12.75"

};

with

this.validfw = new List<string>

{

"47.1.A.8.49",

"47.1.A.12.34",

"47.1.A.12.75",

"47.1.A.12.119",

"47.1.A.12.145"

};

Click on the Button compile. You will see the changes in the main Window from DnSpy.

Click on File -> Save Module --> enter name, save the .exe-file.

Start the patched XperiFix.exe

reboot phone into Bootloader and connect it to your pc, because there XperiFIX can detect it without crashing.

If everything was correct patched with DnSpy you should be allowed to use it.

Set the hook and click on "FIX my Device!" then let XperiFIX do it's work.

if you see magisk and XperiFIX get flashed inside twrp everything is fine.

if the phone restarts into system, reboot phone into bootloader to flash your twrp recovery.

Flash Recovery

reboot phone into Bootloader and connect it to your pc.

"Path to fastboot\fastboot.exe" flash recovery "Path-to-Twrp\twrp-3.2.1-0-lilac-10-patchlevel-2018-04-05.img"

"Path to fastboot\fastboot.exe" reboot

Phone should start into android, first time needs time because it has wiped dalvic and cache.

In Android take a photo and check album if there is a green picture or not (shouldn't be).

You can start telephone APP call *#*#SERVICE#*#* or *#*#7378423#*#* and inside the Service Menu switch to "service tests" and there to Security.

Should be near identically to mine, some Thread entries before.

You have now the new Firmware and XperiFIX installed.

Afterwards I'm using root Explorer and Titanium Backup to clean the Bloatware which come from installing the new Firmware.

If something is not clear or detailed, please write it to me.