[Q] Doesn't unlocking bootloader wipe device anymore ? - Xperia Z2 Q&A, Help & Troubleshooting

Just decided to unlock my bootloader since the DRM fix is not much of hassle anymore, and this way I can run some of the nice kernels available for our device, so I backed up everything on the phone and proceeded with the unlocking (expecting a factory reset/data wipe), I've had my device unlocked/relocked before, and even restored my original TA partition at the time since I had a backup, but when I unlocked my device today, that was it, no data loss or factory reset happened, not even a warning from flashtools about it, flashtools said "unlocked", I rebooted the device and everything worked without even reflashing the rom or even a kernel.
I'm pretty sure my device was bootloader locked because I used the TA-backup app to restore my TA last time, and once that happens my understanding is the bootloader gets locked automatically, plus all the DRM features were working fine (camera,sound) without flashing the DRM fix (I updated/flashed multiple LP/MM stock roms since then).
So my question is : did sony remove the factory reset on unlock/relock, or is my device just doing something on it's own ? just curious.

That's interesting. Perhaps they did update the bootloader with a firmware upgrade, but I highly doubt it, and it probably has something to do with your procedure (unlocking, relocking and unlocking again) because it would open a big gapping security hole for personal info.
eg: Nothing keeps me from stealing someone's phone, reading the IMEI, requesting an unlock code, unlocking the BL, flashing a custom TWRP-enabled kernel, dumping all device data to SD card and stealing all of its info. This is why unlocking the BL wipes the device.

Pixelado said:
That's interesting. Perhaps they did update the bootloader with a firmware upgrade, but I highly doubt it, and it probably has something to do with your procedure (unlocking, relocking and unlocking again) because it would open a big gapping security hole for personal info.
eg: Nothing keeps me from stealing someone's phone, reading the IMEI, requesting an unlock code, unlocking the BL, flashing a custom TWRP-enabled kernel, dumping all device data to SD card and stealing all of its info. This is why unlocking the BL wipes the device.
Click to expand...
Click to collapse
I know, but at least for me this is 100% working, I even relocked my bootloader, flashed the TA backup to get the DRM keys back, and still nothing changed, and I made sure after the unlock to check that DRM keys are gone (camera quality) and flash a custom kernel, to make sure it was 100% unlocked, and it was.
Since relocking, I did a full .291 flash using flashtools, I was hoping some interested dev can pick on this, it might be helpful to use for exploits or something, no idea tbh.

Related

Regarding Bootloader unlock...

Hello guys
I am probably getting my self an xperia z2 this week...
So my question is:
Since i go mad when i get a new phone(desperate need to flash everything out there such as roms, kernels etc) , I need to know what do i lose if i unlock my bootloader and if i do lose something can i get it back?
Please answer only if you are certain of what you are talking about, i want to be free of doubt if possible
There is a lot of debate on what is lost/broken when you unlock the bootloader. As far as I'm aware X-reality, Super Vivid, noise cancelling, and a few other things get lost. It is able to back them up (By Backing the Ta partition up) and restore them at a later date, restoring them re-locks the bootloader though. To back the TA partition up you have to be rooted, you can find guides for that in the general section (there is no one click root method for 23.x.x.x.x.x firmwares btw). @Envious_Data you got any more info on the subject?
from my testing
you lose:
warrenty (region spesific/carrier/international)
X-Reality
Bionz Image processing
the last one effects camera quality but isnt a complete death of camera quality its somewhat worse but its not something to complain about because the device is still able to perform well
x-reality only works in the album app so no need to worry unless you like your pictures being slightly oversaturated and super sharp
i recomend downgrading to 314 via FTF>flashtool and rooting the device so you can backup your TA using the TA backup tool
after you have backed up your TA, store it somewhere safe, google drive, usb stick anywhere you wont lose it
unlock your bootloader and have fun, so long as you dont brick your device
Guys, I'm new to Sony Xperia Z2. Yesterday I backed up my TA partition with TWRP, today I unlocked the bootloader. May I safely restore the TA partition when the bootloader is unlocked, and even after I update the firmware?
I have read a few warnings that wrong TA may permanently hard-brick the device. So, that's why I am afraid.
if you restore someone elses TA it'll brick your device
you have to be on a stock kernel to restore your TA as doing this will relock your bootloader
Then that's fine. The kernel and entire firmware has not changed yet. TA backup is mine.
This guide answered all of my questions: http://forum.xda-developers.com/showthread.php?t=2642081

