Coder Social home page Coder Social 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.

Building

Requires Java 7 or later (Oracle or OpenJDK).

Use the steps mentioned below to build or see Releases for pre-built binaries (runnable jar files).

Use Apache Maven to create an all-in-one jar: mvn package -Prelease. The resulting binary will be at target/abe.jar.

Usage

java -jar target/abe.jar unpack|pack|pack-old|x|c <source> <destination>

Syntax

  • Unpack .ab to .tar: abe unpack <backup.ab> <backup.tar> [password]

  • Pack .tar to .ab: abe pack <backup.tar> <backup.ab> [password]
    (use abe pack-old command for legacy v1 format supported by Android version < 4.4.3)

  • Extract .tar: abe x <backup.tar> <folder>
    (also writes the file list to .filelist)

  • Create .tar: abe c <backup.tar> <folder>
    (uses .filelist to restore original file order)

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.

Usage examples

Backup and unpack:

adb backup -f data.ab my.android.app
java -jar abe.jar unpack data.ab data.tar
java -jar abe.jar x data.tar data

Pack and restore:

java -jar abe.jar c data-new.tar data
java -jar abe.jar pack data-new.ab data-new.tar
adb restore data-new.ab

Packing tar archives

  • Android is very particular about the order of files and the format of 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. The x and c commands write and read a file list in .filelist.

Releases

Releases are built with Travis CI from the master branch and include a runnable fat jar.

Use the binaries at your own risk. No warranty or support provided.

Please report only bugs in backup extractor itself, I can't answer questions regrading unpacking/repacking backups or tar files. (See Usage for a mini usage guide.)

Build Status

Notes

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

android-backup-extractor's People

Contributors

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

Stargazers

 avatar

Watchers

 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.