Last active
December 10, 2015 16:08
-
-
Save Cloudef/4458571 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
# sms through android | |
# $1 = phone number | |
# $@ = message | |
function sms() { | |
[[ -n "$1" ]] || { echo "no number given"; return; } | |
local num="$1"; shift 1; | |
[[ -n "$@" ]] || { echo "no message given"; return; } | |
ssh -q root@hack-ANDROID "am start -a android.intent.action.VIEW -d sms:$num --es sms_body \"$@\" --ez exit_on_sent true" | |
} | |
# call through android | |
# $1 = phone number | |
function call() { | |
ssh -q root@hack-ANDROID "am start -a android.intent.action.CALL tel:$1" | |
} | |
# sms db parser | |
# $@ = file | |
function _parsesmsdb() { | |
sqlite3 "$@" '.dump "sms"'| grep "^INSERT" | sed 's/.*VALUES(\(.*\));/\1/' | awk -F"," '{ print "SMS from "$3": "$13 }' | |
} | |
# cat sms from android | |
function catsms() { | |
ssh -q root@hack-ANDROID "cat /data/data/com.android.providers.telephony/databases/mmssms.db" > /tmp/android-sms.db | |
_parsesmsdb /tmp/android-sms.db | |
rm /tmp/android-sms.db &> /dev/null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment