[Sony Xperia XZ Questions & Answers] awadnisar:
For rooting Xperia XZ, we need recovery and for recovery flashing the bootloader must be unlocked.

PREREQUISITES:

1. ADB/FASTBOOT. View attachment 4715074

2. Drivers for Sony Xperia XZ. View attachment 4715075

3. Backup all your data, Apps, Contacts & everything you need.

4. Charge ur device above 60% to avoid any shutdown during the process

UNLOCKING BOOTLOADER

Unlock Bootloader: Opens the door to System files of your device. This allows you to flash images onto the main system partitions of the phone, after unlocking you will lose the DRM keys and phone's warranty will be void, it will also factory reset your device.(backup is recommended)

1. Open Dialer.

2. Dial *#*#7378423#*#*

3. Press service info than configuration.

4. Check if “Bootloader Unlock” is yes under Rooting status.[If not then your device can not be unlocked]

5. Check what android you are running on. Go to Settings -> About Phone -> Android Version. If you have 6.x.x then goto step 9 but if you have 7.x.x then you have to downgrade to Marshmallow.

6. Download and install FlashTool from its official website.

7. Install the drivers for fastmode and for your device in the driver folder of the FlashTool. [C:>FLASHTOOL>drivers]

8. Download ftf for your device using XpiriFirm and flash it using flashtool.

How to flash ftf?

9. Goto settings>about phone >developers option and ensure that OEM Unlock and USB Debugging is on.

10. Goto Xperia BLU page and Choose Xperia XZ at the bottom of the page.

11. Enter your Email and you will receive a link in your mail. Follow the steps given by Sony.

12. BE CAREFUL and, from now on, DON’T ENABLE the MyXperia. It could hard brick your phone.

Now your phone is unlocked

We will now go over some other fixes.

FLASH ANDRO PLUS KERNEL.

This kernel will help your device cope up with some battery issues and it also has some DRM Fixes. To install it, follow the steps :

1. Download the kernel version supported for your buildnumber.{AndroPlus}

2. Unzip the downloaded file and paste them into your fastboot/adb directory.

3. Now Boot into Bootloader mode by turning the device off and pressing volume up then plug in the USB.

4. Run the command prompt where you pasted the extracted zip . Do this by shift+right click and selecting Open command prompt here.

5. Enter the command "fastboot flash boot boot.img"(without double quotation)

6. Unplug and reboot your device

FLASH CUSTOM RECOVERY [TWRP]

A custom recovery is flashed onto the recovery partition of the device and overwrites the stock recovery that exists by default(XZ doesn't have stock recovery). Custom recoveries bring lots of functionality and allows you to perform wipes, install flashable zips, create full backups of your NAND (Nandroid backup), and various other features. An unlocked bootloader is needed to install a custom recovery.

This process will provide your device a custom recovery (TWRP) This can be used to flash root script, ROM and custom kernels at anytime without PC.

1. Download the TWRP image file.

2. Paste it in your Fastboot directory and rename it as recovery.img

3. Open cmd in the folder where you pasted recovery.img

4. Enter the command "fastboot flash recovery recovery.img"(without double quotation)

5. Reboot your device.

FLASHING MAGISK

Now the final step. To root your device you just need to flash the Magisk zip.

1. Download the zip.

2. Paste it in your device.

3. Now boot into recovery by turning off and press power+volume down at the same time and release the power key after vibration.

4. If TWRP is decrypted use this guide.

5. Now select install and navigate to the pasted zip, swipe for flash.

6. Reboot and check if the Magisk app is installed on your device.

________________________________________________________________________________________

-- If You Liked My Work--

-- Press the Thanks :good: Button --

​