From: Fredrik Fornwall Date: Tue, 22 Mar 2016 15:14:56 +0000 (-0400) Subject: termux-api: Ensure /system/bin/am_process in PATH X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/termux-packages/commitdiff_plain/8cd4ab4e6f8c683f8f0240b8382d8aac089b64ee termux-api: Ensure /system/bin/am_process in PATH Closes https://github.com/termux/termux-api/issues/12 --- diff --git a/packages/termux-api/build.sh b/packages/termux-api/build.sh index f4566076..287423d4 100644 --- a/packages/termux-api/build.sh +++ b/packages/termux-api/build.sh @@ -1,6 +1,6 @@ TERMUX_PKG_HOMEPAGE=http://termux.com/add-ons/api/ TERMUX_PKG_DESCRIPTION="Termux API commands" -TERMUX_PKG_VERSION=0.12 +TERMUX_PKG_VERSION=0.13 termux_step_make_install () { mkdir -p $TERMUX_PREFIX/bin diff --git a/packages/termux-api/termux-api.c b/packages/termux-api/termux-api.c index 30c9175c..f1eaa711 100644 --- a/packages/termux-api/termux-api.c +++ b/packages/termux-api/termux-api.c @@ -35,6 +35,8 @@ void exec_am_broadcast(int argc, char** argv, char* input_address_string, char* char const* const file = "/system/bin/am"; // Avoid the system am binary from linking to wrong libraries: unsetenv("LD_LIBRARY_PATH"); + // Ensure /system/bin/app_process is in path, which is needed by am in some systems: + putenv("PATH=/system/bin"); // The user is calculated from the uid in android.os.UserHandle#getUserId(int uid) as "uid / 100000", so we do the same: uid_t current_uid = getuid();