forked from darxmorph/root-mtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.bat
63 lines (58 loc) · 2.26 KB
/
root.bat
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
:ask
>%temp%\yesno.vbs echo WScript.Echo MsgBox("It seems your device isn't rooted" ^& vbCrLf ^& vbCrLf ^& _
>>%temp%\yesno.vbs echo "Are you sure you want to root your device?","68","Root your MTK by Henry")
for /f "delims=" %%N in ('cscript //nologo %temp%\yesno.vbs') do set yesno=%%N & del %temp%\yesno.vbs
if %yesno%==7 goto eof
if %yesno%==6 goto continue
goto ask
:continue
call common usbdebinfo
adb shell setprop ro.secure 0
call common checkuid0
:root
echo Now is when things get interesting...
echo.
echo Remounting /system R/W...
ping 1.1.1.1 -n 1 -w 1000 >nul
adb shell mount -o remount,rw /system
echo.
echo Adding /system/lib/libsupol.so
adb push libsupol.so /system/lib/libsupol.so
echo Running 'chown 0:0 /system/lib/libsupol.so'
adb shell chown 0:0 /system/lib/libsupol.so
echo Running 'chmod 0644 /system/lib/libsupol.so'
adb shell chmod 0644 /system/lib/libsupol.so
echo Adding /system/xbin/supolicy
adb push supolicy /system/xbin/supolicy
echo Running 'chown 0:2000 /system/xbin/supolicy'
adb shell chown 0:2000 /system/xbin/supolicy
echo Running 'chmod 0755 /system/xbin/supolicy'
adb shell chmod 0755 /system/xbin/supolicy
echo Adding /system/xbin/su
adb push su /system/xbin/su
echo Running 'chown 0:2000 /system/xbin/su'
adb shell chown 0:2000 /system/xbin/su
echo Running 'chmod 0755 /system/xbin/su'
adb shell chmod 0755 /system/xbin/su
echo Installing SuperSU as System App
adb push SuperSU.apk /system/app/SuperSU.apk
echo Running 'chown 0:0 /system/app/SuperSU.apk'
adb shell chown 0:0 /system/app/SuperSU.apk
echo Running 'chmod 0644 /system/app/SuperSU.apk'
adb shell chmod 0644 /system/app/SuperSU.apk
echo.
echo Starting SU daemon
rem This will probably hang ADB, but actually I don't have a fix for that
adb shell /system/xbin/su --daemon
rem adb shell cd /system/xbin ^&^& busybox nohup su --daemon ^>/dev/null 2^>^&1
echo.
adb shell setprop ro.secure 1
:end
echo Killing ADB server...
adb kill-server
>%temp%\info.vbs echo MsgBox "Done^!" ^& vbCrLf ^& vbCrLf ^& _
>>%temp%\info.vbs echo "You must update SU binaries from SuperSU app before rebooting" ^& vbCrLf ^& vbCrLf ^& _
>>%temp%\info.vbs echo "Don't forget to disable USB debugging...","64","Root your MTK by Henry"
call %temp%\info.vbs & del /f /q %temp%\info.vbs
:eof
exit /b