Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set(script_files
scripts/termux-fingerprint
scripts/termux-infrared-frequencies
scripts/termux-infrared-transmit
scripts/termux-install
scripts/termux-job-scheduler
scripts/termux-keystore
scripts/termux-location
Expand Down
31 changes: 31 additions & 0 deletions scripts/termux-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!@TERMUX_PREFIX@/bin/sh
set -e -u

SCRIPTNAME=termux-install
show_usage () {
echo "Usage: $SCRIPTNAME file"
echo "Install an application, showing the system confirmation dialog."
echo "The argument may be a single .apk, a directory of split APKs, or a split"
echo "bundle (.apkm/.apks/.xapk) whose APKs are installed together as one session."
exit 0
}

while getopts :h option
do
case "$option" in
h) show_usage;;
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;;
esac
done
shift $((OPTIND-1))

if [ $# = 0 ]; then echo "$SCRIPTNAME: missing file argument"; exit 1; fi
if [ $# -gt 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

if [ ! -e "$1" ]; then
echo "$1 does not exist"
exit 1
fi

# Note that the file path can contain whitespace.
@TERMUX_PREFIX@/libexec/termux-api Install --es file "$(realpath "$1")"