yashsingh1/xdaforums huggingface dataset:
[Sony Xperia 5 II Guides, News, & Discussion] gspbeetle:
Might want to add a section for quickly updating firmware without wiping data. I am sure everyone here in XDA have done this many times, not sure am I missing any safety steps. Help me take a look

1. Backup your stuff

2. Download xperiafirm, unsin, newflasher, platform-tools, Xpatch

3. Download the firmware with xperiafirm

4. Copy newflasher files into the firmware folder

5. Delete appslog_X-****.sin , diag_X-****.sin , persist_X-****.sin, userdata_X-****.sin , ssd_X-****.sin (may no longer exist) , all *.ta and the partition folder

6. Turn off phone and plug in usb with volume down to enter flash mod (green led)

7. Start newflasher and flash the firmware (newflasher now also have a "keep user data" option)

8. Reboot, wait for andriod update complete

9. Drag the boot_X-****.sin to unsin.exe to get boot_X-****.img

10. Use entr0pia's XPatcher to patch your img, more info: here (remember to delete the old magisk_patch folder in XPatcher's folder) Seems no longer required with latest Magisk v25+

10. Copy boot_X-****.img to your phone and let Magisk app patch the image, which will normally appear as magisk_patched-****.img in your phone's Download folder

11. Copy the magisk-patched.img from your phone's download folder to the platform-tools folder for later use

12. Unplug phone and plug in usb with volume up to enter fastboot mode (blue led)

13. Create a .bat with this code in the platform-tools folder

adb start-server
fastboot flash boot_a magisk-patched.img
fastboot flash boot_b magisk-patched.img
fastboot reboot
adb kill-server
@pause

14. run the .bat and done?

(It is recommended to use Shamiko with UniversalSafetyNet Fix afterwards)
[Sony Xperia 5 II Guides, News, & Discussion] iRAWkTheWorld:
I've spent an embarrassing 3-4 hours trying to figure this out. If a good samaritan ever has a free moment to walk me through this via discord it would be much appreciated!

My tag is; RAW#6319

I feel like it is way easier than I am finding it to be :cry:
[Sony Xperia 5 II Guides, News, & Discussion] donkeyman1234:
Has anyone succeeded with this from 10 to 11(even delete partition folders)? All apps and data remain?
[Sony Xperia 5 II Guides, News, & Discussion] Dojando II:
Hey, very nice guide! That helped me a lot. I am a complete newbe to rooting a smartphone and I managed to do it. Unfortunately I did not read more careful and tried to install the latest 58.1 Update after I succsessfully managed to root the older version. But it was for the wrong region. (Which doenst make sense since my phone came with a UK charger but doesnt seem to be a UK phone lol)

So anyway I spent the last 5 hours to fix my phone which was stuck in a bootloop. I Fixed it with a metric buttload of trial and error.

Since I want the new updated root version for my phone, I am gonna wait until XperiFirm has it for my region. But I want to set up my phone now. Will I lose all my files and apps when I follow your guide again just later with the update?

I know that you lose all you data when you install a custom rom. But as I said I am a total noob here and the only ROMs I know are the Nintendo Game roms. So I dont know if that is actually a rom or not ^^

Thanks again for the guide and everyone who is answering my question <3
[Sony Xperia 5 II Guides, News, & Discussion] Dojando II:
Nice, I am gonna save that for the future! Thanks :)
[Sony Xperia 5 II Guides, News, & Discussion] smr404:
Thanks, Miustone, for the great step-by-step guide! The unlocking and rooting process worked like a charm for me on the first attempt.
[Sony Xperia 5 II Guides, News, & Discussion] :
Just got this phone.. It tells me there is Update - probably Android 11 I didn't click..

Does it matter for this guide if I'm on A10 or A11?
[Sony Xperia 5 II Guides, News, & Discussion] iRAWkTheWorld:
I just got the phone myself (25th Jan) and managed to root it on Android 10. Had to flash new firmware onto the phone last night to get it working on Android 11, although this removed my root.

I was going to try root again tonight so if you haven't tried it yet I will let you know how it works for me!
[Sony Xperia 5 II Guides, News, & Discussion] donkeyman1234:
Did you delete any files or folders before flashing from 10 to 11? Or just flash everything?
[Sony Xperia 5 II Guides, News, & Discussion] Dojando II:
Any news yet? I would like to know that too since Resurrction Remix OS doesnt really wokr for me appearently ;_; So I wanna switch back to Stock and Android 11 would be nice
[Sony Xperia 5 II Guides, News, & Discussion] :
Well well.. I guess this will ne my first non-rooted device ever..

As Google did its best to make custom rom installation more difficult with every Android release I feel like the number of people who root their phones is steadily declining.

I look in the development section and see way to many discontinued projects..

Sad times we live in. Really depressing, being guest on my own device instead of admin. But time is valuable and I don't have any spare time to test and try around when there is lack of guidance.

Goodbye xda.
[Sony Xperia 5 II Guides, News, & Discussion] eqbirvin:
Bro chill. No reason to be mellow dramatic.

There are discontinued ROMs because they are all by the same dev who doesn't have the time or support to support ROMs that are now based on A10 or ROMs that have retired dev trees.

Many of us still use and want root, no it's not going anywhere. Google hasn't shut down or locked down rooting. If you don't want to take the time to read through a page or so of how to root your device, that isn't Google or anyone other than your own fault but don't come on here being a drama queen or Martin Blower. Ever since the old days of rooting you've always had to (or at least been recommended to) read a bunch before messing with your device firmware. If you have never done that and instead expected everyone else to be your guinea pigs then you are the same type of person who would just post something like "doesn't boot, trash" when you didn't follow a step correctly.

The people on this thread take time out of their busy day to write how-to's and develop firmware for us. Your negative attitude isn't welcome so either change your attitude or like you said, "Goodbye xda."
[Sony Xperia 5 II Guides, News, & Discussion] blackpaperweight:
So does relocking remove root status?? also can anyone confirm the audio features return after relocking? sorry for noob question
[Sony Xperia 5 II Guides, News, & Discussion] Bellitsch89:
Deleted
[Sony Xperia 5 II Guides, News, & Discussion] suntanfrodo:
I followed the guide step by step and my phone is now stuck in a bootloop.

I have a XQ-AS52 with firmware 58.1.A.1.178 (Customized EEA). Here is what I did:

- I already had USB debugging and OEM unlock enabled

- I followed the OP's guide to a T (with Magisk beta channel and all that)

- I flashed the magisk_patched.img to both partitions a an b in fastboot

- At this point, I had not used the Newflasher tool at all

- When I finished flashing the images, I got "Your device can't be checked for corruption. Please lock your bootloader"

- That repeated a few times and then it showed "Your device is corrupt. It can't be trusted and will not boot. Your device will be powered off in 5 seconds"

- To get out of that bootloop, I used the firmware boot_XXX.img file (that i got from the XperiFirm and Unsin tools) and flashed it in fastboot mode. However, I did not specify any partition, and just wrote "fastboot flash boot_XXX.img" and it showed that it was flashing that to partition b.

- The phone did boot up afterwards but still showed the "Your device can't be checked for corruption. Please lock your bootloader" message

- I allowed the USB debugging again (but could not find the OEM unlock in the Developer options because I guess the bootloader was already unlocked)

- I pasted the Newflasher files in the folder of the firmware downloaded by the XperiFirm tool

- I turned off the phone and put it in flash mode

- I ran the newflasher.exe file as admin and did "f, n, n, y" (fastboot, no, no, yes)

- But now my device is in bootloop again with the same messages as above and won't power up.

- Even if I redo the step of flashing the boot_XX.img file in fastboot mode, it still shows the same error.

