2016-08-31 23:39:18 +02:00
|
|
|
#!/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
|
2016-03-23 17:45:54 +01:00
|
|
|
|
2016-03-28 19:07:00 +02:00
|
|
|
for p in /system/xbin/su /su/bin/su
|
|
|
|
do
|
|
|
|
if [ -x $p ]; then
|
2016-08-31 23:39:18 +02:00
|
|
|
# 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"
|
2016-03-28 19:07:00 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "There is no su program on this device. Termux"
|
|
|
|
echo "does not supply tools for rooting, see e.g."
|
|
|
|
echo "http://www.androidcentral.com/root for"
|
|
|
|
echo "information about rooting Android."
|
|
|
|
exit 1
|