-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance(main/termux-exec): add support for
v2.0.0
Related pull termux/termux-exec#24
- Loading branch information
1 parent
6ad16f0
commit f48970a
Showing
5 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Fix `implicit declaration of function 'basename' is invalid in C99` | ||
--- | ||
|
||
diff -uNr a/src/file/file_utils.c b/src/file/file_utils.c | ||
--- a/src/file/file_utils.c | ||
+++ b/src/file/file_utils.c | ||
@@ -1,5 +1,6 @@ | ||
#define _GNU_SOURCE | ||
#include <errno.h> | ||
+#include <libgen.h> /* for basename(3) */ | ||
#include <limits.h> | ||
#include <regex.h> | ||
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-exec | ||
TERMUX_PKG_DESCRIPTION="An execve() wrapper to make /bin and /usr/bin shebangs work" | ||
TERMUX_PKG_LICENSE="Apache-2.0" | ||
TERMUX_PKG_VERSION=0.4 | ||
TERMUX_PKG_REVISION=2 | ||
TERMUX_PKG_SRCURL=https://github.com/termux/termux-exec/archive/v$TERMUX_PKG_VERSION.tar.gz | ||
TERMUX_PKG_SHA256=9a8d42d211a7d461d61dcd4e3ef984014c2c2c696cfd6394bae389af13572627 | ||
TERMUX_PKG_MAINTAINER="@termux" | ||
TERMUX_PKG_VERSION=1:1.0 | ||
TERMUX_PKG_SRCURL=https://github.com/termux/termux-exec/archive/v${TERMUX_PKG_VERSION:2}.tar.gz | ||
TERMUX_PKG_SHA256=b977592f197bf3a87e8a005ea0ccefb3e144edc81d5e3dc8d1ad1a12512f4a68 | ||
TERMUX_PKG_ESSENTIAL=true | ||
TERMUX_PKG_BUILD_IN_SRC=true | ||
TERMUX_PKG_EXTRA_MAKE_ARGS="TERMUX_EXEC_PKG__VERSION=${TERMUX_PKG_VERSION} TERMUX_EXEC_PKG__ARCH=${TERMUX_ARCH} \ | ||
TERMUX__NAME=${TERMUX__NAME} TERMUX__LNAME=${TERMUX__LNAME} \ | ||
TERMUX_APP__PACKAGE_NAME=${TERMUX_APP__PACKAGE_NAME} TERMUX_APP__DATA_DIR=${TERMUX_APP__DATA_DIR} \ | ||
TERMUX__ROOTFS=${TERMUX__ROOTFS} TERMUX__PREFIX=${TERMUX__PREFIX} \ | ||
TERMUX_ENV__S_ROOT=${TERMUX_ENV__S_ROOT} \ | ||
TERMUX_ENV__SS_TERMUX=${TERMUX_ENV__SS_TERMUX} TERMUX_ENV__S_TERMUX=${TERMUX_ENV__S_TERMUX} \ | ||
TERMUX_ENV__SS_TERMUX_APP=${TERMUX_ENV__SS_TERMUX_APP} TERMUX_ENV__S_TERMUX_APP=${TERMUX_ENV__S_TERMUX_APP} \ | ||
TERMUX_ENV__SS_TERMUX_API_APP=${TERMUX_ENV__SS_TERMUX_API_APP} TERMUX_ENV__S_TERMUX_API_APP=${TERMUX_ENV__S_TERMUX_API_APP} \ | ||
TERMUX_ENV__SS_TERMUX_ROOTFS=${TERMUX_ENV__SS_TERMUX_ROOTFS} TERMUX_ENV__S_TERMUX_ROOTFS=${TERMUX_ENV__S_TERMUX_ROOTFS} \ | ||
TERMUX_ENV__SS_TERMUX_CORE=${TERMUX_ENV__SS_TERMUX_CORE} TERMUX_ENV__S_TERMUX_CORE=${TERMUX_ENV__S_TERMUX_CORE} \ | ||
TERMUX_ENV__SS_TERMUX_CORE__TESTS=${TERMUX_ENV__SS_TERMUX_CORE__TESTS} TERMUX_ENV__S_TERMUX_CORE__TESTS=${TERMUX_ENV__S_TERMUX_CORE__TESTS} \ | ||
TERMUX_ENV__SS_TERMUX_EXEC=${TERMUX_ENV__SS_TERMUX_EXEC} TERMUX_ENV__S_TERMUX_EXEC=${TERMUX_ENV__S_TERMUX_EXEC} \ | ||
TERMUX_ENV__SS_TERMUX_EXEC__TESTS=${TERMUX_ENV__SS_TERMUX_EXEC__TESTS} TERMUX_ENV__S_TERMUX_EXEC__TESTS=${TERMUX_ENV__S_TERMUX_EXEC__TESTS} \ | ||
TERMUX_APP__NAMESPACE=${TERMUX_APP__NAMESPACE} \ | ||
TERMUX_APP__SHELL_ACTIVITY__COMPONENT_NAME=${TERMUX_APP__SHELL_ACTIVITY__COMPONENT_NAME} TERMUX_APP__SHELL_SERVICE__COMPONENT_NAME=${TERMUX_APP__SHELL_SERVICE__COMPONENT_NAME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Fix `implicit declaration of function 'mempcpy' is invalid in C99` | ||
--- | ||
|
||
diff -uNr a/src/exec/exec_variants.c b/src/exec/exec_variants.c | ||
--- a/src/exec/exec_variants.c | ||
+++ b/src/exec/exec_variants.c | ||
@@ -43,6 +43,16 @@ | ||
|
||
static const char* LOG_TAG = "exec"; | ||
|
||
+#ifdef __ANDROID__ | ||
+# ifndef ANDROID_MEMPCPY | ||
+# define ANDROID_MEMPCPY 1 | ||
+static __inline__ void* mempcpy(void* dest, void const* src, size_t n) | ||
+{ | ||
+ return memcpy(dest, src, n) + n; | ||
+} | ||
+# endif | ||
+#endif | ||
+ | ||
int execl_hook(bool hook, int variant, const char *name, const char *argv0, va_list ap) { | ||
if (hook) { | ||
logErrorDebug(LOG_TAG, "<----- %s() hooked ----->", EXEC_VARIANTS_STR[variant]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters