forked from ghostrider-reborn/aospa-flashing-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flash_firmware_windows.cmd
42 lines (34 loc) · 1.02 KB
/
flash_firmware_windows.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
:: Flash firmware zip generated by xiaomi-flashable-firmware-creator
:: (https://xiaomifirmwareupdater.com/) on garnet
::
:: Author: Adithya R (@ghostrider_reborn)
if exist "%~dp0firmware.zip" (
set fw_zip=%~dp0firmware.zip
) else (
if exist "%~dp0firmware.zip.zip" (
set fw_zip=%~dp0firmware.zip.zip
) else (
echo Error: firmware.zip not found!
goto :exit
)
)
set fw_path=%~dp0firmware
echo Extracting firmware.zip ...
powershell Expand-Archive -Path '%fw_zip%' -DestinationPath '%fw_path%' -Force
set fastboot=%~dp0platform-tools-windows\fastboot.exe
set partitions=abl aop aop_config bluetooth cpucp devcfg dsp featenabler hyp imagefv keymaster^
modem qupfw shrm tz uefi uefisecapp xbl xbl_config xbl_ramdump
(for %%p in (%partitions%) do (
echo:
echo Flashing %%p ...
"%fastboot%" flash %%p_ab "%fw_path%\firmware-update\%%p.img"
if ERRORLEVEL 1 (
echo Error: Flashing %%p failed!
goto :exit
)
))
echo:
echo Completed succesfully!
:exit
pause