Post Reply Subscribe to Thread Email Thread

Question [Q] Unpack backup.ab created by "adb backup" command?

30th March 2012, 01:31 PM   |  #1  
mbirth's Avatar
OP Senior Member
Flag Berlin
Thanks Meter: 105
 
238 posts
Join Date:Joined: Nov 2006
More
Is there any way to unpack the backup files created by the

Code:
adb backup -all
command? (Working since Android 4.0)

It seems this is a file-based backup and unpacking (and repacking) would allow tweaking some internal databases and files without needing to root.
3rd April 2012, 01:01 AM   |  #2  
Junior Member
Thanks Meter: 0
 
4 posts
Join Date:Joined: Jan 2010
I would like to know this also
8th May 2012, 12:40 PM   |  #3  
Junior Member
Thanks Meter: 1
 
9 posts
Join Date:Joined: Apr 2011
More
I believe the ".ab" format is in some kind of "tar" compressed archive.
10th May 2012, 06:01 PM   |  #4  
Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Dec 2010
Quote:
Originally Posted by bakakaka

I believe the ".ab" format is in some kind of "tar" compressed archive.

Doesn't look like it. At least it's neither plain tar nor one of tarred gzip, bzip2 or compress. Also, it's not zip or rar.

So what's left?

- The android backup supports encryption. This does not necessarily mean that the archiver has to support that, too, since you could always first archive and then encrypt or vice versa.

- You can include .apk-files in backups. This suggests, that the archiver does not need to be über-effective, like bzip2, since that would cost time and cycles and .apk-files are already compressed, IIRC.

I don't know how to make any sense of this but maybe someone else does?
9th June 2012, 12:03 PM   |  #5  
Junior Member
Thanks Meter: 16
 
7 posts
Join Date:Joined: Dec 2009
If anyone is still interested, here's a small utility that does this:

Apparently I can't post links, so add 'http' in front to get the URLs:

github.com/nelenkov/android-backup-extractor

More details about the format and the tool here:

nelenkov.blogspot.jp/2012/06/unpacking-android-backups.html
Last edited by kapitan_petko; 29th October 2012 at 04:27 AM.
The Following 9 Users Say Thank You to kapitan_petko For This Useful Post: [ View ]
27th October 2012, 05:54 PM   |  #6  
scandiun's Avatar
Senior Member
Thanks Meter: 814
 
1,381 posts
Join Date:Joined: Jul 2010
How to extract android adb ab backup
You can do it that way, you need dd and openssl. You can do it from linux, mac or windows with cygwin:

Code:
 dd if=mybackup.ab bs=24 skip=1 | openssl zlib -d > mybackup.tar
The Following 9 Users Say Thank You to scandiun For This Useful Post: [ View ]
28th October 2012, 03:01 AM   |  #7  
Junior Member
Thanks Meter: 16
 
7 posts
Join Date:Joined: Dec 2009
Quote:
Originally Posted by scandiun

You can do it that way, you need dd and openssl. You can do it from linux, mac or windows with cygwin:

Code:
 dd if=mybackup.ab bs=24 skip=1 | openssl zlib -d > mybackup.tar

Note that this only works for unencrypted backups though.
The Following 2 Users Say Thank You to kapitan_petko For This Useful Post: [ View ]
28th October 2012, 09:59 AM   |  #8  
scandiun's Avatar
Senior Member
Thanks Meter: 814
 
1,381 posts
Join Date:Joined: Jul 2010
Quote:
Originally Posted by kapitan_petko

Note that this only works for unencrypted backups though.

I see
Last edited by scandiun; 28th October 2012 at 11:26 AM.
8th June 2014, 12:20 AM   |  #9  
Senior Member
Thanks Meter: 24
 
135 posts
Join Date:Joined: Jan 2014
And the other way around:

1. create adb backup header
2. convert tar archive and append to header
Code:
echo -e "ANDROID BACKUP\n1\n1\nnone" > backup.ab
openssl zlib -in backup.tar >> backup.ab

The Following User Says Thank You to aguaz For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
adb, backup, extract, unpack
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes