Skip to content

Commit

Permalink
Setup LD_PRELOAD to point at termux-exec at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall authored and twaik committed Sep 30, 2024
1 parent 417a6c7 commit f20fbbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/cpp/lorie/android.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ Java_com_termux_x11_CmdEntryPoint_start(JNIEnv *env, __unused jclass cls, jobjec
execlp("logcat", "logcat", "--pid", pid, NULL);
}

if (access("/data/data/com.termux/files/usr/lib/libtermux-exec.so", F_OK) == 0)
setenv("LD_PRELOAD", "/data/data/com.termux/files/usr/lib/libtermux-exec.so", 1);

// adb sets TMPDIR to /data/local/tmp which is pretty useless.
if (!strcmp("/data/local/tmp", getenv("TMPDIR") ?: ""))
unsetenv("TMPDIR");
Expand Down

0 comments on commit f20fbbd

Please sign in to comment.