
A MESSAGE TO SONY:
Dear Sony,
It was never my intention to publish a hack for your devices. But... It also was never my intention to buy a device for which I have no control. I find it impertinent to forbid the customer to root a purchased smartphone. I would not have made the effort, if at least the standard functions of the camera could have used. I paid ~750 euros and got a non-functioning camera because I want to have full control of my device. If at least the Camera2 API would have been opened, in order to be able to use other camera apps with full resolution, a hack would not have been necessary. But even with that you are fooling your customers. The only reason I have spent so much time and nerves is that I wanted to have a functioning debloated device with root.
Okay, let's go...
First we need some good music: HERE
##### WARNING: ########
Please note that the modification can result in a loss of warranty. I accept no responsibility for any damage that may occur and do not guarantee the functionality of the modifications. I have created this modification for myself and I just want to make it available to other users. If you have no idea of these things, please keep your fingers away. This hack may - in case of incorrect application - destroy your phone. Please keep to the instructions and report errors right here in the thread.
##### INFO: ###########
I' m providing a complete guide here, explaining how to unlock and root the Sony Xperia XZ Premium. In addition, I offer my hack for the DRM problem. You can root your device and still use the full functionality of the camera. Please note: DON'T flash the fix of other devices/versions to your phone! There are patched system files in my fix, which are only for the related phone/version! I will create different patches for other devices and firmware versions in the future!
Sony has worked on the newer devices on the security functions and made it more difficult to crack the DRM protection. Hidden checks were implemented to make cracking more difficult. The old DRMfix by Tobias Waldvogel no longer works with newer devices. I therefore spent a lot of time (a few weeks) and cracked the protection. Since this was my first time with Sony and I had previously no experience with it, it was a very hard job for me. But okay... finally I did it. And here are my 5 cents...
##### INSTRUCTIONS: #####
Before you start: PLEASE CHECK THE RIGHT VERSION OF YOUR FIRMWARE!!!
Settings -> About the phone -> Model & Build number
Don't flash anything that doesn't match your build!
+++++++++ UPDATE +++++++++++++++++++++++++++
I created a tool "XperiFIX" which can do the magic for you.

See it in action...
If you nevertheless want to do it manually on Nougat, the old instructions and downloads are here: https://forum.xda-developers.com/showpost.php?p=74426201&postcount=285
1. Unlock your bootloader
Visit: https://developer.sonymobile.com/unlockbootloader/ Choose "Xperia XZ" from the list of the devices (only if your device isn't listed) and follow the instructions to unlock your bootloader. Please note, that as soon as you unlock your device, your unique device keys are lost (forever!) and there is NO way back anymore!
2. Use XperiFIX to get what you want
1. Download, install and start "XperiFIX" (as administrator!)
2. Hold down the VolumeUP(+) key only and plug the USB cable to PC and mobile phone until the LED is blue.
3. Read the warning and check the checkbox
4. Click "Fix my device!" button in XperiFIX
5. Now the tool will do it's magic! Please be patient, it can take a few minutes!
Note: If TWRP ask you if the system partition should be mounted read-only, then swipe to the right to allow modifications!
6. If all is done, the device should restart.
7. Check your security status, configuration and camera.
8. Donate me a pizza or some toys for my little son, hehe...
Congratulations!
You now have an unlocked, rooted XZ Premium with my DRMpatch and can use your camera and other functions again without ugly green pictures! Wohoooo... Easy going, huh?
Let's be quiet for a moment and imagine the faces of the developers, who wanted to prevent a DRMfix with the new firmware versions and complex encapsulated security functions:
Cheers!
//sToRm (Heiko Frenzel)
##### FAQ: ################
Can this patch bring back the device key?
No! It simulates the key and a locked device without root. If you unlock and root your device, the unique device key is gone forever! There is not turning back!
Can I use another kernel with this patch?
Yes, but only with Xperifix 2.0 and above. It will patch the ramdisk of the kernel automaticly.
Can I use the patch for other devices or versions?
No! Please don't try this! In my patch I had to fix a system file which is different between the devices and versions. If you flash the wrong version, it could brick your phone! I will create other versions of my patch for other devices, too. So be patient!
TWRP freezes and nothing happens, what should I do?
Please check if you have the correct driver for your device, installed on your PC.
I already rooted my device. Can I use XperiFIX, too?
Yes. If you used Magisk before, you can use XperiFIX without problems. Because XperiFIX will flash a new kernel which isn't pre-rooted. After that XperiFIX will flash Magisk, which will recognize your last Magisk installation. It will patch the new kernel ramdisk and all is fine. Your Magisk old settings will be there, too. If you want to use SuperSU, you can't use XperiFIX, because it's not implemented yet and I personally won't install and test it cause Magisk is running perfect on Nougat and Oreo, too!
I used XperiFIX but it gives me an error and now my device is in a bootloop!
That's not good dude. Please report what exactly you did, with all informations about your device. I will check it. To get a working device again, you can flash the firmware with Newflasher 10+.
My device doesn't respond, nothing works, it stucks in a bootloop, I can't power off?!
Just hold the VolumeUP(+) key together with the Power key. Wait until the device vibrates 3 times (!). Now it's completely off. Then you can try to go in Fastboot mode again to flash or use XperiFIX.
I have a problem, what can I do?
If your question can't be answered here in the FAQ, please post your report. Be sure to give all needed informations. Which device, which firmware version, what you exactly did, ... Without details, nobody can help you!
What does the fox say?
Hatee-hatee-hatee-ho! ^^
##### DOWNLOADS: ##########
XperiFIX_Installer MOD edit, links removed.
Official website: https://www.xperifix.com
Supported devices:
Sony Xperia XZ Premium (Single/Dual)
- Firmware @47.1.A.12.75
- Firmware @47.1.A.12.34
- Firmware @47.1.A.8.49
Sony Xperia XZ1 (experimental)
- Firmware @47.1.A.12.75
- Firmware @47.1.A.12.34
- Firmware @47.1.A.8.49
Sony Xperia XZ1 Compact (experimental)
- Firmware @47.1.A.12.75
- Firmware @47.1.A.12.34
- Firmware @47.1.A.8.49
Old version:
If you are using older firmware versions on your XZ Premium, you can download the last old version (v1.4) from the website (look at the history on the download site).
##### SUPPORT / DONATION: #####
If I could help you with my work, I would be glad if you give me a small thank you. You can DONATE HERE. This would also support further development for newer versions and other devices. Big thanks!
THANKS:
@munjeni
@zxz0O0
@the_brad
@serajr
... and all other users of the "brainstorm thread" for their infos and ideas!
CREDITS:
Included in XperiFIX:
Old DRM restore by @tobias.waldvogel
Magisk by @topjohnwu
TWRP by @Myself5
AndroidLib by @regaw_leinad
Last edited by a moderator: