Browse Source

termux-tools: Try a more functional su wrapper

android-5
Fredrik Fornwall 8 years ago
parent
commit
0ee447355b
  1. 2
      packages/termux-tools/build.sh
  2. 13
      packages/termux-tools/su

2
packages/termux-tools/build.sh

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=https://termux.com/
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
TERMUX_PKG_VERSION=0.28
TERMUX_PKG_VERSION=0.29
TERMUX_PKG_PLATFORM_INDEPENDENT=yes
termux_step_make_install () {

13
packages/termux-tools/su

@ -1,11 +1,16 @@
#!/bin/sh
#!/data/data/com.termux/files/usr/bin/sh
ROOT_SHELL=$PREFIX/bin/bash
if test -x "$HOME/.termux/shell"; then ROOT_SHELL=`readlink -f $HOME/.termux/shell`; fi
for p in /system/xbin/su /su/bin/su
do
if [ -x $p ]; then
# The su tool may require programs
# from /system/bin in path:
PATH=/system/bin:$PATH exec $p $@
# The su tool may require programs in PATH:
PATH=$PATH:/su/bin:/su/xbin:/system/bin:/system/xbin \
exec $p \
--preserve-environment \
-c "LD_LIBRARY_PATH=$PREFIX/lib $ROOT_SHELL"
fi
done

Loading…
Cancel
Save