Root, Unlock Bootloader and Install TWRP Recovery on Xperia Z (Complete guide)

If you want to tweak your Sony Xperia Z then you will have to complete this step by step guide. After applying the operations explained here, you will be able to power up the performances of your device by overclocking the CPU, updating with custom ROMs, removing in built programs, installing new apps and features and so on. You will be able to do so as we will be checking on how to easily root, unlock the bootloader and install TWRP recovery on your Xperia Z smartphone.

The Xperia Z is a high end Android based smartphone that comes with impressive specs, features and capabilities along with an outstanding design. But, the OS might not be on everyone’s taste and most of the users might find it necessary in updating their Xperia Z with a custom ROM or with the stock version of the Android firmware. In that case, you will first have to learn how to root and install a custom recovery image on your handset.

Gaining root access is a custom and unofficial operation that is designed to unchain the internal systems of the Android based devices. So, if you want to access the in-built programs, the OS or if you want to optimize and customize the same, you will first have to root your Sony Xperia Z. After rooting you will be able to apply custom updates, you will be able to flash custom recovery images, apps that require root access in order to work properly and basically you will be able to change the factory restrictions and improve the performances of your phone. Also, you will be able to bump the speeds, by overclocking your Android device.

You should be careful as when dealing with such operations the warranty of your Z will get void. So, try not to mess things up, or damage your device as you will be by yourselves. Don’t panic either, because the warranty can be restored afterwards; for that you will have to downgrade your Xperia Z to stock Android Jelly Bean OS, or you will have to update your handset to an official release of the Android platform – and soon you will be able to apply the new Jelly Bean 4.3 software. Do note that on rooted handsets the OTA updates can’t be received or applied – you will have to manually install the ROMs.

Now, after rooting, you will learn how to unlock the bootloader of your Sony Xperia Z. The bootloader is a small program that runs each time you boot your smartphone. The program is similar with the one that is featured on your notebook or PC, so it will load the OS and some other apps from the ROM memory into the RAM section of your phone. Without the bootloader, your Xperia Z can’t operate at all. So, as you can already tell, usually, when you buy a new device, it will be delivered with a locked bootloader, meaning that it’s your job to unlock the same. But, why to do that?

Well, similar with rooting, unlocking the Xperia Z bootloder will offer more access to the internal system of your smartphone. Furthermore, updating with some custom ROMs and kernels are requiring an unlocked bootloader so the best will be to ensure the same.

Finally, the custom recovery image. Well this is the last operation to perform when looking forward in updating your device with custom ROMs, when trying to install custom kernels, or when trying to perform complex backups, maintenance, optimization and customization operations. The stock recovery that comes pre-installed on the Android based handsets isn’t useful when dealing with procedures like the up-mentioned ones, so you need to install a custom recovery on your Sony Xperia Z; and, by using this step by step guide your will flash TWRP recovery on your phone.

TWRP recovery is the touch version of CWM recovery, which is the most popular Android recovery among worldwide users. The app comes with many features and with an intuitive user interface which makes it easy to use and to handle.

Therefore, now you know everything that’s relevant about the present tutorial that will show you how to easily root, unlock the bootloader and flash TWRP recovery on your Sony Xperia Z. But before starting the steps from below, you first have to prepare your device. Because of that, take a look and complete the pre requisites from below.

  • A computer will be required; your phone and its USB cable should be near you too.
  • On both handset and PC you must uninstall, or only deactivate the antivirus, antimalware and Firewall protection – the security protection might interfere with our work by interrupting the flashing procedures.
  • Since this is a long tutorial, you should first charge your Xperia Z. Do that especially if on your phone you notice that there is less than 60% power left. If your handset gets turned off in the middle of the installation procedure, you will risk in bricking the same.
  • Enable the USB debugging option on your phone because you need to properly connect your Z with the computer; so go to: “Settings -> Development Options -> USB debugging” and check the same.
  • Backup the Xperia Z data because it might get corrupted or even wiped out. You should save the contacts list, the market apps, the calendar info, text messages and internet settings; also don’t forget to store the relevant data such as personal info and accounts.

The tools from below along with the installation procedures are being provided by those of xda-developers team, so we should thank them for the present step by step guide.

