@echo off
color 9f
title mtk root tool
:menu
cls
@echo             ****************************************
@echo.
@echo                   mtk root tool - @moshe-144       
@echo.
@echo             ****************************************
echo 1: install mtk driver 
echo 2: install fastboot driver 
echo 3: unlock bootloader
echo 4: flash boot
echo 5: flash boot_a
echo 6: flash recovery
echo 7: reboot
choice /c 1234567
goto :action_%errorlevel%



:action_1
cls
mtk.exe
cls
goto :menu
:action_2
cls
IF DEFINED programfiles(x86) GOTO x64
:x86
ECHO.
ECHO Installing 32-bit driver ...
ECHO Please continue driver installation ...
PING localhost -n 1 >NUL
START /wait driver\DPInst_x86 /f 2>>%USERPROFILE%\Desktop\adb-installer.log
GOTO FINISH
:x64
ECHO.
ECHO Installing 64-bit driver ...
ECHO Please continue driver installation ...
PING localhost -n 1 >NUL
START /wait driver\DPInst_x64 /f 2>>%USERPROFILE%\Desktop\adb-installer.log
:FINISH
cls
goto :menu
:action_3
cls
adb reboot bootloader
fastboot flashing unlock
echo.
echo.
echo. ****************
echo   1: flash boot
echo   2: exit
echo. ****************
choice /c 12
if %errorlevel% == 1 goto :action_4
if %errorlevel% == 2 goto menu
:action_4
cls
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot flash boot "boot & recovery\boot.img"
echo.
echo.
echo. *************
echo    1: reboot
echo    2: exit
echo. *************
choice /c 12
if %errorlevel% == 1 goto :action_7
if %errorlevel% == 2 goto menu
:action_5
cls
fastboot --disable-verity --disable-verification flash vbmeta_a vbmeta.img
fastboot flash boot_a "boot & recovery\boot.img"
echo.
echo.
echo. *************
echo    1: reboot
echo    2: exit
echo. *************
choice /c 12
if %errorlevel% == 1 goto :action_7
if %errorlevel% == 2 goto menu
:action_6
cls
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot flash recovery "boot & recovery\recovery.img"
echo.
echo.
echo. *************
echo    1: reboot
echo    2: exit
echo. *************
choice /c 12
if %errorlevel% == 1 goto :action_7
if %errorlevel% == 2 goto menu
:action_7
cls
fastboot reboot
echo.
pause
goto :menu