yashsingh1/xdaforums huggingface dataset:
[Xperia Z Original Android Development] PeZoII:
It scared the hell out of me when i saw that blinking led!!! İ got pissed off and decided to ****** burn the device with the charger...but it just worked out for me...hope it does for you too..
[Xperia Z Original Android Development] DreadPirateDan:
Dang, I would have liked to do this to mine. Well and truly unlocked and too late though. Would have been nice for potential future resale to be able to restore all functions :) oh well.

You really should delete/edit your post to that link. There are waaay to many trigger happy flashers around XDA.
[Xperia Z Original Android Development] Clark Joseph Kent:
Download link removed....
[Xperia Z Original Android Development] lilstevie:
Wow, posting your ta was probably a little silly, now everyone who downloaded it before it was edited has all the unique data about your device, Serial, IMEI, customisation details, and your unique drm keys
[Xperia Z Original Android Development] fareeed:
So is this method safe providing you take a backup before you unlock your bootloader? I heard messing with Ta is always risky and many users have bricked their devices in doing so
[Xperia Z Original Android Development] lilstevie:
Messing with TA will always be a risky endevour, TA stores the entire device config, and all flashing operations are risky.

Obviously there are some safe operations to do, as sony alter ta themselves, some sections are less risky like the flags, and stripping the protection,

I really think the best way would be systematically targetting the changes rather than flashing the whole thing.
[Xperia Z Original Android Development] sacredsoul:
Even flashing your own TA can be risky?
[Xperia Z Original Android Development] lilstevie:
if something goes wrong, yes
[Xperia Z Original Android Development] Egan:
Removed the content of the link right after I got notice of this. That's say couple of minutes available tops.

---------- Post added at 05:43 AM ---------- Previous post was at 05:38 AM ----------

I did backup /dev/block/mmcblk0p1 through terminal. My model is C6603.
[Xperia Z Original Android Development] lilstevie:
Everyones will look different, there are device specific settings, including your serial number and IMEI, The biggest difference though will come from the Marlin DRM certificates as each device has a different key
[Xperia Z Original Android Development] Egan:
Is /dev/block/mmcblk0p1 for every Xperia Z the TA? How can one check its the TA?
[Xperia Z Original Android Development] lilstevie:
yes mmcblk0p1 is TA on at least every S4 Xperia I have dealt with. Identifying that it is actually the TA is a little more difficult if you don't know what to look for but it should have your serial number in it, and if APQ8064 also your IMEI, there is also a bunch identifiers that can be searched for including but not limited to model number and marlin drm certificates
[Xperia Z Original Android Development] Egan:
Thanks for the info. I can confirm my TA backup is correct for my device. So the brick is not a restore of an invalid backup.
[Xperia Z Original Android Development] Egan:
It appears there is a bug in Google Drive. When you delete something it places it in the bin folder, but the share is still active. Only when removing from the bin will lift the share. I hope no one else other than gm007 downloaded and used it.
[Xperia Z Original Android Development] Hellscythe:
will there be some sort of tool later? :3

this is definitely a revolution.

its just ADB and my computer don't play nicely
[Xperia Z Original Android Development] rickwyatt:
im make a tool later today
[Xperia Z Original Android Development] Egan:
Maybe we can do a compare between unlocked and locked TA to see what changes. I am able to do this later this week.
[Xperia Z Original Android Development] lilstevie:
I've not done a full analysis so there may be more but from what I have noted so far is:

Strip SIN container from partition

Add in key somehow related to unlock token

The rest I have skipped over so far as the key that is added moves the rest of the data in TA by the size of the key, which trips up a simple compare.
[Xperia Z Original Android Development] rickwyatt:
new tool on first page to make it easy to backup & restore TA
[Xperia Z Original Android Development] gm007:
I bought a new phone,is it safe to use this tool? :p
[Xperia Z Original Android Development] monx®:
this method is completely brilliant. u can restore ori TA anytime after flashing any sony based custom rom to get back BE2 functionality. it does not work with ao*p(a) based tho.

backup TA only once before unlocking bootloader > unlock bootloader > flash (kernel) + custom rom > restore TA.

repeat to reflash other rom/updates that require reflashing kernel.

i prefer to unlock bootloader then flash kernel with permanent recovery. its easier to troubleshoot if anything goes wrong.

dev is brilliant to figure out this.

