[GUIDE][WIN10] Bootloader Unlock/Re-Lock, Rooting with Magisk and flashing Firmwares

Search This thread

CTO_7

New member
Nov 28, 2020
1
0
So i'm having an issue with patching with Magisk, I'm trying to install the US firmware for the Xperia 1 ii XQ-AT51 in XperiFirm I download 1321-7799 Customized US 58.0.A.3.170-R14A I then unpack boot_X-FLASH-ALL-2389.sin into boot_X-FLASH-ALL-2389.img. I then put that onto my phone and patch it with the beta version of Magisk manager. I copy the file magisk_patched.img along with vbmeta.img over using fastboot and they all copy over fine but then the phone gives me an error saying I need to factory reset it. I can't figure out where I'm going wrong here. From what I can tell I followed the guide exactly but for whatever reason the patched Magisk file doesn't seem to be working?

Edit: So I ended up doing "fastboot flash boot magisk_patched.img" which seems to have worked. I'm not entirely sure what "vbmeta.img" is but it doesn't seem to be required in order to root. It seems either patching boot b or vbmeta was causing me to not be able to boot.
 
Last edited:

Tjinn21

New member
Mar 30, 2021
2
0
Good Afternoon,
I am looking to see if these instructions still work for Xperia 1 ii XQ-AT52. I tried rooting but all I get is that my rom is corrupt and cannot be trusted bootlooping screen.
I can successfully flash from XQ-AT52 HK to US XQ-AT51 but I cannot root the US ROM either as all it does is bootloop.
IS there something I'm doing wrong as nothing I've tried has worked so far.
Any help is appretiated.
 
Last edited:

mskyaxl

Senior Member
Aug 16, 2012
65
25
Iasi
Good Afternoon,
I am looking to see if these instructions still work for Xperia 1 ii XQ-AT52. I tried rooting but all I get is that my rom is corrupt and cannot be trusted bootlooping screen.
I can successfully flash from XQ-AT52 HK to US XQ-AT51 but I cannot root the US ROM either as all it does is bootloop.
IS there something I'm doing wrong as nothing I've tried has worked so far.
Any help is appretiated.
Unlocking would show that message on the screen and it will only go away if you relock your phonne to my knowledge. This means that the dm-verity check will fail until you relock it but it does not mean that your phone is broken.

Regarding flashing XQ-AT51 on top of XQ-AT52 firmware, I never tried. I have a XQ-AT51.
 

Fangwulf

