• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Android Infotech

Android Infotech

Android Tips, News, Guide, Tutorials

  • Applications
  • Knowledge
  • I’m Bored
  • Opinion
  • Tutorial
  • Root
  • Firmware
  • Daily Deals
Home » Root » Root Sony Xperia XZ2/Compact/Premium Pie 9.0 using TWRP and Magisk

Root Sony Xperia XZ2/Compact/Premium Pie 9.0 using TWRP and Magisk

Last updated on September 23, 2019 By Selva Kumar A18 Comments

Sony Xperia XZ2 comes in three variants as Regular XZ2, Compact edition, Premium version. Each variant is created to target a different audience. But, the software and support are the same from Sony. All three options received Pie 9.0 upgrade. Sony is always high in maintaining regular patch updates. So with the Good Specs, you don’t need root to enhance the performance. If you are a regular user, you don’t need root. After the root, you will not get an official update. Y0u have to manually update to get the latest features If you use Stock ROM. Your mobile needs regular optimizations also. You should think twice before doing this. If you are a Developer or regular root apps user, you can follow below guide to achieve root on your mobile. All three variants methods would be the same unless I mentioned the Different files.
Sony Xperia XZ2 premium and compact with Sea Wave Background

Read the article thoroughly before starting the process. It will give some ideas for the preparation. If you planned to flash Custom ROMs, you should check what will work and whatnot. Unofficial ROMs may contain a lot of significant bugs. If you want to install the update using TWRP, after the firmware flash, you should flash Magisk every time.

Table of Contents

  • Why should you Root Sony Xperia XZ2/Compact/Premium?
  • How to Root Sony Xperia XZ2/Compact/Premium Pie 9.0
    • Things to check out for;
      • Supporting versions
        • Xperia XZ2
        • XZ2 Compact
        • XZ2 Premium
    • Pre-Requirement Steps
    • Unlock the bootloader using ADB and Fastboot
      • Check Compatibility
      • Unlock Steps
    • Flash TWRP
    • Install TWRP, Magisk, and Kernel in your Sony Xperia XZ2 using TWRP
  • What More?

Why should you Root Sony Xperia XZ2/Compact/Premium?

We thank XDA Developer- topjohnwu,MartinX3 (Who successfully tested this method) and linckandrea (For the Kernel file) Without their hard work, We can’t make this method. Coming to root, you should have a proper reason, and you know what you are doing. Yes, with a minimum of 4/6 GB RAM and Qualcomm Snapdragon 845 processor, You can use this mobile for regular tasks without root for 2-3 Years If you use correctly. Software is better compared with other manufacturers, Custom skin OS. Don’t root because everybody is saying when root your mobile it can become fastest. No. Rooting is to extract some performance from the device. But, you already have Powerful specs and software. So, If you are addicted to some root apps, you can root. But, if you want to test, I won’t recommend it.

How to Root Sony Xperia XZ2/Compact/Premium Pie 9.0

Sony Xperia XZ2 International Variants comes with a flexible bootloader other than some carrier locked devices. This means that different smartphone variants can be easily rooted. Also, the device can accept to install TWRP recovery or any other custom recovery file/app alike.

TWRP recovery is a custom recovery file that must be installed on your devices because you can root them successfully. In this article, we explained the easiest method to follow and install TWRP recovery on Sony Xperia XZ2. However, the tool required for rooting this device is the Magisk App.

With the help of TWRP Recovery, you can quickly flash the latest version of Magisk into your Xperia XZ2 to gain root access. Before sharing the tutorial, you may want to know that, with the TWRP recovery present on your device, you can easily install any custom ROM or firmware. Does it seem complicated? Relax, everything will be explained succinctly in bullets.

Things to check out for;

  • Make sure your device battery is charged above 50%

  • Backup your current files and data, full data loss process (save them on external storage).

Supporting versions

Xperia XZ2
  • H8216
  • H8266 Dual
  • H8276
  • H8296 Dual
XZ2 Compact
  • H8314
  • H8324 Dual
XZ2 Premium
  • H8116
  • H8166 Dual

Pre-Requirement StepsOnePlus 6T OEM Unlock and USB Debugging

  • Enable USB Debugging Mode and OEM Unlock on your mobile. To do this; go to settings >>> about >>> Tap on the “Build Number” 7-10 times consistently to enable “Developer Options,” then go to the “Developer Options” and enable USB Debugging Mode, OEM Unlock. There is no complicated process in Sony Xperia XZ2.

  • Download and Install the Sony PC Companion (Windows)or Sony PC Companion for (Mac)
  • Also, download the ADB drivers. Install it in your PC.

  • Download Magisk.Zip (Latest Version) and Copy it to Your mobile SD card or Pendrive OTG Cable.
  • Pie Kernel, Camera Fix (Both are Optional) Download and Copy it to Your mobile SD Card. This file helps you to maintain the Bootloader unlock and debug some Root issues in your device.
  • Download, extract, and save the TWRP File in your PC and your External mobile storage and rename it to recovery.img. You should keep the file in both locations.

  • twrp-xz2-pie.zip
  • twrp-xz2compact-pie.zip
  • twrp-xz2premium-pie.zip
  • Based on your model number, Download, extract and save the VB meta Files in your PC and rename it to vbmeta.img.
  • vbmeta-xz2-pie.zip
  • vbmeta-xz2compact-pie.zip
  • vbmeta-xz2premium-pie.zip
  • Copy all the above files into the Fastboot folder.

Unlock the bootloader using ADB and Fastboot

Your mobile should be supported to get the unlock code. Check this using the below step. If your mobile supported get the code and unlock using unlock stages.

Check Compatibility

  • Go to Sony Developers Official Page to check if your device model is accepted for this.
  • You should signup to new Sony Xperia account or login with details to an existing account. Alternatively, you can use your Gmail account.

  • The device must be connected to the internet

  • Dual SIM Sony devices have two IMEI numbers. Use the IMEI 1 to get the exact unlock code for your deviceselect device sony

  • This action works for all Sony Android devices. However, you still have to check out if your device model supports such action (unlocking the bootloader);

If your device is supported, then, go ahead with the steps below to unlock the boot loader.

Unlock Steps

  • Open your phone dialer and dial this code – *#*#7378423#*#*

  • Go to Service Info >>> configuration >>> rooting status >>> Check to see if bootloader unlocking is allowed or not. If it is allowed, then continue below.

  • Get the “download_inf.zip” file and paste it into the folder where you installed ADB and Fastboot.

  • Dial *#06# and copy down your Sony Mobile IMEI number.

fill details to get unlock ID sony

  • Return to the Sony Official page, select your device model, and provide your Email Id.

  • You will receive a link to your Email id, click on the link to get the Unlock code to use and unlock your bootloader.

  • Switch off your device. Then, enter into Fastboot mode. To do this; press and hold down the Volume Down button connect mobile to your PC using USB Cable.
  • Go to the ADB and Fastboot folder, Launch the fastboot on your computer. Open a Command prompt on your PC and type below command.

  • fastboot devices
  • It should display the connected devices. If you didn’t get the device, restart the command prompt and Disconnect and Connect your Sony Xperia XZ2. If you are detected type below command and Hit Enter.
  • fastboot oem unlock 0x<insert your unlock code>

Note: you have to replace the key with your own generated Key

  • Tap “Enter” and wait for some time

  • Your mobile bootloader is now unlocked, reboot the device. Move to flash TWRP steps.

Flash TWRP

Xperia XZ2 Download Mode

  • Switch off your device. Then, enter into Fastboot mode. To do this; press and hold down the Volume Down button connect mobile to your PC using USB Cable.
  • Launch the fastboot on your computer. Open a Command prompt on your PC and type below command.
  • fastboot devices
  • It should display the connected devices. If you didn’t get the device, restart the command prompt and Disconnect and Connect your Sony Xperia XZ2. If you are detected type below command and Hit Enter.
  • fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img
  • After the flash of the above file, type below command and hit Enter.

fastboot boot recovery

  • fastboot boot recovery.img
  • If you can’t reboot your mobile using above command, Press Volume Down+ Power button to exit Fastboot mode. When the screen goes off, Immediately Press Volume Up + Power buttons to boot into Recovery mode.
  • It will boot into the temporary TWRP. Don’t Boot into standard OS until we flash magisk.

Install TWRP, Magisk, and Kernel in your Sony Xperia XZ2 using TWRP

  • In TWRP, Make a full Backup on External SD Card or Pendrive using OTG Cable.
  • After the process complete, Reboot to Bootloader using TWRP Option. Reboot->Reboot Bootloader.
  • Go to TWRP menu. Select Advanced Menu->Install recovery ramdisk->recovery.img.
  • Go to TWRP menu. Select Wipe->Advance Wipe->Select Cache Data. The same process goes for VB Meta.img file.
  • Return to Home of TWRP select Install.
  • Select Magisk.Zip.
  • Again Return to Home of TWRP select Install.
  • Select Kernel.Zip. The same process goes for Camera Fix. Don’t use Add more Zips in TWRP. Install one by one.
  • After the Installation Reboot Your Mobile.
  • You can also install Magisk Manager in your Mobile Applications. Download Root Checker to check your mobile root status.

What More?

In my opinion, you don’t need rooting for your Sony Xperia XZ2. If you thought, you could Improve Performance By root; With the Qualcomm Snapdragon 845 Octa-Core processor and 4/6 GB RAM, your device can perform well. If you don’t know how much RAM you need, You will never use this much RAM. Don’t Install any apps other than trusted sites on rooted devices. Third-party site apps can contain some background codes. So, Check twice before installing those apps. If you want to return to stock firmware, flash Sony Xperia XZ2 Pie 9.0 firmware. During this process, If you face any problem, comment below.

Source, (2)

Selva Kumar A

Selva Kumar is an Android Devices Enthusiast, Who Can Talk and Write About Anything If You Give a Hint About the respective devices. He is a Computer Science Graduate, Making His Career towards this Technology. He is always eager to try new Android devices — not only Software level but Hardware-level Also. Beyond this, He is a Good Swimmer, Guitarist.

Related Posts:

  • Root Sony Xperia XZ2/Compact/Premium Android 10 using TWRP and Magisk
  • Download Sony Xperia XZ2/Compact/Premium Android 10 Firmware…
  • Download Sony Xperia XZ2, XZ2 Compact, XZ2 Premium Oreo and…
  • Download Sony Xperia 10/Xperia 10 Plus Android 10 Firmware…
  • Download Sony Xperia 10 II Android 10 Firmware (.ftf creation)
  • Download Sony Xperia 5 Android 10 Firmware (.ftf creation)
Share This Post:

Reader Interactions

