From 717b902303a9afd546e46722f36feca549376471 Mon Sep 17 00:00:00 2001 From: Cswl Coldwind Date: Tue, 14 Nov 2017 10:35:45 +0545 Subject: [PATCH] tsu: prefer magisk and supersu binaries over system one also add message if root doesnt exists --- tsu | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tsu b/tsu index 880b6cd..c431f48 100644 --- a/tsu +++ b/tsu @@ -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;