I have Android 11 by the way (if that helps) and a previous user said to use another method than magisk as it is not currently working with Android 11 (which I, unfortunately, did not do).

Can anyone please help?

EDIT: I managed to get my phone out of the bootloop and it is working now. But it still unrooted and I guess I won't try rooting it again until we have experience trying to root Android 11, especially with Xperia 5 ii.

This is what I did to get my phone out of the bootloop:

- I installed the Sony Companion app and chose to repair the phone

- I do not know how much battery I had but I guess it was enough for the Sony Companion app to work

- The app would not work with an unlocked bootloader. So you have to boot into fastboot mode and lock the bootloader again.

- The app would guide you for the next steps. Basically, it would ask you to turn off the phone, disconnect it from the computer, choose repair in the app, boot into flash mode by pressing the volume down button while plugging in the cable

- if everything is fine (it was in my case), the companion app would reflash the phone with the original firmware and it should boot up normally again.

So my phone is back to operational right now, albeit with bootloader locked and unrooted
[Sony Xperia 5 II Guides, News, & Discussion] doggydog2:
Negative guy is right, rooting was easy back in the day.. i have my 10y old files here for such phones as S Plus, Note 2 (didn't root earlier decade of HTC phones) and it was as easy as flashing one file:)

Last 3-4 years it got difficult unless you have OnePlus or Google device. For these phones, there's just few UI clicks to upgrade, and no tracking of IMEI.

But I will root til i die, so many benefits.. I switch between ~4 flagships a year, and I have hundreds of apps in the exact state on each phone. And the Magisk, Xposed plugins are so necessary..

Having said that, is Xperia5ii ok to upgrade to new firmwares? The OP says data is lost on each update, but some guys encourage otherwise.
[Sony Xperia 5 II Guides, News, & Discussion] Bellitsch89:
I had the same Problem with Android 11.

I have tried very often with Android 11 but IT doesnt works. With Android 10 IT works but I cant change any System files, like delete System Apps or change "normal" Apps like nova launcher to a System-App.
[Sony Xperia 5 II Guides, News, & Discussion] suntanfrodo:
How did you recover your phone when you encountered that problem?

I cannot get my phone out of that bootloop
[Sony Xperia 5 II Guides, News, & Discussion] Bellitsch89:
I have locked the bootloader, then I have flashed android 10 and then I have made a repair with xperia companion. You can load the battery with the original Sony Power Adapter. IT will bootloop every time but IT will load.

You must at the right Moment press the volume down or up and connect to PC then you can Flash and lock the bootloader.

I hope you unterstand me because my Englisch is Not the yellow from the egg 😅

Edit: in this thread

https://xdaforums.com/t/phone-bricked-stuck-in-bootloop.4193363/

I have found the solution. The last 3 or 4 replies has help me.
[Sony Xperia 5 II Guides, News, & Discussion] suntanfrodo:
It worked! Danke dir 😅
[Sony Xperia 5 II Guides, News, & Discussion] Bellitsch89:
Kein Problem 👍🏼
[Sony Xperia 5 II Guides, News, & Discussion] BlackSalami:
I ****ed up somewhere and had to use the Xperia companion app to repair the phone after being stuck. But now my device is on Android 11 and I'm unsure if this tutorial will work or even serve a purpose now that I've learned Magisk is not working properly on android versions past 10. I'm too scared of bricking my device so I guess I'll give up on fully owning this one
[Sony Xperia 5 II Guides, News, & Discussion] Thelemic:
So I searched far and wide but there's no option to backup the DRM keys for the 5 II yet, correct? I'll probably have no use for it but still.
[Sony Xperia 5 II Guides, News, & Discussion] NoroXX:
Hi - step 27 tells me that the .img is too big to download .... what about that?
[Sony Xperia 5 II Guides, News, & Discussion] NoroXX:
Otherwise, the tutorial is great, thanks for that
[Sony Xperia 5 II Guides, News, & Discussion] reclaimerog:
I'm having the absolute worst time trying to root my sony xperia 5 ii.

I have the USA variant XQ-AS62 build number 58.0.A.28.51

I do NOT want to move to android 11, im still stuck nearly at the begining of the entire process

when i look at xperiafirm its only offering me the a11 update which i dont want to do. if anyone is kind enough to please help me out via voice or chat ill gladly compensate you with 125 bucks when we are finished. I'm not completely illiterate when it comes to things like this but its been a long while. my email is reclaimerog@gmail.com message me there then we can figure out discord or phone call. thank you guys.
[Sony Xperia 5 II Guides, News, & Discussion] AgashU:
EDIT: Realised this has been posted in the rom section by fengmubai here:

https://xdaforums.com/t/kernel-stock-kernel-patched-with-magisk-on-android-11.4247827/

If anyone has the XQ-AS72 (Hong Kong) Xperia 5 II on software version 58.1.A.3.87, I have uploaded the fixed boot image patched with magisk as there are problems when flashing magisk on Android 11.

Link:

44.69 MB file on MEGA

mega.nz

Works well on my device, but please make sure you have the correct variant and software version before flashing.
[Sony Xperia 5 II Guides, News, & Discussion] NoroXX:
Hello. Has anyone managed to root the Xperia 5 ii XQ-AS52? I tested the procedure repeatedly /with build 58.1.A.5.55 and 58.1.A.3.87/ The result is always the same - bootlop The new .img is not loading ... Can't anyone advise what to do with it?
[Sony Xperia 5 II Guides, News, & Discussion] b0r000:
@Miustone Have you tried that on Android 11?

Soft version 58.1.A.5.55 to be specific. I've tried that yesterday and it was epic fail. Not sure what went wrong.

Phone ended up in bootloop but luckily Xperia Companion was able to revive it to "factory" state.

I've looked around how's the state of rooting Android 11 looks now (I'm quite outdated when it comes to modding phones) but it seems it was taken care in Magisk 21.0. So I'm really lost what could go wrong?
[Sony Xperia 5 II Guides, News, & Discussion] Miustone:
The Problem is explained here :

Bootloop after installing the patched boot image on Android 11 on Sony Xperia 5 II (needed system_ext removed from fstab) · Issue #3752 · topjohnwu/Magisk

ISSUE DESCRIPTION After trying to install Magisk with the patched magisk_boot.img from the latest Canary (and Beta) version of the Manager, the device is unable to boot and goes into the bootloop. ...

github.com

Let's hope for a fix asap...
[Sony Xperia 5 II Guides, News, & Discussion] robi101012981:
Hello, I just got my 5 II and I would like to root it, but I do have some questions.. Right now I'm on Android 11 and I would like to if rooting it's possible, because, as I've read here, rooting it's more difficult on android 11 than on 10. If I'm rooting, can I still receive OTA updates or I'm stuck on that certain version?
[Sony Xperia 5 II Guides, News, & Discussion] rayman2k1:
Thank you for the guide!!

Got my AS72 shipped from HK this week and did both the OTA updates to bring me to Android 11.

Followed the guide (boy has it been long since I've done a bootloader/recovery/rom replacement) but ended up with a bootloop. It seems that Magisk cannot patch the 58.1.A.3.87 properly.

I was able to resolve the bootloop by getting into the bootloader (Vol+, plug in USB) and just doing

fastboot flash boot_a <unpatched boot.img from XperiFirm+UNSIN>
fastboot flash boot_b <unpatched boot.img from XperiFirm+UNSIN>

So, now this puppy is sitting with the latest firmware, but with an unmodded bootloader (essentially where it was after the fastboot oem unlock step).

Will do some more digging to see if there are any updates to the Magisk/Android 11 situation. If anyone has cracked this nut, I'd appreciate any and all help!

EDIT: Wow, I can't read. Looks like @AgashU has posted a patched bootloader. I will try this now!

EDIT2: Thanks to @AgashU for pointing me to this thread where I downloaded the patched Magisk-patched partition.
[Sony Xperia 5 II Guides, News, & Discussion] robi101012981:
What about AS52?
[Sony Xperia 5 II Guides, News, & Discussion] rayman2k1:
I'm not really sure what you mean, exactly, but I imagine that the procedure would be the exact same, except for the part where you download the firmware, you'd need to grab the one that is right for your phone...
[Sony Xperia 5 II Guides, News, & Discussion] robi101012981:
Thanks, I'll try in this weekend, I have the 58.1.A.5.55 firmware, so I hope that everything will be OK when I'll start the process of rooting my device
[Sony Xperia 5 II Guides, News, & Discussion] zroice:
Ayo,

any news on how to root on android 11?

I get the device corrupt message after flashing xposed patched images - when I flash the unpatched it boots fine again.

Even with the new magisk 22.1.

On another thread here I read people discussing which modules are working on magisk.. so somehow it must be possible to root this thing with android 11 or?
[Sony Xperia 5 II Guides, News, & Discussion] robi101012981:
I've managed to root Android 11 without an issue. Just use the patched image that it's located on this forum: https://xdaforums.com/t/kernel-stock-kernel-patched-with-magisk-on-android-11.4247827/

Or if it s not working, try this: https://drive.google.com/drive/folders/16-eQ8lTNADBTwRPsrphcXq5FL-bifAns?usp=sharing
[Sony Xperia 5 II Guides, News, & Discussion] morphius88:
Unlocked bootloader and rooted on first try. Stock rom even let me theme using Swift Installer without a problem.

Thanks OP for the instructions
[Sony Xperia 5 II Guides, News, & Discussion] Rageplay:
When rooted, can I still (ota) update the device?

I'd like to use magisk but I do want to apply updates and security patches from Sony/Google.
[Sony Xperia 5 II Guides, News, & Discussion] morphius88:
Check post# 107 on page 6 of this thread. There are instructions on how to update while rooted. Always backup the device just in case data gets wiped.
[Sony Xperia 5 II Guides, News, & Discussion] zegoo:
Hello,

I would like to root my Xperia 5 ii XQ-AS52 on 58.1.A.5.159 Europe Customize EEA. Could i use and follow this (long and intersting) process or should/could i flash the kernel patched on this thread even if it is for another variant and market ?
[Sony Xperia 5 II Guides, News, & Discussion] Cobra04:
I have linked a magisk patched Android 11 boot.img from the XQ-AS62 (Firmware is 58.1.A.5.55) that I modified with Android Image Kitchen. You can flash this to boot_a and boot_b to get root on Android 11.

modified-magisk-patched-A11-XQ-AS62-.img

drive.google.com
[Sony Xperia 5 II Guides, News, & Discussion] danbest82:
Is WIN10 a must? I tried to search but didn't find anything. Sorry if it's been mentioned. Has anyone tried with Windows 7(WIN7 to help with future searches)? Thanks!
[Sony Xperia 5 II Guides, News, & Discussion] morphius88:
Is there a way to roll back the XQ-AS72 from android 11 (Firmware 58.1.A.3.87) to android 10? I am really starting to hate the aggressive android 11 ram management. Cant even leave an app for 30 seconds and it restarts from new or reloads. Same **** happens on the OnePlus 8T that I just got and unlocked BL and rooted. And that phone has 12gb ram. Ugh.

Anyway, I cant seem to find anything regarding a roll back so figured I would ask here.
[Sony Xperia 5 II Guides, News, & Discussion] shadiku:
Following along with this guide to get my device rooted but I've already hit a roadblock. While getting the unlock key, I noticed that my phone appears to disallow bootloader unlocking. I have it enabled in developer settings, but it still says it's not allowed in the service info.

As a result, I'm receiving the following error when trying to run the "fastboot oem unlock" command:

FAILED (remote: 'Command not allowed')
fastboot: error: Command failed

I ended up using Google's USB drivers (which didn't require disabling code signing verification) for fastboot as I wasn't able to find the driver from the OP link. Might be a long shot, but is this where I've gone wrong?

I guess I'm just totally out of luck, but if anyone knows of a workaround I'd really appreciate any advice.
[Sony Xperia 5 II Guides, News, & Discussion] eqbirvin:
OP can you provide where you got the drivers for the device?
[Sony Xperia 5 II Guides, News, & Discussion] eqbirvin:
Here is a link to the fastboot and flashmode drivers. Pulled from flashtool for xperia 1 ii.

Dont forget to disable driver verification before install in Windows 10.
[Sony Xperia 5 II Guides, News, & Discussion] morphius88:
I updated to the latest firmware that I downloaded from XperiFirm and relocked the bootloader but I am unable to use the Sony Companion to "repair" the device. I get this error: Temporary Device Incompatibility Detected.

See pic for full details. Devices seems to work fine, I just dont know if it will get updates that can be done from the phone.
[Sony Xperia 5 II Guides, News, & Discussion] hellomot0:
Maybe You have installed a firmware, which does not match the phone region? For example, Your phone identified by IMEI as HK or SEA region (HK and SEA haven't the 58.1.A.5.280 firmware yet), but You have installed 58.1.A.5.280 for TW or CN. XperiFirm discovered Your phone by IMEI as its real region and cant find a proper 58.1.A.5.280 firmware. And cant rollback too
[Sony Xperia 5 II Guides, News, & Discussion] lpcysmi:
Hello!

It has been a while since I rooted a phone

I follow this thread, I am thinking of rooting my device to edit the build.prop. But before doing so I wanted to have a few things clear....

Can I magisk hide apps and get safety net back with this : https://xdaforums.com/t/magisk-module-universal-safetynet-fix-1-1-0.4217823/, or is that no longer needed/possible?

Is there a way to remove the "OK/ENTER" TO UNLOCK SCREEN AFTER ENTERING PIN?

Is there a way to backup DRM keys before unlocking bootloader and putting them again when bootloader is reenabled?

What are the consequences of "fastboot oem relock" and connecting to the companion, what do I loose, for the awesomeness of gaining root?

Do I still need to edit my build prop after root to reenable mira cast?

In android 6 it was done with this:

#property to enable user to access Google WFD settings

persist.debug.wfd.enable=1

##property to choose between virtual/external wfd display

persist.sys.wfd.virtual=0

Thanks!
[Sony Xperia 5 II Guides, News, & Discussion] TheDVIMaster:
Are you still looking for one? Am looking to root, haven't yet, and am ready to be of assistance :3
[Sony Xperia 5 II Guides, News, & Discussion] boybkol:
I need help, i unlocked my xperia 1 lll and rooted but decided to relock following the guide in the OP but I forgot to charge it fully before relocking and when i tried to repair it using Sony companion it says phone should have at least 80% battery charge now my phone won't boot and i have no idea how to charge it since once i connect it to the charger it just keeps rebooting. Can someone please help me?
[Sony Xperia 5 II Guides, News, & Discussion] Bellitsch89:
It reboots but it will loading. I had the same problem. But i can say it will loading
[Sony Xperia 5 II Guides, News, & Discussion] KnockOut^9:
hi guys, i have a quick and stupid question, but i'm not expert in this like many of us: if i want to flash a new firmware, i should be first unlock necessarily the Bootloader? Or this is optional?
[Sony Xperia 5 II Guides, News, & Discussion] Miustone:
Thread Updates coming soon including Android 12 GSI flashing + Magisk
[Sony Xperia 5 II Guides, News, & Discussion] Miustone:
Thread Updated! Enjoy :)
[Sony Xperia 5 II Guides, News, & Discussion] Cridre:
What a wonderful world we'd have if some genius out there could make this into a automatic application. I'd buy it immediately 😁😊😏