■ C6603
[Xperia Z Original Android Development] lilstevie:
Only if the sony based rom uses a stock kernel, restoring TA when running a custom kernel will not work as the kernel is sigchecked on boot.

Of course not, and there are 2 main reasons for this:

1) BE2 is a software feature, AOSP based roms do not include the BE2 software

2) AOSP based roms require a custom kernel, which I already spoke about

Or better yet, don't flash custom kernel because restoring TA will cause the sigcheck on boot to fail leaving you in a state where you need to use pc companion/emma/flashtool/etc to get the device booting again.

I really feel like I am sounding like a broken record here. NO CUSTOM KERNELS WITH LOCKED TA.

This is true, but this doesn't help with that even slightly
[Xperia Z Original Android Development] monx®:
[MENTION=3803210]liste[/MENTION]vie

what im trying to say is restoring TA on ao*p(a) -ie: PAC rom will cause fail to boot as u described, due to its custom kernel, not about BE2.

for sony based rom, -ie: eXistenZ, i did flashed with DooMLorD latest kernel which is stock 253 + CWM. Then restore my original TA. As the result, i get permanent recovery (which is embedded in kernel (ramdisk) stage) + rooted customized rom + BE2 functional.

to change to PAC again, i just unlock my bootloader again to flash PAC included custom kernel and no need to restore TA as it has no puspose. only with custom sony based rom, i restore my ori TA.

■ C6603
[Xperia Z Original Android Development] lilstevie:
I don't see how that would have happened, DooMLorD's kernel is not a Sony elf, but rather a boot.img, and does not contain the signature part of the elf either.

Stock elf is 3 parts, Kernel, Ramdisk, and Certificate. The certificate verifies authenticity of the rest of the elf.
[Xperia Z Original Android Development] monx®:
Yes, i understand. But it just work. Pls try it if u dont belive me. i tried like i said in my previous post with eXistenZ v2 rom. but i prefer using PAC atm.

so the steps are simple as usual. with unlocked bootloader, flash domlord kernel, flash eXistenZ, full boot, restore TA. Profit.

■ C6603
[Xperia Z Original Android Development] monx®:
wrong post due to new tapatalk 4 new UI :p

■ c6603
[Xperia Z Original Android Development] lilstevie:
To give you the benefit of the doubt I did give it a go, just in case something really weird was happening.

but... I can confirm exactly as I said, DooMLorD's kernel does indeed fail the signature check, I get the red flashing notification LED after restoring my locked TA, which is exactly what I expected.
[Xperia Z Original Android Development] monx®:
doesnt matter as long phone boot as usual & BE2 is functional rite?

■ C6603
[Xperia Z Original Android Development] cdesai:
I doubt it's functional, it probably means it can't verify the kernel and so it refuses to boot, and flashes the LED to show that.
[Xperia Z Original Android Development] Jamal_RS:
can i use flashtool to backup & restore TA Partition?

anybody try it?
[Xperia Z Original Android Development] Osyx:
Yes you can, but for now I think [MENTION=5261329]DevShaft[/MENTION]'s tool is safer.
[Xperia Z Original Android Development] monx®:
With respect, it does work. I know how to differentiate BE2 is working or not. Just try it first then share ur result. it boots just fine & BE is working on stock Album app.

again, with unlocked bootloader, flash DooMLorD v6 kernel, boot to recovery, flash eXistenZ v2, full boot, open any pic with more orange color in Album, make screenshot to compare later on, restore TA, reboot, double check whether BE is enabled in settings, reopen same image, u will see what i mean.

■ C6603
[Xperia Z Original Android Development] DevShaft:
Of course it works on eXistenZ, it flashes Sony stock kernel :rolleyes:

You only use DooMKernel for its recovery, which is gone after flashing eXistenZ.
[Xperia Z Original Android Development] monx®:
read again, DooMLorD v6

u can reflash doomlord kernel again via fastboot. duh

eXistenZ doenst come with kernel btw

just try it before saying anything in contra, bcos im starting to get mad bcos ppl just talk without action :p
[Xperia Z Original Android Development] lilstevie:
It doesn't boot though, the red light is the only response from the device in this state
[Xperia Z Original Android Development] cdesai:
Re read my post, I meant to say that the phone won't even boot if you try flashing an unsigned kernel and then restore the TA partition to a locked state (i.e. from a backup taken before unlocking the bootloader)
[Xperia Z Original Android Development] lilstevie:
and even when people do try it you make out that it is all fine.

I am saying 100% categorically DooMLorD's kernel will not ****ing boot if you are locked bootloader
[Xperia Z Original Android Development] DevShaft:
Same here. I tried this couple of times when analyzing the TA partition way earlier in this thread. So [MENTION=273310]monx®[/MENTION], do not think you are the only one who tried it ;).
[Xperia Z Original Android Development] monx®:
sh!t. apologize! maybe got some confusion. in my earlier post I already stated DooMLorD stock kernel 253 + CWM.

I just turned on my pc and found the kernel file I meant is Z_DooMLoRD_AdvStkKernel_FW-253_v6.zip & not DooMLorD's other kernel.
[Xperia Z Original Android Development] DevShaft:
Both wont boot with locked bootloader as DooMLoRD states here:
[Xperia Z Original Android Development] lilstevie:
It is simply not possible to have any form of custom boot image with a locked bootloader. First: Fastboot will not flash an elf image which is required to boot locked, Second: all parts of the elf are subjected to the signing policy, even repacking a stock kernel with a modified ramdisk will invalidate the signature
[Xperia Z Original Android Development] fareeed:
[MENTION=5261329]DevShaft[/MENTION] Hi, I backed up my TA a few weeks ago before unlocking. I used the latest version of Flashtool, what would be the safest way of restoring my TA image backup? :)
[Xperia Z Original Android Development] Osyx:
It would be Flashtool, since it was the one you used from the start.
[Xperia Z Original Android Development] DevShaft:
Either Backup-TA v8.0 and Flashtool are pretty safe to use. Currently Backup-TA v8.0 has a rollback functionality which takes place when the TA is being corrupted in the process of restoring. This prevents the phone from a hard-brick when it reboots or does shutdown while the TA is corrupt. With Flashtool you only get the message "Partition and file differ. Restore is not OK" and leaves your phone open for a hard-brick when it reboots or does shutdown. The chance of such a situation to occur is very slim. However I will propose the same rollback functionality for Flashtool later this week, so both tool will be equally safe to use.

So it comes down to your choice. I'd say you still have a safe bet when using Flashtool. However if you want to use Backup-TA follow these steps:

1. Make a copy of the Flashtool backup.

2. Rename 'ta.dd' from the Flashtool backup to 'ta.img'.

3. Edit 'ta.md5' from the Flashtool backup and remove everything except the last MD5 hash (i.e. 74e9f922859bd7932bd448e1f5d9816c) and leave no trailing or leading spaces.

4. Put these changed 'ta.img' and 'ta.md5' in a ZIP and name it 'TA-backup.zip'

5. Put 'TA-backup.zip' in the 'backup' folder of Backup-TA (same level as 'tools'). Create it when needed.

6. Restore with Backup-TA.

Good luck! :)
[Xperia Z Original Android Development] G0belet:
I am happy to report that flashing to the latest Sony firmware (10.1.1.A.1.253) and relocking works!

I had the UK unbranded firmware, 10.1.A.1.434 version. I did a TA backup, extracted it, unlocked my phone, flashed the newest FR unbranded version through Flashtool (I am from France, it made more sense, plus it arrived earlier than the UK version).

I booted to make sure everything was alright. It updated the NFC firmware. I then flashed a recovery, went through the motions to install SuperSU to get root (I put the SuperSU update.zip file on my internal storage, rebooted on TWRP, and flashed it). I checked I had root. I then decided, risking my phone, that I wanted to relock.

I reflashed the original kernel that came with the French FTF, booted, verified I still had root (I did). I then restored my TA partition, rebooted, my heart stopped for a good 3 seconds before the Sony logo came up, and it booted! It reflashed the NFC update (my guess is that the NFC firmware version is stored on the TA partition), I checked if it still worked (it does), and I went into the service menu to verify all my DRM keys are working. They're all "OK" and "Active".

So reflashing the TA partition after a big update like this works! I am not sure if I messed anything up, but everything seems ok. Now I have the newest version, rooted, and locked!
[Xperia Z Original Android Development] fareeed:
[MENTION=5261329]DevShaft[/MENTION], Hi when I try to restore with flashtool I get this message "Partition and file differ, be sure your backup if from the connected device. Restore anyway" This seems awfully similar to what you said before. Does this mean that my TA backup is corrupt? :crying: I even took 3 just to be sure. Thanks :)
[Xperia Z Original Android Development] Osyx:
You could backup your current TA so in case it doesn't work I think Flashtool tells you a message and then you can restore the working TA, but it's better if [MENTION=5261329]DevShaft[/MENTION] answer on this one or [MENTION=4570682]lilsteve[/MENTION] ;)

