This repository has been archived by the owner on Mar 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
qctools.bat
executable file
·2784 lines (2554 loc) · 83.8 KB
/
qctools.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
:<<cmd
:: begin_batch_script
@echo off
for %%v in (Daytona Cairo Hydra Neptune NT) do ^
ver | find "%%v" > nul && ^
if not errorlevel 1 set OLD_WIN=1
if %OLD_WIN%?==1? goto det_oldwinnt
if %OLD_WIN%?==0? setlocal enableextensions enabledelayedexpansion
for /f "tokens=4-7 delims=[.NT] " %%v in ('ver') do (
if /i "%%v.%%w"=="6.1" if /i %%x LSS 7601 set OLD_WIN=1
for %%a in (6.0 5.4 5.3 5.2 5.1 5.10 5.0 5.00) do (
if /i "%%v.%%w"=="%%a" set OLD_WIN=1
if /i "%%w.%%x"=="%%a" set OLD_WIN=1
)
)
if /i "%PROCESSOR_ARCHITECTURE%"=="X86" (
set ARCH=x86
set Programs=%ProgramFiles%
) else (
set ARCH=x64
set Programs=%ProgramFiles(x86)%
)
set ARGS=%*
set QUIET=^> nul 2^>^&1
set basedir=%~dp0
set basedir=%basedir:~0,-1%
set TMPDIR=%temp%\%~n0
set PyQt_script=%~dpn0.py
set cecho=%basedir%\data\cecho.exe
set downloadbinary=%basedir%\data\emmcdl.exe
set repos=https://github.com/thefirefox12537/qctools_tff
if %OLD_WIN%?==1? (
goto :det_oldwinnt
)
for /f "tokens=*" %%p in ('where /r "%basedir%" python.exe 2^> nul') do (
if exist "%%~p" set "python=%%~p" && goto :next
)
if /i "%python%"=="" (
echo Requirements: python
endlocal & exit /b
)
if not exist "%downloadbinary%" (
mkdir "%basedir%\data\sources" > nul 2>&1
mkdir "%basedir%\data\sources\emmcdl" > nul 2>&1
if not exist "%basedir%\data\sources\emmcdl" call "%python%" -c "^
import ssl, urllib.request; ^
from zipfile import ZipFile; ^
ssl._create_default_https_context = ssl._create_unverified_context; ^
urllib.request.urlretrieve('%repos%/raw/additional/data/sources/emmcdl.zip', '%TMPDIR%\emmcdl.zip'^); ^
with ZipFile('%TMPDIR%\emmcdl.zip', 'r'^) as source: ^
source.extractfile('%basedir%\data\sources\emmcdl\'^)"
del /q "%TMPDIR%\emmcdl.zip"
cd "%basedir%\data\sources\emmcdl"
for /f "tokens=*" %%v in ('where /r "%Programs%\Microsoft Visual Studio" VsDevCmd.bat 2^> nul') do set VS=%%~v
if not exist "!VS!" call "%python%" -c "^
import ctypes, sys; ^
import ssl, urllib.request; ^
from zipfile import ZipFile; ^
ssl._create_default_https_context = ssl._create_unverified_context; ^
urllib.request.urlretrieve('https://aka.ms/vs/17/release/vs_BuildTools.exe', '%TMPDIR%\buildtools.exe'^); ^
if not ctypes.windll.shell32.IsUserAnAdmin(^): ^
ctypes.windll.shell32.ShellExecuteW(None, 'runas', sys.executable, ^
'%TMPDIR%\buildtools.exe', ^
'--add Microsoft.VisualStudio.Workload.MSBuildTools --quiet', 1^)"
for /f "tokens=*" %%s in ('type "!VS!" ^| findstr /v /i "exit./B"') do (
echo %%s >> "%TMPDIR%\tmp_script.bat"
)
call "%TMPDIR%\tmp_script.bat" > nul 2>&1
del /q "%TMPDIR%\tmp_script.bat" > nul 2>&1
msbuild "%cd%\emmcdl.win32.sln" /p:platform=Win32 /p:configuration=Release > nul 2>&1
move /y emmcdl.exe "%basedir%\data" > nul 2>&1
if not exist "%downloadbinary%" goto :no_emmcdl
)
for %%a in ("%basedir%\data\adb.exe" "%basedir%\data\fastboot*.exe") do if not exist "%%~a" set NO_ADB=1
if defined NO_ADB (
mkdir "%basedir%\data" > nul 2>&1
call "%python%" -c "^
import ssl, urllib.request; from zipfile import ZipFile; ^
ssl._create_default_https_context = ssl._create_unverified_context; ^
urllib.request.urlretrieve('https://dl.google.com/android/repository/platform-tools_r28.0.1-windows.zip', '%TMPDIR%\platform-tools.zip'^); ^
with ZipFile('%TMPDIR%\platform-tools.zip', 'r'^) as source: ^
source.extractfile('%temp%\'^)"
del /q "%TMPDIR%\platform-tools.zip"
for %%a in (adb.exe AdbWinApi.dll AdbWinUsbApi.dll fastboot.exe) do (
move /y "%temp%\platform-tools\%%a" "%basedir%\data" > nul 2>&1
)
rd /s /q "%temp%\platform-tools" > nul 2>&1
if not exist "%basedir%\data\adb.exe" goto :no_adb
)
for /f %%c in ('copy /z "%~f0" nul') do set CR=%%c
cd "%basedir%"
if not defined ARGS (
if exist "%PyQt_script%" (
call "%python%" -u "%PyQt_script%"
endlocal
exit /b
) else (
goto :no_pyscript
)
)
for %%i in (%ARGS:^== %) do (
if "%%i"=="--list-available" goto :show_device_list
if "%%i"=="--version" goto :show_credits
for %%d in (--install-drivers -d) do if "%%i"=="%%d" goto :install_drivers
for %%h in (--help -h) do if "%%i"=="%%h" goto :show_usage
for %%m in (--method -M) do if "%%i"=="%%m" set METHOD_ARGS=1
for %%p in (--port -P) do if "%%i"=="%%p" set port_connect=1
for %%s in (--serial-adb -s) do if "%%i"=="%%s" set adb_connect=1
for %%v in (--verbose -v) do if "%%i"=="%%v" set QUIET=
for %%e in (--reboot-edl -E) do if "%%i"=="%%e" (
set METHOD=edl
set METHOD_FULL=Reboot to EDL mode
set REBOOT_EDL=1
)
if defined port_connect (
for /l %%c in (1,1,100) do if "%%i"=="COM%%c" set COMPORT=COM%%c
)
if defined adb_connect (
for /f "tokens=1 delims= " %%s in ('call "%basedir%\data\adb.exe" devices ^| findstr "device\>"') do if "%%i"=="%%s" set serial=%%s
for /f "tokens=1 delims= " %%s in ('call "%basedir%\data\adb.exe" devices ^| findstr "recovery\>"') do if "%%i"=="%%s" set serial=%%s
for /f "tokens=1 delims= " %%s in ('call "%basedir%\data\adb.exe" devices ^| findstr "sideload\>"') do if "%%i"=="%%s" set serial=%%s
for /f "tokens=1 delims= " %%s in ('call "%basedir%\data\fastboot.exe" devices ^| findstr "fastboot\>"') do if "%%i"=="%%s" set serial=%%s
)
for %%l in (
oppo_a33_cph2137 oppo_a53_cph2127 oppo_a53s_cph2139 oppo_a73_cph2099 oppo_a74_cph2219 oppo_a76_cph2375
oppo_a95_cph2365 oppo_f17_cph2095 oppo_f19_cph2219 oppo_f21pro_cph2219 oppo_reno4_oldsec_cph2113
oppo_reno4_newsec_cph2113 oppo_reno4pro_cph2109 oppo_reno5_cph2159 oppo_reno6_cph2235 oppo_reno7_cph2363
realme6pro_rmx2061 realme7i_rmx2103 realme7pro_rmx2170 realme8pro_rmx3091 realme9_rmx3521 realmec15_rmx2195
realmec17_rmx2101 vivo_iq00 vivo_y20_oldsec vivo_iq00_ui vivo_y20_oldsec vivo_y20_newsec vivo_y50t vivo_y53
vivo_y55 vivo_y65 vivo_y71 vivo_y91 vivo_y93 vivo_y95 vivo_v9 vivo_v9yth vivo_v11pro vivo_v20_newsec
vivo_v21e mi8ee_ursa mi8se_sirius mi8ud_equuleus mi9t_raphael mi10lite_toco mi11tpro_vili mia2_jasmine
mia2lite_daisy mimax2_chiron mimax3_nitrogen mimix_lithium mimix2s_polaris mimix3_perseus minote2_scorpio
minote3_jason mipad4_clover pocof1_beryllium pocom2pro_gramin pocom3_citrus redmi5a_riva redmi6pro_sakura
redmi7_onclite redmi9t_lime redmik20pro_raphael note5_whyred note5pro_whyred note5a_ugglite note6pro_tulip
note7_lavender note8_ginkgo note9s_curtana note9pro_joyeuse sm_a015f sm_a025f sm_a115a sm_a115f sm_a115u
sm_a705f sm_j415f sm_j610f sm_m025f sm_m115f
) do if "%%i"=="%%l" set DEVICE=%%l
if "%%i"=="userdata" if %METHOD_ARGS%!==1! (
set METHOD=userdata
set METHOD_FULL=Factory Reset
)
if "%%i"=="frp" if %METHOD_ARGS%!==1! (
set METHOD=frp
set METHOD_FULL=Erase FRP
)
if "%%i"=="efs" if %METHOD_ARGS%!==1! (
set METHOD=efs
set METHOD_FULL=Erase EFS IMEI
)
if "%%i"=="misc" if %METHOD_ARGS%!==1! (
set METHOD=misc
set METHOD_FULL=Safe format data
)
if "%%i"=="micloud" if %METHOD_ARGS%!==1! (
if not "%SHORT_BRAND%"=="xiaomi" (
echo This method only allowed for Xiaomi brands.
endlocal & exit /b
)
set METHOD=micloud
set METHOD_FULL=Erase MiCloud
)
if "%%i"=="unlock-bl" if %METHOD_ARGS%!==1! (
set METHOD=unlock-bl
set DO_METHOD=Unlocking
set do_method_fastboot=unlock
set METHOD_FULL=Unlock bootloader
set RUN_BL=1
)
if "%%i"=="relock-bl" if %METHOD_ARGS%!==1! (
set METHOD=relock-bl
set DO_METHOD=Locking
set do_method_fastboot=lock
set METHOD_FULL=Lock bootloader
set RUN_BL=1
)
if "%%i"=="help" if %METHOD_ARGS%!==1! goto :show_help_method
)
if defined DEVICE call :%DEVICE%
if not defined METHOD_ARGS goto :no_method
if not defined METHOD goto :no_options
if not defined NAME goto :no_device
call :caption
if %REBOOT_EDL%!==1! goto :reboot_edl
if %RUN_BL%!==1! goto :process_bootloader
call :execution
for %%r in (
%firehosefile% boot.xml patch.xml
patch_mod.xml partition.xml
) do ^
del /q "%TMPDIR%\%%r" > nul 2>&1
endlocal
exit /b
:: ######################################################################################################### ::
:: ############################################# MAIN EXECUTION ############################################ ::
:: ######################################################################################################### ::
:execution
if not defined COMPORT (
set /p "=[ * ] Searching port connected . . .!_CR!" < nul
for /f "tokens=2*" %%a in ('reg.exe query HKLM\HARDWARE\DEVICEMAP\SERIALCOMM /v \Device\*QCUSB* 2^> nul') do (
if "%%~b"=="" (goto :no_port) else (set COMPORT=%%~b)
)
"%cecho%" [ {0A}mOK{#} ] Searching port connected . . .
)
echo Port: %COMPORT%
call :get_hwid
call :get_partition
set "current_time=%DATE:~0,2%_%DATE:~3,2%_%DATE:~6,4%__%TIME:~0,2%_%TIME:~3,2%_%TIME:~6,2%"
set /p "=[ * ] Connecting to server . . .!_CR!" < nul
ping -n 3 google.com > nul 2>&1
if %ERRORLEVEL% EQU 0 (
"%cecho%" [ {0A}OK{#} ] Connecting to server . . .
set /p "=[ * ] Downloading from server . . .!_CR!" < nul
for %%s in (
"loader\%SHORT_BRAND%\%firehosefile%"
"xml\%SHORT_BRAND%-%METHOD%-patch.xml"
"xml\boot.xml" "xml\patch.xml"
) do if exist "%basedir%\data\%%~s" (
copy "%basedir%\data\%%~s" "%TMPDIR%\"
) else (
set "repofile=%%~s"
set "repofile=!repofile:\=/!"
call "%python%" -c "^
import ssl, urllib.request; from zipfile import ZipFile; ^
ssl._create_default_https_context = ssl._create_unverified_context; ^
urllib.request.urlretrieve('%repos%/raw/additional/data/!repofile!', '%TMPDIR%\%%~nxs'^)"
)
"%cecho%" [ {0A}OK{#} ] Downloading from server . . .
)
mkdir "%basedir%\data\backup" > nul 2>&1
set "firehose=%TMPDIR%\%firehosefile%"
set "ldr_auto=%basedir%\data\loader\auto"
set "backup_config=%basedir%\data\backup\%SHORT_BRAND%_%device%_%current_time%_config.bin"
set "backup_devinfo=%basedir%\data\backup\%SHORT_BRAND%_%device%_%current_time%_devinfo.bin"
set "backup_efs_fsg=%basedir%\data\backup\%SHORT_BRAND%_%device%_%current_time%_fsg"
set "backup_efs_modemst1=%basedir%\data\backup\%SHORT_BRAND%_%device%_%current_time%_modemst1.bin"
set "backup_efs_modemst2=%basedir%\data\backup\%SHORT_BRAND%_%device%_%current_time%_modemst2.bin"
set "backup_persist=%basedir%\data\backup\%SHORT_BRAND%_%device%_%current_time%_persist.img"
set "backup_persistbak=%basedir%\data\backup\%SHORT_BRAND%_%device%_%current_time%_persistbak.img"
set "backup_persistent=%basedir%\data\backup\%SHORT_BRAND%_%device%_%current_time%_persistent.img"
if /i "%METHOD%"=="userdata" (call :process_userdata) else ^
if /i "%METHOD%"=="frp" (
for %%a in (oppo realme vivo) do if "%SHORT_BRAND%"=="%%a" TMPVAR=1
if !TMPVAR!==1 (call :process_frp) else (call :process_config)
) else ^
if /i "%METHOD%"=="efs" (call :process_efs) else ^
if /i "%METHOD%"=="misc" (call :process_misc) else ^
if /i "%METHOD%"=="micloud" (call :process_micloud_xiaomi) else ^
if /i "%METHOD%"=="unlock-bl" (call :process_bootloader) else ^
if /i "%METHOD%"=="relock-bl" (call :process_bootloader)
if %ERROR_OPT% EQU 1 (pause & exit /b)
call :reboot_device
exit /b
:caption
echo.
echo Selected Model: %NAME%
echo Selected Brand: %BRAND%
echo Operation: %METHOD_FULL%
timeout /nobreak /t 5 > nul
exit /b
:get_hwid
set /p "=[ * ] Connecting to device . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -info > "%TMPDIR%\info.txt"
"%cecho%" [ {0A}OK{#} ] Connecting to device . . .
for /f "tokens=2 " %%x in ('findstr /i "SerialNumber" "%TMPDIR%\info.txt"') do set IDS_SN=%%x
for /f "tokens=2 " %%y in ('findstr /i "MSM_HW_ID" "%TMPDIR%\info.txt"') do set MSM_HW=%%y0000000000000000
for /f "tokens=2 delims=2 " %%z in ('findstr /i "OEM_PK_HASH" "%TMPDIR%\info.txt"') do set OEM_PK=%%z
set IDS_SN=%IDS_SN:~2,8%
set MSM_HW=%MSM_HW:~2,16%
set OEM_PK=%OEM_PK:~2,16%
"%cecho%" IDS SN: {0b}%IDS_SN%{0f}
"%cecho%" MSM HW: {0b}%MSM_HW%{0f}
"%cecho%" OEM PK: {0b}%OEM_PK%{0f}
echo.
set ResultLoader=%MSM_HW%_%OEM_PK%
if "%firehose%"=="" (
set /p "=[ * ] Configuring firehose . . .!_CR!" < nul
for /f "delims= " %%l in ('where /r %ldr_auto% %ResultLoader%*') do set firehose=%%l
)
if "%firehose%"=="" (
goto :err_loader
) else (
"%cecho%" [ {0A}OK{#} ] Configuring firehose . . .
)
exit /b
:err_loader
echo [ ERROR ] Firehose loader not available.
echo.
exit /b
:get_partition
set /p "=[ * ] Configuring device . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -gpt -memoryname %type% > "%TMPDIR%\partition.xml"
timeout /nobreak /t 1 > nul
"%cecho%" [ {0A}OK{#} ] Configuring device . . .
exit /b
:process_userdata
set /p "=[ * ] Erasing userdata . . .!_CR!" < nul
call "%downloadbinary%" -p "%COMPORT%" -f "%firehose%" -e userdata -memoryname "%type%" %QUIET%
"%cecho%" [ {0A}OK{#} ] Erasing userdata . . .
exit /b
:process_frp
set /p "=[ * ] Erasing FRP . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -e frp -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Erasing FRP . . .
exit /b
:process_misc
copy "%TMPDIR%\patch.xml" "%TMPDIR%\patch_mod.xml" > nul 2>&1
for /f "tokens=2 skip=1 delims=SECTOR_SIZE_IN_BYTES= " %%a in ('findstr /i "SECTOR_SIZE_IN_BYTES" "%TMPDIR%\partition.xml"') do ^
call "%python%" -c "^
import re; ^
with open('%TMPDIR%\patch_mod.xml', 'r+'^) as newfile: ^
text = newfile.read(^); ^
text = re.sub('(SECTOR_SIZE_IN_BYTES=^)".*?"(.*^>^)', r'\1"%%a"\2', text^); ^
newfile.seek(0^); ^
newfile.write(text^); ^
newfile.truncate(^)"
for /f "tokens=7 " %%b in ('findstr /i "misc" "%TMPDIR%\partition.xml"') do ^
call "%python%" -c "^
import re; ^
with open('%TMPDIR%\patch_mod.xml', 'r+'^) as newfile: ^
text = newfile.read(^); ^
text = re.sub('(start_sector=^)".*?"(.*^>^)', r'\1"%%b"\2', text^); ^
newfile.seek(0^); ^
newfile.write(text^); ^
newfile.truncate(^)"
set /p "=[ * ] Erasing userdata . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -x "%TMPDIR%\patch_mod.xml" -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Erasing userdata . . .
exit /b
:process_config
if /i "%SHORT_BRAND%"=="samsung" (set TMPVAR=persistent) else (set TMPVAR=config)
set /p "=[ * ] Backing up %TMPVAR% . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -d %TMPVAR% "%backup_config%" -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Backing up %TMPVAR% . . .
set /p "=[ * ] Erasing FRP . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -e %TMPVAR% -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Erasing FRP . . .
exit /b
:process_micloud_xiaomi
set /p "=[ * ] Backing up persist . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -d persist "%backup_persist%" -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Backing up persist . . .
set /p "=[ * ] Backing up persistbak . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -d persistbak "%backup_persistbak%" -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Backing up persistbak . . .
set /p "=[ * ] Erasing MiCloud . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -e persist -memoryname %type% %QUIET%
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -e persistbak -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Erasing MiCloud . . .
exit /b
:process_efs
set /p "=[ * ] Backing up EFS IMEI . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -d fsg "%backup_efs_fsg%" -memoryname %type% %QUIET%
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -d modemst1 "%backup_efs_modemst1%" -memoryname %type% %QUIET%
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -d modemst2 "%backup_efs_modemst2%" -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Backing up EFS IMEI . . .
set /p "=[ * ] Erasing EFS IMEI . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -e fsg -memoryname %type% %QUIET%
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -e modemst1 -memoryname %type% %QUIET%
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -e modemst2 -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Erasing EFS IMEI . . .
exit /b
:process_bootloader
if %RUN_BL% EQU 1 (
set command=%do_method_fastboot%
set /p "=[ * ] %DO_METHOD% bootloader . . .!_CR!" < nul
call "%basedir%\data\fastboot_%SHORT_BRAND%.exe" oem %command% %QUIET% || ^
call "%basedir%\data\fastboot_%SHORT_BRAND%.exe" flashing %command% %QUIET% || ^
call "%basedir%\data\fastboot.exe" oem %command% %QUIET% || ^
call "%basedir%\data\fastboot.exe" flashing %command% %QUIET%
"%cecho%" [ {0A}OK{#} ] %DO_METHOD% bootloader . . .
) else (
copy "%TMPDIR%\%SHORT_BRAND%-%METHOD%-patch.xml" "%TMPDIR%\patch_mod.xml" > nul 2>&1
for /f "tokens=2 skip=1 delims=SECTOR_SIZE_IN_BYTES= " %%a in ('findstr /i "SECTOR_SIZE_IN_BYTES" "%TMPDIR%\partition.xml"') do ^
call "%python%" -c "^
import re; ^
with open('%TMPDIR%\patch_mod.xml', 'r+'^) as newfile: ^
text = newfile.read(^); ^
text = re.sub('(SECTOR_SIZE_IN_BYTES=^)".*?"(.*^>^)', r'\1"%%a"\2', text^); ^
newfile.seek(0^); ^
newfile.write(text^); ^
newfile.truncate(^)"
for /f "tokens=7 " %%b in ('findstr /i "devinfo" "%TMPDIR%\partition.xml"') do ^
call "%python%" -c "^
import re; ^
with open('%TMPDIR%\patch_mod.xml', 'r+'^) as newfile: ^
text = newfile.read(^); ^
text = re.sub('(start_sector=^)".*?"(.*^>^)', r'\1"%%b"\2', text^); ^
newfile.seek(0^); ^
newfile.write(text^); ^
newfile.truncate(^)"
set /p "=[ * ] Backing up devinfo . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -d devinfo "%backup_devinfo%" -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Backing up devinfo . . .
set /p "=[ * ] %DO_METHOD% bootloader . . .!_CR!" < nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -x "%TMPDIR%\patch_mod.xml" -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] %DO_METHOD% bootloader . . .
)
exit /b
:reboot_device
set /p "=[ * ] Rebooting device . . .!_CR!" < nul
timeout /nobreak /t 3 > nul
call "%downloadbinary%" -p %COMPORT% -f "%firehose%" -x "%TMPDIR%\boot.xml" -memoryname %type% %QUIET%
"%cecho%" [ {0A}OK{#} ] Rebooting device . . .
pause
exit /b
:reboot_edl
set /p "=[ * ] Rebooting device to EDL mode . . .!_CR!" < nul
timeout /nobreak /t 10 > nul
call "%basedir%\data\fastboot_%SHORT_BRAND%.exe" oem edl %QUIET% || ^
call "%basedir%\data\fastboot_%SHORT_BRAND%.exe" reboot-edl %QUIET% || ^
call "%basedir%\data\fastboot.exe" oem edl %QUIET% || ^
call "%basedir%\data\fastboot.exe" reboot-edl %QUIET%
"%cecho%" [ {0A}OK{#} ] Rebooting device to EDL mode . . .
pause
exit /b
:install_drivers
echo Checking drivers installed . . .
where /r "%SystemRoot%\system32\DriverStore\FileRepository" qcser.inf > nul 2>&1 && ^
set "ALREADY=1" || (
mkdir "%basedir%\data\drivers" > nul 2>&1
mkdir "%basedir%\data\drivers\qcser" > nul 2>&1
echo Installing Qualcomm HS-USB QLoader driver . . .
if not exist "%basedir%\data\drivers\qcser" call "%python%" -c "^
import ctypes, sys; ^
import ssl, urllib.request; from zipfile import ZipFile; ^
ssl._create_default_https_context = ssl._create_unverified_context; ^
urllib.request.urlretrieve('%repos%/raw/additional/data/drivers/qcser.zip', '%TMPDIR%\qcser.zip'^); ^
with ZipFile('%TMPDIR%\qcser.zip', 'r'^) as source: ^
source.extractfile('%basedir%\data\drivers\qcser\'^); ^
if not ctypes.windll.shell32.IsUserAnAdmin(^): ^
ctypes.windll.shell32.ShellExecuteW(None, 'runas', sys.executable, ^
'pnputil.exe', ^
'-i -a "%basedir%\data\drivers\qcser\%ARCH%\qcser.inf"', 1^)"
del /q "%TMPDIR%\qcser.zip" > nul 2>&1
)
where /r "%SystemRoot%\system32\DriverStore\FileRepository" android_winusb.inf > nul 2>&1 && ^
set "ALREADY=1" || (
mkdir "%basedir%\data\drivers" > nul 2>&1
mkdir "%basedir%\data\drivers\adb_usb" > nul 2>&1
echo Installing Android Debug Bridge USB driver . . .
if not exist "%basedir%\data\drivers\adb_usb" call "%python%" -c "^
import ctypes, sys; ^
import ssl, urllib.request; from zipfile import ZipFile; ^
ssl._create_default_https_context = ssl._create_unverified_context; ^
urllib.request.urlretrieve('%repos%/raw/additional/data/drivers/adb_usb.zip', '%TMPDIR%\adb_usb.zip'^); ^
with ZipFile('%TMPDIR%\adb_usb.zip', 'r'^) as source: ^
source.extractfile('%basedir%\data\drivers\adb_usb\'^); ^
if not ctypes.windll.shell32.IsUserAnAdmin(^): ^
ctypes.windll.shell32.ShellExecuteW(None, 'runas', sys.executable, ^
'pnputil.exe', ^
'-i -a "%basedir%\data\drivers\adb_usb\android_winusb.inf"', 1^)"
del /q "%TMPDIR%\adb_usb.zip" > nul 2>&1
)
if defined ALEADY (
echo Drivers already installed.
)
exit /b
:: ######################################################################################################### ::
:: ############################################### MESSAGES ################################################ ::
:: ######################################################################################################### ::
:show_usage
echo USAGE: %~n0 ^<device^> [OPTION]...
echo.
echo -E, --reboot-edl reboot device in EDL mode
echo -h, --help show help usage
echo -M, --method=^<METHOD^> choose what do you execute
echo -P, --port=^<PORT^> set port connection
echo -s, --serial-adb=^<sn^> set ADB serial number connection
echo -v, --verbose explain what is being done
echo --version show script file version and credits
echo.
echo To see device list, type %~n0 --list-available
endlocal
exit /b
:show_help_method
echo Do erase or reset partition:
echo userdata
echo frp
echo efs
echo misc
echo micloud
echo unlock-bl
echo relock-bl
endlocal
exit /b
:show_credits
echo TFF/QC Tools for Windows
echo Unlock and flash the Android phone devices.
echo Version report: 1.0 revision 3
echo.
echo This script developed by Faizal Hamzah [The Firefox Flasher].
echo Licensed under the MIT License.
echo.
echo Credits:
echo nijel8 Developer of emmcdl
echo bkerler Developer of Qualcomm Firehose Attacker
echo Hari Sulteng Owner of Qualcomm GSM Sulteng
echo Hadi Khoirudin Software engineer
endlocal
exit /b
:show_device_list
echo Devices list available in this tools:
echo.
echo Oppo:
echo oppo_a33_cph2137 Oppo A33
echo oppo_a53_cph2127 Oppo A53
echo oppo_a53s_cph2139 Oppo A53S
echo oppo_a73_cph2099 Oppo A73
echo oppo_a74_cph2219 Oppo A74
echo oppo_a76_cph2375 Oppo A76
echo oppo_a95_cph2365 Oppo A95
echo oppo_f17_cph2095 Oppo F17
echo oppo_f19_cph2219 Oppo F19
echo oppo_f21pro_cph2219 Oppo F21 Pro
echo oppo_reno4_oldsec_cph2113 Oppo Reno4
echo oppo_reno4_newsec_cph2113 Oppo Reno4
echo oppo_reno4pro_cph2109 Oppo Reno4 Pro
echo oppo_reno5_cph2159 Oppo Reno5
echo oppo_reno6_cph2235 Oppo Reno6
echo oppo_reno7_cph2363 Oppo Reno7
echo.
echo Realme:
echo realme6pro_rmx2061 Realme 6 Pro
echo realme7i_rmx2103 Realme 7i
echo realme7pro_rmx2170 Realme 7 Pro
echo realme8pro_rmx3091 Realme 8 Pro
echo realme9_rmx3521 Realme 9
echo realmec15_rmx2195 Realme C15
echo realmec17_rmx2101 Realme C17
echo.
echo Vivo:
echo vivo_iq00 Vivo IQ00 UI
echo vivo_y20_oldsec Vivo Y20
echo vivo_y20_newsec Vivo Y20
echo vivo_y50t Vivo Y50T
echo vivo_y53 Vivo Y53
echo vivo_y55 Vivo Y55/L
echo vivo_y65 Vivo Y65
echo vivo_y71 Vivo Y71
echo vivo_y91 Vivo Y91/i
echo vivo_y93 Vivo Y93
echo vivo_y95 Vivo Y95
echo vivo_v9 Vivo V9
echo vivo_v9yth Vivo V9 Youth
echo vivo_v11pro Vivo V11 Pro
echo vivo_v20_newsec Vivo V20
echo vivo_v21e Vivo V21E
echo.
echo Xiaomi / Poco:
echo mi8ee_ursa Xiaomi Mi 8 EE
echo mi8se_sirius Xiaomi Mi 8 SE
echo mi8ud_equuleus Xiaomi Mi 8 UD
echo mi9t_raphael Xiaomi Mi 9T
echo mi10lite_toco Xiaomi Mi 10 Lite
echo mi11tpro_vili Xiaomi 11T Pro
echo mia2_jasmine Xiaomi Mi A2
echo mia2lite_daisy Xiaomi Mi A2 Lite
echo mimax2_chiron Xiaomi Mi Max 2
echo mimax3_nitrogen Xiaomi Mi Max 3
echo mimix_lithium Xiaomi Mi Mix
echo mimix2s_polaris Xiaomi Mi Mix 2s
echo mimix3_perseus Xiaomi Mi Mix 3
echo minote2_scorpio Xiaomi Mi Note 2
echo minote3_jason Xiaomi Mi Note 3
echo mipad4_clover Xiaomi Mi Pad 4
echo pocof1_beryllium Xiaomi Pocophone F1
echo pocom2pro_gramin Xiaomi Pocophone M2 Pro
echo pocom3_citrus Xiaomi Pocophone M3
echo redmi5a_riva Xiaomi Redmi 5A
echo redmi6pro_sakura Xiaomi Redmi 6 Pro
echo redmi7_onclite Xiaomi Redmi 7
echo redmi9t_lime Xiaomi Redmi 9T
echo redmik20pro_raphael Xiaomi Redmi K20 Pro
echo note5_whyred Xiaomi Redmi Note 5
echo note5pro_whyred Xiaomi Redmi Note 5 Pro
echo note5a_ugglite Xiaomi Redmi Note 5a
echo note6pro_tulip Xiaomi Redmi Note 6 Pro
echo note7_lavender Xiaomi Redmi Note 7
echo note8_ginkgo Xiaomi Redmi Note 8
echo note9s_curtana Xiaomi Redmi Note 9S
echo note9pro_joyeuse Xiaomi Redmi Note 9 Pro
echo.
echo Samsung:
echo sm_a015f Samsung Galaxy A01
echo sm_a025f Samsung Galaxy A02s
echo sm_a115a Samsung Galaxy A11
echo sm_a115f Samsung Galaxy A11
echo sm_a115u Samsung Galaxy A11
echo sm_a705f Samsung Galaxy A70
echo sm_j415f Samsung Galaxy J4 Plus
echo sm_j610f Samsung Galaxy J6 Plus
echo sm_m025f Samsung Galaxy M02s
echo sm_m115f Samsung Galaxy M11
endlocal
exit /b
:no_pyscript
echo This is development release. Coming soon: GUI window.
endlocal
exit /b
:no_emmcdl
echo emmcdl is not found.
endlocal
exit /b
:no_adb
echo platform-tools is not found.
endlocal
exit /b
:no_method
echo Invalid switch parameter.
endlocal
exit /b
:no_options
echo No option inserted.
endlocal
exit /b
:no_device
echo Device is not availabled.
endlocal
exit /b
:no_port
echo.& echo Error: Qualcomm HS-USB port not detected.
echo.& pause
endlocal
exit /b
:no_powershell
echo This script requires Windows Management Framework (PowerShell^).
endlocal
exit /b
:det_oldpwsh
echo This script requires at least .NET Framework version 4.5 and Windows Management Framework version 4.0.
endlocal
exit /b
:det_oldwinnt
echo This script requires Windows 7 Service Pack 1 or latest.
endlocal
exit /b
:: ######################################################################################################### ::
:: ###################################### DEVICE LIST SET VARIABLE ######################################### ::
:: ######################################################################################################### ::
:: ############################################# START OPPO ################################################ ::
:oppo_a33_cph2137
set NAME=Oppo A33 (CPH-2137^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_a33_cph2137
set firehosefile=prog_firehose_ddr_Oppo_A33_A53_A53s.elf
set type=emmc
exit /b
:oppo_a53_cph2127
set NAME=Oppo A53 (CPH-2127^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_a53_cph2127
set firehosefile=prog_firehose_ddr_Oppo_A33_A53_A53s.elf
set type=ufs
exit /b
:oppo_a53s_cph2139
set NAME=Oppo A53s (CPH-2139^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_a53s_cph2139
set firehosefile=prog_firehose_ddr_Oppo_A33_A53_A53s.elf
set type=emmc
exit /b
:oppo_a73_cph2099
set NAME=Oppo A73 (CPH-2099^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_a73_cph2099
set firehosefile=prog_firehose_ddr_OppoReno7CPH2363_OppoA73CPH2099_OppoA74CPH2119_OppoA76CPH2375_OppoA95CPH2365_OppoF17CPH2095_OppoF19CPH2219_OppoF21PRO.elf
set type=ufs
exit /b
:oppo_a74_cph2219
set NAME=Oppo A74 (CPH-2219^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_a74_cph2219
set firehosefile=prog_firehose_ddr_OppoReno7CPH2363_OppoA73CPH2099_OppoA74CPH2119_OppoA76CPH2375_OppoA95CPH2365_OppoF17CPH2095_OppoF19CPH2219_OppoF21PRO.elf
set type=ufs
exit /b
:oppo_a76_cph2375
set NAME=Oppo A76 (CPH-2375^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_a76_cph2375
set firehosefile=prog_firehose_ddr_OppoReno7CPH2363_OppoA73CPH2099_OppoA74CPH2119_OppoA76CPH2375_OppoA95CPH2365_OppoF17CPH2095_OppoF19CPH2219_OppoF21PRO.elf
set type=ufs
exit /b
:oppo_a95_cph2365
set NAME=Oppo A95 (CPH-2365^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_a95_cph2365
set firehosefile=prog_firehose_ddr_OppoReno7CPH2363_OppoA73CPH2099_OppoA74CPH2119_OppoA76CPH2375_OppoA95CPH2365_OppoF17CPH2095_OppoF19CPH2219_OppoF21PRO.elf
set type=ufs
exit /b
:oppo_f17_cph2095
set NAME=Oppo F17 (CPH-2095^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_f17_cph2095
set firehosefile=prog_firehose_ddr_OppoReno7CPH2363_OppoA73CPH2099_OppoA74CPH2119_OppoA76CPH2375_OppoA95CPH2365_OppoF17CPH2095_OppoF19CPH2219_OppoF21PRO.elf
set type=ufs
exit /b
:oppo_f19_cph2219
set NAME=Oppo F19 (CPH-2219^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_f19_cph2219
set firehosefile=prog_firehose_ddr_OppoReno7CPH2363_OppoA73CPH2099_OppoA74CPH2119_OppoA76CPH2375_OppoA95CPH2365_OppoF17CPH2095_OppoF19CPH2219_OppoF21PRO.elf
set type=ufs
exit /b
:oppo_f21pro_cph2219
set NAME=Oppo F21 Pro (CPH-2219^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_f21pro_cph2219
set firehosefile=prog_firehose_ddr_OppoReno7CPH2363_OppoA73CPH2099_OppoA74CPH2119_OppoA76CPH2375_OppoA95CPH2365_OppoF17CPH2095_OppoF19CPH2219_OppoF21PRO.elf
set type=ufs
exit /b
:oppo_reno4_oldsec_cph2113
set NAME=Oppo Reno4 [Old security] (CPH-2113^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_reno4_cph2113
set firehosefile=prog_firehose_ddr_OppoReno4OldSec2019.mbn
set type=ufs
exit /b
:oppo_reno4_newsec_cph2113
set NAME=Oppo Reno4 [New security] (CPH-2113^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_reno4_cph2113
set firehosefile=prog_firehose_ddr_Oppo_Reno4NewSec2021CPH2113_Reno4ProCPH2109_Reno5CPH2159_Reno4G_Reno6CPH2235.elf
type=ufs
exit /b
:oppo_reno4pro_cph2109
set NAME=Oppo Reno4 Pro (CPH-2109^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_reno4pro_cph2109
set firehosefile=prog_firehose_ddr_Oppo_Reno4NewSec2021CPH2113_Reno4ProCPH2109_Reno5CPH2159_Reno4G_Reno6CPH2235.elf
set type=ufs
exit /b
:oppo_reno5_cph2159
set NAME=Oppo Reno5 (CPH-2159^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_reno5_cph2159
set firehosefile=prog_firehose_ddr_Oppo_Reno4NewSec2021CPH2113_Reno4ProCPH2109_Reno5CPH2159_Reno4G_Reno6CPH2235.elf
set type=ufs
exit /b
:oppo_reno6_cph2235
set NAME=Oppo Reno6 (CPH-2235^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_reno6_cph2235
set firehosefile=prog_firehose_ddr_Oppo_Reno4NewSec2021CPH2113_Reno4ProCPH2109_Reno5CPH2159_Reno4G_Reno6CPH2235.elf
set type=ufs
exit /b
:oppo_reno7_cph2363
set NAME=Oppo Reno7 (CPH-2363^)
set BRAND=Oppo/Realme
set SHORT_BRAND=oppo
set DEVICE=oppo_reno7_cph2363
set firehosefile=prog_firehose_ddr_OppoReno7CPH2363_OppoA73CPH2099_OppoA74CPH2119_OppoA76CPH2375_OppoA95CPH2365_OppoF17CPH2095_OppoF19CPH2219_OppoF21PRO.elf
set type=ufs
exit /b
:: ############################################## END OPPO ################################################# ::
:: ############################################ START REALME ############################################### ::
:realme6pro_rmx2061
set NAME=Realme 6 Pro (RMX-2061^)
set BRAND=Oppo/Realme
set SHORT_BRAND=realme
set DEVICE=realme6pro_rmx2061
set firehosefile=prog_firehose_ddr_Realme6Pro_Realme7Pro_Realme8Pro.elf
set type=ufs
exit /b
:realme7i_rmx2103
set NAME=Realme 7i (RMX-2103^)
set BRAND=Oppo/Realme
set SHORT_BRAND=realme
set DEVICE=realme7i_rmx2103
set firehosefile=prog_firehose_ddr_Realme7iRMX2103_Realme9RMX3521.elf
set type=ufs
exit /b
:realme7pro_rmx2170
set NAME=Realme 7 Pro (RMX-2170^)
set BRAND=Oppo/Realme
set SHORT_BRAND=realme
set DEVICE=realme7pro_rmx2170
set firehosefile=prog_firehose_ddr_Realme6Pro_Realme7Pro_Realme8Pro.elf
set type=ufs
exit /b
:realme8pro_rmx3091
set NAME=Realme 8 Pro (RMX-3091^)
set BRAND=Oppo/Realme
set SHORT_BRAND=realme
set DEVICE=realme8pro_rmx3091
set firehosefile=prog_firehose_ddr_Realme6Pro_Realme7Pro_Realme8Pro.elf
set type=ufs
exit /b
:realme9_rmx3521
set NAME=Realme 9 (RMX-3521^)
set BRAND=Oppo/Realme
set SHORT_BRAND=realme
set DEVICE=realme9_rmx3521
set firehosefile=prog_firehose_ddr_Realme6Pro_Realme7Pro_Realme8Pro.elf
set type=ufs
exit /b
:realmec15_rmx2195
set NAME=Realme C15 (RMX-2195^)
set BRAND=Oppo/Realme
set SHORT_BRAND=realme
set DEVICE=realmec15_rmx2195
set firehosefile=prog_firehose_ddr_RealmeC15RMX2195_RealmeC17_RMX2101.elf
set type=emmc
exit /b
:realmec17_rmx2101
set NAME=Realme C17 (RMX-2101^)
set BRAND=Oppo/Realme
set SHORT_BRAND=realme
set DEVICE=realmec17_rmx2101
set firehosefile=prog_firehose_ddr_RealmeC15RMX2195_RealmeC17_RMX2101.elf
set type=ufs
exit /b
:: ############################################# END REALME ################################################ ::
:: ############################################# START VIVO ################################################ ::
:vivo_iq00
set NAME=Vivo IQ00 UI
set BRAND=Vivo
set SHORT_BRAND=vivo
set DEVICE=vivo_iq00
set firehosefile=prog_firehose_ddr_vivo_IQOOU1_Y20_Y50T_V20.elf
set type=ufs
exit /b
:vivo_y20_oldsec
set NAME=Vivo Y20 [Old security]
set BRAND=Vivo
set SHORT_BRAND=vivo
set DEVICE=vivo_y20
set firehosefile=prog_firehose_ddr_vivo_Y20_Y20i_Y20s.elf
set type=emmc
exit /b
:vivo_y20_newsec
set NAME=Vivo Y20 [New security]
set BRAND=Vivo
set SHORT_BRAND=vivo
set DEVICE=vivo_y20
set firehosefile=prog_firehose_ddr_vivo_IQOOU1_Y20_Y50T_V20.elf
set type=emmc
exit /b
:vivo_y50t
set NAME=Vivo Y50T
set BRAND=Vivo
set SHORT_BRAND=vivo
set DEVICE=vivo_y50t
set firehosefile=prog_firehose_ddr_vivo_IQOOU1_Y20_Y50T_V20.elf
set type=ufs
exit /b
:vivo_y53
set NAME=Vivo Y53
set BRAND=Vivo
set SHORT_BRAND=vivo
set DEVICE=vivo_y53
set firehosefile=prog_firehose_8917_ddr_vivo_y53_y53l.mbn
set type=emmc
exit /b
:vivo_y55
set NAME=Vivo Y55/L
set BRAND=Vivo
set SHORT_BRAND=vivo
set DEVICE=vivo_y55
set firehosefile=prog_emmc_firehose_8937_y91_y93_y95_v11.mbn
set type=emmc
exit /b
:vivo_y65
set NAME=Vivo Y65
set BRAND=Vivo
set SHORT_BRAND=vivo
set DEVICE=vivo_y65
set firehosefile=prog_firehose_8917_ddr_vivo_y65.mbn
set type=emmc
exit /b
:vivo_y71
set NAME=Vivo Y71
set BRAND=Vivo
set SHORT_BRAND=vivo
set DEVICE=vivo_y71
set firehosefile=prog_firehose_8917_ddr_vivo_y71.mbn
set type=emmc
exit /b
:vivo_y91
set NAME=Vivo Y91/i