Installing Magisk and rooting a Sony Xperia 1 III

Magisk installed and running on a rooted Sony Xperia 1 III
Magisk installed and running on a rooted Sony Xperia 1 III

PREREQUISITES

  1. An unlocked Xperia 1 III (guide coming soon)
  2. XperiFirm (https://forum.xda-developers.com/t/tool-xperifirm-xperia-firmware-downloader-v5-6-2.2834142/)
  3. UnSIN (https://forum.xda-developers.com/t/tool-unsin-sin-v3-v4-v5-unpacker-v1-13.3128106/)
  4. Android SDK Platform Tools (https://developer.android.com/studio/releases/platform-tools)
  5. Google USB Driver (https://developer.android.com/studio/run/win-usb)
  6. Stock ROM (may also work on 3rd-party ROMs, however I haven't tested and cannot guarantee)

STEPS

  1. Download and unzip the utilities listed above.
  2. If you haven't already, download and install the Google USB Driver from the link above.
  3. Using XperiFirm, download and unpack the latest firmware for your device (in my case, the US 1 III would be XQ-BC62 under PDX-215.
  4. After the firmware is done downloading and unpacking, move the file named boot_X-FLASH-ALL-<some numbers/letters>.sinto the UnSIN folder.
  5. Open the command line (e.g. run cmd.exe in start and then cd <path to UnSIN folder>) and run unsin <name of the .sin file above here to extract the boot image. For example, unsin boot_X-FLASH-ALL-4BA8.sin.
  6. Copy the extracted image file (e.g. boot_X-FLASH-ALL-4BA8.img) above to your phone.
  7. Open Magisk and tap Install in the Magisk section. Then, select Select and Patch a File as the method.
  8. Locate the boot image from above and select it. Then tap LET'S GO. Magisk will patch the boot image.
  9. Copy the patched boot image from Magisk back to your PC to the platform-tools folder inside the unzipped platform-tools folder (e.g. platform-tools inside platform-tools_r31.0.3-windows).
  10. Power off your phone and boot it into recovery. To do this, hold Volume Down + Power until you see the Sony logo. Then, hold Volume Down until the Android Recovery menu appears.
  11. Navigate to Enter Fastboot using the Volume keys and use the Power button to enter it. Then, connect your phone to your PC.
  12. Open a command line inside the platform-tools folder you copied the patched boot image to. Then, type fastboot flash boot_a <name of the Magisk patched boot image> (For example, fastboot flash boot_a magisk_patched-23000_j4z4g.img). This should a few seconds.
  13. After fastboot is done flashing, run fastboot reboot in the command line to reboot back into Android.

That's it! Magisk should be installed and running now! To check, open the Magisk app and it should show a version number (e.g. 23.0 (23000)) next to Installed instead of N/A.

Don't forget to enable MagiskHide in the Magisk settings to fix SafetyNet and (most) apps. I've personally had pretty good luck with the stock MagiskHide settings on stock ROM so far.