Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Backup TA tool for Linux

OP Salamandar3500

22nd August 2014, 12:02 AM   |  #1  
OP Junior Member
Flag Paris
Thanks Meter: 2
 
5 posts
Join Date:Joined: May 2013
More
Hi !
I'm porting the TA Backup script to Linux. It advanced pretty well so backup works, but not restore for today.

I wanted to write this post on the developpement forum, but it seems I can't with less than 10 posts…

You can get my work on Github : github.com/Salamandar/Backup-TA-Linux.

Salamandar aka Félix
The Following 2 Users Say Thank You to Salamandar3500 For This Useful Post: [ View ]
8th September 2014, 05:07 PM   |  #2  
Junior Member
Thanks Meter: 1
 
15 posts
Join Date:Joined: Apr 2007
More
Top stuff! I had a look through you scripts and they're looking pretty good! A lot easier to read through than the Windows BAT files.
9th September 2014, 12:14 AM   |  #3  
OP Junior Member
Flag Paris
Thanks Meter: 2
 
5 posts
Join Date:Joined: May 2013
More
Wink
Thanks

I'd like to say that it'd work for OSX too, but i'm not exactly sure. I'll test it when i can.

I just updated the script, it now checks for script files. (all but busybox)

I'll add some options as help.

If you mant some other features, don't hesitate to ask. If you want some other scripts (bash for android), just ask, I'll do it if i can.
11th September 2014, 05:51 AM   |  #4  
Junior Member
Thanks Meter: 1
 
15 posts
Join Date:Joined: Apr 2007
More
I run OSX. I'm happy to look over your scripts and test them out as best I can.
26th September 2014, 01:35 PM   |  #5  
Junior Member
Thanks Meter: 1
 
15 posts
Join Date:Joined: Apr 2007
More
I think that expecting 'adb' to be in a particular place is not the best idea.

I have 'adb' installed, but not in "/opt/android-sdk/platform-tools/". So I modified the ADB="..." line in the script to be

Code:
ADB=`which adb`
Although this requires adb to be installed somewhere in your $PATH. A possible enhancement might be to use `which adb` with a fall-back to asking the user where adb is installed.

---------- Post added at 09:35 PM ---------- Previous post was at 09:27 PM ----------

Hmmm....

I ran the script and got the following output:

Code:
viking$ ../Backup-TA.sh 

[ ------------------------------------------------------------ ]
[  Backup TA vL1.0 for Sony Xperia                MIT License  ]
[ ------------------------------------------------------------ ]
[  Copyright (C) 2013 DevShaft                                 ]
[                                                              ]
[  Permission is hereby granted, free of charge,               ]
[  to any person obtaining a copy of this software             ]
[  and associated documentation files (the "Software"),        ]
[  to deal in the Software without restriction,                ]
[  including without limitation the rights to use,             ]
[  copy, modify, merge, publish, distribute, sublicense,       ]
[  and/or sell copies of the Software, and to permit           ]
[  persons to whom the Software is furnished to do so,         ]
[  subject to the following conditions:                        ]
[                                                              ]
[  The above copyright notice and this permission notice       ]
[  shall be included in all copies or substantial portions     ]
[  of the Software.                                            ]
[                                                              ]
[  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY   ]
[  KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE  ]
[  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR     ]
[  PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS  ]
[  OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR    ]
[  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR  ]
[  OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE   ]
[  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.      ]
[ ------------------------------------------------------------ ]
Press any key to continue… 

[Lots of empty lines]

[ ------------------------------------------------------------ ]
[  Backup TA vL1.0 for Sony Xperia                MIT License  ]
[ ------------------------------------------------------------ ]
[  Initialization                                              ]
[                                                              ]
[  Make sure that you have USB Debugging enabled, you do       ]
[  allow your computer ADB access by accepting its RSA key     ]
[  (only needed for Android 4.2.2 or higher) and grant this    ]
[  ADB process root permissions through superuser.             ]
[ ------------------------------------------------------------ ]
Starting adb and waiting for phone in USB Debugging Mode…
OK
Pushing Backup TA Tools…     OK !
Checking for SU binary…      OK : Su found at /system/xbin/su
Requesting root permissions… OK : Got Root permissions.

[Lots of empty lines]

[ ------------------------------------------------------------ ]
[  Backup TA vL1.0 for Sony Xperia                MIT License  ]
[ ------------------------------------------------------------ ]
[  Choose an option :                                          ]
[ 1) Backup                                                    ]
[ 2) Restore                                                   ]
[ 3) Restore dry-run - nothing will be written on partition    ]
[ 4) Convert TA.img to backup                                  ]
[ 5) Quit                                                      ]
[ ------------------------------------------------------------ ]
scripts/utils.sh: line 37: read: 0.1: invalid timeout specification
=======================================
 BACKUP
=======================================
When you continue Backup TA will perform a backup of the TA partition.
First it will look for the TA partition by its name. When it can not
be found this way it will ask you to perform an extensive search.
The extensive search will inspect many of the partitions on your device,
in the hope to find it and continue with the backup process.

scripts/utils.sh: line 37: read: 0.1: invalid timeout specification
Are you sure? [y/N] y
=======================================
 Searchin TA Partition…
Partition not found by name.
scripts/utils.sh: line 37: read: 0.1: invalid timeout specification
Do you want to perform an extensive search for the TA ? [y/N] y
=======================================
 Inspecting Partitions…
--- mmcblk0p1 ---
\e[KThis is a compatible TA Partition !figuration…
--- mmcblk0p2 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p3 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p4 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p5 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p6 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p7 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p8 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p9 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p10 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p11 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p12 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p13 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p14 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p15 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p18 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p19 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p20 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p21 ---
\e[KThis is not a TA Partition.entifier…
--- mmcblk0p22 ---
\e[KThis is not a TA Partition.entifier…
Partition found : /dev/block/mmcblk0p1
An unknown error was caught : partition is not set. Aborting…
=======================================
                   Backup unsuccessful
Cleaning working directory…
Removing files from Android…
Killing ADB Daemon…          OK, exiting now !
If you're using ANSI colour sequences, don't. Colour is all well and good, but (as in my case) may not be totally compatible across platforms.

Now, the backup may have failed because my poor phone has had a "rough life" (Stock Sony ROM -> CM10.2 -> FreeXperia -> Stock Sony ROM) and I may have "lost" my TA partition somewhere along the line. Let me restore the backup I made and see what happens.
26th September 2014, 03:00 PM   |  #6  
Junior Member
Thanks Meter: 1
 
15 posts
Join Date:Joined: Apr 2007
More
This is getting very strange. I've restored the original TA backup, rebooted the phone and compared the md5sum output from the original TA backup, the /dev/block/mmcblk0p1 device and the TA backup I took an hour or so ago. They all have different MD5 values. I thought that they should all be the same - after all, they are supposed to be same data.

Code:
aec2542181f6d5c0a21c1563897c9a93  ./TA-backup-2014-05-21.img
347632d7f2761996798acd7f1acc38fc  ./TA-backup-2014-09-26.img
63cabee22106f26d25a34d2664ee1695  /dev/block/mmcblk0p1
When I reboot my phone after restoring the TA image, it puts up a "NFC Firmware Update in progress" message. Which is strange - as I'm not doing anything crazy to the NFC, and I'm putting the TA image back to where I got it from.

Any ideas from anyone?
26th September 2014, 04:21 PM   |  #7  
kingvortex's Avatar
Recognized Contributor
Flag Nottingham
Thanks Meter: 3,145
 
4,244 posts
Join Date:Joined: Mar 2010
More
There's a logging area in the TA partition, so the contents and therefore the md5 can vary.

Sent from my C6603 using Tapatalk
29th September 2014, 08:35 AM   |  #8  
Junior Member
Thanks Meter: 1
 
15 posts
Join Date:Joined: Apr 2007
More
I never knew that. It certainly explains why the MD5s were different. Thanks for clearing that up.
9th October 2014, 01:31 PM   |  #9  
necrotic-nosphe's Avatar
Junior Member
Flag Bordeaux
Thanks Meter: 27
 
27 posts
Join Date:Joined: Jun 2014
Donate to Me
More
Thanks a lot for sharing this work! =)

Will give a shot with my next Xperia as i already lost my TA x)

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes