Asus ROG Phone 3 ZS661KS

@echo off

setlocal

REM Version: V01

REM Date: 20191220

REM ============== USAGE ==============

REM flashall_AFT.cmd [Format option] [SN number]

REM [Format option]: 1=enable, 0=disable. default=0

REM Format userdata/cache

REM [SN number]: device SN number

REM Support multiple download image


REM ============== setting ==============

CLS

SET “dataerase=0”

SET “SSN=”

SET “para=”

SET “ERASEPARM=”

SET RESETPARM=0

set myflashdir=%~dp0

echo myflashdir=%myflashdir%

set flash_raw=%myflashdir%zs661ks_flash_raw.exe

set fastboot=%myflashdir%fastboot.exe

IF “%1” EQU “1” (

SET ERASEPARM=-f

SET RESETPARM=1

)

IF NOT [%2] EQU [] (

SET para=-s

SET SSN=%2

)

::if exist .ImageE del /F /Q “.ImageE”

::if exist .ImageE rmdir /Q /S .ImageE

type nul>nul

dir *.raw && goto startupdate

goto error_no_raw

:startupdate

rem goto crc_check

ECHO “%flash_raw% %para% %SSN% auto %ERASEPARM% ”

ECHO “%flash_raw% %para% %SSN% auto %ERASEPARM% ” > flash_%SSN%.log

%flash_raw% %para% %SSN% auto %ERASEPARM% 2>>flash_%SSN%.log

::echo errorlevel=”%ERRORLEVEL%”

IF “%ERRORLEVEL%” == “0” (

ECHO “””””””””””””””””””

ECHO “UPDATE SUCCESS : %flash_raw% %para% %SSN% auto %ERASEPARM% !!”

ECHO “UPDATE SUCCESS : %flash_raw% %para% %SSN% auto %ERASEPARM% !!” >> flash_%SSN%.log

IF “%RESETPARM%” == “1” (

%fastboot% %para% %SSN% erase asuskey 2>>flash_%SSN%.log

%fastboot% %para% %SSN% oem reset-dev_info 2>>flash_%SSN%.log

%fastboot% %para% %SSN% erase misc 2>>flash_%SSN%.log

)

ECHO “””””””””””””””””””

goto flash_super

)

ECHO “”””””””””””””””””

ECHO “UPDATE FAILED !!”

ECHO “”””””””””””””””””

goto exit_program

:flash_super

ping 127.0.0.1 -n 2 > nul

ECHO “%fastboot% %para% %SSN% flash super super.img”

ECHO “%fastboot% %para% %SSN% flash super super.img” >> flash_%SSN%.log

%fastboot% %para% %SSN% flash super super.img 2>>flash_%SSN%.log

findstr /C:FAILED “flash_%SSN%.log”

IF %errorlevel% == 0 (

echo “Failed to flash super”

goto flash_fail

)

rem wait for stable

ping 127.0.0.1 -n 6 > nul

IF “%1” EQU “1” (goto format_device)

goto download_pass

:format_device

%fastboot% %para% %SSN% reboot-bootloader 2>>flash_%SSN%.log

ping 127.0.0.1 -n 5 > nul

%fastboot% %para% %SSN% oem get-batvol 2>>flash_%SSN%.log

%fastboot% %para% %SSN% erase metadata 2>>flash_%SSN%.log

%fastboot% %para% %SSN% erase userdata 2>>flash_%SSN%.log

%fastboot% %para% %SSN% -w 2>>flash_%SSN%.log

findstr /C:FAILED “flash_%SSN%.log”

IF %errorlevel% == 0 (

echo “Failed to format device”

goto format_fail

)


:download_pass

echo “Download_PASS”

:crc_check

echo “Start CRC Check”

echo “Start CRC Check” >> flash_%SSN%.log

if exist %myflashdir%.ImageErog3_crc_check.cmd.E (

echo “CRC check file exist!”

del “%myflashdir%.ImageEcrccheck_%SSN%.log” 2> nul

copy/Y “%myflashdir%.ImageErog3_crc_check.cmd.E” “%myflashdir%.ImageErog3_crc_check.cmd”

) else (

echo “No CRC check file” >> flash_%SSN%.log

goto flash_fail

)

echo “Start checking”

cd %myflashdir%.ImageE

cd

call rog3_crc_check.cmd %SSN%

cd ..

cd

ping 127.0.0.1 -n 3 > nul

type “%myflashdir%.ImageEcrccheck_%SSN%.log” >> “flash_%SSN%.log”

echo “CRC Check file: %myflashdir%.ImageEcrccheck_%SSN%.log”

ver > nul

findstr /C:FAILED “%myflashdir%.ImageEcrccheck_%SSN%.log”

IF %errorlevel% == 0 (

echo “Failed to check crc”

goto flash_fail

)

echo “CRC Check Pass”

:o em_adb_enable

echo “Enable ADB”

%fastboot% %para% %SSN% oem adb_enable 2>>flash_%SSN%.log

findstr /C:FAILED “flash_%SSN%.log”

IF %errorlevel% == 0 (

echo “Failed to enable adb”

goto adbenable_fail

)

goto exit_program

:flash_fail

echo “FLASH FAIL”

goto exit_program

:format_fail

echo “FORMAT FAIL”

goto exit_program

:adbenable_fail

echo “FAILED: fastboot oem adb_enable”

goto exit_program

:error_no_raw

ECHO “”””””””””””””””””

ECHO “[ERROR] no raw file”

ECHO “”””””””””””””””””

goto exit_program

:exit_program

echo “flashall_FTM.cmd finished”

ping 127.0.0.1 -n 3 > nul

endlocal

@echo off

================
NOTE: You can’t download pls contact to email [email protected] , i will sent link download for you
+++++++++

Donator is respected because they help us keep Findrom.info be the biggest Firmware library. Thank you very much!




More from my site