@echo off
echo *****    Welcome to use LeTV Le 1 Recovery    *****
echo *****    Built By Mahone- Fastcardtech.com    *****
echo *****    Please Check If Your Phone is LeTV Le 1 First    *****
echo ****************************************************

set adb="%~dp0\adb.exe"
set fastboot="%~dp0\fastboot.exe"

:Check
echo   -- Checking Connection.....
::%adb% wait-for-devices
%adb% shell echo
IF not ERRORLEVEL 0 goto Nodev
echo **************Connected, Checking Phone Model**************
for /f %%i in ('%adb% shell getprop ro.product.device') do set dev=%%i
echo   -- Model£º%dev%
if not %dev:~0,4%==x600  goto Noletv
echo ******************Connected!******************
echo   -- Reboot to Bootloader, Click any key to continue, and then please do not touch the phone.....
pause >nul
%adb% reboot bootloader
echo   -- Hold on.....
ping -n 6 127.0.0.1 > nul
echo   -- Check if there's "Fastboot" on the left coner of your phone screen£¬if not please check the data cable and driver£¬if yes, please click any key to continue.....
pause >nul
echo   -- Flashing Recovery, Hold On.....
ping -n 3 127.0.0.1 > nul
%fastboot% flash recovery recovery.img
echo   -- OKAY means okey  :).....
echo   -- Click any key to load Recovery.....
pause >nul
%fastboot% oem reboot-recovery
echo   -- Click any key to the end.....
pause >nul
goto End

:Nodev
echo   -- Please connect your phone and click any key to continue.....
echo   -- If you have already connected your phone, please check if the usb debugging is ticked, or the phone driver is download.....
echo   -- Click any key to continue.....
pause >nul
goto Check

:Noletv
echo   -- The phone you connected is not LeTV Le 1, please reconnect and click any key to continue.....
pause >nul
goto Check

:End