Android backup /data/data/<packagename>

备份/data/data/<package_name>下的文件, 查阅是否包含有 sensitive information.

Method 1

dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -

dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" > backup.tar

Method 2

If apk is debugable.

// get app package name
$ adb shell
$ ps | grep <app_name>
$ adb shell
$ run-as {app-package-name}
$ cd /data/data/{app-package-name}
$ chmod 777 {file}  // or chmod 777 *
$ cp {file} /mnt/sdcard/ 

// or

$ cp -R * /mnt/sdcard/tmp		// make sure folder - tmp exists in sdcard

$ adb pull mnt/sdcard/tmp .

Method 3

不成功, 原因未明

adb pull /data/data/<package_name>

Bonus

How to copy files to an Android emulator’s data directory with 'adb push' | alvinalexander.com

Ref

Show Comments