-
-
Save gerardo-junior/0876935c91a83c4b87661c649217397c to your computer and use it in GitHub Desktop.
#!/data/data/com.termux/files/usr/bin/sh | |
set -e -u | |
# Frist install https://f-droid.org/en/packages/com.android.shellms/ and give sms permission manually | |
SCRIPTNAME=termux-sms-send | |
show_usage () { | |
echo "Usage: $SCRIPTNAME -n number[,number2,number3,...] [text]" | |
echo "Send a SMS message to the specified recipient number(s). The text to send is either supplied as arguments or read from stdin if no arguments are given." | |
echo " -n number(s) recipient number(s) - separate multiple numbers by commas" | |
exit 0 | |
} | |
RECIPIENTS="" | |
while getopts :hn: option | |
do | |
case "$option" in | |
h) show_usage;; | |
n) RECIPIENTS="$OPTARG";; | |
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1; | |
esac | |
done | |
shift $((OPTIND-1)) | |
if [ -z "$RECIPIENTS" ]; then | |
echo "$SCRIPTNAME: no recipient number given"; exit 1; | |
fi | |
if [ $# = 0 ]; then | |
echo "$SCRIPTNAME: no msg given" | |
else | |
echo $RECIPIENTS | tr ',' '\n' | while read number;do | |
/data/data/com.termux/files/usr/bin/am startservice --user 0 -n com.android.shellms/.sendSMS -e contact "$number" -e msg "$*" > /dev/null | |
done | |
fi |
Sorry Gerardo. It's already working fine. Thx!
Hi Gerardo
Looks like I can't put a link inside the message. Any idea how we can fix this? This is my message. Without the link I can send it but adding the link the message won't be sent.
Hola amigo, hola amiga
Hoy salieron a la calle cientos de millones de ciudadanos en todas las ciudades en todo el mundo. Te gustaría ver las imágenes y los videos de tanta gente manifestando? Y quieres saber porque están manifestando?
Te invitamos a investigar lo que de verdad está pasando con este covid y la plandemia. Si quieres saber más, conéctate a nuestro grupo de discusión:
I found out, that all messages with the word "Whatsapp" in it... won't get through. Crazy times. So I changed the whatsapp link to a tiny url link... Now I can send it. Thank you Gerardo. Who would have known... that they are blocking this word. Crazy, crazy... I still can't believe it.
@mexicodespierto this script became useless because termux started to support calls and sms again if installed by f-droid. about your script, did you put the script in your PATH? and the subprocess needs a parameter to be able to capture the function's return. in my timezone it's already late, but tomorrow afternoon I'll send you a corrected version of your script.