Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- %cd:~0,2%
- SET workDIR=%~dp0
- ECHO .
- ECHO .
- ECHO ************* WARNING **************
- ECHO * *
- ECHO * CHOOSING 'Y' WILL WIPE YOUR DATA *
- ECHO * *
- ECHO ************* WARNING **************
- ECHO .
- ECHO . If you are moving between a major version
- ECHO . (such as 1.4 to 2.0 or 2.0 to 1.4)
- ECHO . we recommend choosing 'Y'.
- ECHO .
- SET /P _choice=Do you want to flash user data [Y/N]?
- ECHO .
- ECHO . Rebooting device into fastboot mode.
- ECHO . This can take a few seconds.
- adb.exe reboot boot-fastboot
- goto system
- :: Flash system
- :system
- IF EXIST "%workDIR%system.img" (
- fastboot.exe erase cache
- fastboot.exe flash system system.img
- IF /I "%_choice%"=="Y" goto userdata
- goto boot
- ) ELSE (
- ECHO %workDIR%system.img not found to flash
- goto error
- )
- :: Flash userdata
- :userdata
- IF EXIST "%workDIR%userdata.img" (
- fastboot.exe flash data userdata.img
- goto boot
- ) ELSE (
- ECHO %workDIR%userdata.img not found to flash
- goto error
- )
- :: Flash boot aka kernel
- :boot
- IF EXIST "%workDIR%boot.img" (
- fastboot.exe flash boot boot.img
- goto end
- ) ELSE (
- ECHO %workDIR%boot.img not found to flash
- goto error
- )
- :error
- ECHO
- ECHO Something is wrong. Make sure you follow all the steps... Press any key to exit...
- PAUSE >nul
- EXIT
- :end
- ECHO
- ECHO Everything completed. Press any key to exit/reboot...
- PAUSE >nul
- fastboot reboot
- EXIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement