Last active
October 15, 2017 17:13
-
-
Save gammy/c81832e0bb631f5f9e24b75791bf4149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
which adb || exit | |
if [ -z "$1" ] | |
then | |
echo "Usage: $(basename $0) com.app.package.name dbname" >&2 | |
exit 1 | |
fi | |
pkg=$1 | |
dbname=$2 | |
out=/tmp/${pkg}.sqlite3 | |
echo "Broadening database file mask" | |
adb exec-out run-as $pkg chmod 666 databases/$dbname | |
echo "Dumping database" | |
adb exec-out run-as $pkg cat /data/data/${pkg}/databases/${dbname} > $out || exit 1 | |
echo | |
echo $out | |
sqlitebrowser $out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment