@echo off

cls
echo  Full root for Acer Liquid S2 - S520 (Shreps/Vache @ acer-club.fr)
echo  -
echo  -
echo  Waiting for connected device...
adb wait-for-device
echo  -
echo  Device connected. Rebooting in Bootloader

adb reboot bootloader

echo  -
echo  Wait for your device booted in fastboot/bootloader mode
echo  Press any key to continue.
pause >nul

echo  -
echo  Fastboot devices connected :
fastboot devices

echo  -
echo  Verify that your device is listed. If not, please install the S520 driver properly and restart this script.
echo  Press any key to continue.
pause >nul

fastboot -i 0x0502 boot S2_Superboot.img

echo  -
echo  Please wait until the device completely reboot, unlock your SIM and you phone
echo  And press any key to continue.
pause >nul

adb wait-for-device
adb pull /system/bin/su 
if not exist su goto errroot
del su >nul

echo  Device rooted ! ;)
echo  -
echo  For the further work it is necessary to install SuperSU from the Play Store.
echo  After SuperSU installed, please reboot your device.
echo  -
echo  -
goto end

:errroot
echo  The file "su" isn't created!
echo  -
echo  Not getting root! :(
echo  -
echo  Error!
goto end


:end
echo  -
echo  Press any key to exit this script.
pause >nul
