Skip to content

Instantly share code, notes, and snippets.

@sk22
Last active November 4, 2018 20:08
Show Gist options
  • Save sk22/3eb4d6a987fc8c49b2c98193ab840b1c to your computer and use it in GitHub Desktop.
Save sk22/3eb4d6a987fc8c49b2c98193ab840b1c to your computer and use it in GitHub Desktop.
Make ADB script for outputting a file with root
#!/bin/bash
# ./make-adb-root-cat.sh # call the script that generates the remote script
# /data/data/com.whatsapp/databases/msgstore.db # supply the path to the file to output
# | adb shell # send the script to the android device
# > msgstore.db # save the output to a file
# `su -c 'cat filename'` is the command sent to the device
# requires the device to be rooted
if [ $# -eq 0 ]; then
>&2 echo "No arguments supplied"
exit 1
fi
echo "su -c 'cat $1'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment