yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XA2 Guides, News, & Discussion] sieghartRM:
Well if you are not going to use any Xperia services then you do not have to worry about DRM keys, and do not make backups with B&R app it can not create or restore any backups if DRM keys are lost (I learnt this the hard by having to buy another Sony Xperia XA1 to restore my backup).

I know it can be scary to lose something like the DRM keys with no way of backing them up but as I said above it is not that important as it used to be on older Sony Xperia phones. Only reason you may need DRM keys is for warranty in countries which do not have laws which do not allow OEMs to deny you warranty for unlocking bootloader.
[Sony Xperia XA2 Guides, News, & Discussion] martialaw:
Thanks again for pointing that out. I'm in the EU so losing the warranty is not my main concern.

Have you seen that photo comparison here?

https://www.xda-developers.com/restore-lost-functionality-on-your-unlocked-xperia-device-part-two/

Is that something to expect when unlocking the XA2?
[Sony Xperia XA2 Guides, News, & Discussion] sieghartRM:
I do not think Sony midrange phones rely too much on DRM keys since I did not notice much difference after unlocking bootloader on my Sony Xperia XA2 but you may notice some difference.
[Sony Xperia XA2 Guides, News, & Discussion] Zsir@f:
Hi!

I bought an XA2 was SIM locked. I've got the unlock code from the network administrator and I can use the phone wit any kind of sim card.

I enabled Developer mode and also enabled OEM unlocking. After that I entered into Service menu > Service info > Configuration. At Rooting Status Bootloader unlock allowed says No.

Is there any possibility to unlock the bootloader?

Thank's
[Sony Xperia XA2 Guides, News, & Discussion] matitino:
I think you should unlock it with flashtool so you can relock it if you want ... but wait for someone to answer more competent
[Sony Xperia XA2 Guides, News, & Discussion] Zsir@f:
I use Linux computer and I tried to run fastboot, but there was an error message.
[Sony Xperia XA2 Guides, News, & Discussion] Chronic2k13:
You can't unlock the bootloader!! And even if you could you can't relock it on the Xa2
[Sony Xperia XA2 Guides, News, & Discussion] MartinX3:
Relock is not needed if you want to use custom roms.
[Sony Xperia XA2 Guides, News, & Discussion] Zsir@f:
So, this means, that I can unlock somehow? Id like to install SailfishOS.
[Sony Xperia XA2 Guides, News, & Discussion] sieghartRM:
You can not unlock your device' bootloader since it says no in service menu for bootloader unlocking.

MartinX3 is talking about there is no point in trying to lock your bootlader if you are going to use custom roms not about changing bootloader unlocking to yes to unlock bootloader.

I am not sure if you could ever change the status from no to yes.
[Sony Xperia XA2 Guides, News, & Discussion] MartinX3:
Use xperifirm and newflasher from XDA

Try to flash a Sony firmware without brand for your XA2 :)

Then look again if it says yes or no

Maybe it is a special Simlock which needs to be unlocked by your provider.
[Sony Xperia XA2 Guides, News, & Discussion] Zsir@f:
You've right. This is a special simlock, because the device is sim independent already, but the provider can't (or doesn't want) to unlock the bootloader.

I'm afraid the phone harms somehow during firmware flashing process and will absolutely unusable. You know, I'm not an phone firmware flashing expert. :) Better if I sell this device.

Thank's for everybody's help.
[Sony Xperia XA2 Guides, News, & Discussion] MartinX3:
At least after a period of time he need to unlock it for other SIM cards.

And did the newflasher solution work?
[Sony Xperia XA2 Guides, News, & Discussion] Zsir@f:
This phone was paid in one amount. That's why the provider unlocked the sim and I can use on any mobile network without problem.

The only problem, that in Service menu > Service info > Configuration it says "Bootloader unlock allowed: no".

I didn't use the newflasher, because as I mentioned, I'm afraid the phone will harm and will unusable forever.
[Sony Xperia XA2 Guides, News, & Discussion] MartinX3:
As long as you flash the firmware of your Modell it's fine and working.

And I assume that an unlocked firmware will allow you to unlock your phone

And anyway, even if you flash the wrong firmware, you can flash the correct one any time.

But have in mind that the userdata.sin will wipe your phone, so better delete it before flashing.
[Sony Xperia XA2 Guides, News, & Discussion] Zsir@f:
Where can I find this userdata.sin and how to delete?
[Sony Xperia XA2 Guides, News, & Discussion] MartinX3:
In the downloaded firmware
[Sony Xperia XA2 Guides, News, & Discussion] ben.marks:
Hi,

I am using flashtool but it doesn't seem to work when unlocking the bootloader on my XA2.

I have Rooting status: Yes (simlock unlocked)

25/010/2019 14:10:38 - WARN - Unable to read TA unit 10021, error=-22 ( Hex unit value 00002725 )
25/010/2019 14:10:38 - INFO - Connected device : H3113 / SW release 1311-2845_50.1.A.13.83 / Customization 1312-1442_R10A
25/010/2019 14:10:38 - INFO - Last flash date : null
25/010/2019 14:10:38 - INFO - Phone ready for flashmode operations.
25/010/2019 14:10:38 - INFO - Sending Read-TA:2:2226
25/010/2019 14:10:38 - INFO - Read-TA status : FAIL
25/010/2019 14:10:38 - WARN - Unable to read TA unit 2226, error=-22 ( Hex unit value 000008B2 )
[Sony Xperia XA2 Guides, News, & Discussion] nzpothead:
Hi all,

kind of same issue for me on my XA2 Plus ( H3413).

I first launched Sony Xperia Companion to root my phone. No drivers installed, my phone was not detected. I managed somehow to start the recovery mode ... but It failed !

Now, my phone keeps on rebooting on SONY logo screen.

I downloaded drivers to get my phone detected and ran Emma software. I got the error message : "Locked phone detected. This phone is locked. To update to software please go to sonymobile . com / update".

Then, I tried Xperia flashing tool (v0.9.25.0) and launched 'bootloader unlock'.

I first checked the drivers :

INFO - List of connected devices (Device Id) :

INFO - - USB\VID_0FCE&PID_E1FE\CQ30012GFM	Driver installed : true

INFO - List of ADB devices :

INFO - - none

INFO - List of fastboot devices :

INFO - - none

I could do the flashmode step, I got a few warnings :

WARN - Ufs-info not supported'

WARN - Unable to read TA unit 10021, error=-22 ( Hex unit value 00002725 )

WARN - Unable to read TA unit 2226, error=-22 ( Hex unit value 000008B2 )

Step2, I was asked to go to fastbootmode. Then with my IMEI, I got my unlocking phone key on developer.sony.com/develop/open-devices/get-started/unlock-bootloader/#unlock-code.

I got the final error message :

Unlocking phone using key xxxxxxxxxxxxxxxxx

INFO - FAILED (remote: Command not allowed)

WARN - Maybe the OEM is not enabled

Could someone please help me to move forward coz' I'm stuck as never ...

Couldn't find any hint through forum pages !

Thx
[Sony Xperia XA2 Guides, News, & Discussion] axxx007xxxz:
Ensure to be allowed to unlock bootloader (you know, "Rooting Status = Yes" in the hidden menu) and to have "OEM unlock" option enabled in developer options; also I'd use fastboot for that just to be sure of which commands are being executed.
[Sony Xperia XA2 Guides, News, & Discussion] nzpothead:
Hi !

I appreciate your help but unfortunately, I cannot access my phone options.