Member
Apr 17, 2016
5
1
I was also getting boot loop after flashing the Magisk patched boot.img on Android 11 (XQ-AT51, US 58.1.A.3.87). But with newflasher I was able to successfully rollback to Android 10 RU firmware 58.0.A.3.194 (couldn't find US) and root that. I didn't try upgrading back to 11 after that, since I went with Resurrection Remix anyway.
 

Tjinn21

New member
Mar 30, 2021
2
0
So I figured out what to do but it didnt work on windows.
I booted Linux Mint, installed the Android Image kitchen and removed /system_ext from fstab as reported in the Magisk bug Tracker which ironically links this post as i believe OP is the person who discovered this?
Doing the instructions here failed every time. I still needed to remove the entry for /system_ext in fstab after patching boot.img with Magisk. They also asked for anyone with this issue to go back to the bug tracker to see if Magisk could put in a special hook for sony phones until sony creates a fix.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    YOUR BOOTLOADER NEEDS TO BE/GET UNLOCKED. YOU CAN'T CONTINUE HERE OTHERWISE....
    Please make sure You know what that means! HINT:
    The Devices Hardware and Software Features can all be restored after re-locking except for the Device Key.
    More about that at the very bottom of the Thread...


    What You will need:

    Windows 10 (With USB Access)
    Xperia Bootloader Unlock Key (From HERE)
    Platform Tools alias Fastboot/ADB (From HERE)
    Fastboot and Flashmode Drivers (From HERE)
    XperiFirm (From XDA)
    NewFlasher (From XDA)
    Unsin (From XDA)
    Magisk Manager (GitHub)
    A working Android System
    A Backup of Your Internal Devices Storage (Maybe!?)


    Let's start...
    1. Download the Drivers 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 Windows 10 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 and Flashmode Drivers
    6. Reboot Windows once more and You're prepared to flash Firmwares and to use Fastboot/ADB
    7. Download XperiFirm from XDA and extract it somewhere
    8. Download UnSin from XDA and extract it somewhere
    9. Download the Platform Tools (Fastboot/ADB) from Google and extract it to the root of Your Windows Drive
    10. Download the correct Firmware for Your Device Model with XperiFirm
    11. Download NewFlasher from XDA and extract it to Your Firmware Folder
    12. Download and install the Magisk Manager on Your Xperia Device
    13. Extract the File boot_********.sin with the Unsin Exe (Drag and drop the Image on the Exe)
    14. You will get a .img File which You can patch now with the Magisk Manager on Your Xperia
    15. Open the Magisk Manager and go into the Settings. Tap on the Update Channel and Select the Beta Channel
    16. Go back to the Main Page of Magisk and install Magisk by selecting the Image File You just got from UnSin
    17. Copy the magisk_patched.img in /download from Your Device to the Platform Tools Folder
    18. Grab Your Device again, go to "About Phone" in the Settings and tap several Times on the build Version
    19. Go now to the Developer Settings under "System" and enable "OEM-Unlock" and "USB-Debugging"
    20. Use now the Platform Tools with this Commands:
      (You can acces Fastboot and ADB by starting the Windows Command Prompt)
    21. Type now (Step by Step):
      Code:
      cd\
      cd platform-tools
      (To use the Platform Tools Folder as environment for Fastboot and ADB)
      (In case You extracted the Google platform-tools Folder to Your Windows Drive)
    22. Type now:
      Code:
      adb reboot bootloader
      (You will get a prompt on Your Xperia Device)
    23. Followed by Your Bootloader Unlock Code (You're in fastboot if You can see the BLUE LED on Your Xperia):
      Code:
      fastboot oem unlock 0xYOURKEY
    24. Wait for it... And type now:
      Code:
      fastboot reboot
    25. Wait for Your Device to Wipe and Start. Once in the Android System, turn Your Device off without USB Connected
    26. Press and hold now the Volume UP Button while connecting to USB to enable the fastboot Mode (You're in fastboot if You can see the BLUE LED on Your Xperia)
    27. 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
      fastboot reboot

    Done. You are unlocked and rooted now, just install the Magisk Manager and enjoy!


    Flashing Firmwares and re-locking the Bootloader...

    First of all. You can and should use NewFlasher, with an unlocked and locked Bootloader State.
    That can prevent You from Bootloops and is the only way to Update Your Xperia in unlocked State since OTA don't work anymore.
    Flashing a new Firmware will also wipe Your Device so make sure You have Backups!
    So let's start with the Firmware Flashing (You should have followed the Steps from above before):
    -Make sure Your Device is turned off and that it is disconnected from USB
    -Press and hold the Volume DOWN Button while connecting to USB to access the Xperia Flashmode
    -Go to Your Firmware Folder an start the NewFlasher Exe
    -If it asks for rebooting choose what You want
    -If it asks for extracting Drivers answer No as "n"
    -If it asks for dumping the Trim Area answer No as "n"
    -If it asks for flashing modem, bootloader etc. answer Yes as "y" (always do that)
    Wait for it to finish and You're done with Updating/Flashing Your Firmware. Enjoy!


    If You want to relock Your Bootloader...
    -Just go into fastboot mode any type in the command prompt (like before in this Guide):
    Code:
    cd\
    cd platform-tools
    fastboot oem lock
    -Wait for Your Device and disconnect it from USB
    -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 most of Your DRMs are restored. But please Note, that 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 everyone else who has this Device in his Hands... (SONY knows it anyways).


    That helped? Leave a Thanks! <3
    Donations are actually also really welcome!

    2
    i think in this general root topic you provided wrong files from another image, for your rom, marsom, who is in another section;
    that's why was bricked, sorry for telling you all of this; here you have to tell clearly what image you used as source for magisk;
    your work is good, but the details in this post are limited for simple users like me;
    my version is single sim EU; XQ-AT51; 58.0.A.3.39; customized EU 1321-7706 R13A;

    Don't flash things randomly if you don't know how they work. The DIY section also describes pretty well the simple steps you need to do. Which would've saved you from this entire situation.

    Have attentions, your magisk boot image (link to drive) from this topic are wrong, even as file size.
    Also your refference to the command of flashing 2 partitions is wrong, is not applicable (simple rooting of Xperia 1 II EU single Sim version, in my case); you need only one:
    fastboot flash boot magisk_patched.img

    Learn how A/B partitions work to realize why you need to flash both partitions.


    I reacted because this lack of information and confusion is spread all over the topics, and even a little mistake conduct to risk of bricking the phones;
    the people who post solutions, images, should be aware - here is not instagram, is not beauty contest.

    Again, don't mod your phone if you don't have the knowledge of basic workings of Android. Flashing a bad boot image won't brick your phone, and as you have discovered is recoverable. There is no reason to overreact. You merely flashed a boot image for a different firmware.
    1
    does it need unlock bl and will it break the drm?

    Like i said on other Places before. DRMs will get lost after unlocking but only the Ones for the Display Colors, Xperia Services and Netflix 4K. They will get restored after locking and flashing a Firmware again and it's already handled Like that from SONY since the Xperia 1 & 5.

    And Sure, You need to be unlocked to modify anything on a Android Device persistently.

    Br:cowboy:
    1
    Man , your file corupted my phone....shame to you..

    Thanks for the additional Infos like what Model You have. Is it the Single SIM one (EU?)? An Xperia Z or a Galaxy S2? What have You done? Which Firmware are You on? Don't blame Me for My Work, blame You for not giving even a Single info, No one can Help You Like this....:rolleyes:
    1
    Don't flash things randomly if you don't know how they work. The DIY section also describes pretty well the simple steps you need to do. Which would've saved you from this entire situation.
    @Winrahr: look at the title of topic: Xperia 1 II root guide; not flashed randomly, i falshed for XQ-AT51, as the author named in his post; but his image is wrong;
    You try now to escuse your friend saying that is general topic; it is not, it is reffering dedicated models;
    if he post a rooting guide, should be clear, indicating the source of image; or better without reffering any image, if he want only to stay on general flashing instructions.


    Learn how A/B partitions work to realize why you need to flash both partitions.
    @Winrahr: Really? so this topic is a school, how to root any phone? Even In this case beign general instructions, as you try to escuse him now, are a totally mess; moreover he are indicating: "flash this images, from this drive location"; they are clearly named by author in written : xperia 1 mark 2, XQ-AT51; it was my mistake to download them thinking that i have to do with professionals;



    Again, don't mod your phone if you don't have the knowledge of basic workings of Android. Flashing a bad boot image won't brick your phone, and as you have discovered is recoverable. There is no reason to overreact. You merely flashed a boot image for a different firmware.

    @Winrahr: I repaired myself the phone after bricking due his instructions; The errors belong to author, who indicated: "flash there from this drive image, is for xperia 1 mark 2", XQ-AT51; but the boot image source is wrong; he linked to another moded image, this i discovered later; he posted in this general topic the firmware for another modded rom, marsom, who is in another section;
    What he posted here is far ayaw of the basics, is kindergarden; better avoid to post; when adress a topic, should be clear & complete; not by posting wrong file image and wrong flashing instructions.
    Not try to escuse him by weak argumention as he wanted to present generalities, even those are incomplete.
    Contrary of what is expected from a advanced user, he provided only wrong information and confusion;


    ---------- Post added at 07:31 AM ---------- Previous post was at 07:09 AM ----------

    Thanks for Your Reply! Couldn't say it any better... :highfive:
    To be honest: "This Guide includes the Kernel for the EU Models of the XPERIA 1, 5 and 1 MARK 2. If You have another Model, please get Your own Kernel like explained on the bottom of this Post."
    This is the first Sentence of this Thread. What People can blame Me for is that i don't tell the Model Numbers i got the Images from, but if You take a look on XperiFirm... There is only one EU Model of each Xperia (Except the 2019 Xperias but that would be EU3 in this case instead of EU and is still Dual SIM). Besides that are all Images just fine. The Image Sizes are based on Magisk and is different (smaller) as the OG Image, totally normal so far...

    "Don't flash things randomly" Is the smartest Thing to say. I would clearly ask on the Thread if I'm not sure what i do. I just have made many Threads this Year and i need to maintain all of them besides doing Overlays, My Website, MARS, Images and all that. Sorry if not everything is always that good described, but at the End is the Work important, not the Threads with Cool Pics/Banners and fancy Words. We are not on Instagram nor on a Beauty Contest (already said). But i'm always open for critics if it is constructive... In this case, i will just add Model Numbers to the Threads to avoid confusion of People who never touched XperiFirm before.

    Thanks again and best Regards! :cowboy:

    @Miustone: I don't blame you, but for you would be better not to justify, you should recognize and be a Man. You have another topic , when you present your moded rom; this topic is a general one, and you simply pasted the wrong link to your moded rom, this i discovered after bricking the phone.
    Another mistake you did is that you posted wrong instructions, of flashing two boot partitions, instead of one.
    Now you try to be escused by weak arguments of that you wanted to present generalities, even those beign inclomplete. Maybe you had good intentions but (possible due speed), you pasted wrong link to modded image, not to the rooted one; or you not have own rooted image of XQ- AT51; aslo you continue errors by posting wrong instructions of flashing two partitions instead one;

    You try now to justify yourself, but what's your point? What are the meaning of your post, of "general instructions" if is incomplete, non-aplicable to this topic and generating problems?
    When you adress a topic, you should be clear & complete; not by posting wrong file image and wrong flashing instructions, in a specific , named phone thread.
    Don't continue to defend yourself, maybe you have knowledge, but you posted in hurry, with lack of informations, full of confusions.

    Sorry for others readers, i written too much just to highlight this lesson learned: pay attentions to those called "experts" who try to use this forum as a place for beauty contest.

    ---------- Post added at 08:07 AM ---------- Previous post was at 07:31 AM ----------

    This Guide includes the Kernel for the EU Models of the XPERIA 1, 5 and 1 MARK 2. If You have another Model, please get Your own Kernel like explained on the bottom of this Post.

    -Turn Off Your Device or reboot to fastboot from ADB
    -Hold Volume Up (Louder) while connecting to USB if Your Device is Off
    -Do You see the Blue LED on Your Device? If so, are You in Fastboot Mode!
    -Download the Boot Image for Your Device from HERE and place it into Your fastboot Folder
    -Use fastboot with this commands for Treble A/B Devices:
    Code:
    fastboot flash boot_a magisk_patched.img
    fastboot flash boot_b magisk_patched.img
    fastboot continue

    Done. You will be rooted now, just install the Magisk Manager and enjoy! The Provided Images are from the J9110, J9210 and XQ-AT51...

    DIY - How to get Your own Kernel / Boot Image:
    Download XperiFirm from XDA
    Download UnSin from XDA
    Download a Firmware with XperiFirm
    Extract the File boot_X-FLASH-ALL*** with Unsin (By drag and drop)
    You will get a .img File which You can patch with Magisk Manager

    If i helped You, leave a Thanks <3

    Sorry to tell this, advice for another readers: the provided image is wrong, is not for XQ-AT51, have different size, better build your own using Magisk - check other posts to learn how to do this; also not need to flash two boot partitions, is enough one: fastboot flash boot magisk_patched.img
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone