Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
#
# Usage:
# ./android-backup.sh com.example.app [example_backup]
#
# Outputs com.example.app.tar or if second parameter is provided, example_backup.tar
#
# Tarfile contains application private data such as database, shared preferences and internal files.
#
packagename="$1"
if (( $# > 1 )); then
backup_file="$2.ab"
output_file="$2.tar"
else
backup_file="$packagename".ab
output_file="$packagename".tar
fi
adb backup -f "$backup_file" "$packagename"
dd if="$backup_file" bs=24 skip=1|openssl zlib -d > "$output_file" && rm "$backup_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment