How To Root Sony Xperia XZ2/Compact/Premium Android 10 Using TWRP And Magisk


In terms of supporting software, Sony is good compared to other mobile manufacturers. They keep rolling out small security patch updates and essential updates on an everyday basis. The matter is that a significant upgrade usually comes within the sort of a buggy package. They need to re-roll out patch updates for the most OS. Also, they do not use hardware as other companies do. But when you are a regular user of your transportable to handle universal apps, the Sony Xperia XZ2 can deliver better performance. So, you do not have to root your mobile device to regulate settings manually. But after you are a frequent Root app user or user of custom ROM, you’ll Root Sony Xperia XZ2 Android 10 version using the below method. The foundation method works with TWRP. YES, you’ll uninstall custom ROMs if needed.


Read the article thoroughly before starting the method. It’ll give some ideas for the preparation. If you planned to flash Custom ROMs, you must check what’s going to work and whatnot. Unofficial ROMs may contain plenty of significant bugs. If you wish to put in the update using TWRP, after the firmware flash, you should flash Magisk anytime.

Should You Root Sony Xperia XZ2/Compact/Premium On The Android 10 Version?

As a native, you have to have a good reason, and you realize what you’re doing. Yes, with a minimum of 4/6 GB RAM and Qualcomm Snapdragon 845 processor, you will be using this mobile device for regular tasks without rooting for 2-3 years if you use it properly.

Android 10 software better than other manufacturers, Custom Skin OS. Don’t root because everyone says that when rooting your mobile device, it can become the fastest. Not. The foundation is to extract some performance from the device.

However, you already have potent specs and software. So if you are addicted to some rooted apps, you should be able to root. But, if you want to experiment, I don’t recommend doing so.

How To Root Sony Xperia XZ2/Compact/Premium Android 10?

Sony Xperia XZ2 International Variants comes with a versatile bootloader aside from some carrier locked devices. It implies that different smartphone variants will be easily rooted. Also, the device can accept to put in TWRP recovery or the other custom recovery file/app alike.

TWRP recovery can be a custom recovery file that must be installed on your device since you will successfully root them. In this article, we have explained the best method to follow and install TWRP recovery on Sony Xperia XZ2. However, the necessary tool to root this device is the Magisk App.

With the support of TWRP Recovery, you’ll quickly install the latest version of Magisk onto your Xperia XZ2 for root access. Before sharing the guide, you may want to understand that, with TWRP recovery present on your device, you will easily install any custom ROM or firmware. Does it seem complicated? Relax, everything is briefly explained in bullet points.

Things to check out for;

  • First of all, please check your device is charged more than 70%.
  • Please create a backup of your Android device before begin rooting.

Supporting versions

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

1. Download Necessary Files


2. Unlock Sony Xperia XZ2 Bootloader Using ADB And Fastboot

Your mobile phone must be supported to generate the unlock code. Check this out using the step below. If your mobile device is supported, get the code and open it with the unlock stages.

2.1 Check Compatibility

  • Go to Sony Developers Official Page to check if your device model is available in the list.
  • You should sign up for a replacement Sony Xperia account or sign in with details on an existing account. Additionally, you’ll use your Gmail account.
  • The device must have an internet connection.
  • Dual SIM Sony devices have two IMEI numbers. Use IMEI 1 to induce the proper unlock code for your device.
  • This action works for all Sony Android devices. However, you continue to should take a look at if your device model supports such action (unlocking the bootloader);

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

2.2 Unlock Steps

  • Open your phone dialer and dial this code – *#*#7378423#*#*
  • Go to Service Info >>> configuration >>> rooting status >>> Check to work out if bootloader unlocking is allowed or not. If it’s allowed, then continue below.
  • Get the “” file and paste it into the folder where you installed ADB and Fastboot.
  • Dial *#06# and replica down your Sony Mobile IMEI number.
  • Return to the Sony Official page, select your device model, and supply your Email Id.
  • Switch off your device. Then, enter into Fastboot mode. To try to do this; Press and hold down the amount Down button connect mobile to your PC using USB Cable.
  • Go to the ADB and Fastboot folder, Launch the fastboot on your computer. Open an electronic communication on your PC and sort below command.
  • fastboot devices
  • It should display the connected devices. If you didn’t get the equipment, restart the prompt and Disconnect and Connect your Sony Xperia XZ2. If you’re 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.

3. Flash TWRP In Sony Xperia XZ2 Android 10 Devices

  • Turn off your device. Then enter Fastboot mode. To try and do this; Press and hold the Volume Down button to connect your mobile device to your PC using the USB Cable.
  • Launch fastboot on your computer. Open the prompt on your PC and enter the command below.
  • fastboot devices
  • It will display the connected devices. If you do not recognize the device, restart electronic communication and Disconnect and Connect your Sony Xperia XZ2. If your device is detected, enter each command below and press Enter.
  • fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img
  • After flashing the file above, type the command below and press Enter.
  • fastboot boot recovery.img
  • If you are unable to restart your mobile device using the above command, press the Volume Down + Power button to exit Fastboot mode. When the screen beats, immediately Press the Volume Up + Power button in Recovery mode.
  • It will boot into TWRP temporarily. Don’t boot into standard OS until we flash magisk.

4. Install TWRP And Magisk In Your Sony Xperia XZ2 Using TWRP

  • In TWRP, Make a full Backup on External SD Card or Pendrive using OTG Cable.
  • Once the process is complete, Restart the Bootloader using TWRP Option. Reboot-> Restart Bootloader.
  • Go to the TWRP menu. Select Advanced Menu-> Recovery ram disk settings-> recovery.img. This file is what we have stored in the SD card before.
  • Go to the TWRP menu. Select Wipe->Advance Wipe->Select Cache Data. The identical process goes for the 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 identical 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 must not root the Sony Xperia XZ2. If you think that you’ll be able to improve performance by rooting; With Qualcomm Snapdragon 845 Octa-Core processor and 4/6 GB RAM, your device can perform well.

If you do not understand how much RAM you wish, you’ll never use that much RAM. Don’t install any applications apart from trusted websites on rooted devices. Third-party website apps may contain some background code.

So check it twice before installing those apps. If you would like to travel back to stock firmware, flash the Android 10 firmware of Sony Xperia XZ2. During the method, if you run into any issues, Be happy to comment below.



Leave a Reply

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