This tutorial is compatible only with the Sony Xperia Z smartphone. Don’t root, unlock the bootloader and flash TWRP recovery by using the next steps if you have a different or similar Sony or Android device because you will probably end up in bricking your handset.

Root the Xperia Z and back up the DRM keys

  1. On your phone go to “Settings -> Security” and enable the “Unknown sources” option.
  2. Then, go to “Settings -> Display -> Sleep” and increase the screen timeout – 10 minutes.
  3. Download the rooting script that can be used for locked bootloaders from here.
  4. Save the file on your computer.
  5. Unzip the file (double click on the script .zip file).
  6. Connect your Xperia Z with the computer by using the USB cord.
  7. Go to the root script folder from desktop and run the executable file dubbed as .bat file.
  8. A command prompt window will be displayed on your computer.
  9. Press “enter”.
  10. Your phone will be rooted.
  11. In the end the handset will reboot meaning that you are done.
  12. If you can’t unlock the bootloder after this method, or if any kind of issues occurs, go to the rooting script folder and open a command prompt window (press shift key and while doing so right click on any blank area of the folder; then choose “open command prompt window here”). Then enter the following commands: “adb shell”, “su”, “rm /data/data/com.sonyericsson.android.servicemenu/lib/libservicemenu.so”, “exit” and again “exit”.

Backup TA – save the DRM keys

  1. On your computer download the TA script file from here.
  2. Save the same on desktop.
  3. Unzip the file by clicking on the .zip file.
  4. Your Xperia Z must be connected with the computer.
  5. Now, click on the backup TA . bat executable file.
  6. A command prompt window will be displayed on your computer.
  7. Type “x” and press “enter”.
  8. The process will now be completed.

How to Unlock the Xperia Z bootloader

  1. First check if your phone can get unlocked.
  2. For that open the phone app / dialer.
  3. Enter / dial *#*service#*#*
  4. Then go to “Service Info -> Configuration” and check if unlocking bootloader is available for your phone.
  5. If there is “yes” you can continue with this procedure; else you must stop going any further.
  6. Now, for learning how to unlock the Xperia Z bootloader use our detailed guide (click on the mentioned link) as there are a few steps to take care of.
  7. Then return here and resume the present tutorial.

How to install TWRP Recovery on Xperia Z

  1. First of all, download the recovery file on your computer.
  2. The download link is here.
  3. Since you have unlocked the bootloader of your device, ADB along fastboot should be installed on your computer (learn how to flash Android SDK on Windows, or how to set up ADB on MAC / Linux).
  4. Now, copy the “boot-twrp-v2.img” file on the fastboot folder.
  5. Open a command prompt window inside the fastboot folder (learn how to do that by using the steps from above).
  6. Your smartphone should be connected with the computer.
  7. In the cmd window enter the following command: “fastboot.exe flash boot boot-twrp-v2.img”.
  8. Good job you have installed a custom recovery image on your Xperia Z.

Re-root the Xperia Z – for good this time

  1. Download the Super SU app from here.
  2. Also download the recovery app from here – use it for booting in recovery easily and fast.
  3. Save the files on your computer.
  4. Your handset should be connected with your computer.
  5. Select the downloaded files and copy them to your phone’s SD card.
  6. You can remove the USB cable now.
  7. Install the recovery app on your smartphone.
  8. Then use the tool and reboot in recovery mode.
  9. From recovery select “install zip from SD card” followed by “choose zip from SD card”.
  10. Pick the Super SU file from the SD card.
  11. Flash the same on your device.
  12. Wait while the installation procedure is running.
  13. In the end, from recovery select “+++go back+++” followed by “reboot system now”.

If in the end, your phone will get stuck in a boot loop, or if any other problems have been encountered while trying to complete the steps from above, use our dedicated tutorial for learning how to resolve the most common Android issues. Also, use the comments section from below for sharing your experience with us and with other users who might want to use our guide.

So, that was all. I know that there were a lot of stuffs to take care of, but now your Sony Xperia Z is ready for customization and optimization procedures. You have successfully learned how to root, unlock the bootloader and install TWRP recovery on your Xperia Z. You can safely update your smartphone with a custom ROM firmware now, or you can even consider in overclocking the CPU for bumping the speeds. Stay close for further Android related tutorials, tips and tricks.

Sony Xperia Z Articles