2
2
setlocal enabledelayedexpansion
3
3
:HOME
4
4
5
- REM 设置机型
5
+ REM 设置机型
6
6
set " right_device = Model_code"
7
7
8
8
set " PATH = %PATH% ;%cd% \bin\windows"
@@ -13,28 +13,28 @@ for /f "tokens=2 delims=:" %%a in ('chcp') do set "locale=%%a"
13
13
cls
14
14
15
15
if " !locale! " == " 936" (
16
- set " confirm_switch = {08}{\n}你确定要执行这个操作吗?{\n}{\n}如果确定,请输入 'sure',否则,输入任意以退出:{\n}{\n}"
17
- set " device_mismatch_msg = 此 ROM 仅适配 !right_device! ,但你的设备是 !DeviceCode! "
18
- set " disabled_avb_verification = 已禁用 Avb2.0 校验"
19
- set " exit_program = {04}{\n}[4] {01}退出程序{#}{#}{\n}"
20
- set " execution_completed = 执行完成,等待自动重启"
21
- set " failure_status = 因为某些原因,未能刷入"
22
- set " fastboot_mode = {06}当前所处状态:Fastboot 模式{\n}"
23
- set " fastbootd_mode = {06}当前所处状态:Fastbootd 模式{\n}"
24
- set " format_data_flash = {04}{\n}[2] {01}格式化用户数据并刷入{#}{#}{\n}"
25
- set " formatting_data = 正在格式化 DATA"
26
- set " keep_data_flash = {04}{\n}[1] {01}保留全部数据并刷入{#}{#}{\n}"
27
- set " kept_data_reboot = 已保留全部数据,准备重启!"
16
+ set " confirm_switch = {08}{\n}你确定要执行这个操作吗?{\n}{\n}如果确定,请输入 'sure',否则,输入任意以退出:{\n}{\n}"
17
+ set " device_mismatch_msg = 此 ROM 仅适配 !right_device! ,但你的设备是 !DeviceCode! "
18
+ set " disabled_avb_verification = 已禁用 Avb2.0 校验"
19
+ set " exit_program = {04}{\n}[4] {01}退出程序{#}{#}{\n}"
20
+ set " execution_completed = 执行完成,等待自动重启"
21
+ set " failure_status = 因为某些原因,未能刷入"
22
+ set " fastboot_mode = {06}当前所处状态:Fastboot 模式{\n}"
23
+ set " fastbootd_mode = {06}当前所处状态:Fastbootd 模式{\n}"
24
+ set " format_data_flash = {04}{\n}[2] {01}格式化用户数据并刷入{#}{#}{\n}"
25
+ set " formatting_data = 正在格式化 DATA"
26
+ set " keep_data_flash = {04}{\n}[1] {01}保留全部数据并刷入{#}{#}{\n}"
27
+ set " kept_data_reboot = 已保留全部数据,准备重启!"
28
28
set " one_title = {F9} Powered By {F0}Garden Of Joy {#}{#}{\n}"
29
- set " retry_message = 重试..."
30
- set " select_project = {02}请选择你要操作的项目:{\n}{\n}"
31
- set " success_status = 刷入成功"
32
- set " switch_to_fastboot = {04}{\n}[3] {01}切换到 Fastboot 模式{#}{#}{\n}"
33
- set " switch_to_fastbootd = {04}{\n}[3] {01}切换到 Fastbootd 模式{#}{#}{\n}"
34
- set " title = 盾牌座 UY 线刷工具"
35
- set " waiting_device = {0D}———— 正在等待设备 ————{#}{\n}{\n}"
29
+ set " retry_message = 重试..."
30
+ set " select_project = {02}请选择你要操作的项目:{\n}{\n}"
31
+ set " success_status = 刷入成功"
32
+ set " switch_to_fastboot = {04}{\n}[3] {01}切换到 Fastboot 模式{#}{#}{\n}"
33
+ set " switch_to_fastbootd = {04}{\n}[3] {01}切换到 Fastbootd 模式{#}{#}{\n}"
34
+ set " title = 盾牌座 UY 线刷工具"
35
+ set " waiting_device = {0D}———— 正在等待设备 ————{#}{\n}{\n}"
36
36
) else (
37
- set " confirm_switch = {08}{\n}Are you sure you want to perform this operation?{\n}{\n}If sure, please enter 'sure', otherwise, enter anything to exit:{\n}{\n}"
37
+ set " confirm_switch = {08}{\n}Are you sure you want to perform this operation?{\n}{\n}If sure, please enter 'sure', otherwise, enter anything to exit:{\n}{\n}"
38
38
set " device_mismatch_msg = This ROM is only compatible with !right_device! , but your device is !DeviceCode! "
39
39
set " disabled_avb_verification = Avb2.0 verification has been disabled"
40
40
set " exit_program = {04}{\n}[4] {01}Exit program{#}{#}{\n}"
@@ -48,39 +48,39 @@ if "!locale!"==" 936" (
48
48
set " kept_data_reboot = All data has been kept, ready to reboot!"
49
49
set " one_title = {F9} Powered By {F0}Garden Of Joy {#}{#}{\n}"
50
50
set " retry_message = Retry..."
51
- set " select_project = {02}Please select the project you want to operate:{\n}{\n}"
51
+ set " select_project = {02}Please select the project you want to operate:{\n}{\n}"
52
52
set " success_status = Flash successful"
53
53
set " switch_to_fastboot = {04}{\n}[3] {01}Switch to Fastboot mode{#}{#}{\n}"
54
54
set " switch_to_fastbootd = {04}{\n}[3] {01}Switch to Fastbootd mode{#}{#}{\n}"
55
55
set " title = UY Scuti Flash Tool"
56
- set " waiting_device = {0D}———— Waiting for device ————{#}{\n}{\n}"
56
+ set " waiting_device = {0D}———— Waiting for device ————{#}{\n}{\n}"
57
57
)
58
58
59
59
title !title!
60
60
61
- REM 显示等待设备的消息
61
+ REM 显示等待设备的消息
62
62
echo .
63
63
cho !waiting_device!
64
64
65
- REM 获取设备型号
65
+ REM 获取设备型号
66
66
for /f " tokens=2" %%a in ('fastboot getvar product 2^ > ^ &1^ |find " product" ') do (
67
67
set DeviceCode = %%a
68
68
)
69
- REM 获取设备的分区类型
69
+ REM 获取设备的分区类型
70
70
for /f " tokens=2" %%a in ('fastboot getvar slot-count 2^ > ^ &1^ |find " slot-count" ') do (
71
71
set DynamicPartitionType = %%a
72
72
)
73
- REM 根据设备的分区类型设置变量 DynamicPartitionType 的值
73
+ REM 根据设备的分区类型设置变量 DynamicPartitionType 的值
74
74
if " !DynamicPartitionType! " == " 2" (
75
75
set DynamicPartitionType = NonOnlyA
76
76
) else (
77
77
set DynamicPartitionType = OnlyA
78
78
)
79
- REM 获取设备的 Fastboot 状态
79
+ REM 获取设备的 Fastboot 状态
80
80
for /f " tokens=2" %%a in ('fastboot getvar is-userspace 2^ > ^ &1^ |find " is-userspace" ') do (
81
81
set FastbootState = %%a
82
82
)
83
- REM 根据设备的 Fastboot 状态设置变量 FastbootState 的值
83
+ REM 根据设备的 Fastboot 状态设置变量 FastbootState 的值
84
84
if " !FastbootState! " == " yes" (
85
85
set FastbootState = !fastbootd_mode!
86
86
) else (
@@ -144,7 +144,7 @@ goto HOME&pause
144
144
cls
145
145
echo .
146
146
147
- REM 对 vbmeta 分区文件专门刷入
147
+ REM 对 vbmeta 分区文件专门刷入
148
148
set " count = 0"
149
149
for /R " images\" %%i in (*.img) do (
150
150
echo %%~ni | findstr /B " vbmeta" > nul && (
@@ -162,7 +162,7 @@ if !count! gtr 0 (
162
162
echo .
163
163
)
164
164
165
- REM 遍历分区文件并刷入
165
+ REM 遍历分区文件并刷入
166
166
for /f " delims=" %%b in ('dir /b images\*.img ^ | findstr /v /i " super.img" ^ | findstr /v /i " preloader_raw.img" ^ | findstr /v /i " cust.img" ^ | findstr /v /i " recovery.img" ^ | findstr /v /i /b " vbmeta" ') do (
167
167
set " filename = %%~nb "
168
168
if " !DynamicPartitionType! " == " OnlyA" (
@@ -192,7 +192,7 @@ for /f "delims=" %%b in ('dir /b images\*.img ^| findstr /v /i "super.img" ^| fi
192
192
)
193
193
)
194
194
195
- REM MTK 机型专属
195
+ REM MTK 机型专属
196
196
if exist " images\preloader_raw.img" (
197
197
fastboot flash preloader_a " images\preloader_raw.img"
198
198
fastboot flash preloader_b " images\preloader_raw.img"
@@ -207,6 +207,7 @@ if exist images\cust.img (
207
207
)
208
208
209
209
if exist images\super.img (
210
+ fastboot erase super
210
211
fastboot flash super " images\super.img"
211
212
echo .
212
213
)
0 commit comments