(Q) DRM keys

When i originally unlocked the bootloader I had backed up my TA partition.
Now I have a question, can I restore my drm keys from it since im on another version of lollipop?
Sent from my D6503 using XDA Free mobile app
Drm keys are Android version independent. So the answer is yes, you can restore them.
However it's good to remember some rules before restoring; it will also relock your bootloader so, if you have unauthorized software inside your phone by Sony, like a recovery or a custom ROM, your phone will NOT boot as they are normally designed to work with unlocked bootloader.
You should do a backup before proceed or make sure you are on a nin-custom Sony firmware.
Sent from my D6503 using XDA Free mobile app
_delice_doluca_ said:
Drm keys are Android version independent. So the answer is yes, you can restore them.
However it's good to remember some rules before restoring; it will also relock your bootloader so, if you have unauthorized software inside your phone by Sony, like a recovery or a custom ROM, your phone will NOT boot as they are normally designed to work with unlocked bootloader.
You should do a backup before proceed or make sure you are on a nin-custom Sony firmware.
Sent from my D6503 using XDA Free mobile app
Click to expand...
Click to collapse
Excuse me I ment im on another version of Android*, From your answer I understood I cant restore that.. So what are my options for restoring them?
Sent from my D6503 using XDA Free mobile app
As I understand, the DRM keys are not reliant on your Android version. So keys from 4.4.4 should work on 5.0.2 as they shouldn't change. I'm pretty sure envious_data has confirmed this (please correct me if I'm wrong).
HOWEVER, restoring them will relock the bootloader. If you are on a non-sony custom ROM (so CM, AOSP, etc) the phone will not boot (eXistenZ, Moonwalker (I think), and other stock based ROM's will however).
Stock based ROM's will ONLY boot if you have a stock kernel (which is found inside of the ftf file), any custom kernel (advanced stock, AndroPlus, any CM/AOSP, any other stock based kernel) kernels will not.
A locked bootloader recovery will not prevent the phone from booting, as it is on the /system partition and not inside of a kernel.
Also, if you have a recovery installed to the FOTAKernel partition, restore that to stock as that will prevent the phone from booting. The stock FOTAKernel file can be found in the ftf file too. If needed I can strip an ftf file down to stock kernel and FOTAKernel to be flashed.
CosTuMe said:
Excuse me I ment im on another version of Android*, From your answer I understood I cant restore that.. So what are my options for restoring them?
Sent from my D6503 using XDA Free mobile app
Click to expand...
Click to collapse
You can restore your DRM keys on any android version but you must make sure you'r completely on a stock build. (No custom kernals)
Deleted.
whats the procedure for restoring them?
CosTuMe said:
whats the procedure for restoring them?
Click to expand...
Click to collapse
If you used the BackupTA tool (or whatever it is called, it's in the cross device section) use the restore function in that.
But before you do, make sure you are on a stock based ROM, with a full stock kernel and full stock FOTAKernel partition.
gamer649 said:
If you used the BackupTA tool (or whatever it is called, it's in the cross device section) use the restore function in that.
But before you do, make sure you are on a stock based ROM, with a full stock kernel and full stock FOTAKernel partition.
Click to expand...
Click to collapse
Ok, i had done it(and the phone boots). is there anyway to check i got them back?
CosTuMe said:
Ok, i had done it(and the phone boots). is there anyway to check i got them back?
Click to expand...
Click to collapse
Open the phone dialer, *#*#7378423#*#*, Service Tests, Security, and then look to each row. Each one will be followed by [KEY OK][ACTIVE].
Also, to check the bootloader is relocked.
Open the phone dialer, *#*#7378423#*#*, Service Info, Configuration, look to rooting status. It will say "Bootloader unlock allowed: Yes", instead of "Bootloader unlocked: Yes".
Thank you very much, I had succeeded restoring them
Sent from my D6503 using XDA Free mobile app
im currently on kitkat rom with full root and unlocked bootloader, and im planning to lock the bootloader. if i upgrade my phone to the latest official lolipop rom. can my phone lock the bootloader? can i get a new DRM key?
PS: i unlocked BL without backing the DRM keys so i lost it.
ulyshut said:
im currently on kitkat rom with full root and unlocked bootloader, and im planning to lock the bootloader. if i upgrade my phone to the latest official lolipop rom. can my phone lock the bootloader? can i get a new DRM key?
PS: i unlocked BL without backing the DRM keys so i lost it.
Click to expand...
Click to collapse
You can re-lock the bootloader without the DRM keys, however it will not restore them. You can use the bootloader unlock/re-lock function in flashtool to lock the bootloader again.
You can lock the bootloader on any android version, regardless of what version you unlocked it on. But if you didn't back up your DRM keys there is no way to get them back, they are lost forever unfortunately.
thanks for the reply, because my remote play access did not work when i rooted my phone . now based on the other thread, its about the DRM key and unlock BL that is causing the issue.
Steps to restore DRM keys?
Hey,
I want to just request some help about the DRM keys. I know more or less what to do since I have lost them in order to get root. As I have understood the steps go:
Backup all apps and whatnot
Flash stock ftf file from any version (wipe APPSLOG, CACHE, DATA) via Flashtool
Root using Easy Root Tool
Backup TA partition using this tool
Push dual recovery into phone using NUTs Dual Recovery script
Restore TA partition using the tool above
And hopefully I would have Root with working keys? I am currently getting the 17.1.2.A.0.314 & 17.1.1.A.0.402 ftf firmware. If I am missing anything from the steps above please inform me.
Thanks ^^
.
suenoromis said:
Hey,
I want to just request some help about the DRM keys. I know more or less what to do since I have lost them in order to get root. As I have understood the steps go:
Backup all apps and whatnot
Flash stock ftf file from any version (wipe APPSLOG, CACHE, DATA) via Flashtool
Root using Easy Root Tool
Backup TA partition using this tool
Push dual recovery into phone using NUTs Dual Recovery script
Restore TA partition using the tool above
And hopefully I would have Root with working keys? I am currently getting the 17.1.2.A.0.314 & 17.1.1.A.0.402 ftf firmware. If I am missing anything from the steps above please inform me.
Thanks ^^
Click to expand...
Click to collapse
If you unlocked your BL before making backup of TA your keys are lost FOREVER .
Even if you downgrade and start everything again you won't get the keys back as they were unique to your device. If you don't have a TA backup of your keys don't waste time downgrading...
But if you DO HAVE A WORKING TA backup with YOUR keys then downgrade to 4.4.2, root, restore your TA (BL will get locked in the process), install dual recovery and upgrade to a pre-rooted firmware. You'll still have your keys and BL locked.
Steps to restore DRM keys?
ptmaniac said:
If you unlocked your BL before making backup of TA ..... You'll still have your keys and BL locked.
Click to expand...
Click to collapse
So there's absolutely no way to get the keys back after unlocking the bootloader?
What about this?
_delice_doluca_ said:
Drm keys are Android version independent. So the answer is yes, you can restore them.
However it's good to remember some rules before restoring; it will also relock your bootloader so, if you have unauthorized software inside your phone by Sony, like a recovery or a custom ROM, your phone will NOT boot as they are normally designed to work with unlocked bootloader.
You should do a backup before proceed or make sure you are on a nin-custom Sony firmware.
Click to expand...
Click to collapse
suenoromis said:
So there's absolutely no way to get the keys back after unlocking the bootloader?
What about this?
Click to expand...
Click to collapse
Confused about what? you are overcomplicating things.
You can get your keys back ONLY if you have a backup of your TA BEFORE unlocking your bootloader.
DID YOU BACKUP YOUR TA BEFORE UNLOCKING YOUR BOOTLOADER?
If you answer YES --> you can restore your keys
If you answer NO --> they are lost forever.
SImple.
suenoromis said:
So there's absolutely no way to get the keys back after unlocking the bootloader?
What about this?
Click to expand...
Click to collapse
Sorry, If I got things complicated. Let me explain it in scenerios and steps;
Small İnfo first; there is a small partition (or a small and untouchable part inside of a partition) in our phones. It contains and "device-specific" keys, basically an ID.
Some Sony-made softwares (like a picture or sound enhancer which are activated when user starts a music or takes a picture) are patent protected and search for these keys before run. If keys are not there user still can take a picture or listen to music however the patented enhancing software will not kick in. So how do you lose the keys? Why is Sony making this?
Because they want to protect their patented technology from being exposed to inspections or non-Sony users. So basically they tell you if you "unlock your bootloader" you will be able to do anything with your phone freely but the keys-including-partition will be wiped forever and those patented software addings will not run.
Let's get to scenerios.
1th Scenerio: You want to install custom kernel, recovery or ROM to your device? You have to unlock bootloader and it is simple. But doing this basically will wipe your keys and they will be gone forever.
2nd Scenerio: The device can be rooted without unlocking its recovery (very clever Sony, you think about protecting your patent and invent the "keys partition" and lock them to bootloader and get rooted that easily). Once we obtain root, we can read and write to any partition, including the one with the keys (it is called Trim Area). Once we are rooted, with FlashTool, we can backup the TA partition and protect the keys on our PCs.
"After the backing up", once we unlock the bootloader the phone will wipe TA partition but we will have a backup of them on our PCs.
With that backup on our PCs, we can safely do whatever we want; install custom ROMS, kernels, recoveries etc. (actually, there is even a recovery installation possible with "locked bootloader" ) and once we need to claim our warranty or want Sony-patented software enhancements, we can simply restore the TA partition (again with FlashTool).

What happens when I unlock my bootloader?

So, as per title, I'm on stock Lollipop .690, and I'm very tempted to root/flash ROMs etc. But I realised it's a lot easier if my bootloader was unlocked.
Now I've done similar things to HTC/Samsung/LG phones so I know what unlocking bootloader means but I've always read reports that if you unlock an Xperia phone your camera doesn't work or something?
So if I unlock my bootloader, can I still use my camera? Basically, does anything bad happen?
1st off, this is a question so it belongs in the Q&A section.
Any how, when you unlock your bootloader the entirety of you INTERNAL memory gets wiped (any external SD cards do not get wiped). You also lose your DRM keys, these are stored in your TA files so make sure to back them up using the Backup-TA (you need root to do so however, this means you will have to downgrade to 4.4.2 to be able to back up your TA files) tool in the cross device development section. The DRM keys contain things liked noise cancelling algorithms, camera processing algorithms (the camera still works), X-Reality algorithms and other algorithms. What is actually lost when you unlock your bootloader is debated, as some people appear to lose them and some people don't. You also lose your warranty when you unlock your bootloader.
A vcat from every country of the world die
DNT
do not do this job dude u will regreat it to the end of ure life

working root method for 5.1.1 with unlockable bootloader?

I have mine updated to 5.1.1 and the bootloader is unlockable. However, the rooting instruction is confusing for this version.
I am looking for the definite solution for rooting (if it is required to unlock the bootloader, should I backup TA partition first?) 100% stock 5.1.1.
Frankly, I don't want to mess with Kingroot or similar tools from China.
I'm interested in this as well. Sent for warranty repair and came back with 5.1.1. Looking for recommended way to root and backup TA (though I have the original backup somewhere)
http://forum.xda-developers.com/xperia-z-ultra/general/guide-how-to-root-install-recovery-t3210207
I managed to root the device. Here is a guide:
http://forum.xda-developers.com/xperia-z-ultra/general/comprehensive-guide-rooting-5-1-x-t3219502
This is how i did it...downgraded to 4.4.4 and root it,TA backup, unlocked the device, updated to 5.1.1 with stock ftf installed the new recovery an flashed the TWRP after that flash the SuperSU zip and done...
fnldstntn said:
This is how i did it...downgraded to 4.4.4 and root it,TA backup, unlocked the device, updated to 5.1.1 with stock ftf installed the new recovery an flashed the TWRP after that flash the SuperSU zip and done...
Click to expand...
Click to collapse
That's a waste of time. OP has an unlockable bootloader, so he just has to:
- Flash recovery
- Flash SuperSU
- Reboot
Klaos3000 said:
That's a waste of time. OP has an unlockable bootloader, so he just has to:
- Flash recovery
- Flash SuperSU
- Reboot
Click to expand...
Click to collapse
unlockable =/= unlocked
mingkee said:
unlockable =/= unlocked
Click to expand...
Click to collapse
Unlocking the BL is still FAR quicker than going through that hellish process for locked bootloaders. It's like trying to juggle with your hands tied to your back, but they're not really tied. Not sure why WE are arguing though. You provided a guide for a locked bootloader, while I gave one for unlocked. What OP decides to do is currently a mystery.
Klaos3000 said:
Unlocking the BL is still FAR quicker than going through that hellish process for locked bootloaders. It's like trying to juggle with your hands tied to your back, but they're not really tied. Not sure why WE are arguing though. You provided a guide for a locked bootloader, while I gave one for unlocked. What OP decides to do is currently a mystery.
Click to expand...
Click to collapse
Here is a deal: unlocking bootloader will remove DRM key. The only workaround is to backup TA partition. However, doing such also requires root, so you have to root before unlocking bootloader.
Don't you know your method is no brainer???! But dealing with DRM key is another story.
Hello !
Frankly you should try with kingroot it's not really a big deal it's quicker and don't worry you will not mess up your phone. I did the same on mine, and it's quick...
LordBli said:
Hello !
Frankly you should try with kingroot it's not really a big deal it's quicker and don't worry you will not mess up your phone. I did the same on mine, and it's quick...
Click to expand...
Click to collapse
Kingroot does not work with 5.1.x, sorry.
I still have to rollback to 4.4.x and use dualrecovery method 3.
mingkee said:
Kingroot does not work with 5.1.x, sorry.
I still have to rollback to 4.4.x and use dualrecovery method 3.
Click to expand...
Click to collapse
Okay, so roll back to KitKat, root, backup your TA, unlock bootloader, and then update to 5.1.1 again. You'll then be able to just flash a recovery and root. If you don't care about the TA partition, then unlock bootloader and flash recovery and root.
Be aware that if your device is still under warranty, it'll be voided the second you lose the DRM keys (TA). If you're not under warranty anymore, it doesn't make any difference. If your device has to go into repairs down the road, it won't matter since you don't have warranty either way. But if you have, it's a good idea to back it up.
Also, the X-Reality engine etc. were at one point dependent on the TA partition, but this changed on KitKat, so X-Reality still works on an unlocked bootloader (even though it's really bad).
Klaos3000 said:
Okay, so roll back to KitKat, root, backup your TA, unlock bootloader, and then update to 5.1.1 again. You'll then be able to just flash a recovery and root. If you don't care about the TA partition, then unlock bootloader and flash recovery and root.
Be aware that if your device is still under warranty, it'll be voided the second you lose the DRM keys (TA). If you're not under warranty anymore, it doesn't make any difference. If your device has to go into repairs down the road, it won't matter since you don't have warranty either way. But if you have, it's a good idea to back it up.
Also, the X-Reality engine etc. were at one point dependent on the TA partition, but this changed on KitKat, so X-Reality still works on an unlocked bootloader (even though it's really bad).
Click to expand...
Click to collapse
Here is what I did as mentioned on the post linked on earlier post.
Download the latest ROM with Xperifirm, and 4.4.x ROM found in a sticky on the general section.
Pack the 5.1.X ROM as flashable pre-rooted.
Use Flashtool to rollback to 4.4.x, completely wipe, made initial setup and enable debug, and install recovery.
Install pre-rooted ROM through TWRP.
Backup TA partition and device data.
Unlock bootloader.
Restore TA partition and device data.
Done.

How do I relock the bootloader and update to the latest software?

So I rooted this phone 1 or 2 years ago and now I want to give this phone to my uncle. I read on some other sites to remove the root you just have to delete some folders etc and you're good. I did that but twrp is still on the phone.
I want to make it so the phone is no longer rooted and relock the bootloader so that it doesn't have the "do not trust this device" message on it
The build number it has installed is 34.4.A.2.85
hello. I'm XP docomo user here. let me tell you about my experience here. my bootloader unlock allowed was initially no. i backed up my ta partition before i force my bootloader allow to be yes. it was a successful attempt and i went straight unlocking my bootloader. then i attempted to flash back my ta for fun. the bootloader was automatically locked and the allow was no again. twrp recovery also gone lol. i don't know whether this will okay for you
the main point is backup your ta partition before unlocking the bootloader. it has drm keys which really vital to xperia camera as well as x reality mode/ super vivid. once you unlocked the bootloader, the drm keys will be gone for good unless you've it backed up.
i think restoring the ta partition which is created before unlock is the best way to relock the bootloader again.
first restore the ta partition, download latest firmware on xperifirm, use flashtool to flash ftf created by xperifirm. then, voila.
friendly reminder, flash only ftf supported for your variant. (eg. flash only f8131 ftf for f8131, SO-04H ftf for SO-04H, etc)
DO NOT ATTEMPT TO FLASH OTHER PERSON'S TA PARTITION OR YOU WILL GET ETERNITY HARD BRICK
If you didn't back up your TA partition, you can NOT unlock, as the previous poster said, trying to flash one from a different device will irrecoverably brick your one.
You can flash stock with Flashtool (the one by Androxyde, not Sony Flash Tool, they are different) though. While at it, you might give SailfishOS and Ubuntu Touch (alternative, Linux-based OSes) a shot.

Categories

Resources