diff --git a/Client/OSTRemote_Client/Localization/0409.cmd b/Client/OSTRemote_Client/Localization/0409.cmd index 5f0734b..5e449ba 100644 --- a/Client/OSTRemote_Client/Localization/0409.cmd +++ b/Client/OSTRemote_Client/Localization/0409.cmd @@ -11,7 +11,7 @@ set h0006= -n [nb0_file], --nb0file=[nb0_file] : Specify the path of nb0 format set h0007= -e, --erase-user-data : Erase user data during flashing procedure. set h0008a= -s [skuid], --skuid=[skuid] : Change SKUID to desired value. Leave empty in set h0008b= SKUID value for automatic SKUID definition. -set h0009= -f, --erase-frp : Erase FRP and bbox during flashing procedure. +set h0009= -f, --erase-frp : Erase FRP during flashing procedure. set h0010a= -o, --override : Skip flashing security check. NOT RECOMMENDED set h0010b= for inexperienced end-users. set h0011= -t [otp_code], --token=[otp_code] : Specify OTP code given by HCTSW Care. @@ -25,20 +25,24 @@ set h0015b= service bootloader, -e, -s an set h0016= -D, --disable-fac-mode : Disable Factory Bar Code mode. set h0017a= -H, --halt : Power off the phone. if specified with firmware set h0017b= flashing, it will power off the phone after procedure. -set h0018a= -i1 [imei1], --imei1=[imei1] : Change IMEI1 to desired value. You must specify the -set h0018b= path of firmware file to use it. -set h0019a= -i2 [imei2], --imei2=[imei2] : Change IMEI2 to desired value. You must specify the -set h0020a= -m [meid], --meid=[meid] : Change MEID to desired value. You must specify the -set h0021a= -w [wlan_mac], --wlan=[wlan_mac] : Change WLAN MAC to desired value. You must specify the -set h0022a= -b [bt_addr], --bluetooth=[bt_addr] : Change Bluetooth Address to desired value. You must -set h0022b= specify the path of firmware file to use it. +set h0018a= -c, --no-checksum : The md4 and md5 partition will not be flashed during flash +set h0018b= with this parameter enabled. +set h0019a= -y, --stay : Stay at Fastboot Mode after flash. Phone will not be rebooted. +set h0019b= -H parameter will not function with this parameter enabled. +set h0020a= -u, --unlock-bootloader : Unlock the bootloader with given firmware. +set h0021a= -afu, --anti-force-update : Inject anti-force update code into firmware. Firmwares that +set h0021b= push updates via Google are unsupported. +set h0022= -F, --ftm : Enter FTM mode. +set h0023= -q [qlz_file], --qlzfile=[qlz_file] : Specify the path of QLZ format firmware file used by NOST. +set h0024= -k, --keep-firmware : When using nb0 or QLZ firmware file, keep unpacked firmware. +set hf0001= set ex0001=Examples: set ex0002a=Flash DRG-415C-0-00WW-B01.mlf into the phone: set ex0002b=-m C:\path\to\FIHSW_DRG-415C-0-00WW-B01\DRG-415C-0-00WW-B01.mlf -e -s 600WW set ex0003a=Flash E2M-0390-0-00WW-B02.nb0 into the phone with unlocked bootloader: set ex0003b=-n C:\path\to\E2M-0390-0-00WW-B02.nb0 -e -S -set ex0004a=Erase FRP and format userdata under service bootloader: -set ex0004b=-a -e -f +set ex0004a=Flash T-virus-20201108.qlz into the phone with unlocked bootloader: +set ex0004b=-q C:\path\to\t-virus-20201108.qlz -e -S set ex0005a=Flash HH6-350D-0-00A0-B01.mlf into the phone and power it off: set ex0005b=-m C:\path\to\FIHSW_HH6-350D-0-00A0-B01\HH6-350D-0-00A0-B01.mlf -e -H set override_notice=If you'd like to take your own risk, please add -o or --override parameter to skip safety check, or this tool will not work. @@ -105,6 +109,27 @@ set t0058=ERROR: Outdated Fastboot Binary in environment variable detected. Dele set t0059=You have requested FRP erase during flash, for that we need you to acknowledge something. set t0060=Erasing FRP... set t0061=Authentication Only Mode +set t0062=Emergency Download Mode +set t0063=Sending firehose... +set t0064=Writing rawprogram... +set t0065=Writing patch... +set t0066=Rebooting phone... +set t0067=ERROR: Cannot find any Qualcomm EDL Port. +set t0068=EDL Port is +set t0069=ERROR: This firmware is only meant for MediaTek model. Please use SP Flash Tool to operate manually. +set t0070=ERROR: An error has occurred during flash. Please do judgement from the failure reason given above. +set t0071=Current Battery Capacity is +set t0072=ERROR: Battery capacity might be insufficient for flashing. +set t0073=ERROR: You cannot skip authentication procedure for bootloader unlock. +set t0074=ERROR: Python 3 is not installed on this PC. +set t0075=HCTSW Care does not recommend you to utilize nb0 firmware. Initializing firmware file... +set t0076=HCTSW Care does not recommend you to utilize QLZ firmware. Initializing firmware file... +set t0077=HMDSW DEVICE DETECTED, PLEASE USE CODENAME "DK2" +set t0078=ERROR: HMDSW Device is unsupported by this tool. +set t0079a=No parameters defined. Please execute +set t0079b=-h" to show usage. +set t0080a=ERROR: Emergency Download failed. Please read +set t0080b=for troubleshooting. set yes=Yes set no=No set z0001=========== PLEASE COPY CONTENT BELOW TO HCTSW CARE ========== diff --git a/Client/OSTRemote_Client/auth_utility/autoskuid.cmd b/Client/OSTRemote_Client/auth_utility/autoskuid.cmd index 724363e..51d9c8c 100644 --- a/Client/OSTRemote_Client/auth_utility/autoskuid.cmd +++ b/Client/OSTRemote_Client/auth_utility/autoskuid.cmd @@ -1,5 +1,9 @@ @echo off +::Override_Enabled_read_FVER +if "%override%"=="1" goto overridereadfver + +:defines ::Rules ::Brand0 @@ -38,6 +42,7 @@ if "%fver:~0,3%"=="CTL" set sku_brand=6 if "%fver:~0,3%"=="TAS" set sku_brand=6 if "%fver:~0,3%"=="NB1" set sku_brand=6 if "%fver:~0,3%"=="A1N" set sku_brand=6 +if "%fver:~0,3%"=="PNX" set sku_brand=6 if "%fver:~0,3%"=="AOP" set sku_brand=6 ::Carrier @@ -69,4 +74,16 @@ if "%fver:~0,3%"=="EAG" set sku_locales=US if "%fver:~0,3%"=="RHD" set sku_locales=US if "%fver:~0,3%"=="HH6" set sku_locales=KR -set targetskuid=%sku_brand%%sku_carrier%%sku_locales% \ No newline at end of file +set targetskuid=%sku_brand%%sku_carrier%%sku_locales% +goto eof + +:overridereadfver +if exist "%fwfilepath%systeminfo.img" set fverfile="%fwfilepath%systeminfo.img" +if exist "%fwfilepath%fver" set fverfile="%fwfilepath%fver" +findstr MLF %fverfile% > %temp%\fver.txt +set /p fver= < %temp%\fver.txt +del %temp%\fver.txt +set fver=%fver:~4,19% +goto defines + +:eof \ No newline at end of file diff --git a/Client/OSTRemote_Client/auth_utility/call_auth.cmd b/Client/OSTRemote_Client/auth_utility/call_auth.cmd index 4b7d088..667df95 100644 --- a/Client/OSTRemote_Client/auth_utility/call_auth.cmd +++ b/Client/OSTRemote_Client/auth_utility/call_auth.cmd @@ -1,7 +1,33 @@ echo. echo %t0055% echo. -if "%auth_only%"=="1" goto authonly_mode +:authonly_mode +fb2 oem alive 2>nul + +:Workaround for MTK devices +:Need to wait few seconds to ensure USB traffic become stable +if "%psn:~0,3%"=="NE1" set mtkdev=1 +if "%psn:~0,3%"=="FRT" set mtkdev=1 +if "%psn:~0,3%"=="ES2" set mtkdev=1 +if "%psn:~0,3%"=="CO2" set mtkdev=1 +if "%psn:~0,3%"=="PDA" set mtkdev=1 +if "%psn:~0,3%"=="ROO" set mtkdev=1 +if "%psn:~0,3%"=="ANT" set mtkdev=1 +if "%psn:~0,3%"=="012" set mtkdev=1 +if "%mtkdev%"=="1" timeout /t 2 /nobreak > nul + +fb2 oem getBootloaderType 2>&1 | findstr getBootloaderType | findstr /V FAILED > %temp%\bldrtype.txt +set /p bldrtype=<%temp%\bldrtype.txt +For /f "tokens=1* delims= " %%A in ( %temp%\bldrtype.txt ) Do set bldrtype=%%B +del %temp%\bldrtype.txt +fb2 oem getSecurityVersion 2>&1 | findstr getSecurityVersion | findstr /V FAILED > %temp%\secver.txt +For /f "tokens=1* delims= " %%A in ( %temp%\secver.txt ) Do set secver=%%B +del %temp%\secver.txt + +:sec1 +fb2 oem getProjectCode 2>&1 | findstr FAILED > nul +if "%errorlevel%"=="0" set secver=0001 + :returnX if %bldrtype%==commercial if %secver%==0001 call sec1-verity.cmd if %bldrtype%==commercial if %secver%==0004 call sec4-veracity.cmd @@ -11,14 +37,4 @@ if %bldrtype%==service if %secver%==0004 call sec4-encuid.cmd if %bldrtype%==service if %secver%==0008 call sec8-encuid.cmd goto eof -:authonly_mode -fb2 oem getBootloaderType 2>&1 | findstr getBootloaderType > %temp%\bldrtype.txt -set /p bldrtype=<%temp%\bldrtype.txt -For /f "tokens=1* delims= " %%A in ( %temp%\bldrtype.txt ) Do set bldrtype=%%B -del %temp%\bldrtype.txt -fb2 oem getSecurityVersion 2>&1 | findstr getSecurityVersion > %temp%\secver.txt -For /f "tokens=1* delims= " %%A in ( %temp%\secver.txt ) Do set secver=%%B -del %temp%\secver.txt -goto returnX - :eof \ No newline at end of file diff --git a/Client/OSTRemote_Client/auth_utility/fbdirect.cmd b/Client/OSTRemote_Client/auth_utility/fbdirect.cmd index 7820ba9..15da568 100644 --- a/Client/OSTRemote_Client/auth_utility/fbdirect.cmd +++ b/Client/OSTRemote_Client/auth_utility/fbdirect.cmd @@ -4,7 +4,9 @@ echo. fastboot !target! echo. if "!target:~0,6!"=="reboot" timeout /t 5 /nobreak +fb2 oem alive 2>nul ) else ( fastboot !target! 2>nul if "!target:~0,6!"=="reboot" timeout /t 5 /nobreak >nul -) \ No newline at end of file +fb2 oem alive 2>nul +) diff --git a/Client/OSTRemote_Client/auth_utility/fberase.cmd b/Client/OSTRemote_Client/auth_utility/fberase.cmd index d9d0803..9854465 100644 --- a/Client/OSTRemote_Client/auth_utility/fberase.cmd +++ b/Client/OSTRemote_Client/auth_utility/fberase.cmd @@ -1,3 +1,10 @@ +if "%service_auth%"=="0" goto skipauth +:precaution_for_mtk_device +fb2 oem getBootloaderType 2>&1 | findstr service > nul +if "%errorlevel%"=="0" fb2 oem getRootStatus 2>&1 | findstr Disable > nul +if "%errorlevel%"=="0" call call_auth.cmd +:skipauth + echo %t0038% "fastboot erase !target!"... if %verbose_mode%==1 ( echo. diff --git a/Client/OSTRemote_Client/auth_utility/fbflash.cmd b/Client/OSTRemote_Client/auth_utility/fbflash.cmd index e6835be..e8b1965 100644 --- a/Client/OSTRemote_Client/auth_utility/fbflash.cmd +++ b/Client/OSTRemote_Client/auth_utility/fbflash.cmd @@ -1,8 +1,17 @@ +if "%service_auth%"=="0" goto skipauth +:precaution_for_mtk_device +fb2 oem getBootloaderType 2>&1 | findstr service > nul +if "%errorlevel%"=="0" fb2 oem getRootStatus 2>&1 | findstr Disable > nul +if "%errorlevel%"=="0" call call_auth.cmd +:skipauth + if "!target:~0,3!"=="md4" ( +if "%resultverify%"=="0" goto eof echo %t0049% goto noechox ) if "!target:~0,3!"=="md5" ( +if "%resultverify%"=="0" goto eof echo %t0049% goto noechox ) @@ -10,6 +19,11 @@ echo %t0038% "fastboot flash !target!"... :noechox if %verbose_mode%==1 ( echo. +if "%msm8937value%"=="1" ( +if "!target:~0,6!"=="system" ( +fastboot erase !target! +) +) fastboot flash !target! if "!errorlevel!"=="1" ( set errorflash=1 @@ -18,10 +32,15 @@ goto eof ) echo. ) else ( +if "%msm8937value%"=="1" ( +if "!target:~0,6!"=="system" ( +fastboot erase !target! 2>nul +) +) fastboot flash !target! 2>&1 | findstr FAILED if "!errorlevel!"=="0" ( set errorflash=1 -echo errorflash>%temp%\eflash.txt +echo errorflash>%temp%\eflash2.txt goto eof ) ) diff --git a/Client/OSTRemote_Client/auth_utility/fbformat.cmd b/Client/OSTRemote_Client/auth_utility/fbformat.cmd index 0b08b99..ea8b553 100644 --- a/Client/OSTRemote_Client/auth_utility/fbformat.cmd +++ b/Client/OSTRemote_Client/auth_utility/fbformat.cmd @@ -1,3 +1,22 @@ +if "%service_auth%"=="0" goto skipauth +:precaution_for_mtk_device +fb2 oem getBootloaderType 2>&1 | findstr service > nul +if "%errorlevel%"=="0" fb2 oem getRootStatus 2>&1 | findstr Disable > nul +if "%errorlevel%"=="0" call call_auth.cmd +:skipauth + +if "!target:~0,8!"=="userdata" ( +echo %t0038% "fastboot -w"... +if %verbose_mode%==1 ( +echo. +fastboot -w +echo. +) else ( +fastboot -w 1>nul 2>nul +) +goto eof +) + echo %t0038% "fastboot format !target!"... if %verbose_mode%==1 ( echo. @@ -5,4 +24,6 @@ fastboot format !target! echo. ) else ( fastboot format !target! 1>nul 2>nul -) \ No newline at end of file +) + +:eof \ No newline at end of file diff --git a/Client/OSTRemote_Client/auth_utility/hmdsw_check.cmd b/Client/OSTRemote_Client/auth_utility/hmdsw_check.cmd new file mode 100644 index 0000000..2e982f3 --- /dev/null +++ b/Client/OSTRemote_Client/auth_utility/hmdsw_check.cmd @@ -0,0 +1,7 @@ +fb2 oem getsecurityversion 2>&1 | findstr FAILED > nul +if not %errorlevel%==0 ( +echo === %t0077% === +echo. +echo hmdsw > %temp%\hmdsw_flag +) +:eof diff --git a/Client/OSTRemote_Client/auth_utility/mlf-parser.cmd b/Client/OSTRemote_Client/auth_utility/mlf-parser.cmd index c1335fa..de9ac75 100644 --- a/Client/OSTRemote_Client/auth_utility/mlf-parser.cmd +++ b/Client/OSTRemote_Client/auth_utility/mlf-parser.cmd @@ -2,9 +2,13 @@ setlocal enabledelayedexpansion set errorflash=0 set PATH=%PATH%;%~dp0\bin -findstr "^OPTION" "%mlffile%" | sed "s/OPTION = //g" > %temp%\1.txt -findstr "^BOOT_NAME" "%mlffile%" | sed "s/BOOT_NAME = //g" > %temp%\2.txt -findstr "^IMAGE_FILE" "%mlffile%" | sed "s/IMAGE_FILE = //g" > %temp%\3.txt +echo %fwfilepath%| sed "s/ /\" \"/g" > %temp%\spacepath.txt +set /p quotefwfp=<%temp%\spacepath.txt +if "%nb0mode%"=="1" set mlffile=%quotefwfp%%mlffile% +if "%qlzmode%"=="1" set mlffile=%quotefwfp%%mlffile% +findstr "^OPTION" %mlffile% | sed "s/OPTION = //g" > %temp%\1.txt +findstr "^BOOT_NAME" %mlffile% | sed "s/BOOT_NAME = //g" > %temp%\2.txt +findstr "^IMAGE_FILE" %mlffile% | sed "s/IMAGE_FILE = //g" > %temp%\3.txt awk "NR==FNR{a[NR]=$0;nr=NR;}NR>FNR{print a[NR-nr]\",\"$0}" %temp%\1.txt %temp%\2.txt > %temp%\2x.txt awk "NR==FNR{a[NR]=$0;nr=NR;}NR>FNR{print a[NR-nr]\" \"$0}" %temp%\2x.txt %temp%\3.txt > %temp%\3x.txt sed -i "s/\"//g" %temp%\3x.txt @@ -18,11 +22,32 @@ findstr zip %temp%\5.txt > %temp%\servicebootloaderzip.txt del %temp%\5.txt if exist %temp%\extractedsbl.txt del %temp%\extractedsbl.txt for /f "tokens=1* delims= " %%i in ( %temp%\servicebootloaderzip.txt ) do zipinfo -1 "%fwfilepath%%%i" >> %temp%\extractedsbl.txt -for /f "tokens=1* delims= " %%i in ( %temp%\servicebootloaderzip.txt ) do unzip -q -P WLBGFIH123 -o "%fwfilepath%%%i" -d %fwfilepath% +for /f "tokens=1* delims= " %%i in ( %temp%\servicebootloaderzip.txt ) do unzip -q -P WLBGFIH123 -o "%fwfilepath%%%i" -d %quotefwfp% if exist %temp%\replacement.txt del %temp%\replacement.txt awk "NR==FNR{a[NR]=$0;nr=NR;}NR>FNR{print a[NR-nr]\",\"$0}" %temp%\servicebootloaderzip.txt %temp%\extractedsbl.txt | sed "s/ ,/\//g" > %temp%\replacement.txt -for /f %%i in ( %temp%\replacement.txt ) do bin\sed -i "s/%%i/g" %temp%\servicebootloader.txt -for /f %%i in ( %temp%\replacement.txt ) do bin\sed -i "s/%%i/g" %temp%\regular.txt +for /f %%i in ( %temp%\replacement.txt ) do sed -i "s/%%i/g" %temp%\servicebootloader.txt +:workaround_for_msm8937_device +if "%msm8937value%"=="1" ( +findstr /V abootbak %temp%\servicebootloader.txt > %temp%\sbl2.txt +del %temp%\servicebootloader.txt +>nul move %temp%\sbl2.txt %temp%\servicebootloader.txt +) +for /f %%i in ( %temp%\replacement.txt ) do sed -i "s/%%i/g" %temp%\regular.txt +if "%afu%"=="1" ( +>%temp%\99.txt set /p=99nul dd if=%temp%\99.txt of=%quotefwfp%\systeminfo_b99.img bs=1 seek=21 +sed -i "s/systeminfo.img/systeminfo_b99.img/g" %temp%\regular.txt +del %temp%\99.txt +) +if exist %quotefwfp%\fver ( +copy %quotefwfp%\fver %quotefwfp%\fver +2>nul dd if=%temp%\99.txt of=%quotefwfp%\fver bs=1 seek=21 +sed -i "s/fver/fver_b99/g" %temp%\regular.txt +del %temp%\99.txt +) +) del %temp%\servicebootloaderzip.txt del %temp%\replacement.txt del %temp%\extractedsbl.txt @@ -39,7 +64,7 @@ del %temp%\bldrtype.txt fb2 oem getSecurityVersion 2>&1 | findstr getSecurityVersion > %temp%\secver.txt For /f "tokens=1* delims= " %%A in ( %temp%\secver.txt ) Do set secver=%%B del %temp%\secver.txt -cd /d %fwfilepath% +cd /d "%fwfilepath%" if %bldrtype%==service goto directflash if "%service_auth%"=="1" call call_auth.cmd for /f "tokens=1* delims=," %%a in ( %temp%\servicebootloader.txt ) do ( @@ -55,6 +80,7 @@ echo. ) else ( fastboot reboot-bootloader 2>nul ) +fb2 oem alive 2>nul timeout /t 2 /nobreak > nul echo %t0040% fb2 oem getBootloaderType 2>&1 | findstr getBootloaderType > %temp%\bldrtype.txt @@ -70,12 +96,12 @@ echo ,>>%temp%\regular.txt for /f "tokens=1* delims=," %%a in ( %temp%\regular.txt ) do ( if "!errorflash!"=="1" goto eof set target=%%b -if %%a==0x1000000000000000 if %service_auth%==1 call fbdirect.cmd +if %%a==0x1000000000000000 call fbdirect.cmd if %%a==0x1000000000000004 if %service_auth%==1 call call_auth.cmd if %%a==0x1000000000000044 if %service_auth%==1 call call_auth.cmd if %%a==0x2 call fbflash.cmd if %%a==0x4 call fberase.cmd -if %%a==0x40 call fberase.cmd +if %%a==0x40 call fbflash.cmd if %%a==0x1000 call fbflash.cmd if %%a==0x40000 call fbflash.cmd if %%a==0x4000 ( @@ -88,11 +114,14 @@ call fbflash.cmd ) ) if %%a==0x8 if %erase%==1 ( +if "%msm8937value%"=="1" ( +call fberase.cmd +) else ( if "!target:~0,8!"=="userdata" ( call fbformat.cmd ) else ( call fberase.cmd -) ) +) ) ) if %%a==0x100000 call fbflash.cmd if %%a==0x200000 call fbflash.cmd if %%a==0x400000 call fbflash.cmd diff --git a/Client/OSTRemote_Client/auth_utility/nb0-parser.cmd b/Client/OSTRemote_Client/auth_utility/nb0-parser.cmd new file mode 100644 index 0000000..138d0d6 --- /dev/null +++ b/Client/OSTRemote_Client/auth_utility/nb0-parser.cmd @@ -0,0 +1,30 @@ +@echo off +setlocal enabledelayedexpansion +set errorparse=0 +python --version | findstr 3. > nul +if not %errorlevel%==0 goto error_python_not_installed +cd /d "%fwfilepath%" +if exist nb0out rd /s /q nb0out +mkdir nb0out +cd nb0out +SET fwfile="%fwfile%" +SET fwfile=%fwfile:"=% +echo %fwfile%| sed "s/ /\" \"/g" > %temp%\spacepath.txt +set /p quotefwfile=<%temp%\spacepath.txt +echo. +echo %t0075% +echo. +if "%verbose_mode%"=="0" ( +nb0-unpack.py %quotefwfile% > nul +) else ( +nb0-unpack.py %quotefwfile% +) +dir /b *.mlf > %temp%\mlffile.txt +goto eof + +:error_python_not_installed +echo no > %temp%\nopython +echo. +goto eof + +:eof \ No newline at end of file diff --git a/Client/OSTRemote_Client/auth_utility/pretest.cmd b/Client/OSTRemote_Client/auth_utility/pretest.cmd index e72978f..031e8e6 100644 --- a/Client/OSTRemote_Client/auth_utility/pretest.cmd +++ b/Client/OSTRemote_Client/auth_utility/pretest.cmd @@ -1,15 +1,16 @@ - echo. if %pretest%==1 echo %t0002% -echo %t0003% -fastboot oem alive 2>nul +if %edl_mode%==0 echo %t0003% fastboot oem alive 2>nul for /f %%i in ( 'fb2 devices' ) do set psn=%%i echo. call auth_utility\prototype_check.cmd +call auth_utility\hmdsw_check.cmd echo. %t0004%!psn! -fb2 oem getProjectCode 2>&1 | findstr getProjectCode | sed "s/getProjectCode: / %t0006%/g" -fb2 oem getSecurityVersion 2>&1 | findstr getSecurityVersion | sed "s/getSecurityVersion: / %t0007%/g" +fb2 oem getProjectCode 2>&1 | findstr getProjectCode | sed "s/getProjectCode: / %t0006%/g" | findstr /V FAILED +fb2 oem getprojectcode 2>&1 | findstr bootloader | sed "s/(bootloader) / %t0006%/g" | findstr /V FAILED +fb2 oem getSecurityVersion 2>&1 | findstr getSecurityVersion | sed "s/getSecurityVersion: / %t0007%/g" | findstr /V FAILED +fb2 oem getsecurityversion 2>&1 | findstr bootloader | sed "s/(bootloader) / %t0007%/g" | findstr /V FAILED fb2 oem getBrandCode 2>&1 | findstr /V FAILED | findstr getBrandCode | sed "s/getBrandCode: / %t0026%/g" if %localized_value%==1 ( fb2 oem getversions 2>&1 | findstr bootloader | sed "s/(bootloader) //g"| sed "s/^model=/ %t0008%/g" | sed "s/^sub_model=/ %t0009%/g" | sed "s/^software version=/ %t0010%/g" | sed "s/^SW model=/ %t0011%/g" | sed "s/^build number=/ %t0012%/g" | sed "s/^hardware version=/ %t0013%/g" | sed "s/^RF band id=/ %t0014%/g" | sed "s/^chip version=/ %t0015%/g" | sed "s/^MCP info=/ %t0016%/g" | sed "s/^MCP version=/ %t0016%/g" | sed "s/^EMMC version=/ %t0017%/g" | sed "s/^UFS version=/ %t0018%/g" | sed "s/none/ %znone%/g" @@ -17,13 +18,20 @@ fb2 oem getversions 2>&1 | findstr bootloader | sed "s/(bootloader) //g"| sed "s fb2 oem getversions 2>&1 | findstr bootloader | sed "s/(bootloader) //g"| sed "s/=/: /g" ) fb2 getvar secure 2>&1 | findstr secure | sed "s/secure: / %t0019%/g" | sed "s/no/ %no%/g" | sed "s/yes/ %yes%/g" -fb2 getvar current-slot 2>&1 | findstr current-slot | sed "s/current-slot: / %t0020%/g" +fb2 getvar current-slot 2>&1 | findstr current-slot | sed "s/current-slot: / %t0020%/g" | findstr /V FAILED fb2 getvar unlocked 2>&1 | findstr unlocked | sed "s/unlocked: / %t0021%/g" | sed "s/yes/ %yes%/g" | sed "s/no/ %no%/g" if %localized_value%==1 ( fb2 oem device-info 2>&1 | findstr /V panel | findstr bootloader | sed "s/\t//g" | sed "s/(bootloader) //g" | sed "s/^Device tampered: / %t0022%/g" | sed "s/^Device unlocked: / %t0023%/g" | sed "s/^Device critical unlocked: / %t0024%/g" | sed "s/^Charger screen enabled: / %t0025%/g" | sed "s/^Verity mode: / %t0027%/g" | sed "s/true/ %ztrue%/g" | sed "s/false/ %zfalse%/g" ) else ( fb2 oem device-info 2>&1 | findstr /V panel | findstr bootloader | sed "s/\t//g" | sed "s/(bootloader) //g" ) +if "%psn:~0,2%"=="D1" set msm8937value=1 +if "%psn:~0,2%"=="D10" set msm8937value=0 +if "%psn:~0,3%"=="E1M" set msm8937value=1 +if "%psn:~0,3%"=="E2M" set msm8937value=1 +if "%psn:~0,3%"=="EVW" set msm8937value=1 +if "%psn:~0,3%"=="VN3" set msm8937value=1 +if "%psn:~0,3%"=="PLE" set msm8937value=1 echo. if %pretest%==1 echo %t0028% if %pretest%==1 choice /C RHS /M "%ms0001%" /N @@ -34,4 +42,4 @@ echo %t0029% if %errorlevel%==2 ( fb2 oem HALT 2>nul echo %t0030% -) \ No newline at end of file +) diff --git a/Client/OSTRemote_Client/auth_utility/qlz-parser.cmd b/Client/OSTRemote_Client/auth_utility/qlz-parser.cmd new file mode 100644 index 0000000..5bc70b6 --- /dev/null +++ b/Client/OSTRemote_Client/auth_utility/qlz-parser.cmd @@ -0,0 +1,23 @@ +@echo off +setlocal enabledelayedexpansion +set errorparse=0 +cd /d "%fwfilepath%" +if exist qlzout rd /s /q qlzout +mkdir qlzout +cd qlzout +SET fwfile="%fwfile%" +SET fwfile=%fwfile:"=% +echo %fwfile%| sed "s/ /\" \"/g" > %temp%\spacepath.txt +set /p quotefwfile=<%temp%\spacepath.txt +echo. +echo %t0076% +echo. +if "%verbose_mode%"=="0" ( +exdupe -R %quotefwfile% . 2>nul +) else ( +exdupe -R %quotefwfile% . +) +dir /b *.mlf > %temp%\mlffile.txt +goto eof + +:eof \ No newline at end of file diff --git a/Client/OSTRemote_Client/auth_utility/safety_check.cmd b/Client/OSTRemote_Client/auth_utility/safety_check.cmd index b7cab2d..f8c1124 100644 --- a/Client/OSTRemote_Client/auth_utility/safety_check.cmd +++ b/Client/OSTRemote_Client/auth_utility/safety_check.cmd @@ -1,15 +1,23 @@ @echo off +set fverfile=unspecified fb2 oem getversions 2>&1 | findstr software > %temp%\swver.txt for /f "tokens=1* delims==" %%i in ( %temp%\swver.txt ) do set cswver=%%j del "%temp%\swver.txt" if exist "%fwfilepath%systeminfo.img" set fverfile="%fwfilepath%systeminfo.img" -if exist "%fwfilepath%fver" set fverfile="%fwfilepath%fver" else goto insecure_nosysteminfo -findstr MLF %fverfile% > %temp%\fver.txt +if exist "%fwfilepath%fver" set fverfile="%fwfilepath%fver" +SET fverfile="%fverfile%" +SET fverfile=%fverfile:"=% +if "%fverfile%"=="unspecified" goto insecure_nosysteminfo +) +findstr MLF "%fverfile%" > %temp%\fver.txt set /p fver= < %temp%\fver.txt del %temp%\fver.txt set fver=%fver:~4,19% ::General Rules +fb2 oem battery getcapacity 2>&1 | findstr Cap > %temp%\bcap.txt +for /f "tokens=1* delims==" %%i in ( %temp%\bcap.txt ) do set cbatterycap=%%j +echo %t0071% %cbatterycap% ::Project Code Mismatch if not "%fver:~0,3%"=="%cswver:~0,3%" goto insecure_prjcodemismatch ::MTK Insecure Downgrade @@ -35,7 +43,9 @@ if "%fver:~0,3%"=="ANT" if "%cswver:~4,1%"==0 ( if "%fver:~4,1%" gtr "%cswver:~4 if "%fver:~0,3%"=="PNX" if "%cswver:~4,1%" geq "4" if "%fver:~4,1%"=="1" goto insecure_pnxdowngrade ::Insecure Downgrade if "%erase%"=="0" if "%cswver:~4,3%" gtr "%fver:~4,3%" goto insecure_downgrade - +::BatteryCheck +echo. +if %cbatterycap% lss 41 goto insecure_lowbattery ::Safety Passed echo %t0031% set insecure=0 @@ -79,4 +89,10 @@ echo %override_notice% set insecure=1 goto eof +:insecure_lowbattery +echo %t0072% +echo %override_notice% +set insecure=1 +goto eof + :eof \ No newline at end of file diff --git a/Client/OSTRemote_Client/auth_utility/sec1-verity.cmd b/Client/OSTRemote_Client/auth_utility/sec1-verity.cmd index 067de52..2ae0524 100644 --- a/Client/OSTRemote_Client/auth_utility/sec1-verity.cmd +++ b/Client/OSTRemote_Client/auth_utility/sec1-verity.cmd @@ -1,5 +1,5 @@ -md5 -l -d%sn%>%temp%\md5.txt +md5 -l -d%psn%>%temp%\md5.txt set /p md5=<%temp%\md5.txt del %temp%\md5.txt fb2 oem dm-verity %md5% 2>nul -echo Service Permission Granted. \ No newline at end of file +echo %t0053% \ No newline at end of file diff --git a/Client/OSTRemote_Client/auth_utility/sec8-encuid.cmd b/Client/OSTRemote_Client/auth_utility/sec8-encuid.cmd index fdc8316..3806d55 100644 --- a/Client/OSTRemote_Client/auth_utility/sec8-encuid.cmd +++ b/Client/OSTRemote_Client/auth_utility/sec8-encuid.cmd @@ -1,7 +1,7 @@ :retry_sec8u echo %z0001% echo %t0007%%secver% -echo %t0004%%sn% +echo %t0004%%psn% :Defining Project Code fb2 oem getProjectCode 2>&1 | findstr getProjectCode > %temp%\prjcode.txt @@ -24,7 +24,7 @@ echo %z0002% echo. :Input_Encoding_MSG -if exist %temp%\encuid_sec8-%brandcode%-%prjcode%-%sn%-%uid%.bin ( +if exist %temp%\encuid_sec8-%brandcode%-%prjcode%-%psn%-%uid%.bin ( echo %t0054% goto reuse ) @@ -33,16 +33,16 @@ set /p challenge=%z0003% if not defined challenge goto Input_Encoding_MSG echo %challenge% > %temp%\rawbase64.txt set challenge=pass ->nul certutil -f -decode %temp%\rawbase64.txt %temp%\encuid_sec8-%brandcode%-%prjcode%-%sn%-%uid%.bin +>nul certutil -f -decode %temp%\rawbase64.txt %temp%\encuid_sec8-%brandcode%-%prjcode%-%psn%-%uid%.bin del %temp%\rawbase64.txt :reuse -fb2 flash encUID %temp%\encuid_sec8-%brandcode%-%prjcode%-%sn%-%uid%.bin 2>&1 | findstr FAILED > nul +fb2 flash encUID %temp%\encuid_sec8-%brandcode%-%prjcode%-%psn%-%uid%.bin 2>&1 | findstr FAILED > nul fb2 oem selectKey service 2>nul fb2 oem doKeyVerify 2>&1 | findstr FAILED > nul if %errorlevel%==0 ( echo %t0043% pause>nul -del %temp%\encuid_sec8-%brandcode%-%prjcode%-%sn%-%uid%.bin +del %temp%\encuid_sec8-%brandcode%-%prjcode%-%psn%-%uid%.bin goto retry_sec8u ) fb2 oem allport 2>nul diff --git a/Client/OSTRemote_Client/auth_utility/sec8-veracity.cmd b/Client/OSTRemote_Client/auth_utility/sec8-veracity.cmd index 7ce8548..41f7650 100644 --- a/Client/OSTRemote_Client/auth_utility/sec8-veracity.cmd +++ b/Client/OSTRemote_Client/auth_utility/sec8-veracity.cmd @@ -1,7 +1,7 @@ :retry_sec8v echo %z0001% echo %t0007%%secver% -echo %t0004%%sn% +echo %t0004%%psn% :Defining Project Code fb2 oem getProjectCode 2>&1 | findstr getProjectCode > %temp%\prjcode.txt @@ -29,15 +29,15 @@ set /p challenge=%z0003% if not defined challenge goto Input_Encoding_MSG echo %challenge% > %temp%\rawbase64.txt set challenge=pass ->nul certutil -f -decode %temp%\rawbase64.txt %temp%\veracity_sec8-%brandcode%-%prjcode%-%sn%-%veracity%.bin -del rawbase64.txt -fb2 flash veracity %temp%\veracity_sec8-%brandcode%-%prjcode%-%sn%-%veracity%.bin 2>&1 | findstr FAILED > nul +>nul certutil -f -decode %temp%\rawbase64.txt %temp%\veracity_sec8-%brandcode%-%prjcode%-%psn%-%veracity%.bin +del %temp%\rawbase64.txt +fb2 flash veracity %temp%\veracity_sec8-%brandcode%-%prjcode%-%psn%-%veracity%.bin 2>&1 | findstr FAILED > nul if %errorlevel%==0 ( echo %t0043% pause>nul goto retry_sec8v ) -del %temp%\veracity_sec8-%brandcode%-%prjcode%-%sn%-%veracity%.bin +del %temp%\veracity_sec8-%brandcode%-%prjcode%-%psn%-%veracity%.bin echo %t0053% goto EOF diff --git a/Client/OSTRemote_Client/auth_utility/ubl.cmd b/Client/OSTRemote_Client/auth_utility/ubl.cmd new file mode 100644 index 0000000..0940541 --- /dev/null +++ b/Client/OSTRemote_Client/auth_utility/ubl.cmd @@ -0,0 +1,165 @@ +setlocal enabledelayedexpansion +set normallock=1 +set criticallock=1 +set lockcnt=9 +set dtype=unknown +::BootloaderUnlockJudgement +findstr "lk" %temp%\servicebootloader.txt > nul +if %errorlevel%==0 set dtype=mtk +findstr "xbl" %temp%\servicebootloader.txt > nul +if %errorlevel%==0 set dtype=sdm660 +findstr "xbl gpt_both1" %temp%\regular.txt > nul +if %errorlevel%==0 set dtype=sdm835 +findstr "aboot" %temp%\servicebootloader.txt > nul +if %errorlevel%==0 set dtype=msm8937 +findstr "aboot_a" %temp%\servicebootloader.txt > nul +if %errorlevel%==0 set dtype=msm8937us +findstr "xbl_config" %temp%\servicebootloader.txt > nul +if %errorlevel%==0 set dtype=sdm845 + +if "%dtype%"=="unknown" goto error_unknown +if "%dtype%"=="sdm845" goto error_unsupported_pnx +if "%dtype%"=="mtk" goto unlockscheme_mtk +if "%dtype%"=="sdm660" goto unlockscheme_sdm660-835 +if "%dtype%"=="sdm835" goto unlockscheme_sdm660-835 +if "%dtype%"=="msm8937" goto unlockscheme_msm8937 +if "%dtype%"=="msm8937us" goto unlockscheme_msm8937us + +if not "%dtype%"=="mtk" ( +fastboot oem device-info 2>%temp%\unlockstate.txt +findstr /C:"Device unlocked" %temp%\unlockstate.txt|>nul findstr false +if %errorlevel%==1 set normallock=0 +findstr /C:"Device critical unlocked" %temp%\unlockstate.txt|>nul findstr false +if %errorlevel%==1 set criticallock=0 +>nul set /a lockcnt=!normallock!+!criticallock! +) + +:unlockscheme_mtk +if "%verbose_mode%"=="1" ( +call :MTKFlashingUnlock_Verbose +) else ( +call :MTKFlashingUnlock +) +goto eof + +:unlockscheme_sdm660-835 +if "%verbose_mode%"=="1" ( +call :MTKFlashingUnlock_Verbose +) else ( +call :MTKFlashingUnlock +) +goto eof + + + +:CriticalUnlock_Verbose +fastboot oem fih on +fastboot oem devlock allow_unlock +fastboot flashing unlock_critical +if not %errorlevel%==0 goto unlock-go +if not "%dtype%"=="msm8937" echo %t0009% +if not "%dtype%"=="msm8937" echo %t0010% +:loop1_fcuv +devcon_%osarch% find USB* | findstr %sn% > nul +if %errorlevel%==0 goto loop1_fcuv +echo %t0011% +goto :eof + +:UnlockGo_Verbose +fastboot oem fih on +fastboot oem devlock allow_unlock +fastboot oem unlock-go +if not %errorlevel%==0 goto unlocked +if not "%dtype%"=="msm8937" echo %t0009% +if not "%dtype%"=="msm8937" echo %t0010% +:loop2_ugov +devcon_%osarch% find USB* | findstr %sn% > nul +if %errorlevel%==0 goto loop2_ugov +echo %t0012% +pause>nul +goto :eof + +:FlashingUnlock_Verbose +fastboot oem fih on +fastboot oem devlock allow_unlock +fastboot flashing unlock +if not %errorlevel%==0 goto unlocked +if not "%dtype%"=="msm8937" echo %t0009% +if not "%dtype%"=="msm8937" echo %t0010% +:loop2_funv +devcon_%osarch% find USB* | findstr %sn% > nul +if %errorlevel%==0 goto loop2_funv +echo %t0012% +pause>nul +goto :eof + +:MTKFlashingUnlock_Verbose +fastboot oem fih on +fastboot oem devlock allow_unlock +echo %t0009% +echo %t0010% +fastboot flashing unlock +if not %errorlevel%==0 goto unlocked +:loop2_funv +devcon_%osarch% find USB* | findstr %sn% > nul +if %errorlevel%==0 goto loop2_funv +echo %t0012% +pause>nul +goto :eof + +:CriticalUnlock +fastboot oem fih on 2>nul +fastboot oem devlock allow_unlock 2>nul +fastboot flashing unlock_critical 2>nul +if not %errorlevel%==0 goto unlock-go +if not "%dtype%"=="msm8937" echo %t0009% +if not "%dtype%"=="msm8937" echo %t0010% +:loop1_fcuv +devcon_%osarch% find USB* | findstr %sn% > nul +if %errorlevel%==0 goto loop1_fcuv +echo %t0011% +goto :eof + +:UnlockGo +fastboot oem fih on 2>nul +fastboot oem devlock allow_unlock 2>nul +fastboot oem unlock-go 2>nul +if not %errorlevel%==0 goto unlocked +if not "%dtype%"=="msm8937" echo %t0009% +if not "%dtype%"=="msm8937" echo %t0010% +:loop2_ugov +devcon_%osarch% find USB* | findstr %sn% > nul +if %errorlevel%==0 goto loop2_ugov +echo %t0012% +pause>nul +goto :eof + +:FlashingUnlock +fastboot oem fih on 2>nul +fastboot oem devlock allow_unlock 2>nul +fastboot flashing unlock 2>nul +if not %errorlevel%==0 goto unlocked +if not "%dtype%"=="msm8937" echo %t0009% +if not "%dtype%"=="msm8937" echo %t0010% +:loop2_funv +devcon_%osarch% find USB* | findstr %sn% > nul +if %errorlevel%==0 goto loop2_funv +echo %t0012% +pause>nul +goto :eof + +:MTKFlashingUnlock +fastboot oem fih on 2>nul +fastboot oem devlock allow_unlock 2>nul +echo %t0009% +echo %t0010% +fastboot flashing unlock 2>nul +if not %errorlevel%==0 goto unlocked +:loop2_funv +devcon_%osarch% find USB* | findstr %sn% > nul +if %errorlevel%==0 goto loop2_funv +echo %t0012% +pause>nul +goto :eof + +:eof \ No newline at end of file diff --git a/Client/OSTRemote_Client/ostremote.cmd b/Client/OSTRemote_Client/ostremote.cmd index 4e1a33e..a3be4e8 100644 --- a/Client/OSTRemote_Client/ostremote.cmd +++ b/Client/OSTRemote_Client/ostremote.cmd @@ -1,8 +1,8 @@ @echo off setlocal enabledelayedexpansion -set PATH=%PATH%;%~dp0bin;%~dp0auth_utility +set PATH=%PATH%;%~dp0bin;%~dp0auth_utility;%~dp0qti_edl_utility set targetskuid= -set ver=V0.0.0.3a.Windows +set ver=V0.0.0.3l.Windows set verbose_mode=0 set erase=0 set edl_mode=0 @@ -17,9 +17,17 @@ set disable_fac_mode=0 set device_halt=0 set paramcount=1 set nb0mode=0 +set qlzmode=0 set mlffile=0 +set skipfrp=0 +set keepfw=0 set localized_value=0 +set msm8937value=0 set resultverify=1 +set edl_fail=0 +set noreboot=0 +set ubl=0 +set afu=0 For /f "tokens=2* delims= " %%A in ('Reg Query HKLM\System\CurrentControlSet\Control\Nls\Language /v InstallLanguage') Do Set langcode=%%B IF EXIST Localization\%langcode%.cmd ( @@ -40,12 +48,14 @@ fastboot help 2>&1 | findstr slot > nul if %errorlevel%==1 goto error_fastbootconflict if "%1"=="" ( -echo no prm defined +echo %t0079a% "%0 %t0079b% goto eof ) :readparam set cparam=%1 +SET cparam="%cparam%" +SET cparam=%cparam:"=% if defined cparam ( ::Read NB0 @@ -60,7 +70,22 @@ if "%cparam%"=="--nb0file" ( set nb0mode=1 set nb0file=%2 set nb0filepath=%~dp2 -if not exist "!mlffile!" goto invalid_fw else shift +if not exist "!nb0file!" goto invalid_fw else shift +) + +::Read QLZ +if "%cparam%"=="-q" ( +set qlzmode=1 +set qlzfile=%2 +set qlzfilepath=%~dp2 +if not exist "!qlzfile!" goto invalid_fw else shift +) + +if "%cparam%"=="--qlzfile" ( +set qlzmode=1 +set qlzfile=%2 +set qlzfilepath=%~dp2 +if not exist "!qlzfile!" goto invalid_fw else shift ) ::Read MLF @@ -82,21 +107,35 @@ if not exist "!mlffile!" goto invalid_fw else shift if "%cparam%"=="-s" ( set chngskuid=1 set targetskuid=%2 -if "!targetskuid!"=="" (set autoskuid=1) else shift if "!targetskuid:~0,1!"=="-" ( set targetskuid= set autoskuid=1 -) else shift +shift +goto readparam +) +if "!targetskuid!"=="" ( +set autoskuid=1 +shift +goto readparam +) +shift ) if "%cparam%"=="--skuid" ( set chngskuid=1 set targetskuid=%2 -if "!targetskuid!"=="" (set autoskuid=1) else shift if "!targetskuid:~0,1!"=="-" ( set targetskuid= set autoskuid=1 -) else shift +shift +goto readparam +) +if "!targetskuid!"=="" ( +set autoskuid=1 +shift +goto readparam +) +shift ) ::Help Message @@ -148,6 +187,28 @@ if "%cparam%"=="--disable-fac-mode" set disable_fac_mode=1 if "%cparam%"=="-H" set device_halt=1 if "%cparam%"=="--halt" set device_halt=1 +::Skip Checksum +if "%cparam%"=="-c" set resultverify=0 +if "%cparam%"=="--no-checksum" set resultverify=0 + +::Stay +if "%cparam%"=="-y" set noreboot=1 +if "%cparam%"=="--stay" set noreboot=1 + +::Bootloader Unlock +if "%cparam%"=="-u" set ubl=1 +if "%cparam%"=="--unlock-bootloader" set ubl=1 + +::Anti Force Update +if "%cparam%"=="-afu" ( +set afu=1 +set resultverify=0 +) +if "%cparam%"=="--anti-force-update" ( +set afu=1 +set resultverify=0 +) + shift set /a paramcount=%paramcount%+1 ) else ( @@ -158,6 +219,7 @@ goto readparam :proc_start if "%pretest%"=="1" ( call pretest.cmd +del %temp%\hmdsw_flag 2>nul goto eof ) @@ -166,6 +228,7 @@ set fwmode=NB0 set fwfile=%nb0file% set fwfilepath=%nb0filepath% if "%mlfmode%"=="1" goto invalid_prm +if "%qlzmode%"=="1" goto invalid_prm ) if "%mlfmode%"=="1" ( @@ -173,6 +236,15 @@ set fwmode=MLF set fwfile=%mlffile% set fwfilepath=%mlffilepath% if "%nb0mode%"=="1" goto invalid_prm +if "%qlzmode%"=="1" goto invalid_prm +) + +if "%qlzmode%"=="1" ( +set fwmode=QLZ +set fwfile=%qlzfile% +set fwfilepath=%qlzfilepath% +if "%nb0mode%"=="1" goto invalid_prm +if "%mlfmode%"=="1" goto invalid_prm ) if %verbose_mode%==1 ( @@ -185,22 +257,59 @@ if "%autoskuid%"=="1" echo %t0050% if %service_auth%==0 ( set chngskuid=0 set erase_frp=0 +if %ubl%==1 goto error_cannotskipubl +) + +if "%nb0mode%"=="1" ( +@echo on +call nb0-parser.cmd +if exist %temp%\nopython goto error_nopython +set fwfilepath=%fwfilepath%nb0out\ +set /p mlffile=<%temp%\mlffile.txt +del %temp%\mlffile.txt +@echo off +) + +if "%qlzmode%"=="1" ( +call qlz-parser.cmd +set fwfilepath=%fwfilepath%qlzout\ +set /p mlffile=<%temp%\mlffile.txt +del %temp%\mlffile.txt ) +if "%edl_mode%"=="1" ( +echo. +echo %t0062% +echo. +call qti_edl.cmd +) +if exist %temp%\edl_fail1 goto error_edlfail +if exist %temp%\edl_fail2 goto error_mtkedl +if exist %temp%\edl_fail3 goto error_noedldesc +if exist %temp%\edl_fail4 goto error_edlfail2 + if "%auth_only%"=="1" echo %t0061% call pretest.cmd if "%auth_only%"=="1" ( call call_auth.cmd goto eof ) -if %override%==0 call safety_check.cmd else set insecure=0 + +if exist %temp%\hmdsw_flag goto error_nohmdsw + +if %override%==0 ( +call safety_check.cmd +) else ( +set insecure=0 +) +if %insecure%==1 goto eof if %service_auth%==1 if %erase_frp%==1 call frpwarning.cmd if %skipfrp%==1 goto eof -if %insecure%==1 goto eof call mlf-parser.cmd if %service_auth%==0 ( if exist %temp%\eflash.txt goto error_notunlocked -) +) +if exist %temp%\eflash2.txt goto error_flashfail if %autoskuid%==1 call autoskuid.cmd if %chngskuid%==1 ( echo %t0046% %targetskuid%... @@ -218,6 +327,16 @@ fastboot erase frp fastboot erase frp 2>&1 | findstr FAILED ) ) +if "disable_fac_mode%"=="1" ( +echo %t0060% +if "%verbose_mode%"=="1" ( +fastboot oem FacMode Disable +) else ( +fastboot oem FacMode Disable frp 2>&1 | findstr FAILED +) +) +if exist "%fwfilepath%\systeminfo_b99.img" del "%fwfilepath%\systeminfo_b99.img" +if "%noreboot%"=="1" goto eof if "%device_halt%"=="1" ( echo %t0030% if "%verbose_mode%"=="1" ( @@ -233,6 +352,10 @@ fb2 reboot fb2 reboot 2>nul ) ) +if "%keepfw%"=="0" ( +if "%qlzmode%"=="1" rd /s /q "%fwfilepath%" +if "%nb0mode%"=="1" rd /s /q "%fwfilepath%" +) goto eof @@ -245,8 +368,11 @@ echo %h0003% echo %h0004% echo %h0005a% echo %h0005b% -rem echo %h0006% -rem echo %h0005b% +echo %h0006% +echo %h0005b% +echo %h0023% +rem echo %h0024% +echo %h0005b% echo %h0007% echo %h0008a% echo %h0008b% @@ -254,7 +380,7 @@ echo %h0009% echo %h0010a% echo %h0010b% rem echo %h0011% -rem echo %h0012% +echo %h0012% echo %h0013% echo %h0014a% echo %h0014b% @@ -264,15 +390,14 @@ echo %h0015b% echo %h0016% echo %h0017a% echo %h0017b% -rem echo %h0018a% -rem echo %h0018b% -rem echo %h0019a% -rem echo %h0018b% +echo %h0018a% +echo %h0018b% +echo %h0019a% +echo %h0019b% rem echo %h0020a% -rem echo %h0018b% -rem echo %h0021a% -rem echo %h0018b% -rem echo %h0022a% +echo %h0021a% +echo %h0021b% +rem echo %h0022% rem echo %h0022b% echo. echo %ex0001% @@ -280,11 +405,12 @@ echo. echo %ex0002a% echo. %0 %ex0002b% echo. -rem echo %ex0003a% -rem echo. %0 %ex0003b% +echo %ex0003a% +echo. %0 %ex0003b% +echo. +echo %ex0004a% +echo. %0 %ex0004b% echo. -rem echo %ex0004a% -rem echo %ex0004b% echo %ex0005a% echo. %0 %ex0005b% echo. @@ -306,6 +432,12 @@ echo %t0052% del %temp%\eflash.txt goto eof +:error_flashfail +echo. +echo %t0070% +del %temp%\eflash2.txt +goto eof + :error_noucrt echo. echo %t0057% @@ -318,4 +450,35 @@ echo. where fastboot goto eof +:error_edlfail +echo %t0067% +2>nul del %temp%\edl_fail* +goto eof + +:error_mtkedl +echo %t0069% +2>nul del %temp%\edl_fail* +goto eof + +:error_edlfail2 +echo %t0080a% %~dp0port_trace.txt %t0080b% +2>nul del %temp%\edl_fail* +goto eof + +:error_cannotskipubl +echo. +echo %t0073% +goto eof + +:error_nopython +echo. +echo %t0074% +goto eof + +:error_nohmdsw +echo. +echo %t0078% +del %temp%\hmdsw_flag +goto eof + :eof \ No newline at end of file