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

Search This thread

calamari

Senior Member
Mar 23, 2009
68
18
Tucson, AZ
kidsquid.com
DO NOT USE NEWFLASHER IT WILL BRICK YOUR DEVICE. Just stay on the outdated OS instead. Newflasher will look like it's working, flashing a bunch of files. But ultimately you're screwed, because it WILL bootloop and then say your "device is corrupt" and now you wasted $1000. Can't get into fastboot can't get into anything.
 

Miustone

Senior Member
Jul 23, 2012
3,173
5,950
28
Marburg an der Lahn
sites.google.com
Sony Xperia 5
DO NOT USE NEWFLASHER IT WILL BRICK YOUR DEVICE. Just stay on the outdated OS instead. Newflasher will look like it's working, flashing a bunch of files. But ultimately you're screwed, because it WILL bootloop and then say your "device is corrupt" and now you wasted $1000. Can't get into fastboot can't get into anything.
How do come to the Idea to tell other People they shouldn't use something that works for anyone but not You? And why are You complaining here? Go to the Newflasher Thread to get help and stop scaring other People over here... Sad to hear You face a bootloop but before blaming something should You make sure it wasn't Your fault...
And why fastboot? Just hold Volume Down and connect Your Device to USB. Thats all You have to do to use NewFlasher...
Oh. And make sure You use the correct Firmware from Xperifirm and not something else. You haven told us what You have done so i can just write this. Sorry for You...
 

calamari

Senior Member
Mar 23, 2009
68
18
Tucson, AZ
kidsquid.com
How do come to the Idea to tell other People they shouldn't use something that works for anyone but not You? And why are You complaining here? Go to the Newflasher Thread to get help and stop scaring other People over here... Sad to hear You face a bootloop but before blaming something should You make sure it wasn't Your fault...
And why fastboot? Just hold Volume Down and connect Your Device to USB. Thats all You have to do to use NewFlasher...
Oh. And make sure You use the correct Firmware from Xperifirm and not something else. You haven told us what You have done so i can just write this. Sorry for You...
Nah, I wasn't telling people what to do I was attempting to warn them away from danger. People need to know that if they root their phone they'll be stuck on whatever firmware they had when rooting, as newflasher does not work properly. That's not the end of the world, but it's something they should weigh when deciding to root. And really, I should have read this thread more carefully because a bunch of people have already run into this bootloop problem, not just me. And yes, of course I carefully used the correct firmware, as I'm sure they did as well.

This story does have a semi-happy ending. I was eventually able to get into Flash mode, then I flashed the tadump backup I made. The phone still couldn't boot but at least I could now get the phone into bootloader mode, where I could do a fastboot oem lock. Once my bootloader was locked, the Xperia Companion windows application allowed me to factory reset the device. I lost a lot, but at least my phone works again and Google was able to restore some stuff.
 
Nov 26, 2017
8
2
Great guide! Thank you! It's working wonderfully.

I have a few notes/changes based on my experience that I'll share in case others come across these issues:

