Remove All Ads from XDA
Honor 9 Lite

[Tutorial] Manual TA partition management (Win/OS X/*nix)

1,145 posts
Thanks Meter: 499
Post Reply Email Thread
There are tools that do this automatically for you, but to date they only work on Windows and as a general rule of thumb it is a bad idea to blindly run scripts found on the internet on your computer, even if the author doesn't mean any harm, things can go wrong. Furthermore it is generally a good idea to actually learn how your device works rather than just using tools that do everything for you.

However if you do not feel up to the task, and you are running Windows, you can use this automated tool instead if you want.

Fair warning: Flashing your TA partition is dangerous stuff, do this wrong and you can most certainly hard-brick your device. I will not take any responsibility at all for anything you deem might have (or might not have) been a result of these procedures, be it bricked devices, lost DRM-keys, your milk going sour, your computer exploding, your friends computer exploding, repetitive stress injury, the loss of any limbs and/or digits or literally anything else.

General requirements before getting started:
  • Android SDK platform-tools (namely ADB)
  • Rooted Sony Xperia Z1 Compact
For this guide I am going to assume you know how ADB works and that you know how to get access to ADB in your preferred operating system.

Backing up your TA partition

For this part you will need both a locked and rooted Xperia Z1 Compact (this method works, follow the rooting part only). Ok, you don't actually need a locked device, but the most common reason for backing up this partition is to keep your DRM-keys intact, and this means your device needs to be locked.

  1. Open your favourite terminal emulator
  2. Acquire a shell with your device (adb shell)
  3. Acquire a root shell with your device (su)
  4. dd if=/dev/block/platform/msm_sdcc.1/by-name/TA of=/sdcard/TA.img
  5. md5 /dev/block/platform/msm_sdcc.1/by-name/TA /sdcard/TA.img
    Verify that the hashes match!
  6. Leave root shell (exit)
  7. Leave device shell (exit)
  8. adb pull /sdcard/TA.img TA.img
  9. Use your favourite tool to verify the hash hasn't changed after copying to your computer (openssl md5 TA.img)
    Put this file (and the hash) in a safe place, this is your TA backup.

Restoring your TA partition

For this part you will need your TA partition backup and the matching rooted Xperia Z1 Compact (literally the exact same device you got the backup from). You will also need to restore an unmodified stock boot partition (a boot partition from any ROM claiming to work on locked bootloaders will do fine) prior to restoring the TA partition backup, otherwise you will not be able to boot after restoring the TA partition. Also, do not attempt this with someone elses TA partition, I haven't personally tried it but I am told you will hard-brick your device! It sucks but if you've lost your DRM keys then you will not be able to recover them.

  1. Open your favourite terminal emulator
  2. adb push TA.img /sdcard/TA.img
  3. Acquire a shell with your device (adb shell)
  4. Acquire a root shell with your device (su)
    If you have the hash you read during the backup procedure stored, now is a good time to verify that it still matches the backup
  5. dd if=/sdcard/TA.img of=/dev/block/platform/msm_sdcc.1/by-name/TA
  6. md5 /dev/block/platform/msm_sdcc.1/by-name/TA /sdcard/TA.img
    Make absolutely certain that the hashes match!
    If they don't, DO NOT REBOOT YOUR DEVICE!
  7. Leave root shell (exit)
  8. Leave device shell (exit)
Good luck! If I have helped you, please click the thanks button!
The Following 7 Users Say Thank You to Rekoil For This Useful Post: [ View ] Gift Rekoil Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes