forked from darxmorph/root-mtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.bat
39 lines (39 loc) · 741 Bytes
/
main.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
@echo off
setlocal EnableDelayedExpansion
title Root your MTK by Henry
echo Welcome to Root your MTK
echo.
:waitfordevice
ping 1.1.1.1 -n 1 -w 1000 >nul
echo Waiting for device...
adb wait-for-device
echo.
echo Device detected^^!
echo.
:checkroot
echo Checking root status...
echo.
for /f "tokens=2" %%i in ('adb shell ls -al /system/xbin/su') do (
set subin=%%i
if not %%i==!subin:root=! goto hassubin
)
goto noroot
rem adb shell ls -al /system/xbin/su
rem Check for install-recovery.sh
:hassubin
for /f "tokens=2" %%i in ('adb shell ls -al /system/etc/install-recovery.sh') do (
set recsh=%%i
if not %%i==!recsh:root=! goto rooted
)
goto broken
:broken
call broken
goto eof
:rooted
call unroot
goto eof
:noroot
call root
goto eof
:eof
exit