For Newflasher, you have to put your phone into flash mode first, but it wasn't explained how. For Sony devices, the method is explained here: https://developer.sony.com/develop/open-devices/get-started/flash-tool/useful-key-combinations/
To enter Flash mode, make sure your phone is turned off and press and hold the Flash key Volume down when you connect your phone to the computer.
(I held it for at least 10 seconds. The phone screen won't show anything, but you will here a Windows device connection sound.)

Newflasher didnt flash anything the first time I tried. The first time I ran it I had it dump the trim area, so maybe you have to run it again and skip that step. I wasn't sure why it didn't work so I also redownloaded the firmware from xperifirm, and placed in the root of my hard drive in a folder with no spaces. Running it after those steps worked. (I also installed Xperia Companion in between these attempts, but I doubt that made a difference. People say you need to close xperia companion and potentially stop all related processes/services for newflasher to work).

You might want to add a note at the beginning of step 4 that warns this will wipe your phone (I was doing it on a fresh phone because I already knew this, but others may not know until it's too late).

Step 4, #17 says to run fastboot reboot fastboot on newer phones, but don't do this, just skip that step. That starts the phone in fastbootD and the computer doesn't see the phone anymore until you shut down the phone and boot back into normal fastboot mode (with nothing showing on the phone screen).

Step 4, #19, after doing fastboot -w it erased almost everything except it failed at erasing 'metadata'. I tried again with the same result so I just proceeded to fastboot reboot and my phone rebooted to a screen about my data may be corrupt, with two options: Try again or Factory reset. I did the factory reset option and it successfully cleared the metadata. I had to wait a minute or two and then it rebooted into android successfully.

Thanks again for the guide!
Next I'm trying to degoogle this phone and replace google play services with microg, but the guide I found uses TWRP. Hopefully I can figure out some alterations to the process to make it work.
 
  • Like
Reactions: Miustone

Miustone

Senior Member
Jul 23, 2012
3,173
5,950
28
Marburg an der Lahn
sites.google.com
Sony Xperia 5
Great guide! Thank you! It's working wonderfully.

I have a few notes/changes based on my experience that I'll share in case others come across these issues:

For Newflasher, you have to put your phone into flash mode first, but it wasn't explained how. For Sony devices, the method is explained here: https://developer.sony.com/develop/open-devices/get-started/flash-tool/useful-key-combinations/

(I held it for at least 10 seconds. The phone screen won't show anything, but you will here a Windows device connection sound.)

Newflasher didnt flash anything the first time I tried. The first time I ran it I had it dump the trim area, so maybe you have to run it again and skip that step. I wasn't sure why it didn't work so I also redownloaded the firmware from xperifirm, and placed in the root of my hard drive in a folder with no spaces. Running it after those steps worked. (I also installed Xperia Companion in between these attempts, but I doubt that made a difference. People say you need to close xperia companion and potentially stop all related processes/services for newflasher to work).

You might want to add a note at the beginning of step 4 that warns this will wipe your phone (I was doing it on a fresh phone because I already knew this, but others may not know until it's too late).

Step 4, #17 says to run fastboot reboot fastboot on newer phones, but don't do this, just skip that step. That starts the phone in fastbootD and the computer doesn't see the phone anymore until you shut down the phone and boot back into normal fastboot mode (with nothing showing on the phone screen).

Step 4, #19, after doing fastboot -w it erased almost everything except it failed at erasing 'metadata'. I tried again with the same result so I just proceeded to fastboot reboot and my phone rebooted to a screen about my data may be corrupt, with two options: Try again or Factory reset. I did the factory reset option and it successfully cleared the metadata. I had to wait a minute or two and then it rebooted into android successfully.

Thanks again for the guide!
Next I'm trying to degoogle this phone and replace google play services with microg, but the guide I found uses TWRP. Hopefully I can figure out some alterations to the process to make it work.
We had the same Idea after i was wondering what could go wrong for People. I think reading does always help... (NewFlasher Thread)

I edited point 3. of the Guide and will do that also for ALL OTHER GUIDES for other Xperias...

Since i'm working hard behind the Scenes on new stuff are my guides lacking some love i usually show on My Contributions here. If You are willed to contribute a bit more, am i willed to invite You to edit My Guides after Your great Feedback... Some Hints and some other Edits could really help to make it Bulletproof and more understandable for all coming Xperia Users who want to Unlock their Devices in the Future...
 
Nov 26, 2017
8
2
Since i'm working hard behind the Scenes on new stuff are my guides lacking some love i usually show on My Contributions here. If You are willed to contribute a bit more, am i willed to invite You to edit My Guides after Your great Feedback... Some Hints and some other Edits could really help to make it Bulletproof and more understandable for all coming Xperia Users who want to Unlock their Devices in the Future...
Sure, I could help out with some edits for this guide at least. Just let me know how.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Is anything beyond step 5 necessary if you just want root and magisk? Thank you

    You're right, 5/6/7 are optional.
    1
    Great guide! Thank you! It's working wonderfully.

    I have a few notes/changes based on my experience that I'll share in case others come across these issues:

    For Newflasher, you have to put your phone into flash mode first, but it wasn't explained how. For Sony devices, the method is explained here: https://developer.sony.com/develop/open-devices/get-started/flash-tool/useful-key-combinations/
    To enter Flash mode, make sure your phone is turned off and press and hold the Flash key Volume down when you connect your phone to the computer.
    (I held it for at least 10 seconds. The phone screen won't show anything, but you will here a Windows device connection sound.)

    Newflasher didnt flash anything the first time I tried. The first time I ran it I had it dump the trim area, so maybe you have to run it again and skip that step. I wasn't sure why it didn't work so I also redownloaded the firmware from xperifirm, and placed in the root of my hard drive in a folder with no spaces. Running it after those steps worked. (I also installed Xperia Companion in between these attempts, but I doubt that made a difference. People say you need to close xperia companion and potentially stop all related processes/services for newflasher to work).

    You might want to add a note at the beginning of step 4 that warns this will wipe your phone (I was doing it on a fresh phone because I already knew this, but others may not know until it's too late).

    Step 4, #17 says to run fastboot reboot fastboot on newer phones, but don't do this, just skip that step. That starts the phone in fastbootD and the computer doesn't see the phone anymore until you shut down the phone and boot back into normal fastboot mode (with nothing showing on the phone screen).

    Step 4, #19, after doing fastboot -w it erased almost everything except it failed at erasing 'metadata'. I tried again with the same result so I just proceeded to fastboot reboot and my phone rebooted to a screen about my data may be corrupt, with two options: Try again or Factory reset. I did the factory reset option and it successfully cleared the metadata. I had to wait a minute or two and then it rebooted into android successfully.

    Thanks again for the guide!
    Next I'm trying to degoogle this phone and replace google play services with microg, but the guide I found uses TWRP. Hopefully I can figure out some alterations to the process to make it work.
  • 8

    Introducing this Guide

    Hello Folks 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. Inform Yourself using Google and be smart and to enjoy the total Freedom of Android... If You can't solve Problems Yourself by communicating and research, don't touch Your Bootloader!

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

    1. Requirements:
    • Windows 10/11 for Firmware flashing & downloading
    • Xperia Bootloader Unlock Key (From HERE)
    • Platform Tools alias Fastboot & ADB (From HERE)
    • Fastboot and Flashmode Drivers (From HERE)
    • XperiFirm for Firmware Downloads (From XDA)
    • NewFlasher for Firmware flashing (From XDA)
    • Unsin to extract .sin Files (From XDA)
    • Magisk App (From GitHub)
    • A working Android System for Magisk
    • GSI & vbmeta Image (From Google) (Optional)
    • A Backup of Your Internal Devices Storage (Optional)


    2. Installing Drivers:
    1. Download the Drivers from the Link above and install them with disabled Driver Signature Enforcement. To do so:
    2. Press and hold down the Shift key while you click the “Restart” Option in the Windows Restart/Shutdown/Standby Options to do a advanced Restart.
    3. Select the “Troubleshoot” Option, followed by the advanced Options and Select "Startup Settings"
    4. Click on Restart and select Option "7) Disable driver signature enforcement"
    5. Once back in Windows, Install the Fastboot, Flashmode and Device Drivers
    6. Reboot Windows once more and You're prepared to flash Firmwares and to use Fastboot & ADB


    3. Flashing Firmwares with NewFlasher:
    1. SINCE PEOPLE WITH MISSING BASIC KNOWLEDGE COMPLAINED...
    2. DONT USE XPERIFIRM IN FASTBOOT!
    3. SHUT DOWN YOUR DEVICE
    4. HOLD VOLUME DOWN WHILE INSERTING A USB CABLE
    5. THAT WILL BRING YOU INTO THE FLASHMODE... (Google, NewFlasher Thread!?)
    6. Download XperiFirm from the Link above and extract it somewhere
    7. Download the wanted Firmware for Your Device Model with XperiFirm
    8. Download NewFlasher from XDA and extract it to Your Firmware Folder
    9. Start the NewFlasher Exe and make Your Choices
    10. That's it... You can do that with Locked and Unlocked Bootloaders!


    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 (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 Xperia
    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:
    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 Volume UP Button while connecting to USB to enable the fastboot Mode

    17. Continue with flashing the Images for Root (Step by Step):
      (On 2020+ Xperias run: "fastboot reboot fastboot" first after You booted into fastboot)
      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: 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).



    5. GSI flashing with Fastboot:

    Note: GSI ROMs can be found around the Web. Like here...
    Not all 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!

    • Download a GSI "Starter Pack" 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
      fastboot --disable-verity --disable-verification flash vbmeta_a vbmeta.img
      fastboot --disable-verity --disable-verification flash vbmeta_b vbmeta.img
      fastboot -w (this erases Your Userdata / Settings and Files)
      fastboot reboot


    6. Bootloader Re-Lock:
    • Flash the latest Firmware for Your Device with XperiFirm and Newlfasher
    • Erase all Userdata before You continue (like with fastboot -w)
    • 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
    Flash Firmware with newflasher ends in bootloop and "your device is corrupt"....
    How can i fix it?

    Edit: I Fixed it with set_active:a
    2
    Thanks for the great guide. This is my first Xperia device, and I'm loving it.
    Can I still perform OTA updates like normal using the OTA option in Magisk, or do I need to do the whole firmware patching process every time?
    Glad it helped You!
    You need to perform Manual Updates with NewFlasher every time. But You can keep Your Data. You Just need to Patch the new Boot Images after every Update...
    1
    which file i need from there for A 11

    Basic knowledge for all Tech around the World before You continue with anything of this:

    ARM = Mobile Chips
    ARM64 = Mobile Chips with 64Bit Support
    X86 = Desktop Chips like from AMD or Intel
    X86_64 = You guessed it? Desktop 64Bit Chips...
    GMS = Google Services or Google Apps

    You want to use an Xperia Mobile Device with GMS?
    ARM64 GMS... No GMS no Play Store...
    1
    no problems at all. apparently some DRM issues that may mean you can't watch Netflix in 4K (doesn't affect me at all), and that's about it.