[GUIDE][WINDOWS] Bootloader Unlock & Relock, Drivers, Magisk rooting, Firmware and GSI ROM flashing without TWRP

Search This thread

Robot76

Senior Member
Aug 26, 2015
1,365
776
Sony Xperia 1
I was dead for a number of years, and was resurrected by a sith lord.
🥰
Excuse my newbnessness, Respectfully...

Is there any particular reason we're not using TWRP? or is it just an option? or is it to do with this A/B Treble stuff? or just because it can be done without?
 
  • Haha
Reactions: Miustone
I was dead for a number of years, and was resurrected by a sith lord.
🥰
Excuse my newbnessness, Respectfully...

Is there any particular reason we're not using TWRP? or is it just an option? or is it to do with this A/B Treble stuff? or just because it can be done without?
lol :D

Older Xperia like 2019 and back are using the Kernel for the Recovery. Means we always need a new Boot Image once we get Updates. We don't get updates anymore and newer Xperias have an extra partition for the Recovery. So if someone is willed to build TWRP that works with the latest Stock Firmwares it would be nice. But we don't have one yet so the only way is this Guide... Sadly
 

Robot76

Senior Member
Aug 26, 2015
1,365
776
Sony Xperia 1
lol :D

Older Xperia like 2019 and back are using the Kernel for the Recovery. Means we always need a new Boot Image once we get Updates. We don't get updates anymore and newer Xperias have an extra partition for the Recovery. So if someone is willed to build TWRP that works with the latest Stock Firmwares it would be nice. But we don't have one yet so the only way is this Guide... Sadly

😃, haha, woah!.... I see, very much appreciated!

(goodbye Sony Image Enhancement 😢, farewell👋, hello auto-white balance, lol)
 
Last edited:
Hi Miustone... Just a question to clarify regarding ''vbmeta'.
Do I use Google's vbmeta only if it is needed? otherwise ignore it, and use stock?
^what a horrible question...
You just need to flash vbmeta if You have Issues booting Up an specific GSI. Google provides just Images for that, that we can also use on Xperias. Otherwise just flash the OEM AOSP Binaries from Sony If You want to use GSIs. They May Help on some functionality here and there...
 
  • Like
Reactions: Robot76

Robot76

Senior Member
Aug 26, 2015
1,365
776
Sony Xperia 1
You just need to flash vbmeta if You have Issues booting Up an specific GSI. Google provides just Images for that, that we can also use on Xperias. Otherwise just flash the OEM AOSP Binaries from Sony If You want to use GSIs. They May Help on some functionality here and there...
Thanks so much!!! On Android 12 now and it's perfect... At the moment on PE, trying others now too...
😍
 

Turayedin

New member
Feb 13, 2022
1
0
DO NOT FOLLOW THIS GUIDE if your system build is Android 11
I have carefully followed it for five times in the past and every time it led to brick.
Not because of A/B partition or flashing a different image or reasons like that, it was just simply because Sony added 「system_ext」code in android 11 so directly flash magisk_patched.img will 100% brick the phone.
Use Android Image Kitchen to unpack the img and delete the code in ramdisk file and repack it, then it can be flashed.
 
DO NOT FOLLOW THIS GUIDE if your system build is Android 11
I have carefully followed it for five times in the past and every time it led to brick.
Not because of A/B partition or flashing a different image or reasons like that, it was just simply because Sony added 「system_ext」code in android 11 so directly flash magisk_patched.img will 100% brick the phone.
Use Android Image Kitchen to unpack the img and delete the code in ramdisk file and repack it, then it can be flashed.
You encountered a Bug of older Magisk releases. Just use the recent one. @Robot76 just managed it one Post before yours. "Your Temp Fix" was known for Long and isnt needed anymore on Magisk 23/24+

And your Device was never bricked. It may just got into a bootloop which You could easily fix by flashing the original Boot Image. Please don't tell People they shouldnt follw My Guides just because of your Personal Issues that let You think You Had a bricked Device.
 
Last edited:
  • Like
Reactions: Robot76

Robot76

Senior Member
Aug 26, 2015
1,365
776
Sony Xperia 1
DO NOT FOLLOW THIS GUIDE if your system build is Android 11
I have carefully followed it for five times in the past and every time it led to brick.
Not because of A/B partition or flashing a different image or reasons like that, it was just simply because Sony added 「system_ext」code in android 11 so directly flash magisk_patched.img will 100% brick the phone.
Use Android Image Kitchen to unpack the img and delete the code in ramdisk file and repack it, then it can be flashed.
I'm lucky that I have been doing this a long time in the past, that my experience showed me this this was the easiest flash of my life, it was over in maybe 1-2 minutes tops, making this the easiest flash yet (my device was locked and was Android 11 stock, and I was on Linux, making preparations a little complicated).

Your device isn't bricked, although it might seem that way. Take a break for a day knowing that everything is fine. And then try again.

Always make sure that all your tools and files are the absolute latest and that you checked for problems there, not here. You were at the easiest part. Read the entire thread and heed all the advice.

