Just for reference of others, here is some background on the .ab file format.

The Android Backup (*.ab) file is a compressed [TAR][1] file. It is compressed using the [DEFLATE][2] algorithm. On top of that, there can be [AES encryption][3] used. This is determined when you create the backup, if you enter a password then the backup is encrypted, otherwise; there is no encryption, it is only compressed.

The HEADER of the file is a little different than a normal DEFLATE archive. It contains information about the backup and looks like the following:


The first line is the ["Magic" line][4]. The next line is the version of the Android Backup file format. The next line is a boolean (true or false, 1 or 0) indicating if the file is compressed. The last line is the type of encryption. This example is not using any encryption. If there was a password, the line would read "AES-256". After that is the encryption cipher. If no password, then the DEFLATE "archive" starts.

It is compressed using the [Java Deflater][5]. Which, from a developers perspective,  causes issues if you want to use anything besides Java to extract it. I haven't been able to find anything that can deflate it using the same algorithm, even though all that I have found (for like C#) are supposed to follow the "SPEC".

With that said, there is an [open source project][6] under the Apache 2.0 license,  written by [Nikolay Elenkov][7] that will allow you to extract the .ab in to a tar file.


    java -jar abe.jar unpack <backup.ab> <backup.tar> <password>

If you are not sure how to really use that (which is beyond the scope of this answer) the next version of [Droid Explorer][8] v0.8.8.7 ([available here][9]) will allow you to do exactly this, and more, right from Explorer. You can read more about the features on [my blog][10] (yes, i know, shameless plug. I do that when it fits the question)


  [1]: http://en.wikipedia.org/wiki/Tar_%28file_format%29
  [2]: http://en.wikipedia.org/wiki/DEFLATE
  [3]: http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
  [4]: http://en.wikipedia.org/wiki/Magic_number_%28programming%29
  [5]: http://docs.oracle.com/javase/1.4.2/docs/api/java/util/zip/Deflater.html
  [6]: https://github.com/nelenkov/android-backup-extractor
  [7]: http://nelenkov.blogspot.com/
  [8]: http://de.codeplex.com/
  [9]: http://de.codeplex.com/releases
  [10]: http://blog.twimager.com/2012/08/droid-explorer-0887-backup-feature.html
  [11]: http://lh3.ggpht.com/-I4TYf85x5qI/UD6ZrmryW2I/AAAAAAAAKU4/qKkn9JTXndU/image%25255B18%25255D.png?imgmax=800