Install TWRP and Root Xperia XZ on Android 8.0 Oreo [DRM Fix]

In this article, we will tell you how to root Xperia XZ running Android 8.0 Oreo and install TWRP Recovery on it.

SONY rolled out the Android Oreo Update for the Xperia XZ and Xperia XZs today. The update is rolling out in the form of OTA to the users. The Xperia XZ Android Oreo update comes with a lot of Android Oreo goodness as we have seen during the Google Event. It is important to note that some of the manufacturers have already rolled out the update to some of their devices. The Android Oreo Update of Xperia XZ comes with new features like Picture in picture mode, Auto-fill API and a number of other exciting features. Read ahead to know how to install TWRP Recovery and root the Xperia XZ running Android 8.0 Oreo. Thanks to korom42 for putting together this amazing guide!

Prerequisites

  1. Your device bootloader must be unlocked.
  2. Make sure ADB and fastboot are installed on your PC. GuideDownload Minimal ADB and Fastboot for Windows.
  3. Make sure you have the latest Sony Android USB Drivers.
  4. Make a complete backup of your device before proceeding. GuideHow to Backup Your Android Device Without Root

Necessary Downloads

  1. Latest TWRP for Xperia XZ: Download
  2. Latest Magisk Zip for Xperia XZ: Download
  3. SafetyNet Cleaning Tool.zip file: Download
  4. Xperia XZ Oreo Kernel Image [boot.img]: Download
  5. DRM Fix Zip: Download
  6. Install the Latest Flash Tool: Download

How to Install TWRP and Root Xperia XZ on Android 8.0 Oreo

Method 1:

  1. Copy the drmfix.zipSafetyNet Cleaning Tools.zipMagisk v14.5.zip to your phone’s internal memory.
  2. Copy the downloaded Oreo Kernel Image [boot_oreo.img] and TWRP image file [twrp-3.1.1-0-kagura.img] to the folder where ADB and fastboot are installed.
  3. Open a command prompt from inside the folder where ADB and Fastboot are installed. To do this, Hold down Shift Key and Right click > Select ‘Open command window here‘.
  4. Switch off your device.
  5. Enter fastboot mode:
    1. Connect the USB cable to your phone.
    2. Hold down Volume Up Key.
    3. While holding the Volume Up key, plug in the other end of the USB cable into PC.
  6. Once you are in the fastboot mode, execute the below command:
    fastboot flash boot boot_oreo.img
  7. Once the above process completes, flash TWRP Recovery by executing the below command:
    fastboot flash recovery twrp-3.1.1-0-kagura.img
  8. Now, unplug your device. DO NOT TURN ON yet.
  9. Enter TWRP Recovery by holding down Volume Down and Power Button together.
  10. Now flash [Install > Select File > Confirm Flash] the following files one by one in the below-given order:
    1. Flash drmfix.zip.
    2. Flash SafetyNet Cleaning Tools.zip.
    3. Flash Magisk v14.5.zip.
  11. Reboot your device.
  12. Done!

Congratulations! You have successfully rooted your Xperia XZ running Android Oreo. Now, if the above method did not work for you, we have another method below, try that as well.

Method 2:

Note: If the above method does not work or if the TWPR does not work, you can follow the below method.

  1. Note that, to continue with this method, you need to be on Android Nougat or below. If you are already running Android Oreo, you need to downgrade first.
  2. Once you are in Android version Nougat or below, copy the drmfix.zipSafetyNet Cleaning Tools.zipMagisk v14.5.zip to your phone’s internal memory.
  3. Copy the downloaded Oreo Kernel Image [boot_oreo.img] and TWRP image file [twrp-3.1.1-0-kagura.img] to the folder where ADB and fastboot are installed.
  4. You need a boot.img file from a custom Kernel. You can download either this zip [for Android Marshmallo] or this zip [for Android Nougat].
  5. Once you downloaded the above zip, extract it. You will find a boot.img file inside it. Copy it to the folder where ADB and Fastboot are installed.
  6. Switch off your device.
  7. Enter fastboot mode:
    1. Connect the USB cable to your phone.
    2. Hold down Volume Up Key.
    3. While holding the Volume Up key, plug in the other end of the USB cable into PC.
  8. Open a command prompt from inside the folder where ADB and Fastboot are installed. To do this, Hold down Shift Key and Right click > Select ‘Open command window here‘.
  9. Execute the below command in the command window:
    fastboot flash boot boot.img
  10. Once the above process completes, execute the below command:
    fastboot flash recovery twrp-3.1.1-0-kagura.img
  11. After the flashing process completes, unplug the device from your computer.
  12. If Flashtool is already open on your device, close it and open again.
  13. While flashing in the Oreo in Flashtool, full wipe is recommended EXCEPT for  FOTAKERNEL PARTITION. Make sure to tick it in the ‘Exclude’ list. This is to keep the TWRP intact. Refer to the image below:
    root-xperia-xz-oreo
    Credit: @korom42 from XDA
  14. When the flashing completes, unplug the device but DO NOT SWITCH IT ON.
  15. Enter fastboot mode:
    1. Connect the USB cable to your phone.
    2. Hold down Volume Up Key.
    3. While holding the Volume Up key, plug in the other end of the USB cable into PC.
  16. Execute the below command in the command prompt [opened earlier inside ADB and Fastboot folder]:
    fastboot flash boot boot_oreo.img
  17. Once the above process completes, boot the device into TWRP mode by holding down Volume Down and Power Button together.
  18. Now flash [Install > Select File > Confirm Flash] the following files one by one in the below-given order:
    1. Flash drmfix.zip.
    2. Flash SafetyNet Cleaning Tools.zip.
    3. Flash Magisk v14.5.zip.
  19. Reboot your device.
  20. Done!

Congratulations! You have successfully rooted your Xperia XZ running Android Oreo.

Need help? Drop a comment below!


Loved the article? Share it with others!

7 thoughts on “Install TWRP and Root Xperia XZ on Android 8.0 Oreo [DRM Fix]

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.