forked from CyanogenDefy/android_external_bootmenu
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathunroot.sh
executable file
·39 lines (30 loc) · 821 Bytes
/
unroot.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/sbin/sh
######## BootMenu Script v0.8.6
######## Execute [Root/Unroot] Menu
export PATH=/sbin:/system/xbin:/system/bin
remove_superuser()
{
mv /data/data/com.noshufou.android.su /system/bootmenu/ext/
rm /system/bin/su
rm /system/xbin/su
rm /system/app/[Ss][Uu][Pp][Ee][Rr][Uu][Ss][Ee][Rr].[Aa][Pp][Kk]
}
restore_superuser()
{
cp /system/bootmenu/ext/su /system/bin/
cp /system/bootmenu/ext/su /system/xbin/
cp /system/bootmenu/ext/Superuser.apk /system/app/
mv /system/bootmenu/ext/com.noshufou.android.su /data/data/
chmod 6755 /system/bin/su
chmod 6755 /system/xbin/su
chmod 644 /system/app/Superuser.apk
}
######## Main Script
ls /system/app/[Ss][Uu][Pp][Ee][Rr][Uu][Ss][Ee][Rr].[Aa][Pp][Kk] # hehe..
ret=$?
if [ $ret -eq 0 ]; then
remove_superuser
else
restore_superuser
fi
exit