这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed

Usb #175

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
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ include(GNUInstallDirs)

set(TERMUX_PREFIX ${CMAKE_INSTALL_PREFIX})

add_library(termux-api SHARED termux-api.c)
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake
${CMAKE_MODULE_PATH}
)

find_package(libusb REQUIRED)

add_library(termux-api SHARED termux-api.c termux-usb.c)
include_directories(termux-api ${LIBUSB_INCLUDE_DIRS})
target_link_libraries(termux-api ${LIBUSB_LIBRARIES})

add_executable(termux-api-broadcast termux-api-broadcast.c)
target_link_libraries(termux-api-broadcast termux-api)
Expand Down Expand Up @@ -107,6 +116,7 @@ install(

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/termux-api.h
${CMAKE_CURRENT_SOURCE_DIR}/termux-usb.h
TYPE INCLUDE
)

Expand Down
674 changes: 674 additions & 0 deletions LICENSE.GPL

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions LICENSE → LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
MIT License

Copyright (c) 2017-2021 Termux
Copyright (C) 2017-2022 Termux

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 5 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
All of the source code is licensed as MIT, with the exception of the
termux-usb part which is instead licensed under GPL-3.0 or newer.

See [LICENSE.MIT](LICENSE.MIT) and [LICENSE.GPL](LICENSE.GPL) for the
full license texts.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# termux-api-package
Termux package containing scripts to call exposed API methods in the [Termux:API](https://github.com/termux/termux-api) app.

This package contains userspace tools to call exposed API methods in
the [Termux:API](https://github.com/termux/termux-api) app.

The core functionality is put in a libtermux-api.so library, and can
be accessed either by linking directly to it, or by calling the
termux-api-broadcast program, which basically just forwards given args
to the `run_api_command` function in libtermux-api.so. (bash) scripts
for using the various API methods are available in the scripts/
directory. These make use of termux-api-broadcast.

78 changes: 78 additions & 0 deletions cmake/Findlibusb.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Based on module from bladeRF:
# https://github.com/Nuand/bladeRF/blob/e09200c38e1b273ebe43cd789839e66b0506aead/host/cmake/modules/FindLibUSB.cmake

# This is a modified version of the file written by Hedrik Sattler,
# from the OpenOBEX project (licensed GPLv2/LGPL). (If this is not correct,
# please contact us so we can attribute the author appropriately.)
#
# https://github.com/zuckschwerdt/openobex/blob/master/CMakeModules/FindLibUSB.cmake
# http://dev.zuckschwerdt.org/openobex/
#
# Find libusb-1.0
#
# It will use PkgConfig if present and supported, otherwise this
# script searches for binary distribution in the path defined by
# the LIBUSB_PATH variable.
#
# The following standard variables get defined:
# LIBUSB_FOUND: true if LibUSB was found
# LIBUSB_HEADER_FILE: the location of the C header file
# LIBUSB_INCLUDE_DIRS: the directorys that contain headers
# LIBUSB_LIBRARIES: the library files
# LIBUSB_VERSION the detected libusb version
# LIBUSB_HAVE_GET_VERSION True if libusb has libusb_get_version()

include(CheckLibraryExists)
include(CheckIncludeFile)

# Find libusb
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PKGCONFIG_LIBUSB QUIET libusb-1.0 libusb)
endif(PKG_CONFIG_FOUND)
if(PKGCONFIG_LIBUSB_FOUND AND NOT LIBUSB_FOUND)
set(LIBUSB_INCLUDE_DIRS ${PKGCONFIG_LIBUSB_INCLUDE_DIRS})
foreach(i ${PKGCONFIG_LIBUSB_LIBRARIES})
string(REGEX MATCH "[^-]*" ibase "${i}")
find_library(${ibase}_LIBRARY
NAMES ${i}
PATHS ${PKGCONFIG_LIBUSB_LIBRARY_DIRS}
)
if(${ibase}_LIBRARY)
list(APPEND LIBUSB_LIBRARIES ${${ibase}_LIBRARY})
endif(${ibase}_LIBRARY)
mark_as_advanced(${ibase}_LIBRARY)
endforeach(i)

else(PKGCONFIG_LIBUSB_FOUND)
find_file(LIBUSB_HEADER_FILE
NAMES
libusb.h
PATHS
${LIBUSB_PATH}
${LIBUSB_EXTRA_PATHS}
PATH_SUFFIXES
include include/libusbx-1.0 include/libusb-1.0
)
mark_as_advanced(LIBUSB_HEADER_FILE)
get_filename_component(LIBUSB_INCLUDE_DIRS "${LIBUSB_HEADER_FILE}" PATH)

find_library(usb_LIBRARY
NAMES
libusb-1.0 usb-1.0
PATHS
${LIBUSB_PATH}
${LIBUSB_EXTRA_PATHS}
PATH_SUFFIXES
${LIBUSB_LIBRARY_PATH_SUFFIX}
)
mark_as_advanced(usb_LIBRARY)
if(usb_LIBRARY)
set(LIBUSB_LIBRARIES ${usb_LIBRARY})
endif(usb_LIBRARY)

endif(PKGCONFIG_LIBUSB_FOUND AND NOT LIBUSB_FOUND)

if(LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES)
set(LIBUSB_FOUND TRUE)
endif(LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES)
2 changes: 1 addition & 1 deletion scripts/termux-audio-info.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api AudioInfo
@TERMUX_PREFIX@/libexec/termux-api-broadcast AudioInfo
2 changes: 1 addition & 1 deletion scripts/termux-battery-status.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api BatteryStatus
@TERMUX_PREFIX@/libexec/termux-api-broadcast BatteryStatus
2 changes: 1 addition & 1 deletion scripts/termux-brightness.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ else
ARGS="--ei brightness $1 --ez auto false"
fi

@TERMUX_PREFIX@/libexec/termux-api Brightness $ARGS
@TERMUX_PREFIX@/libexec/termux-api-broadcast Brightness $ARGS
2 changes: 1 addition & 1 deletion scripts/termux-call-log.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ shift $((OPTIND-1))
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

PARAMS="$PARAMS --ei offset $PARAM_OFFSET --ei limit $PARAM_LIMIT"
@TERMUX_PREFIX@/libexec/termux-api CallLog $PARAMS
@TERMUX_PREFIX@/libexec/termux-api-broadcast CallLog $PARAMS
2 changes: 1 addition & 1 deletion scripts/termux-camera-info.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api CameraInfo
@TERMUX_PREFIX@/libexec/termux-api-broadcast CameraInfo
2 changes: 1 addition & 1 deletion scripts/termux-camera-photo.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ if [ $# != 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
touch "$1"
PARAMS="$PARAMS --es file `realpath $1`"

@TERMUX_PREFIX@/libexec/termux-api CameraPhoto $PARAMS
@TERMUX_PREFIX@/libexec/termux-api-broadcast CameraPhoto $PARAMS
2 changes: 1 addition & 1 deletion scripts/termux-clipboard-get.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api Clipboard
@TERMUX_PREFIX@/libexec/termux-api-broadcast Clipboard
2 changes: 1 addition & 1 deletion scripts/termux-clipboard-set.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ do
done
shift $((OPTIND-1))

CMD="@TERMUX_PREFIX@/libexec/termux-api Clipboard -e api_version 2 --ez set true"
CMD="@TERMUX_PREFIX@/libexec/termux-api-broadcast Clipboard -e api_version 2 --ez set true"
if [ $# = 0 ]; then
$CMD
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-contact-list.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api ContactList
@TERMUX_PREFIX@/libexec/termux-api-broadcast ContactList
2 changes: 1 addition & 1 deletion scripts/termux-dialog.in
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,4 @@ if [ -n "$ARG_P" ]; then set -- "$@" $ARG_P "$OPT_P"; fi
if [ -n "$ARG_N" ]; then set -- "$@" $ARG_N "$OPT_N"; fi
if [ -n "$ARG_D" ]; then set -- "$@" $ARG_D "$OPT_D"; fi

@TERMUX_PREFIX@/libexec/termux-api Dialog "$@"
@TERMUX_PREFIX@/libexec/termux-api-broadcast Dialog "$@"
2 changes: 1 addition & 1 deletion scripts/termux-download.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ if [ -n "$ARG_T" ]; then set -- "$@" $ARG_T "$OPT_T"; fi
if [ -n "$ARG_P" ]; then set -- "$@" $ARG_P "$OPT_P"; fi
set -- "$@" "$URL_TO_DOWNLOAD"

@TERMUX_PREFIX@/libexec/termux-api Download "$@"
@TERMUX_PREFIX@/libexec/termux-api-broadcast Download "$@"
2 changes: 1 addition & 1 deletion scripts/termux-fingerprint.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ if [ -n "$ARG_D" ]; then set -- "$@" $ARG_D "$OPT_D"; fi
if [ -n "$ARG_S" ]; then set -- "$@" $ARG_S "$OPT_S"; fi
if [ -n "$ARG_C" ]; then set -- "$@" $ARG_C "$OPT_C"; fi

@TERMUX_PREFIX@/libexec/termux-api Fingerprint "$@"
@TERMUX_PREFIX@/libexec/termux-api-broadcast Fingerprint "$@"
2 changes: 1 addition & 1 deletion scripts/termux-infrared-frequencies.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api InfraredFrequencies
@TERMUX_PREFIX@/libexec/termux-api-broadcast InfraredFrequencies
2 changes: 1 addition & 1 deletion scripts/termux-infrared-transmit.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ if [ -z "$FREQUENCY" ]; then echo "$SCRIPTNAME: No frequency specified"; exit 1;
if [ $# -lt 1 ]; then echo "$SCRIPTNAME: too few arguments"; exit 1; fi
if [ $# -gt 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api InfraredTransmit $FREQUENCY --eia pattern $1
@TERMUX_PREFIX@/libexec/termux-api-broadcast InfraredTransmit $FREQUENCY --eia pattern $1
2 changes: 1 addition & 1 deletion scripts/termux-job-scheduler.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ if [ -n "$OPT_PERSISTED" ]; then set -- "$@" --ez persisted "$OPT_PERSISTED"; fi
if [ -n "$OPT_TRIGGER_CONTENT_URI" ]; then set -- "$@" --es trigger_content_uri "$OPT_TRIGGER_CONTENT_URI"; fi
if [ -n "$OPT_TRIGGER_CONTENT_FLAG" ]; then set -- "$@" --ez trigger_content_flag "$OPT_TRIGGER_CONTENT_FLAG"; fi

@TERMUX_PREFIX@/libexec/termux-api JobScheduler "$@"
@TERMUX_PREFIX@/libexec/termux-api-broadcast JobScheduler "$@"
2 changes: 1 addition & 1 deletion scripts/termux-keystore.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!@TERMUX_PREFIX@/bin/sh
set -e -u

readonly CMD_BASE="@TERMUX_PREFIX@/libexec/termux-api Keystore"
readonly CMD_BASE="@TERMUX_PREFIX@/libexec/termux-api-broadcast Keystore"

SCRIPTNAME=termux-keystore
show_usage () {
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-location.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api Location $PARAMS
@TERMUX_PREFIX@/libexec/termux-api-broadcast Location $PARAMS
2 changes: 1 addition & 1 deletion scripts/termux-media-player.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ show_usage () {
}

main() {
@TERMUX_PREFIX@/libexec/termux-api MediaPlayer "$@"
@TERMUX_PREFIX@/libexec/termux-api-broadcast MediaPlayer "$@"
}

case "$1" in
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-media-scan.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ shift $((OPTIND-1))
if [ $# = 0 ]; then echo "$SCRIPTNAME: missing file argument"; exit 1; fi

PATHS=`get_paths "$@" | sed ':a;N;$!ba;s/,/\\\\,/g;s/\n/,/g'`
@TERMUX_PREFIX@/libexec/termux-api MediaScanner $PARAMS "$PATHS"
@TERMUX_PREFIX@/libexec/termux-api-broadcast MediaScanner $PARAMS "$PATHS"
2 changes: 1 addition & 1 deletion scripts/termux-microphone-record.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ add_params() {
}

call_api () {
@TERMUX_PREFIX@/libexec/termux-api MicRecorder "$@"
@TERMUX_PREFIX@/libexec/termux-api-broadcast MicRecorder "$@"
}

while getopts h,f:,l:,e:,b:,r:,c:,d,i,q option
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-nfc.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ if [ -n "$ARG_R" ]; then if [ -n "$ARG_W" ]; then echo "Error: Incompatible para
if [ -n "$ARG_R" ]; then set -- "$@" $ARG_R $OPT_R;fi
if [ -n "$ARG_W" ]; then set -- "$@" $ARG_W;fi
if [ -n "$ARG_T" ]; then set -- "$@" $ARG_T "$OPT_T";fi
@TERMUX_PREFIX@/libexec/termux-api Nfc "$@"
@TERMUX_PREFIX@/libexec/termux-api-broadcast Nfc "$@"
2 changes: 1 addition & 1 deletion scripts/termux-notification-list.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api NotificationList
@TERMUX_PREFIX@/libexec/termux-api-broadcast NotificationList
2 changes: 1 addition & 1 deletion scripts/termux-notification-remove.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 1 ]; then echo "$SCRIPTNAME: no notification id specified"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api NotificationRemove --es id "$1"
@TERMUX_PREFIX@/libexec/termux-api-broadcast NotificationRemove --es id "$1"
2 changes: 1 addition & 1 deletion scripts/termux-notification.in
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ fi
# Trim trailing newlines
OPT_CONTENT="$(echo "$OPT_CONTENT")"

echo "$OPT_CONTENT" | @TERMUX_PREFIX@/libexec/termux-api Notification "$@"
echo "$OPT_CONTENT" | @TERMUX_PREFIX@/libexec/termux-api-broadcast Notification "$@"
2 changes: 1 addition & 1 deletion scripts/termux-sensor.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ get_limit () {
}

call_api () {
@TERMUX_PREFIX@/libexec/termux-api Sensor "$@"
@TERMUX_PREFIX@/libexec/termux-api-broadcast Sensor "$@"
}

set_flag () {
Expand Down
4 changes: 2 additions & 2 deletions scripts/termux-share.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if [ $# != 0 ]; then
fi

# Note that the file path can contain whitespace.
@TERMUX_PREFIX@/libexec/termux-api Share $PARAMS --es file "$(realpath "$1")"
@TERMUX_PREFIX@/libexec/termux-api-broadcast Share $PARAMS --es file "$(realpath "$1")"
else
@TERMUX_PREFIX@/libexec/termux-api Share $PARAMS
@TERMUX_PREFIX@/libexec/termux-api-broadcast Share $PARAMS
fi
2 changes: 1 addition & 1 deletion scripts/termux-sms-list.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ case "$PARAM_TYPE" in
esac

PARAMS="$PARAMS --ei offset $PARAM_OFFSET --ei limit $PARAM_LIMIT --ei type $PARAM_TYPE $PARAM_NUMBER"
@TERMUX_PREFIX@/libexec/termux-api SmsInbox $PARAMS
@TERMUX_PREFIX@/libexec/termux-api-broadcast SmsInbox $PARAMS
2 changes: 1 addition & 1 deletion scripts/termux-sms-send.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -z "$RECIPIENTS" ]; then
echo "$SCRIPTNAME: no recipient number given"; exit 1;
fi

CMD="@TERMUX_PREFIX@/libexec/termux-api SmsSend $RECIPIENTS $SLOT"
CMD="@TERMUX_PREFIX@/libexec/termux-api-broadcast SmsSend $RECIPIENTS $SLOT"
if [ $# = 0 ]; then
$CMD
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-speech-to-text.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

CMD=@TERMUX_PREFIX@/libexec/termux-api
CMD=@TERMUX_PREFIX@/libexec/termux-api-broadcast
if [ $show_progress = true ]; then
$CMD SpeechToText
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-storage-get.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ shift $((OPTIND-1))
if [ $# -gt 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
if [ $# -lt 1 ]; then echo "$SCRIPTNAME: no output file specified"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api StorageGet --es file "$(realpath "$1")"
@TERMUX_PREFIX@/libexec/termux-api-broadcast StorageGet --es file "$(realpath "$1")"
2 changes: 1 addition & 1 deletion scripts/termux-telephony-call.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ done
shift $((OPTIND-1))

if [ $# = 1 ]; then
@TERMUX_PREFIX@/libexec/termux-api TelephonyCall --es number "$1"
@TERMUX_PREFIX@/libexec/termux-api-broadcast TelephonyCall --es number "$1"
else
echo "$SCRIPTNAME: No single number to call specified." >&2
exit 1
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-telephony-cellinfo.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api TelephonyCellInfo
@TERMUX_PREFIX@/libexec/termux-api-broadcast TelephonyCellInfo
2 changes: 1 addition & 1 deletion scripts/termux-telephony-deviceinfo.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api TelephonyDeviceInfo
@TERMUX_PREFIX@/libexec/termux-api-broadcast TelephonyDeviceInfo
2 changes: 1 addition & 1 deletion scripts/termux-toast.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ do
done
shift $((OPTIND-1))

CMD="@TERMUX_PREFIX@/libexec/termux-api Toast $PARAMS"
CMD="@TERMUX_PREFIX@/libexec/termux-api-broadcast Toast $PARAMS"

# If toast text was not passed as an argument, then attempt to read from STDIN with a 3s timeout
# Toast text arguments takes precedence over STDIN
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-torch.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ else
show_usage
fi

@TERMUX_PREFIX@/libexec/termux-api Torch $PARAMS
@TERMUX_PREFIX@/libexec/termux-api-broadcast Torch $PARAMS
2 changes: 1 addition & 1 deletion scripts/termux-tts-engines.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ shift $((OPTIND-1))

if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi

@TERMUX_PREFIX@/libexec/termux-api TextToSpeech --es engine LIST_AVAILABLE
@TERMUX_PREFIX@/libexec/termux-api-broadcast TextToSpeech --es engine LIST_AVAILABLE
2 changes: 1 addition & 1 deletion scripts/termux-tts-speak.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ do
done
shift $((OPTIND-1))

CMD="@TERMUX_PREFIX@/libexec/termux-api TextToSpeech $PARAMS"
CMD="@TERMUX_PREFIX@/libexec/termux-api-broadcast TextToSpeech $PARAMS"
if [ $# = 0 ]; then
$CMD
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/termux-usb.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ else
fi
fi

CMD="@TERMUX_PREFIX@/libexec/termux-api Usb -a $ACTION $PARAMS"
CMD="@TERMUX_PREFIX@/libexec/termux-api-broadcast Usb -a $ACTION $PARAMS"

if [ "$ACTION" == "permission" ]
then
Expand Down
Loading