Git Product home page Git Product logo

android-backup-extractor's Introduction

Android backup extractor

Utility to extract and repack Android backups created with adb backup (ICS+). Largely based on BackupManagerService.java from AOSP.

Requires Java 7. Handling encrypted backups requires the JCE unlimited strength jurisdiction policy.

http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

Usage (Eclipse):

Download the latest version of Bouncy Castle Provider jar (bcprov-jdk15on-*.jar) from here:

http://www.bouncycastle.org/latest_releases.html

Drop the latest Bouncy Castle jar in lib/, import in Eclipse and adjust build path if necessary. Use the abe script to start the utility. Syntax:

unpack:       abe unpack  <backup.ab> <backup.tar> [password]
pack:         abe pack    <backup.tar> <backup.ab> [password]
pack for 4.4: abe pack-kk <backup.tar> <backup.ab> [password]
(creates version 2 backups, compatible with Android 4.4.3)

If the filename is -, then data is read from standard input or written to standard output.

If the password is not given on the command line, then the environment variable ABE_PASSWD is tried. If you don't specify a password the backup archive won't be encrypted but only compressed.

Alternatively with Ant:

Use the bundled Ant script to create an all-in-one jar and run with: (you still need to put the Bouncy Castle jar in lib/; modify the bcprov.jar property accordingly)

java -jar abe.jar pack|unpack|pack-kk [parameters as above]

(Thanks to Jan Peter Stotz for contributing the build.xml file)

Alternatively with Gradle:

Use gradle to create an all-in-one jar: ./gradlew and then:

java -jar build/libs/abe-all.jar pack|unpack|pack-kk [parameters as above]

Notes

More details about the backup format and the tool implementation in the associated blog post.

Packing tar archives

  • Android is very particular about the order of files in the tar archive. The format is described here.
  • Incompatible tar archives lead to errors or even system crashes.
  • Apps with the allowBackup flag set to false are not backed up nor restored.
    • (you can try restoring manually via adb push and adb shell)
  • Errors are only printed to logcat, look out for BackupManagerService.

The safest way to pack a tar archive is to get the list of files from the original backup.tar file:

tar tf backup.tar | grep -F "com.package.name" > package.list

And then use that list to build the tar file. In the extracted backup directory:

tar cf restore.tar -T package.list

You can now pack restore.tar and try adb restore restore.ab

android-backup-extractor's People

Contributors

nelenkov avatar lekensteyn avatar charles-dyfis-net avatar boris-de avatar cpeterso avatar dfredell avatar abinashbishoyi avatar bendavis78 avatar jomo avatar

Watchers

Amadou Cisse avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.