Advertisements

Unlock Bootloader and Root Sony Xperia 1 II using Magisk

In this tutorial, we will show you how to unlock the bootloader on Sony Xperia 1 II and then root it via Magisk. While Sony devices aren’t among the most development-friendly, yet it has made sure that users don’t end up facing any trouble when trying their hands on the unlocking process. So this might bring up a pretty obvious yet important question: why does one need to carry out the aforementioned task. Well, here is the thing. The Google-owned OS is always known to provide a plethora of tweaks. We aren’t only talking here about the icon packs and themes, you could even install a new custom build ROM.

Likewise, you could also root your device and flash tons of modules and frameworks. But for all of this to be effectively carried out, there is just one prerequisite that your device needs to qualify. And that is an unlocked bootloader. In this guide, we will help you achieve just that. So without further ado, here are the required instructions to unlock the bootloader on your Sony Xperia 1 II and then root it via Magisk. But first, let us get you aware of the risks and advantages of bootloader unlocking and rooting your Xperia device. Please go through it once and make your decision accordingly.

root Sony Xperia 1 II

Advantages of Bootloader Unlocking and Rooting

Once you have unlocked the bootloader on your Xperia device, you have literally opened the gates to a plethora of tweaks. To begin with, you could install a custom ROM or GSI ROM onto your Xperia 1 II device. Likewise, you could replace the device’s stock recovery with a custom one like TWRP. This in turn will provide you with a plentitude of other options like creating a Nandroid backup, installing ZIP and IMG files, etc.

nandroid backup twrp
Nandroid Backup Feature of TWRP

Along the same lines, you could even gain administrative privileges and carry out system-level tweaks. This would be achieved by rooting your device via Magisk. Once rooted, you could then try out Magisk Modules, Substratum Themes, Xposed Framework, and tons of other customizations. While all these are definitely worth commendable but comes with a  few risks as well. Given below are some of the dangers associated with such tweaks.

Risks of an Unlocked Bootloader and Rooting

First and foremost, unlocking the bootloader might make the device warranty null and void. Along the same lines, it will wipe off all the data from your device. Some apps like Google Pay and Pokemon Go might no longer work. Others like Netflix won’t be able to stream content in HD (due to the fact that Widevine L1 will be degraded to L3). You might also lose the ability to receive official OTA updates.

The entire process might itself be risky and could even brick your device. So with that, you have got a pretty decent idea regarding the works and risks of these tweaks. if you are ready to proceed ahead, then here are the required instructions to unlock the bootloader and root Sony Xperia 1 II using Magisk.

How to Unlock Bootloader and Root Sony Xperia 1 II

There are a few settings that you need to enable on your device and a few files that need to be downloaded. Please go through the below-requirements section and carry out the said task.

Warning

Before we begin with the unlocking of the bootloader, I would strongly recommend you to create a backup of your device storage and all your files stored on your device. Unlocking of bootloader will wipe off the entire data on your device. Moreover, it is advised to follow the steps mentioned in this post very carefully to avoid permanent damage or bricking of your device. If anything goes wrong the author or GetDroidTips are not responsible for it.

Prerequisites

  • Create a complete device backup. This is because the unlock process will format all the data from your device.
  • Next up, download and install the Android SDK and Platform Tools on your PC. This will provide you with the necessary ADB and Fastboot files.
  • Install the Sony USB drivers on your PC as well.
  • Download and install the XperiFirm software on your PC. This will be needed to download the stock firmware file for your device.
  • Also, enable USB Debugging and OEM Unlocking. The former will make it easy for your PC to recognize the device in ADB mode. Whereas the latter will allow you to unlock the device’s bootloader. To enable both of them, head over to Settings > About Phone > tap on Build Number 7 Times > Go back to Settings > System > Advanced >  Developer Options > Enable USB debugging and OEM Unlocking.
    oem-and-USB-Debugging
  • Download the Magisk Manager APK file. This will provide the necessary functionalities to root your device. Don’t install it now as your device is about to go a full reset (by unlocking the bootloader). Install it after the said process is complete.

Unlock Bootloader of Sony Xperia 1 II

  1. Head over to the Sony Unlocking site and select your device from the list.
    select device
  2. Open the dialer on your device and type in *#*#7378423#*#*. This will take you to the Service Menu.
  3. Now head over to Service info > Configuration > Rooting Status. If it says Yes, then move over to the next step.
  4. Type in *#06#, copy the IMEI number and paste it in the provided space on the website.
    enter imei
  5. Then checkmark both the acknowledgments and hit the Submit button. You will then get an Unlock Code, copy it, and keep it in a safe place.
  6. Now connect your device to PC via USB cable. Make sure USB Debugging is enabled.
  7. Head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
    cmd platform-tools
  8. Type in the below command in that CMD window to boot your device to fastboot mode:
    adb reboot bootloader
  9. You could also boot to Fastboot by powering off your device, then press the Volume Up button, and connect it to the PC via USB cable.
  10. Moving on, execute the following command to unlock the bootloader on your Xperia device. Replace the <unlock code> with the code that you had got from Sony in STEP 5.
    fastboot oem unlock 0x<unlock code>
  11. The unlocking process will now begin and once that is done, your device should reboot. If not, you could do so via the following command as well:
    fastboot reboot
  12. Set up the device by logging in to your Google Account. With this, you have unlocked the bootloader on Sony Xperia 1 II, its now time to root it via Magisk. Follow along for the instructions.

Root Sony Xperia 1 II

Since TWRP isn’t available for your device, we will first patch the stock boot.img file via Magisk. Then this patched file will be flashed via the Fastboot commands. All these instructions are given below under separate sections for ease of understanding.

STEP 1: Extract Stock Boot File from Firmware

To get hold of the stock boot file, you will first have to download the stock firmware file. Here is how it could be done:

Advertisements
  1. Launch the XperiFirm software on your PC.
  2. Select your device from the left side menu bar.
    Sony Xperia 1 II firmware
  3. Then select the firmware region and you should see the corresponding firmware file under the Available Firmware section.
  4. Click on the firmware version and you should then see the popup dialog box will appear, click on Download.
  5. Once the firmware has been downloaded, extract it and get hold of the stock boot_XXXXX.sin file.

STEP 2: Patch Stock Boot File via Magisk

  1. Install the Magisk Manager app on to your device. Since you are sideloading it, you will have to allow installation from Unknown Sources.
  2. Then transfer the boot_XXXXX.sin file to your device.
  3. Launch the Magisk app and tap on Install next to the Magisk Status.
  4. Under the Install Magisk dialog box, tap on Install.
    Sony Xperia 1 II magisk
  5. In the Select Method option, tap on Select and Patch a File.
  6. Navigate to the boot_XXXXX.sin file and select it.
  7. Magisk will then begin patching the file. Once that is done, you should see the patched boot file placed under the Downloads folder on your device.

STEP 3: Flash Patched Boot File via Fastboot

  1. Transfer the patched boot file to the platform-tools folder on your PC. It is recommended to rename it to boot, hence the complete file name will then be boot.img.
  2. Now connect your device to PC via USB cable. You will have to enable USB Debugging as well.
  3. Inside the platform-tools folder, type in CMD in the address bar and hit Enter. This will launch the Command Prompt window.
    cmd platform-tools
  4. Execute the below command to boot your device to Fastboot mode:
    adb reboot bootloader
  5. You will now have to flash the patched boot image file. Make sure that the file has been renamed to boot.img and placed inside the platform-tools folder. Now type in the following command to flash this file:
    fastboot flash boot boot.img
  6. Once that is done, you could now reboot your device to the OS, using the following command:
    fastboot reboot

With this, we conclude the guide on how to unlock the bootloader on Sony Xperia 1 II and then root it via Magisk. If you have any doubts regarding the aforementioned steps, do let us know in the comments section below. Rounding off, here are some iPhone Tips and TricksPC tips and tricks, and Android Tips and Trick that you should check out as well.

Leave a 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.