[GUIDE] Back up DRM Keys & unlock/relock Bootloader (Noob proof)

zxz0O0

Senior Member
Apr 18, 2011
1,534
5,156
0
Go to Backup TA folder, open folder backup/ and extract your TA backup. Open TA.img in hex editor (or text editor probably also works) and search for "NEW_VERSION" (first occurence), shortly after that there should be "fs_version:" (e.g. mine is fs_version:EURO-LTE_14.2.A.1.114 => so I would use 14.2.A.1.114 to restore my TA backup)
 

EpicLPer

Senior Member
Aug 29, 2012
677
379
93
25
Scheibbs
epiclper.com
Go to Backup TA folder, open folder backup/ and extract your TA backup. Open TA.img in hex editor (or text editor probably also works) and search for "NEW_VERSION" (first occurence), shortly after that there should be "fs_version:" (e.g. mine is fs_version:EURO-LTE_14.2.A.1.114 => so I would use 14.2.A.1.114 to restore my TA backup)
Wow, thanks for the fast reply! I'll do this now :) Have some "Thanks" from me! :D

---------- Post added at 08:57 PM ---------- Previous post was at 08:40 PM ----------

1. Flash stock firmware you used for TA backup and root it (e.g. if you used Jelly Bean to take TA backup, flash Jelly Bean)
2. Restore TA backup with Backup TA (this will also relock your bootloader)
3. Flash stock firmware (preferably from your original cust# but it's not so important) and check wipe everything
One more question to this tho: With Step 1 do you mean flashing it via Recovery (ZIP) or Flashtool? Because Step 3 is the same. Also "cust#" confuses me a bit right now, sorry :eek:
 

EpicLPer

Senior Member
Aug 29, 2012
677
379
93
25
Scheibbs
epiclper.com
It does not matter how you flash it, as long as you have root. You can get root by flashing a pre-rooted zip, by using Easy Root Tool or any other or by custom kernel.
You can read here about cust# ( http://forum.xda-developers.com/showthread.php?p=52011642 ) but as I said I don't think it's that important.
I tried to flash the "EURO-LTE_14.2.A.1.114" version (the one I used for making the TA Backup) but all I got was this error in the Flashtool:

Code:
20/048/2014 22:48:53 - INFO  - Device connected in flash mode
20/048/2014 22:48:54 - INFO  - Opening device for R/W
20/048/2014 22:48:54 - INFO  - Start Flashing
20/048/2014 22:48:54 - INFO  - Processing loader.sin
20/048/2014 22:48:54 - INFO  -     Checking header
20/048/2014 22:48:54 - ERROR - Processing of loader.sin finished with errors.
20/048/2014 22:48:54 - INFO  - Ending flash session
20/048/2014 22:48:54 - ERROR - 
20/048/2014 22:48:54 - ERROR - Error flashing. Aborted
20/048/2014 22:48:55 - INFO  - Device connected in flash mode
 

EpicLPer

Senior Member
Aug 29, 2012
677
379
93
25
Scheibbs
epiclper.com
1. Flash stock firmware you used for TA backup and root it (e.g. if you used Jelly Bean to take TA backup, flash Jelly Bean)
2. Restore TA backup with Backup TA (this will also relock your bootloader)
3. Flash stock firmware (preferably from your original cust# but it's not so important) and check wipe everything
Heya!

PS.: I managed to flash the stock ROM now, was just a weird Flashtool error...

Tried to use your Easy Root tool as you told me but it failed, it says:
Code:
==============================================
=                                            =
=             Easy Root Tool v11             =
=      Supports various Xperia devices       =
=            created by zxz0O0               =
=                                            =
=     http://forum.xda-developers.com/       =
=        showthread.php?p=53448680           =
=                                            =
=       Many thanks to:                      =
=       - [NUT]                              =
=       - geohot                             =
=       - MohammadAG                         =
=       - cubeundcube                        =
=       - nhnt11                             =
=       - xsacha                             =
=                                            =
==============================================

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
=============================================
Waiting for Device, connect USB cable now...
Make sure you have only one Android device connected
BlueStacks emulator can also cause problems
=============================================
Device found

=============================================
Getting device variables
=============================================
Device model is D5503
Firmware is 14.2.A.1.114

=============================================
Sending files
=============================================
119 KB/s (1585 bytes in 0.013s)
2489 KB/s (657704 bytes in 0.258s)
276 KB/s (1133 bytes in 0.004s)
1324 KB/s (9496 bytes in 0.007s)
1907 KB/s (13672 bytes in 0.007s)

Copying kernel module...
2244 KB/s (34473 bytes in 0.015s)
124 KB/s (767 bytes in 0.006s)
1474 KB/s (13592 bytes in 0.009s)
Kernel version is 3.4.0-perf-ga439037-01014-gdd051d5
Version does not match 3.4.0-perf-ge4322cd, needs patching...
1+0 records in
0+1 records out
34 bytes transferred in 0.001 secs (34000 bytes/sec)
Kernel module patched.

modulecrcpatch (by zxz0O0)

module_layout: patched to 0xD87FCB74
__aeabi_unwind_cpp_pr1: match
kallsyms_lookup_name: not found
printk: not found
mem_text_write_kernel_word: not found
__aeabi_unwind_cpp_pr0: match
successfully patched

=============================================
Loading towelzxperia
=============================================
1659 KB/s (13592 bytes in 0.008s)
2535 KB/s (197320 bytes in 0.076s)
=============================================

Waiting for towelzxperia to exploit...

towelzxperia by zxz0O0 (EasyRootTool Version)
libexploit by geohot

libzxploit.so created
doing the magic
creating vm (loljavasucks)
insmod: init_module '/data/local/tmp/wp_mod.ko' failed (Exec format error)
mount: Operation not permitted
/system/bin/chcon:  Could not label /system/xbin/su with u:object_r:system_file:
s0:  No such file or directory
chcon:  Could not label /system/xbin/su with u:object_r:system_file:s0:  No such
 file or directory
sh: /system/xbin/su: not found
cleaning up
done

Checking if device is rooted...
Error: device not rooted
 

asterixmic

Member
Oct 21, 2008
47
5
0
Bucharest
Hello

A few months ago I relocked the bootloader, but I did not check the lock code if it was correct.
Right now I can not unlock it again and I also don't have the previous files of flashtool.

I have searched and tried everything that I found and still can not unlock it.

Is there any way that the unlock code might be different now?
First time I try it says command failed.
After that it says device already rooted.

I am running official firmware, not rooted.

Thanks
 

zxz0O0

Senior Member
Apr 18, 2011
1,534
5,156
0
Did you relock the bootloader with flashtool or by restoring the TA backup? It's not possible for the unlock code to be changed. Have you tried unlocking the bootloader through flashtool?
 

asterixmic

Member
Oct 21, 2008
47
5
0
Bucharest
I have locked it using flashtool.
Now I tried relocking it using both flashtool and fastboot command.

In both cases at first run I get failed, no reason. At second run I get "device already rooted" .

The bootloader is confirmed to be unlockable.
I also tried the trick with the folder and file but still no luck. The tutorials I found pointed to a folder structer that is different in the current build of flashtool, though.
 

asterixmic

Member
Oct 21, 2008
47
5
0
Bucharest
Have you made a TA backup with locked bootloader? Try restoring that.

If not, create a TA backup now and send it to me for analysis.
Thanks for trying to help me and replying to the PM.
I figured it out eventually:
- the ulcode.txt needs to reside in C:\Users\[your_username]\.flashTool\registeredDevices\[phone's_serial_number]

I always thought that this could be the issue because the previous tutorials I found were referencing an older path of an older flashtool version.
But when I did a TA backup directly from flashtool and saw that the folder for a specific device is the one from above, I tried creating the ulcode.txt over there.

And it did work :)
 
  • Like
Reactions: redijia

freeman94

Senior Member
Jul 2, 2011
169
19
38
Tarnów
Hi.
I have question and please answer me if I'm understanding this correct.
Let say I'm on Custom Rom, with bootloader unlock then I have missing this Sony's technnology X-reallty and others, cuz of bootlaoder drm keys missing.
But if I Relock the bootloader, and restore the copy of the drm key, and then flash the official sony firmware, then I'm like on STOCK with all this functionalty of Sony's working?
Will I get back the sony image processing etc stuff?
Please Answer.
 

Frunzdoedel

Senior Member
Sep 19, 2010
191
75
48
Offenbach
Hi.
I have question and please answer me if I'm understanding this correct.
Let say I'm on Custom Rom, with bootloader unlock then I have missing this Sony's technnology X-reallty and others, cuz of bootlaoder drm keys missing.
But if I Relock the bootloader, and restore the copy of the drm key, and then flash the official sony firmware, then I'm like on STOCK with all this functionalty of Sony's working?
Will I get back the sony image processing etc stuff?
Please Answer.
Yes but be aware that you need at first be on stock and then restore your TA partition.

Sent from my D5503 using xda premium
 
  • Like
Reactions: freeman94

freeman94

Senior Member
Jul 2, 2011
169
19
38
Tarnów
Yes but be aware that you need at first be on stock and then restore your TA partition.

Sent from my D5503 using xda premium
Thank, you for answer.
One more thing, let say that for now I will stay with stock lollipop 5.0.2 firmware and only root my device to tweak some thing by myself.
In my old device with was the LG L90 after rooting on stock rom, I could not anymore update the software over OTA or the LG Suite as it was giving me the message that the device have super user privilages, and the update can't be done, It's was some kind of LG safty procasions, don't know why they bother. To fix that I had to unroot=>update and then root again, so going back to my question.
Does Sony makes such practices to advanced users to make life difficult for them?

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

EDIT: Only Bootloder Unlocking delete drm keys, rooting doesn't right?
 

Premananda_laishram

Senior Member
Dec 23, 2007
215
56
48
I unlocked my bootloader without backing up TA. However, I did not flash any custom ROM. In the meantime, I tested whether my TA could be backup and it indeed was successful. At this point what I want to know is whether the backup-ed TA is indeed what everybody is concerned about i.e., DRM keys??? Or am I just fooling around??
 

Poomr95

Member
May 17, 2015
7
0
0
Hi Guys I want to ask you. If I unlocked bootloader unlocked already and relocked again so it means I can't get my DRM keys ? If there there is any possibilty to get in my sutiation, please help. :)
 

Frunzdoedel

Senior Member
Sep 19, 2010
191
75
48
Offenbach
Hi Guys I want to ask you. If I unlocked bootloader unlocked already and relocked again so it means I can't get my DRM keys ? If there there is any possibilty to get in my sutiation, please help. :)
When you unlock your phones bootloader without a ta backup your phones drm keys are gone forever, in short no.

Sent from my D5503 using xda premium
 
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