You must be very young with some growing to do.
I can't think of anything worse than calling someone a liar publicly, and ruining the thread, just because it hasn't worked for you yet, and you're feeling down. This is not how you win friends and influence people, take this lesson and add it to your life.

If you had checked the author's profile, you would have known that he is well established and an awesome guy, an expertand veteran.

If you wanted to flash GSI specifically, follow the other thread by Miustone and read the whole thread if in doubt. And that you thanked his OP, comments, and thanked any comments that helped you.
 
Last edited:
  • Like
Reactions: Miustone

Robot76

Senior Member
Aug 26, 2015
1,365
776
Sony Xperia 1
I was on PE 12 GSI and life was beautiful... ....I then decided to experiment with LOS, and so I erased Userdata...
Then I failed to install it stuck on LOS logo...
Whenever I use ' fastboot -w ' I get this ouutput:

Erasing 'userdata' OKAY [ 73.324s]
/usr/lib/android-sdk/platform-tools/mke2fs failed with status 1

Have I missed something? is it because I f'd myself, and I need to flash stock, re-lock, and repair, and start again?
 
Last edited:

Robot76

Senior Member
Aug 26, 2015
1,365
776
Sony Xperia 1
I was on PE 12 GSI and life was beautiful... ....I then decided to experiment with LOS, and so I erased Userdata...
Then I failed to install it stuck on LOS logo...
Whenever I use ' fastboot -w ' I get this ouutput:

Erasing 'userdata' OKAY [ 73.324s]
/usr/lib/android-sdk/platform-tools/mke2fs failed with status 1

Have I missed something? is it because I f'd myself, and I need to flash stock, re-lock, and repair, and start again?
Solved this shortly afterwards. The ubuntu repository (kubuntu) for platform tools was incomplete, once I downloaded Google's platform tools and 'copied' (cheated) the missing files into "/usr/lib/android-sdk/platform-tools/", 'mke2fs' in particular (the commands were unable to utilize ubuntu's own using e2fsprogs), once doing "fastboot -w" , everything behaved as it was supposed to.
:love:
 
Last edited:

tarakula

New member
Dec 11, 2016
3
0
Sony Xperia 1
Redmi K20 Pro


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

  1. Download UnSin from XDA and extract it somewhere
  2. Download the "Platform Tools" (Fastboot/ADB) from Google and extract it to the root of Your Windows Drive
  3. Download and install the Magisk Manager on Your Xperia Device
  4. Extract the File boot_********.sin with the Unsin Exe (Drag and drop the Image on the Exe)
  5. You will get a .img File which You can patch now with the Magisk Manager on Your Xperia
  6. Open the Magisk Manager and go into the Settings. Tap on the Update Channel and Select the Beta Channel
  7. Go back to the Main Page of Magisk and install Magisk by selecting the Image File You just got from UnSin
  8. Copy the magisk_patched.img in /download from Your Device to the Platform Tools Folder
  9. Grab Your Device again, go to "About Phone" in the Settings and tap several Times on the build Version
  10. Go now to the Developer Settings under "System" and enable "OEM-Unlock" and "USB-Debugging"
  11. Use now the Platform Tools with this Commands:
  12. Type now (Step by Step):
    Code:
    cd\
    cd platform-tools
    Note: To use the Platform Tools Folder as environment for Fastboot and ADB. Or hold Shift and Make a right Click in the Platform Tools Folder to open the Command prompt there...
  13. Type now:
    Code:
    adb reboot bootloader
    You will get a prompt on Your Xperia Device. Your Device will Reboot afterwards...
  14. Now Your Bootloader Unlock Code:
    Code:
    fastboot oem unlock 0xYOURKEY
  15. Wait for it... And type now:
    Code:
    fastboot reboot
  16. Wait for Your Device to Wipe and Start. Once in the Android System, turn Your Device off without USB Connected
  17. Press and hold now the Volume UP Button while connecting to USB to enable the fastboot Mode
  18. Continue with flashing the Images for Root (Step by Step):
    Code:
    fastboot flash boot_a magisk_patched.img
    fastboot flash boot_b magisk_patched.img
  19. Wipe and Reboot:
  20. Code:
    fastboot -w
    fastboot reboot
Note: Unlocking Your Bootloader erases Your unique Device Key FOREVER. That will flag Your Device as "it was unlocked". This can be checked by SONY and (maybe) everyone else who has Your Device in his Hands...
(SONY knows it anyways since You have to order a Key with Your IMEI).

Help stuck on logo XPERIA, android 11
 

Attachments

  • Screenshot 2022-02-27 225601.jpg
    Screenshot 2022-02-27 225601.jpg
    108.3 KB · Views: 75
Last edited:

akztsn