The screen is keeping on booting on SONY logo :(

"Ensure to be allowed to unlock bootloader (you know, "Rooting Status = Yes" in the hidden menu) " --> what hidden menu ? If it's in the phone, I cannot.

"and to have "OEM unlock" option enabled in developer options" --> where do you find developer options ? Not in the phone I hope !

If you could help, I'd really appreciate :)

THX
[Sony Xperia XA2 Guides, News, & Discussion] sieghartRM:
First thing you need to do is ensure drivers for your device is installed, so your device can communicate with your laptop.

To do this re-install Sony Xperia Companion or you can install the drivers from flashtool (flashtool drivers are unsigned so you must enable this option in your laptop to install them).

If you have re-installed Sony Xperia Companion then you must click on repair your device and follow the instructions and you will lose your data stored on device not SD card.

If you are going to use flashtool then make drivers are installed and download firmware from Xperifirm and then wait for flashtool to create FTF for you to flash your device you will be able to get more information on how to use flashtool in flashtool's XDA forum.

This should get rid of bootlooping and allow you to access developer options and service menu.

To access developer menu click on build number 7 times in Settings app and to access service menu you enter *#*#7378423#*#* in Phone app.
[Sony Xperia XA2 Guides, News, & Discussion] nzpothead:
Hey !

I reinstalled Xperia companion and installed drivers from Flashtools (driver folder).

There is no doubt my phone can communicate with laptop as I was already able to perform some steps in flashtool when I tried to 'unlock bootloader'.

If my drivers were not correctly installed, I couldn't have been able to go so far in Flashtool process. I really think there's something 'locked' that prevent me from moving forward.

When I restart Xperia companion, my phone is detected but a message pops up and tells : "Your device is locked". Then I am told to unlock my phone (Password or digital print) and allow access to datas.

I tried with no device connected, start Xperia companion, cliked on 'Repair', turned on my device and connected in flash mode, start to repair --> failed !

I got message : "UERepairDeviceDisconnected : 2.4.3.0 / Windows 10 64 bit / Win32 / ".

I've downloaded firmware from Xperifirm and created FTF (Device: Xperia XA2 Plus (H3413)).

I've correctly created the bundle, tried to flash and of course it failed ...

INFO - Bundle creation finished

INFO - Selected Bundle for Sony Xperia XA2 Plus Dual(H4413). FW release : 316-3114_50.1.A.13.123_R9A. Customization : sony

--> I could'nt find my device H3413 in the list ... :(

I decided to choose H4413.

INFO - Preparing files for flashing

WARN - Ufs-info not supported

WARN - Unable to read TA unit 10021, error=-22 ( Hex unit value 00002725 )

ERROR - The bundle does not match the connected device

Any idea ???

I'm lost :( :( :(
[Sony Xperia XA2 Guides, News, & Discussion] sieghartRM:
Did you buy your device from a mobile carrier in France or Philippines?
[Sony Xperia XA2 Guides, News, & Discussion] nzpothead:
France second hand but it was working before ...

Everything started when I forgot my security pattern for screen unlocking. After many tries, I gave up and found out the only option was a full reboot because I couldn't even get into the options menu.

Then I started a repair with Xperia companion and it failed and since, after many other tries, my screen is locked on Sony logo.
[Sony Xperia XA2 Guides, News, & Discussion] sieghartRM:
Did you download Bouygues Telecom FR FTF?
[Sony Xperia XA2 Guides, News, & Discussion] nzpothead:
Of course !

INFO - Selected Bundle for Sony Xperia XA2 Plus Dual(H4413). FW release : 316-3114_50.1.A.13.123_R9A. Customization : sony

---------- Post added at 10:20 PM ---------- Previous post was at 10:16 PM ----------

Of course !

But I think the issue comes from my 'unlocked' thing ...

If you look closely to my flashboot report, it seems obvious something is wrong with unlocking ...
[Sony Xperia XA2 Guides, News, & Discussion] sieghartRM:
Have you tried to power down the phone by pressing power button and volume + button untill you get three vibrations?

This should completely shut you phone down.

If your phone is completely shut down then run Sony Xperia Companion again and select repair but do not connect your phone untill it asks you to connect while pressing volume - button and make sure the phone is off not bootlooping (this may be difficult if phone keeps rebooting itself even after completely turning your phone off but you must ensure it is off so it connect in flash mode and your device can be repaired by Sony Xperia Companion).
[Sony Xperia XA2 Guides, News, & Discussion] nzpothead:
Thanks a lot, it worked !

My mistake was to plug the phone too early.

Many many thanks for your precious time :)

:good:
[Sony Xperia XA2 Guides, News, & Discussion] sieghartRM:
Good to see that this did repair your phone.
[Sony Xperia XA2 Guides, News, & Discussion] Gword256:
I cannot get into fastboot. Is there something with the recent version of WIN10 that doesn't allow drivers to install or needs a work around? (Just to check all I should do is turn off - plug in usb - hold Vol.Up, right?)

When I use FlashTool to install drivers I get an Install Failed for the Google Inc Android USB drivers.

When the phone is off I try to install drivers via "Update Driver" but nothing is ever found.
[Sony Xperia XA2 Guides, News, & Discussion] EwokIng:
Disable driver signing

You have to disable driver signing through Windows recovery. Yes technically you could use the buttons by pressing the power and the volume up but I don't like to do that I just like it better when I use ADB Commands. ADB reboot bootloader. That should bring you into fast food from your phone being turned on and using the ADB Commands. That would be when you install the Google driver. So after you disable driver signing with windows recovery options you have to reboot your computer and plug your phone in with ADB enabled in your developer options and then ADB reboot bootloader. It might be ADB boot bootloader or you could use the button combinations to but it has a black screen with a little light at top it should be a blue light or something. The important thing is that ADB recognises fastboot commands and responds with device. I'll send you a link to the video that I posted on YouTube here it is

https://youtu.be/IX78-rblKZ4
[Sony Xperia XA2 Guides, News, & Discussion] Gword256:
Okay,went through the process here to disable driver signing.

https://www.supportrix.com/kb/how-to-install-unsigned-drivers-in-windows-10/

Thanks, i've been working on this for a few hours.
[Sony Xperia XA2 Guides, News, & Discussion] EwokIng:
Okay

There are a few other pointers net video too. If you get stuck with fast food that don't recognize a device even after you install the drivers in your in fast food then you need to go and report to your USB debugging Privileges and turn off USB debugging then turn it back on and restart your phone and make sure you're on the home screen and not in the settings menu when you plug it back in so it will prompt you to authorize USB debugging. If you're in the settings menu then it definitely will not ask you to authorize USB debugging. That's too many pop-up windows for this phone.
[Sony Xperia XA2 Guides, News, & Discussion] piwei:
Failure to unlock XA2

Trying to install LineageOS, I followed the steps, verified that "Bootloader unlock allowed: Yes" was specified in the Service info -> Configuration and was able to successfully enter fastboot mode (both using adb and using Volume up + connect USB).

After wrangling with dozens of Capchas I also got an unlock code from the Sony website.

However, despite fastboot devices listing the phone, the actual unlock never worked. I always got something like

fastboot oem unlock 0xANDTHECODE

...

FAILED (remote: Command not allowed)

finished. total time: 0.064s
​

I also tried to use -i 0x0fce (which I had used on another XA2 a few months ago), and ran it with sudo (from Linux) and also without the 0x, but always got the same response.

Any idea what I could have missed?

P.S.: I went through the whole thread by now, but I don't think my case was in there yet. (Some of the posts I do not understand at all, so sorry if I missed something.)
[Sony Xperia XA2 Guides, News, & Discussion] Chronic2k13:
Have you turned on OEM unlocking in the developer options?
[Sony Xperia XA2 Guides, News, & Discussion] Chronic2k13:
Here
[Sony Xperia XA2 Guides, News, & Discussion] piwei:
Actually, now that you say this, no! I forgot to mention that. It was greyed out. ("Connect to the internet or contact your carrier.") Since I didn't get the SIM card yet, I now tried to use another one, and the OEM unlocking in the settings was functional and allowed, and so at least I could unlock the boot loader.

(Strange, I didn't remember having to input the SIM card on the previous phone at this stage.)

Thanks! :)
[Sony Xperia XA2 Guides, News, & Discussion] Chronic2k13:
You're welcome
[Sony Xperia XA2 Guides, News, & Discussion] olivrd:
has anyone managed to get root on 50.2.A.0.379?

i have h3113 unit with unlocked bootloader and i tried to flash magisk via twrp, it flashes successfully, but i end up in bootloop. i'm happy with stock, but i miss screen mirroring (lost after unlocking bootloader and i need root to modify build.prop). any help would be appreciated :)

thanks!
[Sony Xperia XA2 Guides, News, & Discussion] bobsright:
Yes, I was able to get Magisk to work but it took a couple of attempts and a bricking before I did. Works great. I installed the Pix3lfy module now my phone looks like 9 without the problems others are having with 9 firmware.
[Sony Xperia XA2 Guides, News, & Discussion] fixik71:
Hi to everyone who already had such a problem, I'm trying to unlock through the command line as on the sony website.

C:\Users\serko\Desktop\Nueva carpeta (7)\platform-tools>fastboot devices

CQ3000UK8J fastboot

C:\Users\serko\Desktop\Nueva carpeta (7)\platform-tools>fastboot oem unlock 0xA6EC12AB09995AA6

FAILED (remote: 'Command not allowed')

fastboot: error: Command failed
[Sony Xperia XA2 Guides, News, & Discussion] ElLibertador:
This thread has not been used for a while, but my experience might be helpful for someone:

I tried to unlock the bootloader, but always got stuck with

fastboot oem unlock XXXXXXXXXXXX

showing;

FAILED (remote: unknown command)
finished. total time: 0.000s

The solution was to connect my XA2 via an USB-Hub. Sounds strange, but it worked afterwards.
[Sony Xperia XA2 Guides, News, & Discussion] teracube:
Hy,

after 5 hours I managed it to unlock bootloader and flash Twrp with Lineage Os 19 :-))) with Linux Mint Laptop:-)))

**** WIN 10 Laptop find no workng driver for my xa2........
[Sony Xperia XA2 Guides, News, & Discussion] robjbw:
Hi. Have a quick question regarding unlocking and iventually rooting. How about loosing DRM/TA keys? Is something that we will loose when unlocking the bootloader? No way to back it up?
[Sony Xperia XA2 Guides, News, & Discussion] li0nh3art3d:
I'll think I tried those drivers but I'll try again when I get to a Pc. i tried a ton of drivers and finally it worked, only long enough to unlock the bootloader in fastboot. After that fastboot stopped recognizing it, and ADB never recognized it

---------- Post added at 09:50 PM ---------- Previous post was at 09:49 PM ----------

I don't think there's a way around that. It's just a consequence of unlocking any device I would think
[Sony Xperia XA2 Guides, News, & Discussion] li0nh3art3d:
Check this out:

https://xdaforums.com/xa2-ultra/help/unlocking-bootloader-rooting-t3762968

Looks like there's a way to get magisk to help us get root
[Sony Xperia XA2 Guides, News, & Discussion] renatofontes:
Isn't that only a problem with sony phones?
[Sony Xperia XA2 Guides, News, & Discussion] li0nh3art3d:
It has to do with the encryption/security of the device. Honestly doesn't seem like a big deal to me. Basically on any phone, by unlocking the bootloader, you're going to open the door to security flaws. It's the trade-off that comes with customization i.e. rooting. Sony uses DRM, but on just about any manufacturer, they use some system of encryption that becomes less secure when unlocking the bootloader. Mostly because this opens the door to a rootkit potentially embedding itself into the bootloader.
[Sony Xperia XA2 Guides, News, & Discussion] renatofontes:
The problem with Sony phones is that it breaks the most important thing to most smartphones users, the camera. In every other non-sony phone there's no big hit on the final user experience.

There's also the fact that you can relock your bootloader and everything goes but to normal(except the warranty, of course), but not in a sony phone.

So yeah, I wouldn't say it is the same for every manufacturer. Maybe for you it is, but not for most users. ?
[Sony Xperia XA2 Guides, News, & Discussion] li0nh3art3d:
My camera's working fine with an unlocked bootloader... I know there's a DRM fix for the XZ premium also.
[Sony Xperia XA2 Guides, News, & Discussion] renatofontes:
Wtih fine, you mean the same as before unlocking? Or not that worse? :confused:

I would love to get an XA2 to mess around with roms and stuff, but the problems with unlocking sony phones has kept me off the idea.
[Sony Xperia XA2 Guides, News, & Discussion] li0nh3art3d:
my camera is working exactly the same as before unlocking. I know for the XZ premium though there is a DRM fix that has been made. the only difference I've noticed really is that there's a message when booting that says my bootloader is unlocked, and the device can't be checked for corruption. but the camera app works fine
[Sony Xperia XA2 Guides, News, & Discussion] renatofontes:
Wow! That's amazing! :D

The mid-range tier is getting really interesting this year. I want to get a phone to play around with treble roms... Now I don't know if I should get the XA2 a Zenfone 5 , Redmi Note 5 Pro or a Nokia 7 Plus ?
[Sony Xperia XA2 Guides, News, & Discussion] :
anybody with unlocked bootloader willing to test "fastboot boot boot.img"?

it should be rooted, just install magisk manager

https://drive.google.com/open?id=1tK_Wf95KXwJ7SJo0bu2Du-fMnmp93TS7

EDIT: tried it myself and it works
[Sony Xperia XA2 Guides, News, & Discussion] matitino:
Someone knows a way to relock bootloader with fastboot?
[Sony Xperia XA2 Guides, News, & Discussion] li0nh3art3d:
I can confirm both Magisk patched & fastboot flashed boot.img & also Xposed Framework installer on 90.2 API 26 Oreo 8.0 are working on my XA2 H3123

---------- Post added at 03:43 AM ---------- Previous post was at 03:42 AM ----------

unfortunately I don't think it can be undone. Once you're unlocked, you're warranty is void, DRM keys invalid. Sony warns of this when giving you your unlock code.
[Sony Xperia XA2 Guides, News, & Discussion] matitino:
Since I come from a xiaomi and I'm not a great expert I would need some advice: I think I have correctly installed the boot.img file, now how do I get into recovery?
[Sony Xperia XA2 Guides, News, & Discussion] nguyenlucky:
Anyone tried flashing Treble system.img by phhusson via fastboot?
[Sony Xperia XA2 Guides, News, & Discussion] :
yes i flashed the system.img, fastboot was reporting it's flashing to part A and after reboot there was only xperia animation
[Sony Xperia XA2 Guides, News, & Discussion] li0nh3art3d:
at the moment the only recovery systems I've found are fastboot and flash mode. There is no traditional TWRP style recovery for the device yet. Only root so far. I found this odd too, coming from Samsung devices. For now we should be patient and appreciate root access until TWRP is made

---------- Post added at 03:17 PM ---------- Previous post was at 03:16 PM ----------

what system.img did you flash? to gain root access, you should only be flashing magisk patched boot.img to the boot partition.
[Sony Xperia XA2 Guides, News, & Discussion] serajr:
I'll start working on twrp porting to xa2 (ultra) as soon as I get mine on hands!
[Sony Xperia XA2 Guides, News, & Discussion] :
phhusson's resurrection remix arm64 A/B. i cleaned Data in recovery but that didn't help and i have no idea how i got into recovery
[Sony Xperia XA2 Guides, News, & Discussion] makotech222:
Anyone try that LineageOS for treble?

Also, hope that TWRP works for regular XA2 as well as Ultra.
[Sony Xperia XA2 Guides, News, & Discussion] jimzhong:
I unlocked the bootloader and got root. Is there anyway to revert to the stock ROM and relock the bootloader? Thanks
[Sony Xperia XA2 Guides, News, & Discussion] li0nh3art3d:
no way to relock the bootloader, no. You can flash stock firmware though. That's as close as you're gonna get..
[Sony Xperia XA2 Guides, News, & Discussion] Endriu22:
how to upload stock rom as flash tools does not support xa2?