-
Notifications
You must be signed in to change notification settings - Fork 12
/
flash_all.bat
executable file
·155 lines (86 loc) · 3.69 KB
/
flash_all.bat
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
@echo off
echo nothing phone(1) fastboot flash by @sh4tteredd
echo.
echo DON'T flash a nothingOS version lower than that one that's currently installed on the phone!
echo.
echo In order to gather all the files that we need, consider to run my other script available on https://github.com/sh4tteredd/nothing-phone-1-tools
echo.
echo Instead, if you already have the .img files, put all your files in a subfolder called 'images' to continue
echo.
::fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *lahaina" || echo This script is only for nothing phone(1)
::fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *lahaina" || exit \B 1
FOR /F "tokens=2 delims=:" %%A IN ('fastboot getvar product 2^>^&1 ^| findstr /R /C:"^product: *lahaina" /C:"^product: *Spacewar"') DO (
IF NOT "%%A"=="" (
ECHO This script is only for nothing phone(1)
EXIT /B 1
)
)
fastboot -w
fastboot --set-active=a
echo Flashing A slot. Please wait...
fastboot reboot fastboot
fastboot flash abl_a .\images\abl.img
fastboot flash aop_a .\images\aop.img
fastboot flash bluetooth_a .\images\bluetooth.img
fastboot flash boot_a .\images\boot.img
fastboot flash cpucp_a .\images\cpucp.img
fastboot flash devcfg_a .\images\devcfg.img
fastboot flash dsp_a .\images\dsp.img
fastboot flash dtbo_a .\images\dtbo.img
fastboot flash featenabler_a .\images\featenabler.img
fastboot flash hyp_a .\images\hyp.img
fastboot flash imagefv_a .\images\imagefv.img
fastboot flash keymaster_a .\images\keymaster.img
fastboot flash modem_a .\images\modem.img
fastboot flash multiimgoem_a .\images\multiimgoem.img
fastboot flash odm_a .\images\odm.img
fastboot flash product_a .\images\product.img
fastboot flash qupfw_a .\images\qupfw.img
fastboot flash shrm_a .\images\shrm.img
fastboot flash system_a .\images\system.img
fastboot flash system_ext_a .\images\system_ext.img
fastboot flash tz_a .\images\tz.img
fastboot flash uefisecapp_a .\images\uefisecapp.img
fastboot flash vbmeta_a .\images\vbmeta.img
fastboot flash vbmeta_system_a .\images\vbmeta_system.img
fastboot flash vendor_a .\images\vendor.img
fastboot flash vendor_boot_a .\images\vendor_boot.img
fastboot flash xbl_a .\images\xbl.img
fastboot flash xbl_config_a .\images\xbl_config.img
fastboot reboot bootloader
fastboot --set-active=b
echo Flashing B slot. Please wait...
fastboot reboot fastboot
fastboot flash abl_b .\images\abl.img
fastboot flash aop_b .\images\aop.img
fastboot flash bluetooth_b .\images\bluetooth.img
fastboot flash boot_b .\images\boot.img
fastboot flash cpucp_b .\images\cpucp.img
fastboot flash devcfg_b .\images\devcfg.img
fastboot flash dsp_b .\images\dsp.img
fastboot flash dtbo_b .\images\dtbo.img
fastboot flash featenabler_b .\images\featenabler.img
fastboot flash hyp_b .\images\hyp.img
fastboot flash imagefv_b .\images\imagefv.img
fastboot flash keymaster_b .\images\keymaster.img
fastboot flash modem_b .\images\modem.img
fastboot flash multiimgoem_b .\images\multiimgoem.img
fastboot flash odm_b .\images\odm.img
fastboot flash product_b .\images\product.img
fastboot flash qupfw_b .\images\qupfw.img
fastboot flash shrm_b .\images\shrm.img
fastboot flash system_b .\images\system.img
fastboot flash system_ext_b .\images\system_ext.img
fastboot flash tz_b .\images\tz.img
fastboot flash uefisecapp_b .\images\uefisecapp.img
fastboot flash vbmeta_b .\images\vbmeta.img
fastboot flash vbmeta_system_b .\images\vbmeta_system.img
fastboot flash vendor_b .\images\vendor.img
fastboot flash vendor_boot_b .\images\vendor_boot.img
fastboot flash xbl_b .\images\xbl.img
fastboot flash xbl_config_b .\images\xbl_config.img
fastboot reboot bootloader
fastboot --set-active=a
fastboot %* reboot
echo "Your phone(1) is rebooting"
pause