@echo off
title [Recovery TWRP 2.6.3.2]
cd bin
echo.
echo [TWRP 2.6.3.2] for Gpad v500 by Letschky
echo.
echo Enable USB Debugging and connect your LG G Pad (v500).
echo.
echo.
pause
cls
echo.
adb kill-server
adb wait-for-device
echo.
adb push g_security /sdcard/
adb root
cls
adb wait-for-device
echo.
echo Install Recovery...
echo.
adb push loki_patch /data/local/tmp
adb push loki_flash /data/local/tmp
adb push recovery.img /data/local/tmp
echo.
adb shell "dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=/data/local/tmp/aboot.img"
adb shell "chmod 644 /data/local/tmp/aboot.img"
adb shell "chmod 755 /data/local/tmp/loki_patch"
adb shell "chmod 755 /data/local/tmp/loki_flash"
echo.
adb shell "/data/local/tmp/loki_patch recovery /data/local/tmp/aboot.img /data/local/tmp/recovery.img /data/local/tmp/recovery.lok"
echo.
adb shell "/data/local/tmp/loki_flash recovery /data/local/tmp/recovery.lok"
adb shell "rm /sdcard/g_security"

:choice
echo.
set /P c=Reboot into recovery now [yes/no]?
if /i "%c%"=="yes" goto :reboot
if /i "%c%"=="no" goto :exit
goto :choice

:reboot
echo.
echo Rebooting...
echo.
adb reboot recovery
pause
adb kill-server
exit

:exit
echo.
pause
adb kill-server
exit