Comments

  1. Justinsays

    October 14, 2019 at 3:29 am

    Hey, my sony Xperia xz2 premium is looping in start screen, how can I fix it?

    Reply
    • Selva Ganeshsays

      October 14, 2019 at 11:45 am

      You should flash the VB metafile. Boot into Recovery using fastboot recovery. Clear cache data and install the files in the order from TWRP to the kernel.

      Reply
  2. Mark Bissettsays

    November 11, 2019 at 7:48 am

    Hello,
    I need to root my XZ2 device to extract some data from an app that does not allow for backup (as per Helium, says “backup disallowed”)
    So long story short, I can’t back up the data without rooting the phone, and I can’t root the phone if it means I lose the data I’m trying to recover.
    You mentioned, “Backup your current files and data, full data loss process (save them on external storage).”
    So it that a guaranteed full data loss or only possible complete data loss?
    Thanks!

    Reply
    • Selva Ganeshsays

      November 11, 2019 at 9:11 am

      Your case is unique.
      You should Boot into TWRP after the flash. You should not boot into the OS. For other users, they can retry, But, You may lose Data. So, It should be first hit or loss. After the first boot, Go to TWRP settings and Take Complete Backup. Clear Cache, done all the Installation things, and Boot into OS, Setup everything. Everything is done, Boot into TWRP-> Restore Backup. Everything is looking good.
      But, sometimes TWRP may not detect the External Storage, So, be ready with OTG Storage also.

      Reply
  3. luo96says

    December 20, 2019 at 4:19 pm

    Hi, if I flash twrp on my xz2 and install pixel experience, will my camera got blurry like other Sony devices?

    Reply
    • Selva Ganeshsays

      December 20, 2019 at 7:20 pm

      Flash Latest patched version. Don’t flash Old versions.

      Reply
      • Hamzakovskysays

        December 21, 2019 at 8:21 pm

        Could you please tell me where I can find this patched version? thanks in advance

        Reply
        • Selva Ganeshsays

          December 21, 2019 at 8:28 pm

          What patched file? VB-Meta?

          Reply
          • Hamzakovskysays

            December 22, 2019 at 10:49 pm

            1st of all, the method mentioned in this tutorial doesn’t work with pixel experience rom ! you have to side-load it.
            So, could you please update this step by step? Thanks in advance.

          • Selva Ganeshsays

            December 23, 2019 at 12:11 pm

            If you have Pixel Experience ROM, You already have TWRP. You Didn’t Install TWRP During the Pixel Experience ROM Flash?

  4. tariksays

    December 25, 2019 at 3:05 pm

    Hi Selva Ganesh
    I have Xperia xz2 I am using flash tool to update to the pie with bootloader unlock, so I have a problem my camera screen black can I fix it with root and install fix camera or going to use old firmware oreo?

    Reply
    • Selva Ganeshsays

      December 26, 2019 at 11:29 am

      Maybe It can be a Stock Firmware problem. Flash the latest firmware, Or Install the other third-party cameras. If you have the same issues in those apps, there is a chance of hardware problems. But, if you didn’t face any difficulties, consider flashing the other firmware.

      Reply
  5. Mikisays

    January 9, 2020 at 8:47 pm

    Work on latest android 10 ???

    Reply
    • Selva Ganeshsays

      January 9, 2020 at 9:36 pm

      It will support only up to the Pie version.

      Reply
  6. Tim Tobiassonsays

    January 19, 2020 at 7:30 pm

    I need help. I’m rooting my Xperia XZ2. When I type
    ” fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img” it just says ” unknown option — d. ” What seems to be the problem?

    Reply
    • Selva Ganeshsays

      January 19, 2020 at 9:26 pm

      Copy the vbmeta file to the fastboot folder. Instead of typing the command, Copy the above command paste it in command prompt.

      Reply
  7. Tylersays

    May 10, 2020 at 1:33 am

    No matter what I do, when I type “fastboot devices,” nothing happens…
    It just skips a line, and the command prompt goes back to
    “C:\\adb”
    Here is the scenario
    C:\\adb>fastboot devices
    C:\\adb

    Reply
    • Selva Ganeshsays

      May 10, 2020 at 1:38 pm

      What feedback did you get? There should be no devices or command response.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

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

Primary Sidebar

Join With Us

Recent Posts

  • Download Xiaomi Redmi Note 8/Pro MIUI 12 Android 11 ROM
  • Samsung Galaxy S21/Plus/Ultra SM-G991/G996/G998 Modes, Reset and SAR Value
  • How to export Facebook photos and videos to Dropbox?
  • Download Realme X Lite Youth Edition RMX1851 Android 10 Realme UI Stock ROM
  • Root Realme X7 Pro 5G RMX2176 Android 10 Realme UI using TWRP and Install Magisk

Today Tip

Dropbox Home page on iMac

How to export Facebook photos and videos to Dropbox?

Now you can export your Facebook Photos and Videos to Dropbox. Even if we share our photos from our … [Read More...] about How to export Facebook photos and videos to Dropbox?

Advertisement

Copyright © 2021 AndroidInfotech.com, All Rights Reserved, Android is a trademark of Google Inc. All contents on this blog are copyright protected and should not be reproduced without permission.

  • Subscribe
  • Sitemap
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Our Image License
  • Hosted on Google Cloud
  • Ad Partner Ezoic