Member
May 18, 2022
9
0
Hey! Is it possible if i just unlocking bootloader and root with magisk without re-install the firmware? Now I'm on firmware J8110 build 154
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10

    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!


    INDEX:
    1. Requirements
    2. Installing Drivers
    3. Firmware Flashing
    4. Bootloader Unlocking & Magisk Root
    5. GSI ROM flashing with Fastboot (Optional)
    6. Bootloader Re-Locking (TheWayBack)
    7. Firmware Restoring after Re-Locking

    1. Requirements:
    • 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:
    1. Download the Drivers from the Links above and extract them
    2. Install the downloaded and extracted Drivers by right clicking on the ***.inf Files "Install"


    3. Flashing Firmwares with EMMA:
    1. Download EMMA and install it
    2. Start EMMA and connect Your Device to USB (Flashmode)

    3.1. Downloading Firmwares with XperiFirm:
    1. Download and extract XperiFirm from the link above
    2. 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...

    1. Download UnSin from the link above and extract it somewhere
    2. Download the "Platform Tools" from Google and extract it to the root of Your main Windows Drive
    3. Download and install the Magisk Manager on Your Android Device
    4. Extract the File boot_********.sin (60MB+ File) with the Unsin Exe (Drag and drop the Image on the Exe)
    5. You will get a .img File which You can patch now with the Magisk Manager on Your Android Device
    6. Open the Magisk Manager and Install Magisk by selecting the Image File You just got from UnSin
    7. Copy the magisk_patched.img in /download from Your Device to the Platform Tools Folder
    8. Grab Your Device again, go to "About Phone" in the Settings and tap several Times on the build Version
    9. Go now to the Developer Settings under "System" and enable "OEM-Unlock" and "USB-Debugging"
    10. Use now the Platform Tools with this Commands (In Powershell):
    11. Type now (Step by Step):
      Code:
      cd\
      cd platform-tools
      Note: To use the Platform Tools Folder as environment for Fastboot and ADB. Or hold Shift and Make a right Click in the Platform Tools Folder to open the Command prompt there...

    12. Type now:
      Code:
      adb reboot bootloader
      You will get a prompt on Your Xperia Device. Your Device will Reboot afterwards...

    13. Now Your Bootloader Unlock Code:
      Code:
      fastboot oem unlock 0xYOURKEY

    14. Wait for it... And type now:
      Code:
      fastboot reboot

    15. Wait for Your Device to Wipe and Start. Once in the Android System, turn Your Device off without USB Connected

    16. Press and hold now the VolumeUp (+) Button while connecting to USB to enable the fastboot Mode

    17. Continue with flashing the Images for Root (Step by Step):
      Code:
      fastboot flash boot_a magisk_patched.img
      fastboot flash boot_b magisk_patched.img

    18. Wipe and Reboot:
    19. Code:
      fastboot -w
      fastboot reboot
      Note: Your are unlocked and rooted now! Enjoy Your Unleashed Device :)



    5. GSI flashing with Fastboot:

    Note: GSI ROMs can be found around the Web. Like here...
    Not all GSIs require the vbmeta change. You can use all GSIs that are made for ARM64 + A/B Devices. Play around. Systems can't damage Your Device since You keep the Stock Vendor & Kernel! You can use any Android Version! Don't forget to make backups if needed. You are going to Format Your Device!

    • 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)
      Code:
      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):
    Code:
    fastboot oem lock
    • Wait for Your Device and disconnect it from USB
    • Done... Continue with Step 7.
    7. Firmware Restoring after Re-Locking:
    • 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)
    Continue once Your Device gets recognized and let the Xperia Companion do his work...
    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!


    BTC: 3A93fjg2KxZJEHUpBExs7rVgivfAUumQoJ
    ETH&ERC20-USDT: 0xD27860248B7E51720DDf9CA5a1f861CA1029c14A
    ERC20: 0xD27860248B7E51720DDf9CA5a1f861CA1029c14A
    2
    I was dead for a number of years, and was resurrected by a sith lord.
    🥰
    Excuse my newbnessness, Respectfully...

    Is there any particular reason we're not using TWRP? or is it just an option? or is it to do with this A/B Treble stuff? or just because it can be done without?
    lol :D

    Older Xperia like 2019 and back are using the Kernel for the Recovery. Means we always need a new Boot Image once we get Updates. We don't get updates anymore and newer Xperias have an extra partition for the Recovery. So if someone is willed to build TWRP that works with the latest Stock Firmwares it would be nice. But we don't have one yet so the only way is this Guide... Sadly
    2
    You just need to flash vbmeta if You have Issues booting Up an specific GSI. Google provides just Images for that, that we can also use on Xperias. Otherwise just flash the OEM AOSP Binaries from Sony If You want to use GSIs. They May Help on some functionality here and there...
    Thanks so much!!! On Android 12 now and it's perfect... At the moment on PE, trying others now too...
    😍
    1
    Thread Updated! Enjoy :)
    1
    I was dead for a number of years, and was resurrected by a sith lord.
    🥰
    Excuse my newbnessness, Respectfully...

    Is there any particular reason we're not using TWRP? or is it just an option? or is it to do with this A/B Treble stuff? or just because it can be done without?