@echo off
adb push boot.img /data/
echo %errorlevel%
if "%errorlevel%"=="1" (goto B) else (goto A)
:A
adb shell sync
for /f "delims=" %%i in ('adb shell "getprop |grep slot"') do set adb_output=%%i
echo %adb_output%
for /f "delims=" %%i in ('echo %adb_output:~-3,2%') do set slot=%%i
adb shell "dd if=/data/boot.img of=/dev/block/by-name/boot%slot%"
echo dd to boot%slot%
adb shell sync
echo reboot
adb shell reboot
echo update succeed
:B
pause