Just to be sure you have tried the other backups?

Edit: Listen to [MENTION=5261329]DevShaft[/MENTION] ;P
[Xperia Z Original Android Development] DevShaft:
Thats the message Flashtool gives when it sees your current TA is different from your backup, which of course is the case when you restore. So this is a bug in Flashtool which will be fixed soon. You can ignore it for now by saying 'yes' :).
[Xperia Z Original Android Development] fareeed:
Can't thank you enough, worked perfectly. Running .253, rooted, with DRM keys intact :)

---------- Post added at 08:26 PM ---------- Previous post was at 08:24 PM ----------

Yep should have added that, all backups seemed to give me this message. Read DevShaft's post and it went perfectly. Thank you :)!
[Xperia Z Original Android Development] Jamal_RS:
I have a backup from TA on GB rom,

Can I restore that on ICS or JB?
[Xperia Z Original Android Development] DevShaft:
TA is unrelated to the ROM you run.
[Xperia Z Original Android Development] lilstevie:
Your mileage may vary, devices of that age allegedly do not support this method as trustzone prevents you from taking a full backup of your TA
[Xperia Z Original Android Development] race4life:
Great. I already have a TA image backup using v4. Do i have to convert this to a v8.0 before I can restore it. I am thinking about unlocking the boot loader today and just need to make sure that I have a known backup. Also how do I backup the TA file using flashtool?.

I am running 10.1.1.A.253 at the moment but its not rooted. I am still waiting for a proper root procedure to come up. I really cant be bothered to go back to .434 and flash through cwm.
[Xperia Z Original Android Development] -Zork-:
How much space is the TA.IMG with firmware .434, i have done the backup and it´s 2.1mb aprox + Ta.md5 around 80 bytes . Is it correct?
[Xperia Z Original Android Development] DevShaft:
Yes, you have to convert from v4 to v8. You can find instructions when you run v8 and choose menu option 3.

Switch to PRO mode (File >> Switch Pro) and then it is Advanced >> Trim Area >> Raw devices >> backup

---------- Post added at 08:55 AM ---------- Previous post was at 08:51 AM ----------

The TA.img should be 2 megabytes round, thus 2048 kilobytes. Is it?
[Xperia Z Original Android Development] silencer51:
I have two TA backups (for good measure!), one from .434 and one from .235 (I know they 're supposed to be the same, but... what the hell!)

I'm trying to restore a TA backup after flashing .235 and rooting via DoomLord's method, however when I select option 2 I see an error message:

/system/bin/sh: data/local/tmp/busybox: not found

obviously the tool doesn't push busybox properly... should I abort?
[Xperia Z Original Android Development] that-fat-old-man:
I used Backup TA v4 to save my trim area. After several attempts to restore the trim area failed I used the instructions above and it finally worked. DRM and BE2 are working again. Thanks a lot.

Before using the instructions above I tried to root via Goroh_kun's root method. I was able to get a valid backup of the TA but restoring it failed giving me the following error message:

/system/bin/sh: data/local/tmp/busybox: not found

So the TA was definitly not restored. I checked that. ;)

Now that I used schaggos instructions it worked and everything is back to normal, but I still got the same error message during the restore procedure:

/system/bin/sh: data/local/tmp/busybox: not found

I will make a new backup using Flashtool and hopefully this will work a little smoother. Anyway, everything worked as promised so thank you very much for this great tool.
[Xperia Z Original Android Development] mirhl:
I think that if you receive busybox errors you should try adbd insecure
[Xperia Z Original Android Development] that-fat-old-man:
If you get this error message, then I assume that Backup TA already tried to restore your trim area. Try to reboot your device. If it reboots then it failed, but if it doesn't than you should have a soft bricked XZ which means restoring the TA worked.

Just flash the stock kernel and see if it reboots. If it does than DRM and BE2 should be working again. I had the same problems, but now everything is working again.
[Xperia Z Original Android Development] silencer51:
For some reason, I reran the tool and received no busybox error. Weird. md5's matched, so I proceeded to restore TA, it worked fine. Bootloader unlock status is back to yes, certificates are there, also on first boot as others have said the NFC firmware update ran again for some reason.
[Xperia Z Original Android Development] DevShaft:
People, please post which version of Backup-TA you are using when giving feedback. For example v8.0 does not use '/data/local/tmp/busybox', instead it uses '/data/local/tmp/busybox-backup-ta'. So this latest feedback wasnt coming from v8.0 :).
[Xperia Z Original Android Development] Osyx:
Isn't it possible for a mod to edit the OP so your tool stands their and hide rickwyatt’s because I've seen quite a lot people who just use the one in the OP and doesn't read the rest of the thread until it's too late :rolleyes:
[Xperia Z Original Android Development] DevShaft:
It would indeed be great when I can take over this thread to maintain it. Have been thinking about creating a new thread, but I believe people will still find the older thread first because of the amount of content already index by Google and XDA-Forums. Hopefully a mod can reach a helping hand here :).
[Xperia Z Original Android Development] silencer51:
This is exactly what happened in my case, thankfully rickwyatt's tool worked fine.
[Xperia Z Original Android Development] shoey63:
Yes, Rickywatt's tool works fine, but it uses abdb insecure, which is a paid for app by Chainfire. (He may not be impressed)
[Xperia Z Original Android Development] DevShaft:
His tool indeed works fine when everything goes as planned and needs adbd-insecure to do it. What the users do not see is the lack of safeguards which could potentially (not to underestimate) hard-brick your device. On top of that it doesnt clean up after the job which leaves temporary files on your device which you do not want. The difference between v4 and v8.0 is huge and its a shame to sometimes see people use v4 and to be aware of the risk they're unknowingly take.
[Xperia Z Original Android Development] shoey63:
Yes, v8 has much better safeguards. One question though - shouldn't the MD5 of the TA image in both the generated zip and the one sent to SDCard be the same? Mine differ :confused:
[Xperia Z Original Android Development] DevShaft:
They should indeed be the same. When they differ one has corrupted along the way. Does the TA image in the ZIP has the same MD5 as in the MD5 file? If so, its the one on the SDCard that is incorrect. Does the tool also give a warning or error?

ps. I'm working on a feature which gives you the ability to dry-run (test run) a restore without actually restoring it or writing anything to the TA partition.
[Xperia Z Original Android Development] silencer51:
Could you please elaborate on the temp files left on the device? Where can they be found?

EDIT: Are you referring to the busybox pushed to /data/local/tmp?

I can't think of anything else leftover from rickwyatt's tool...
[Xperia Z Original Android Development] shoey63:
Not @ Pc right now , but will get back to you later with more feedback:thumbup:
[Xperia Z Original Android Development] DevShaft:
The temp files left with v4 are:

- /data/app/adbd-Insecure-v1.1.apk

- /data/local/tmp/busybox (may overwrite another one which can be unwanted)

- /sdcard/TA.img
[Xperia Z Original Android Development] silencer51:
Thanks, hadn't seen the TA.img on /sdcard.:good:
[Xperia Z Original Android Development] DevShaft:
Just uploaded Backup-TA v8.1 with the following changes:

Backup-TA v8.1 (2013-05-20)

==============================

New Features, Improvements

--------------------------

- Added menu option to 'dry run' the restore, so a restore can be tested without writing.

- Added IMEI length check when restoring.

- Added extra safeguard to make sure a restore is fully written from memory to disk when restore ends.

Fixed Bugs

----------

- Fixed bug which caused the tool to think a restore was unsuccesful while it was not.
[Xperia Z Original Android Development] brockyneo:
hi guys am i right in saying that after backing up i can unlock the bootloader flash rom,kernel ect the flash backup and the bootloader will remain unlocked and ill have drm keys and bravia back :confused:

thanks
[Xperia Z Original Android Development] Osyx:
No the bootloader will be locked again after restoring TA backup. ;) You'll get them back but only to use on locked bootloader.
[Xperia Z Original Android Development] CrackaBoi:
When attempting a restore I'm getting the "Integrity Check" error. Im using v8.1. I successfully backed up the TA partition using v7. Then I unlocked bootloader and installed KA-ROM. Now I want to restore TA but unfortunately I am unable..

Output:

=======================================
EXTRACT BACKUP
=======================================

7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18

Processing archive: backup\TA-backup.zip

Extracting TA.img
Extracting TA.md5

Everything is Ok

Files: 2
Size: 2097187
Compressed: 189472

=======================================
INTEGRITY CHECK
=======================================
FAILED

*** Restore unsuccesful. ***
Press any key to continue . . .