1 #!/data/data/com.termux/files/usr/bin/sh
6 echo "Usage: $SCRIPTNAME [options] path-or-url"
7 echo "Open a file or URL in an external app."
8 echo " --send if the file should be shared for sending"
9 echo " --view if the file should be shared for viewing (default)"
10 echo " --chooser if an app chooser should always be shown"
11 echo " --content-type type specify the content type to use"
15 TEMP=`busybox getopt \
18 --long send,view,chooser,content-type:,help\
22 ACTION=android.intent.action.VIEW
26 --send) ACTION="android.intent.action.SEND"; shift;;
27 --view) ACTION="android.intent.action.VIEW"; shift;;
28 --chooser) EXTRAS="$EXTRAS --ez chooser true"; shift;;
29 --content-type) EXTRAS="$EXTRAS --es content-type $2"; shift 2;;
30 -h | --help) show_usage;;
39 if [ -f "$FILE" ]; then
40 FILE=`realpath "$FILE"`
43 am broadcast --user 0 \
45 -n com.termux/com.termux.app.TermuxOpenReceiver \