fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *lake" || fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *pond" || echo Missmatching image and device
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *lake" || fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *pond" || exit /B 1
fastboot %* flash gpt %~dp0images\PGPT_EMMC || @echo "Flash gpt error" && exit /B 1
fastboot %* flash opcust %~dp0images\opcust.img || @echo "Flash opcust error" && exit /B 1
set CURRENT_ANTI_VER=1
for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
if [%version%] EQU [] set version=0
if %version% GTR %CURRENT_ANTI_VER% (
@echo error : current device antirollback version is greater than this package
exit /B 1
)
::fastboot %* getvar crc 2>&1 | findstr /r /c:"^crc: 1" && if %errorlevel% equ 0 (
::fastboot %* flash crclist %~dp0images\crclist.txt || @echo "Flash crclist error" && exit /B 1
::fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @echo "Flash sparsecrclist error" && exit /B 1
)
::erase opcust and opconfig when cota enabled; Judge whether the partition exists before erase;
::fastboot %* getvar partition-type:opcust 2>&1 | findstr /r /c:"^partition-type:opcust: raw"
::if %errorlevel% equ 0 (
::fastboot %* erase opcust || @echo "Erase opcust error" && exit /B 1
)
::fastboot %* getvar partition-type:opconfig 2>&1 | findstr /r /c:"^partition-type:opconfig: raw"
::if %errorlevel% equ 0 (
::fastboot %* erase opconfig || @echo "Erase opconfig error" && exit /B 1
)
fastboot %* erase boot || @echo "Erase boot error" && exit /B 1
fastboot %* erase expdb || @echo "Erase expdb error" && exit /B 1
fastboot %* erase metadata || @echo "Erase metadata error" && exit /B 1
fastboot %* flash efuse %~dp0images\efuse.img || @echo "Flash efuse error" && exit /B 1
fastboot %* erase md_udc || @echo "Erase md_udc error" && exit /B 1
fastboot %* flash preloader_ab %~dp0images\preloader_lake.bin || @echo "Flash preloader error" && exit /B 1
fastboot %* flash vbmeta_ab %~dp0images\vbmeta.img || @echo "Flash vbmeta error" && exit /B 1
fastboot %* flash vbmeta_system_ab %~dp0images\vbmeta_system.img || @echo "Flash vbmeta_system error" && exit /B 1
fastboot %* flash vbmeta_vendor_ab %~dp0images\vbmeta_vendor.img || @echo "Flash vbmeta_vendor error" && exit /B 1
fastboot %* flash md1img_ab %~dp0images\md1img.img || @echo "Flash md1img error" && exit /B 1
fastboot %* flash spmfw_ab %~dp0images\spmfw.img || @echo "Flash spmfw error" && exit /B 1
fastboot %* flash scp_ab %~dp0images\scp.img || @echo "Flash scp error" && exit /B 1
fastboot %* flash sspm_ab %~dp0images\sspm.img || @echo "Flash sspm error" && exit /B 1
fastboot %* flash gz_ab %~dp0images\gz.img || @echo "Flash gz error" && exit /B 1
fastboot %* flash lk_ab %~dp0images\lk.img || @echo "Flash lk error" && exit /B 1
fastboot %* flash boot_ab %~dp0images\boot.img || @echo "Flash boot error" && exit /B 1
fastboot %* flash dtbo_ab %~dp0images\dtbo.img || @echo "Flash dtbo error" && exit /B 1
fastboot %* flash vendor_boot_ab %~dp0images\vendor_boot.img || @echo "Flash vendor_boot error" && exit /B 1
fastboot %* flash tee_ab %~dp0images\tee.img || @echo "Flash tee error" && exit /B 1
fastboot %* flash logo_ab %~dp0images\logo.bin || @echo "Flash logo error" && exit /B 1
fastboot %* getvar partition-type:countrycode_a 2>&1 | findstr /r /c:"^partition-type:countrycode_a: raw"
if %errorlevel% equ 0 (
fastboot %* flash countrycode_a %~dp0images\countrycode.img || @echo "Flash countrycode_a error" && exit /B 1
)
fastboot %* getvar partition-type:countrycode_b 2>&1 | findstr /r /c:"^partition-type:countrycode_b: raw"
if %errorlevel% equ 0 (
fastboot %* flash countrycode_b %~dp0images\countrycode.img || @echo "Flash countrycode_b error" && exit /B 1
)
fastboot %* flash rescue %~dp0images\rescue.img || @echo "Flash rescue error" && exit /B 1
fastboot %* flash super %~dp0images\super.img || @echo "Flash super error" && exit /B 1
::fastboot %* flash cust %~dp0images\cust.img || @echo "Flash cust error" && exit /B 1
fastboot %* flash userdata %~dp0images\userdata.img || @echo "Flash userdata error" && exit /B 1
fastboot %* flash misc %~dp0images\misc.img || @echo "Flash misc error" && exit /B 1
fastboot %* oem cdms
fastboot %* getvar unlocked 2>&1 | findstr /r "yes" 2>&1 && fastboot %* set_active a
fastboot %* reboot
extract file error Thanks !
Hi
test and no problem