Untitled diff

Created Diff never expires
23 removals
74 lines
15 additions
68 lines
@ECHO OFF
@ECHO OFF
echo BY INSTALLING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE BlackBerry
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 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 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 REEMENT, PLEASE CONTACT blackberry AT LEGALinfo@BLACKBERRY.COM. PLEASE READ
echo THIS DOCUMENT CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE.
echo THIS DOCUMENT CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE.
echo ***************************************************************************
echo ***************************************************************************
echo.
echo.
set BIN=.\host\windows-x86\bin
set BIN=.\host\windows-x86\bin
set IMG=.\img
set IMG=.\img
set FASTBOOT=fastboot.exe
set FASTBOOT=fastboot.exe


echo Note:If device is not in fastboot mode
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
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)
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=%var1:device:=%
set devname=%devname: =%
set devname=%devname: =%
if not "%devname%" == "bbb100" (
if not "%devname%" == "bbb100" (
echo Loader is not valid for this device, the device product detected is %devname%.
echo Loader is not valid for this device, the device product detected is %devname%.
GOTO End
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)
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=%var1:hlos-sig-tag:=%
set devname=%devname: =%
set devname=%devname: =%
if not "%devname%" == "" (
if "%devname%" == "" set devname=common
GOTO ERRORMSG
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
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]:
set /P answer=This script will wipe off all user data. Do you want to continue? [y/n]:
if "%answer%" == "n" ( GOTO End
if "%answer%" == "n" ( GOTO End
) else if "%answer%" == "y" ( GOTO COMMANDS
) else if "%answer%" == "y" ( GOTO COMMANDS
) else ( GOTO Error
) else ( GOTO Error
)
)
:COMMANDS
:COMMANDS
%BIN%\fastboot.exe oem securewipe
%BIN%\fastboot.exe oem securewipe
ECHO "It may take 5 to 15 minutes to securely wipe the device"
ECHO "It may take 5 to 15 minutes to securely wipe the device"
ping -n 5 127.0.0.1 > nul
ping -n 5 127.0.0.1 > nul
%BIN%\%FASTBOOT% flash tz %IMG%\tz.mbn
%BIN%\%FASTBOOT% flash tz %IMG%\tz.mbn
%BIN%\%FASTBOOT% flash devcfg %IMG%\devcfg.mbn
%BIN%\%FASTBOOT% flash devcfg %IMG%\%DCFG%.mbn
%BIN%\%FASTBOOT% flash rpm %IMG%\rpm.mbn
%BIN%\%FASTBOOT% flash rpm %IMG%\rpm.mbn
%BIN%\%FASTBOOT% flash sbl1 %IMG%\sbl1_signed.mbn
%BIN%\%FASTBOOT% flash sbl1 %IMG%\sbl1_signed.mbn
%BIN%\%FASTBOOT% flash aboot %IMG%\emmc_appsboot.mbn
%BIN%\%FASTBOOT% flash aboot %IMG%\emmc_appsboot.mbn
%BIN%\%FASTBOOT% flash bootsig %IMG%\boot.img.sig
%BIN%\%FASTBOOT% flash bootsig %IMG%\boot.img.sig
%BIN%\%FASTBOOT% flash recoverysig %IMG%\recovery.img.sig
%BIN%\%FASTBOOT% flash recoverysig %IMG%\recovery.img.sig
%BIN%\%FASTBOOT% flash boot %IMG%\boot.img
%BIN%\%FASTBOOT% flash boot %IMG%\boot.img
%BIN%\%FASTBOOT% flash recovery %IMG%\recovery.img
%BIN%\%FASTBOOT% flash recovery %IMG%\recovery.img
%BIN%\%FASTBOOT% flash cache %IMG%\cache.img
%BIN%\%FASTBOOT% flash cache %IMG%\cache.img
%BIN%\%FASTBOOT% flash userdata %IMG%\userdata.img
%BIN%\%FASTBOOT% flash userdata %IMG%\userdata.img
for /f "tokens=1 delims=" %%i in ('%BIN%\fastboot.exe getvar variant 2^>^&1 ^| findstr variant ') do (set var2=%%i)
%BIN%\%FASTBOOT% flash modem %IMG%\NON-HLOS-%dev_variant%.bin
set dev_variant=%var2:variant:=%
set dev_variant=%dev_variant: =%
if "%dev_variant%" == "" (
echo Failed to detect the device variant
GOTO End
) else (
%BIN%\%FASTBOOT% flash modem %IMG%\NON-HLOS-%dev_variant%.bin
)
%BIN%\%FASTBOOT% flash dsp %IMG%\adspso.bin
%BIN%\%FASTBOOT% flash dsp %IMG%\adspso.bin
%BIN%\%FASTBOOT% flash system %IMG%\system.img
%BIN%\%FASTBOOT% flash system %IMG%\system.img
%BIN%\%FASTBOOT% flash oem %IMG%\oem.img
%BIN%\%FASTBOOT% flash oem %IMG%\oem_%devname%.img
%BIN%\%FASTBOOT% reboot
%BIN%\%FASTBOOT% reboot
GOTO End

:ERRORMSG
if "%devname%" == "" set devname=common
echo.
echo Loader is not valid for this device variant, the device variant detected is %devname%.
echo Please obtain a loader which supports the device variant above and try again.
GOTO End
GOTO End
:Error
:Error
ECHO Please enter y or n! Bye bye!!
ECHO Please enter y or n! Bye bye!!
:End
:End
echo Press any key to close this window
echo Press any key to close this window
pause >nul
pause >nul