yashsingh1/xdaforums huggingface dataset:
[Xperia Z Original Android Development] DevShaft:
My backup ZIPs are between 196 KB and 122 KB, not anything near 94 KB. Still this may be ok for your device. Do the following to check:

1. Extract your backup and open TA.md5. Compare this string with the MD5 of TA.img (tools\md5.exe TA.img). They should match.

2. Make a new backup and see what the size is this time.

The reason the ZIP files are smaller than the actual backup image is because the TA partition can have lots of empty space of the total 2048 KB available. When we ZIP the backup image it can highly compress that empty space which results in such a difference in file size.

---------- Post added at 05:37 AM ---------- Previous post was at 05:32 AM ----------

Ps. Thanks a lot guys for all the thanks. You are great! :highfive:
[Xperia Z Original Android Development] Droidphilev:
Hi,

[MENTION=5261329]DevShaft[/MENTION]: a while ago i made a couple of backups using your tool. That time i used v6.

-is that version good enough and can i leave it this way (and use v6 if i ever need to restore) or is it better to go back to stock and start all over using v7?

-i see that v7 can convert v4 versions of a backup. is v6 thesame kind of back as v4?

thank!
[Xperia Z Original Android Development] DevShaft:
When you have a backup from v6 you can use it with v7+ as well, nothing changed there. Its better to use v7+, since it has some bugs fixed and better safeguards. You can always download the latest version here. I'm thinking about adding a feature / instructions to convert v6+ backups to Flashtool, so in the future you can also restore with Flashtool.
[Xperia Z Original Android Development] Droidphilev:
Thanks!
[Xperia Z Original Android Development] caer_ayu:
wow ..just discovered this method ..don't know is this question is already ask but, can it work with other xperia on stock jb ?
[Xperia Z Original Android Development] DevShaft:
Currently we only know it works on Xperia Z and ZL. Other Xperia devices are not confirmed yet, its a matter of a dare devil to try it. Know that when the device is not compatible it can get hard-bricked.
[Xperia Z Original Android Development] Osyx:
OP might just want to add that to the op so people don't need to ask :rolleyes:
[Xperia Z Original Android Development] caer_ayu:
true ..op need to tell others so that they don't always ask the same question

anyway ..i tried to see if the path are available as the op mentioned, /dev/block/mmcblk0p1 was there and the size was 2mb

after i tried to backup, it went flawlessly ..backup was successful and the md5 was the same

what bothers me is when i try to copy mmcblk0p1 to sdcard *cause i can't check when its in the folder* to check md5, it was not the same with the backup i've made

and don't know if it would work if i restore it cause i still not yet feel that mmcblk0p1 is the right TA file for my phone
[Xperia Z Original Android Development] wawyed:
Lose*,

Zip is a lossless compression method.
[Xperia Z Original Android Development] Osyx:
If the md5 sum were the same while making a backup with Egan/DevShaft tool there shouldn't be any problems.
[Xperia Z Original Android Development] caer_ayu:
then is should work ..hopefully

i open mmcblk0p1 in txt editor ..i did found my imei,serial, firmware etc. in there ..so this is the right file

if only i was brave enough to unlock bootloader then relock, restore my TA and see if it working or not,

unfortunately, i don't. i've already brick 2 of my past phones before. :(
[Xperia Z Original Android Development] RHBH:
Just one note restoring TA does relock your bootloader, so there is no need to relock it before restore.
[Xperia Z Original Android Development] Tungstwenty:
Could someone with carrier-subsidized devices let me know if their devices allow an official unlock?

"Bootloader unlock allowed: YES" on the service menu

I'm planning on getting my Xperia Z in few weeks but from what I've read in PT forums it appears that only devices which are not carrier locked allow officially unlocking the bootloader.

It seems like the operators went the lazy route in preventing network lock to be changed, altough AFAIK the ARM TrustZone facilities would be sufficient to keep that under control even if a custom kernel is allowed (much like the TA contents that have been discussed on this thread).

I'd just like to have an idea if this is generalized behavior from the carriers or not.
[Xperia Z Original Android Development] mirhl:
a guy perfectly restored his TA on a xperia ion

so we can be quite certain this trick works on all MSM8660 devices
[Xperia Z Original Android Development] schaggo:
Bad idea asking for this information this way. Two reasons: a) rooting the device changes the string to "No" regardless of the actual state b) there's PLENTY of noobs around with little to no clue.

Now count a) and b) together and well... you've most likely already figured it out, what I'm on about... :rolleyes:

From what I gathered this far, is that branded devices are very likely permanently locked where unbranded/generic but carrier-sold or carrier-subsidized devices are usually unlockable.
[Xperia Z Original Android Development] CrackaBoi:
I just bought a new Xperia Z and I just want to install some custom ROMs for a better experience. Do I really need to do this??

Also, I am on a Mac, has anyone got any tips on how to do this on a Mac/Unix machine?

Thanks!
[Xperia Z Original Android Development] RHBH:
If you want backup your drm keys. Yes you do need it.

I don't know anything about running this tool on Mac or Linux it have some windows commands so you're just increasing the chance of a hard brick when you restore.
[Xperia Z Original Android Development] eryen:
Is there any body tested to.

BackUp 1.DRM TA and 2.unlocked TA.

So whenever we need to root new firmwares "that still can not be rooted fw:10.1.1.A.1.253"

So after update to newer firmwares, with restoring "unlocked TA"

1. Boot to DoomLords recovery kernel.

2. Rooting with recovery menu.

After all rooting squence, flash stok kernel and restore Stock TA again.
[Xperia Z Original Android Development] alfiabraham:
You mean to say that the latest firmware 10.1.1.A.1.253 can be rooted by using this method?
[Xperia Z Original Android Development] DevShaft:
That should work. With an unlocked bootloader, rooting is easy :).
[Xperia Z Original Android Development] shoey63:
It would be a wild ride though;)
[Xperia Z Original Android Development] colacin:
I'd volunteer to be a guinea pig for this - but I'd need a more concise guide to doing this since I'm new to android.

My phone is:

1. Unlockable (have the unlock code from Sony)

2. Rooted via Bin4ry's method

3. TA backed up via v7 of DevShaft's script

4. Have the update available via PC companion but not OTA.

5. On what seems to be an unbranded Singapore ROM. The carrier had a few items on the phone, but no branding. When I updated to .434 all traces of the carrier apps were gone.
[Xperia Z Original Android Development] schaggo:
Given that .434 kernels don't work with the new ROM. IF they work and IF you already have the backup, why not leave it unlocked and permanently (until you return/sell the device) run a kernel with included recovery? It's not like the device is slowly decaying when running unlocked. New kernels with added recovery will show up soon, matter of days.

Breaks down like this: If you have proper recovery access, you have root. Any device.

There is no "guinea pig" in this, sorry. And no hardbrick risk or anything else. It's dead simple:

after unlock and DRM backup simply fastboot flash a kernel with included recovery, there's 3 of those to choose from

use recovery to flash a su-binary zip package of your choice, again there's 3 of those to choose from.

Profit!!

In case the device doesn't boot at step 3 in a .253/.434 cross-version setup, fastboot flash or flashtool flash stock kernel. Now, definitely profit :cool:
[Xperia Z Original Android Development] shoey63:
Some speculation - what if someone on a carrier bootloader locked phone were to flash a stock, unlockable bootloader? Instant hardbrick?
[Xperia Z Original Android Development] harfot:
Yes
[Xperia Z Original Android Development] schaggo:
Are you sure? AFAIK the bootloader is the same across all devices, not so much the TA contents though.

As unlocking status does not depend on the bootloader but on the TA, and - as per the statement a line above - the bootloader is exactly the same on all devices, this would be incorrect and/or irrelevant. No?

Edit: Reading it again, I believe though shoey63 meant to flash an "unlockable" TA onto a blocked device. Yes, that would be hardbrick.
[Xperia Z Original Android Development] shoey63:
What about if flashed in conjunction with appropriate bootloader?

Edit: Nevermind, that would involve flashing someone else's TA and bootloader:o
[Xperia Z Original Android Development] harfot:
Exactly, and it was that scenario I answered :)
[Xperia Z Original Android Development] lilstevie:
flashing TA and bootloader wouldn't help, there will be 0 difference between the bootloader on your device, and their device.

There are a bunch of hardware based ID's that are unique to your specific device, at this time there is no way to change these, and flashing TA that references ID's that do not belong to your device will lead to hard brick
[Xperia Z Original Android Development] shoey63:
Thanks for clarifying Lilstevie. I understood TA partition rereferenced bootloader, but I didn't know it also was tied to hardware ID's,

Cheers :thumbup:
[Xperia Z Original Android Development] caer_ayu:
so after restoring ta will relock the bootloader ..can i unlock again? since after restoring, the phone will back to it's original state
[Xperia Z Original Android Development] tomanlam:
just wondering, is the risk of restoring TA the same as unlocking the bootloader using the sony method? (becoz both involve tampering of TA partition):confused:

will a failure in unlocking the bootloader result in the same hardbrick as a failure in restoring TA?:silly:

wanted to restore to stock now that we have official support for white balance for xperia z:p
[Xperia Z Original Android Development] Tungstwenty:
[MENTION=5261329]DevShaft[/MENTION],

To further reduce the possibility of hard-bricking when writing the TA, do you think it might be useful to do an md5 of the partition after a restore, and check if the contents after a write (possibly after a sync ???) end up being the expected ones?

I can't see the dd command partially failing, but an extra check wouldn't hurt :)

When restoring the script could get the md5 of the current contents of the TA, the one from the file being written, and in the end check if the new contents are there (expected situation), if the OLD contents are there (somehow, dd failed but the TA is valid, as it was before), or for some reason it's different. In this last, unlikely situation, the user would be advised to NOT reboot the device before restoring again or doing SOMETHING to end up with a valid TA.
[Xperia Z Original Android Development] Bioschnitzel:
Today i restored my TA-Partition successfully with V6 Tool.

Now i have the new 253 Firmware with root and Bravia Engine/DRM keys :victory:
[Xperia Z Original Android Development] DevShaft:
Have been thinking about this scenario a few days ago and I think it's a valid one.

We have 3 possible outcomes when restoring a valid backup image:

1. Restore is truly successful.

2. Restore thinks it succeeded but actually wrote nothing to the TA.

3. Restore thinks it succeeded but actually corrupted the TA.

I even want to take it further than your proposal. Before restoring I want it to first compare the then current TA against the to be restored TA, so it doesn't unnecessarily take the risk of writing the TA. When they differ take a backup of the then current TA. When that was successful the restore continues as usual. When the restore appears successful I want it to check the MD5s as you described. When the then current TA does not match either the previous TA or the TA chosen for restore it will restore the TA it did backup just before the actual restore (scenario 3). In the other two scenarios it either shows the message the restore has succeeded (scenario 1) or that the restore failed because of none was written and it should be tried again (scenario 2).

I believe we cover it very well then :).
[Xperia Z Original Android Development] shoey63:
Won't the Md5 of the TA partition AFTER unlocking bootloader always be different to the original? After all - DRM keys are no longer there! So message about differing MD5s will always occur when trying to flash back original TA:confused:
[Xperia Z Original Android Development] RHBH:
You're RIGHT and WRONG.

Right. TA partition MD5 always change when you unlock your bootloader.

Wrong. The script doesn't compare the MD5 of your TA.img and your current TA partition.

Also TA partition MD5 changes time from time without even unlocking or relocking your bootloader but this WON'T result in a failure restore.

[MM-DD-YYYY]

As you can check, TA.img I made 05/08/2013, TA2.img I made 05/13/2013, TA3.img and TA4.img I made 05/15/2013 (some minutes ago), I didn't even changed my ROM, just normal use and my TA partition had some changes (the MD5 changed). But if I unlock my bootloader now and restore immediately after I can use ANY image (the one I made day 08 or day 13 or today), since it's my device TA (IMEI, Serial Number, Internal hardware serial...) any of them will relock my bootloader and restore DRM.

Now I'm explaining how the script works with MD5 check:

1- Backup

When You backup TA using Evan's v7.7 the script will compare the MD5 of your current TA partition and the MD5 of the backup pulled to SD card and the MD5 of the backup pulled to SD card to you PC. If everything is equal then proceed and create a file named TA.md5 which contains the MD5 of the backup and the TA.img, if not then backup failed.

2- Restore

When You use restore command using Evan's v7.7, first it'll check the MD5 stored in the TA.md5 file and MD5 of the TA.img, then it'll pull the TA.img from your zip to your SD card, then check the MD5 of the image pulled to the SD card, If everything is Ok the script will compare the IMEI from your current TA partition and IMEI from the TA.img on the SD card (this avoid that You flash a TA.img from another device), if it's ok the script will replace your TA partition with the image on the SD card.

Anyway, my recommendation is, do a backup and protect the file with your life, if you loose or the file gets corrupted and you already unlocked your device, you lost your DRM keys forever.
[Xperia Z Original Android Development] shoey63:
Thanks for the explanation. I will be making multiple backups and saving them on various media before I even THINK about unlocking bootloader!
[Xperia Z Original Android Development] RHBH:
No need to backup it more than once, unless if you lost or corrupted your image or if you're like me and study the changes on TA and how they work.
[Xperia Z Original Android Development] Andrewtst:
Anyway with full root success? Mine not fully working.

I install CWM for unlocked boot loader, install Super SU, re-install stock kernel, restore TA.

Before restore TA, root is 100% working.

But after restore TA, root only work for certain, I can using titanium backup, AdAway, this and that apps required root, but the phone will auto restart once I touch the R/W at system/apps.

Appreciate anyone with success no auto restart when touch the R/W at system/apps after restore TA can share the step. :)
[Xperia Z Original Android Development] Bioschnitzel:
Hahaha same problems here ^^
[Xperia Z Original Android Development] Andrewtst:
Hmmm, ya when I unlocked back the bootloader, the root is working back 100%, whenever restore back TA which locked back the bootloader, the phone will restart once touch the R/W.

---------- Post added at 05:25 PM ---------- Previous post was at 05:24 PM ----------

Can, I do plenty time today, just unlocked again using Flash Tools.
[Xperia Z Original Android Development] Bioschnitzel:
How do you root?

Do you use this:

http://xdaforums.com/showthread.php?t=2167381

and flash supersu.zip?
[Xperia Z Original Android Development] Andrewtst:
Ya, same method.
[Xperia Z Original Android Development] CrackaBoi:
The "adb Insecure (v1.2) app just jumps back to home screen after I grant it superuser permission (which I have to do twice). Anybody else experience this? Im on stock firmware, newly rooted.

Frustrating, because it is preventing me from backing up my TA partition which means it also prevents me from installing a custom ROM.

Thanks
[Xperia Z Original Android Development] DevShaft:
Use v7.7 here :).
[Xperia Z Original Android Development] CrackaBoi:
Awesome, thanks! I'll try it.

Weird that this v7 version isn't mentioned in the original thread for adbd Insecure.
[Xperia Z Original Android Development] DevShaft:
Its v7.7 of Backup-TA not adbd-insecure ;).
[Xperia Z Original Android Development] CrackaBoi:
Doh! Nvm then.

Thanks again
[Xperia Z Original Android Development] *boy*racer*:
Worked like a charm. Thanks mate. :thumbup:
[Xperia Z Original Android Development] -Zork-:
which version shoud i need? i´m rooted with Romaur 2.7 LB -

In OP, show v.4 and after read almost last 15 pages, it´s showign link for TA. V7.7.-

Any tips to help to decided and what´s is the difference, there isn´t changelog for laste version :)
[Xperia Z Original Android Development] lilstevie:
use the latest version, so 7.7
[Xperia Z Original Android Development] Hamidreza2010:
connect phone

hi

thanks for this instruction

but i have one question;

how to connect the phone to use your tools?

i mean i turn of the phone and connect it or turn on the phone? how do it?

my phone is xperia XU

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

i cant download the tools v7.7

please upload in another link like media fire

tnx alot
[Xperia Z Original Android Development] mirhl:
You need adb to use this tool

So you need at least a workibg recovery, or to normally boot up phone
[Xperia Z Original Android Development] tjackbjorn:
I'm sorry if this has been asked before, but if I restore this after unlocking the bootloader, it will always be there even if I flash a rom or something? And when I relock the bootloader, if it would be necessary, the drm keys will still be there? I don't need to restore them again? :)

I hope you understands what I mean. Thanks.

Sent from my starship.
[Xperia Z Original Android Development] wawyed:
if you restore this when your bootloader is unlocked I think it will be relocked and you will softbrick it. Unless you are running everything stock.

If you relock the bootloader the drm keys won't return unless you restore them with this tool. Supposing you made a backup with this tool before unlocking the bootloader.
[Xperia Z Original Android Development] *boy*racer*:
Is it a good idea to do another backup if I want to unlock the bootloader again? Or can I still use my 1st backup? :-S
[Xperia Z Original Android Development] Osyx:
The first one is enough, and if it worked you should definitely use it since you know it worked.
[Xperia Z Original Android Development] *boy*racer*:
Yeah it worked great the 1st time. Thanks mate.
[Xperia Z Original Android Development] Hamidreza2010:
dll

you mean

i turn off the phone and turn on and press +volume kay?

i cant dl your tools v7.7

please upload anolther host like media fire.

tnx
[Xperia Z Original Android Development] Osyx:
It isn't his tool it's [MENTION=5261329]DevShaft[/MENTION] and you download the tool by right clicking and save link.

Or by clicking on the link and then save as zip.

Or pressing back, located leftmost next to the name, and then save as zip.
[Xperia Z Original Android Development] tjackbjorn:
So if I restore the drm keys right after I've unlocked the bootloader, running stock rom and kernel, I'll just get them back? Not softbrick or something? And if I flash a new rom after the drm restore, the drm keys will still be there right?

I'm sorry for all these questions, but I just want to be 100% sure! Hehe :)

Xperia Z.
[Xperia Z Original Android Development] wawyed:
I'm not 100% sure but I think if you are running stock kernel it won't softbrick

If you restore ta backup the bootloader will be locked so you will only be able to flash stock roms.
[Xperia Z Original Android Development] schaggo:
Inform yourself. It all can be found by reading and searching. Locked bootloader only runs stock software. If you try to run custom software on a locked device, the device will softbrick. Now count 1 and 1 together and answer your question to yourself.

Flashing a ROM does not interfere with the TA partition. Again, try to extract the crucial bits for you from this information I just gave you.

No. Run, not flash.
[Xperia Z Original Android Development] wawyed:
? You can flash stock roms with a locked bootloader.
[Xperia Z Original Android Development] DevShaft:
Yes, but only stock roms with stock kernel.
[Xperia Z Original Android Development] schaggo:
Technically, you can flash ANYTHING, even a Samsung ROM if you wish. A "flash" is a simple digital transfer of information onto the memory chip of the device. Litterally you could even "flash" a JPEG file onto /system. And I don't mean put a JPEG file in a directory on system, I mean replace the whole contents of the system partition with the digital, binary content of 1s and 0s of the JPEG file. But it's no use, as you can't boot an image file. So logically nobody will ever do it.

The question must be: can I run/boot something given this or that situation, not can I flash something. As the latter always get the answer: Yes, you can. But you may or may not run/boot it.

So I'll answer again, as I already did with the post further up, reciting information which is freely available all over the place if one would only search and read: a locked bootloader can only boot an original, untampered sony stock kernel. An unlocked bootloader can boot any device compatible kernel, irrespective or origin. The ROM doesnt matter, the mods don't matter, its solely and only about the kernel.
[Xperia Z Original Android Development] shoey63:
Good info - thanks :cool:
[Xperia Z Original Android Development] DevShaft:
I will have v8.0 done for release tonight :).

From that version on it will contain a changelog as well.

Here is what is going to change for this version.

- No need for pre-installed busybox. The tool will temporarily add and remove it without the need of adbd-insecure app. No trash left behind.

- Much better safeguards including rollback in case of a corruption to lower the chance of a hard-brick to a minimum.

- Code rewrite to make maintenance and enhancing later on a lot easier.

- Release the code under MIT license at GitHub.

In a release later I will add the possibility to convert backups with this tool to Flashtool, cause I believe Flashtool is the better tool to use on the long run at least. However with this release restoring with Backup-TA might be a bit safer, but I will propose the same safeguards for Flashtool next week.
[Xperia Z Original Android Development] RohanAJoshi:
will this work on xperia xperia ZL also ?
[Xperia Z Original Android Development] californicated:
Is it right to say there is no chance to backup the TA partition without root?
[Xperia Z Original Android Development] DevShaft:
Yes

---------- Post added at 08:55 PM ---------- Previous post was at 08:55 PM ----------

Correct, you need root to read out the TA partition.
[Xperia Z Original Android Development] DevShaft:
Backup-TA v8.0 (2013-05-18)

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

New Features, Improvements

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

- Complete rewrite of the code to make it easier to maintain.

- Added extra safeguards to decrease the risk of a hard-brick (including rollback in case of a corruption).

- Added backup confirmation when backup package already present, to prevent an accidental backup overwrite.

- No need for pre-installed busybox. The tool will temporarily add and remove it without the need of adbd-insecure app.

- Released the code under MIT license at GitHub: https://github.com/DevShaft/Backup-TA.

- Better output to console.

- Better disposal of used data.

Download Backup-TA v8.0 here.