• Stars
    star
    2,032
  • Rank 22,775 (Top 0.5 %)
  • Language
    Java
  • License
    Other
  • Created over 12 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android backup extractor

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 11. Handling encrypted backups requires the JCE unlimited strength jurisdiction policy (not needed if using current Java 9 release).

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

Use one of the tools listed below to build or see Releases for pre-built binaries (runnable jar files).

With Eclipse:

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

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.

With Maven (requires at least JDK11):

To create a self-executable all-in-one jar: mvn clean package and then:

java -jar target/abe.jar pack|unpack|pack-kk ...

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 ...

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

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 ...

Usage

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.

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

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.

More Repositories

1

android-keystore

Direct access to Android's credential storage (keystore)
Java
238
star
2

android-pbe

Android password-based encryption (PBE) implementation.
Java
99
star
3

cryptfs-password-manager

Android device encryption password manager
Java
90
star
4

android-device-check

Check Android device security settings
Python
77
star
5

custom-cert-https

Custom certificate trust store on Android sample app
Java
65
star
6

gdrive-appdata

Fetch Android appdata/ from Google Drive
Python
61
star
7

keystore-decryptor

Java
59
star
8

aboot-parser

Android bootloader (aboot) parser
Python
56
star
9

android-se-access

Android Secure Element (SE) access
Java
43
star
10

virtual-pki-card

Virtual PKI smart card using CyanogenMod 9.1 software card emulation
Java
36
star
11

sim-password-manager

SIM Password Manager
Java
34
star
12

ecdh-kx

ECDH key exchange on Android
Java
24
star
13

verity

Various dm-verity tools for Android
C
21
star
14

keystore-test

Sample code for ICS security blog posts
Java
19
star
15

generate-cert

Certificate chain generator compatible with most Android versions
Java
17
star
16

ghetto-unlock

Lollipop trust agent sample
Java
16
star
17

cryptsetup

veritysetup Android build
C
14
star
18

jb-app-encryption

Jelly Bean app encryption sample
Java
14
star
19

cert-pinner

Certificate pinning on Android sample
Java
13
star
20

RemoteAuthenticator

OATH authenticator with remote interface
Java
10
star
21

wwwjdic

WWWJDIC for Android
Java
9
star
22

nfc-smime

Android S/MIME client using MuscleCard
Java
6
star
23

cert-blacklist

Jelly Bean certificate blacklisting sample
Java
4
star
24

android_device_ti_beagleboneblack

BBB rowboat build with LCD4 and USB WiFi support
C
3
star
25

nelenkov

2
star
26

android-misc

1
star