Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- echo BY INSTALLING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE BlackBerry
- echo Solution License Agreement which can be reviewed at www.blackberry.com/leg-
- echo al/bbsla. IF YOU HAVE ANY QUESTIONS OR CONCERNS ABOUT THE TERMS OF THIS AG-
- echo REEMENT, PLEASE CONTACT blackberry AT LEGALinfo@BLACKBERRY.COM. PLEASE READ
- echo THIS DOCUMENT CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE.
- echo ***************************************************************************
- echo.
- set BIN=.\host\windows-x86\bin
- set IMG=.\img
- set FASTBOOT=fastboot.exe
- echo Note:If device is not in fastboot mode
- echo Please switch to fastboot mode by holding the power and volume down key for 30s
- for /f "tokens=1 delims=" %%i in ('%BIN%\fastboot.exe getvar device 2^>^&1 ^| findstr device ') do (set var1=%%i)
- set devname=%var1:device:=%
- set devname=%devname: =%
- if "%devname%" == "" (
- echo Failed to detect the device name
- GOTO End
- )
- for /f "tokens=1 delims=" %%i in ('%BIN%\fastboot.exe getvar hlos-sig-tag 2^>^&1 ^| findstr hlos-sig-tag ') do (set var1=%%i)
- set devname=%var1:hlos-sig-tag:=%
- set devname=%devname: =%
- set devname_sig=%devname%
- if "%devname%" == "" set devname=common
- for /f "tokens=1 delims=" %%i in ('%BIN%\fastboot.exe getvar variant 2^>^&1 ^| findstr variant ') do (set var2=%%i)
- set dev_variant=%var2:variant:=%
- set dev_variant=%dev_variant: =%
- if "%dev_variant%" == "" (
- echo Failed to detect the device variant
- GOTO End
- )
- if %dev_variant% == "dscn" set dev_variant=china
- if %dev_variant% == "cn" set dev_variant=china
- if %dev_variant% == "indonesia" set dev_variant=india
- set DCFG=devcfg
- if %dev_variant% == "china" set DCFG=devcfg_cn
- set /P answer=This script will wipe off all user data. Do you want to continue? [y/n]:
- if "%answer%" == "n" ( GOTO End
- ) else if "%answer%" == "y" ( GOTO COMMANDS
- ) else ( GOTO Error
- )
- :COMMANDS
- %BIN%\fastboot.exe oem securewipe
- ECHO "It may take 5 to 15 minutes to securely wipe the device"
- ping -n 5 127.0.0.1 > nul
- %BIN%\%FASTBOOT% flash tz %IMG%\tz.mbn
- %BIN%\%FASTBOOT% flash devcfg %IMG%\%DCFG%.mbn
- %BIN%\%FASTBOOT% flash rpm %IMG%\rpm.mbn
- %BIN%\%FASTBOOT% flash sbl1 %IMG%\sbl1_signed.mbn
- %BIN%\%FASTBOOT% flash aboot %IMG%\emmc_appsboot.mbn
- %BIN%\%FASTBOOT% flash bootsig %IMG%\boot.img%devname_sig%.sig
- %BIN%\%FASTBOOT% flash recoverysig %IMG%\recovery.img%devname_sig%.sig
- %BIN%\%FASTBOOT% flash boot %IMG%\boot.img
- %BIN%\%FASTBOOT% flash recovery %IMG%\recovery.img
- %BIN%\%FASTBOOT% flash cache %IMG%\cache.img
- %BIN%\%FASTBOOT% flash userdata %IMG%\userdata.img
- %BIN%\%FASTBOOT% flash modem %IMG%\NON-HLOS-%dev_variant%.bin
- %BIN%\%FASTBOOT% flash dsp %IMG%\adspso.bin
- %BIN%\%FASTBOOT% flash system %IMG%\system.img
- %BIN%\%FASTBOOT% flash oem %IMG%\oem_%devname%.img
- %BIN%\%FASTBOOT% reboot
- GOTO End
- :Error
- ECHO Please enter y or n! Bye bye!!
- :End
- echo Press any key to close this window
- pause >nul
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement