Created
December 13, 2016 14:30
-
-
Save Dhaval2404/cf126ac0d1e96786cbbf8ddbc8a0f21f 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
#Run this script to copy android app private data to your desktop. Use below command | |
#./pull_private_data.sh app_package_name local_directory_path >> ./pull_private_data.sh com.niyantras.homifiandroid /home/dhaval/app_data | |
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
packageName=$1; | |
localDirectory=$2; | |
echo "Package Name=$packageName" | |
./adb shell run-as $packageName chmod 777 databases | |
./adb shell run-as $packageName chmod 777 shared_prefs | |
./adb shell run-as $packageName chmod 777 files | |
#./adb shell run-as $packageName chmod 777 cache | |
tempPath="/sdcard/data/" | |
tempPath="$tempPath$1" | |
echo "Temp File Directory=$tempPath" | |
./adb shell run-as $packageName mkdir -p $tempPath | |
./adb shell run-as $packageName cp -r databases $tempPath | |
./adb shell run-as $packageName cp -r shared_prefs $tempPath | |
./adb shell run-as $packageName cp -r files $tempPath | |
#./adb shell run-as $packageName cp -r cache $tempPath | |
mkdir -p $localDirectory | |
./adb pull $tempPath $localDirectory | |
./adb shell run-as $1 rm -r $tempPath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment