Skip to content

Commit

Permalink
tsu: prefer magisk and supersu binaries over system one
Browse files Browse the repository at this point in the history
also add message if root doesnt exists
  • Loading branch information
Cswl Coldwind committed Nov 14, 2017
1 parent a5f07a5 commit 717b902
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tsu
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ else
fi

# using the -c option of su allows to pass enviroment variables
for s in '/system/xbin/su' '/su/bin/su' '/magisk/.core/bin/su'; do
for s in '/su/bin/su' '/magisk/.core/bin/su' '/sbin/su' '/system/xbin/su' '/system/bin/su' ; do
if [ -e "$s" ]; then
exec "$s" --preserve-environment -c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH $ROOT_SHELL"
else
printf "No superuser binary detected. \n"
printf "Are you rooted? \n"
exit -1
fi;
done;

0 comments on commit 717b902

Please sign in to comment.