Introducing this Guide
Hello there and welcome to My Guide for Your Xperia Smartphone. This Guide will walk with You thru the whole Process of installing Drivers, getting an unlock Key for Your Bootloader, rooting with Magisk and even flashing GSI Custom ROMs up to re-locking Your Bootloader and re-flashing Stock for the total Factory Reset. This Thread/Guide is not meant as Wiki n'or will it teach You about Android at all. Inform Yourself using Google to enjoy the total Freedom and Customization of Android... If You can't solve Problems Yourself, by communicating and research, don't touch Your Bootloader!IMPORTANT:
2020+ Xperias are using fastbootd, and equivalent to fastboot which runs in Userspace (Same as Recoveries).
You can access Your Recovery on Your Xperia by holding VolumeDown (-) & the Powerbutton (Your Device needs to be turned off before ofc). Release the Powerbutton after the Display turned on and hold VolumeDown (-) until You see the Recovery Screen. From there, You can enter fastbootd and fastboot. Labled as "Fastboot" for fastbootd and "Bootloader" which is the old fastboot. You can flash Kernels, Recoveries and other stuff from fastboot. Everything else like System Images (GSIs for example), Product Images, System_ext Images and any Userspace stuff has to be flashed from fastbootd. 2019 Xperias are still using fastboot only...
Fastboot and Fastbootd has nothing to do with SONYs Flashmode on Xperias!
- Installing Drivers
- Firmware Flashing
- Bootloader Unlocking & Magisk Root
- GSI ROM flashing with Fastboot (Optional)
- Bootloader Re-Locking (TheWayBack)
- Firmware Restoring after Re-Locking
- Read! Inform Yourself about the Tools You use...
- Xperia Basics:
Your Device is turned Off...
Blue LED=Fastboot (Hold VolumeUp (+) & Connect to USB)
Green LED=Flashmode (Hold VoumeDown (-) & Connect to USB)
- Windows 10/11 for Firmware flashing & downloading
- Xperia Bootloader Unlock Key (From HERE)
- Platform Tools alias ADB and Fastboot (From HERE)
- Fastboot and Flashmode Drivers (From HERE and HERE)
- EMMA for Firmware Updates (From HERE)
- XperiFirm for Firmware Downloads (From XDA)
- Unsin to extract the Kernel .sin from XperiFirm (From XDA)
- Magisk Manager to patch the extracted Kernel .sin (From GitHub)
- A working Android System for the Magisk Kernel patching
- GSI & vbmeta Image (From Google) (Optional)
- A Backup of Your Internal Devices Storage (Optional)
2. Installing Drivers:
- Download the Drivers from the Links above and extract them
- Install the downloaded and extracted Drivers by right clicking on the ***.inf Files "Install"
3. Flashing Firmwares with EMMA:
- Download EMMA and install it
- Start EMMA and connect Your Device to USB (Flashmode)
3.1. Downloading Firmwares with XperiFirm:
- Download and extract XperiFirm from the link above
- Run XperiFirm and Download the right Firmware for Your Device
4. Bootloader Unlocking and Magisk Root:
Note: Since You are going to unlock Your Bootloader, You may surely want to get Root. So let's start with Magisk or it will take more Time afterwards...
- Download UnSin from the link above and extract it somewhere
- Download the "Platform Tools" from Google and extract it to the root of Your main Windows Drive
- Download and install the Magisk Manager on Your Android Device
- Extract the File boot_********.sin (60MB+ File) with the Unsin Exe (Drag and drop the Image on the Exe)
- You will get a .img File which You can patch now with the Magisk Manager on Your Android Device
- Open the Magisk Manager and Install Magisk by selecting the Image File You just got from UnSin
- Copy the magisk_patched.img in /download from Your Device to the Platform Tools Folder
- Grab Your Device again, go to "About Phone" in the Settings and tap several Times on the build Version
- Go now to the Developer Settings under "System" and enable "OEM-Unlock" and "USB-Debugging"
- Use now the Platform Tools with this Commands (In Powershell):
- Type now (Step by Step):
cd\ cd platform-tools
- Type now:
adb reboot bootloader
- Now Your Bootloader Unlock Code:
fastboot oem unlock 0xYOURKEY
- Wait for it... And type now:
- Wait for Your Device to Wipe and Start. Once in the Android System, turn Your Device off without USB Connected
- Press and hold now the VolumeUp (+) Button while connecting to USB to enable the fastboot Mode
- Continue with flashing the Images for Root (Step by Step):
fastboot flash boot_a magisk_patched.img fastboot flash boot_b magisk_patched.img
- Wipe and Reboot:
fastboot -w fastboot reboot
5. GSI flashing with Fastboot:
Note: GSI ROMs can be found around the Web. Like here...
Treble-Enabled Device Development A/AB ROMS
- Download a GSI Zip from Google
- Extract the system.img and the vbmeta.img to Your Platform-Tools
- Connect Your Device in Fastboot Mode and use Fastboot with:
(On 2020+ Xperias run: "fastboot reboot fastboot" first after You booted into fastboot)
fastboot flash system_a system.img fastboot flash system_b system.img [Optional] fastboot --disable-verity --disable-verification flash vbmeta_a vbmeta.img [Optional] fastboot --disable-verity --disable-verification flash vbmeta_b vbmeta.img fastboot -w (This does Format Your Device and is needed everytime You change the GSI!) fastboot reboot
6. Bootloader Re-Lock:
- Flash the latest Firmware for Your Device with EMMA
- Erase all Userdata before You continue (like with fastboot -w or via Recovery)
- Just go into Fastboot mode and type in the command prompt (like before in this Guide):
fastboot oem lock
- Wait for Your Device and disconnect it from USB
- Done... Continue with Step 7.
- Download and Install the "Xperia Companion" from SONY
- Open the Xperia Companion and select Software Repair
- Select that Your Device can't get recognized (or is a Smartwatch 3 lol)
- Go to the next Page and select the Xperia Smartphone Option
- Continue and wait for the Initialization
- Press and hold Volume DOWN while connecting to USB (You will see the Green Flashmode LED again)
Done. Your Bootloader is locked again and almost all of Your DRMs are restored.
That helped? Leave a Thanks! <3
Donations are actually also really welcome!
Go to paypal.me/miustone and type in the amount. Since it’s PayPal, it's easy and secure. Don’t have a PayPal account? No worries.