From d043653ea97cc7a325680d64b65044586b6830da Mon Sep 17 00:00:00 2001 From: Ingo-FP-Angel Date: Sat, 22 May 2021 19:22:03 +0200 Subject: [PATCH] Use double quotes around variables that contains paths --- .../windows/fp3_install-from-fastboot.bat | 30 +++++++++---------- flash-scripts/windows/fp3_oem-unlock.bat | 4 +-- .../windows/gs290-flashingUnlock.bat | 4 +-- .../windows/gs290-install-from-bootloader.bat | 22 +++++++------- .../gs290-wait-reboot-from-fastboot.bat | 9 +++--- .../windows/install-from-bootloader-GS290.bat | 20 ++++++------- .../windows/install-from-recovery.bat | 14 ++++----- flash-scripts/windows/install-recovery.bat | 6 ++-- flash-scripts/windows/reboot-fastboot.bat | 6 ++-- flash-scripts/windows/verify-heimdall.bat | 4 +-- flash-scripts/windows/wait-download.bat | 4 +-- .../windows/wait-fastboot-unlocked.bat | 4 +-- flash-scripts/windows/wait-fastboot.bat | 4 +-- .../windows/wait-reboot-from-fastboot.bat | 8 ++--- flash-scripts/windows/wait-reboot.bat | 9 ++---- flash-scripts/windows/wait-recovery.bat | 6 ++-- 16 files changed, 75 insertions(+), 79 deletions(-) diff --git a/flash-scripts/windows/fp3_install-from-fastboot.bat b/flash-scripts/windows/fp3_install-from-fastboot.bat index 9d9c4dc6..77f93b8b 100755 --- a/flash-scripts/windows/fp3_install-from-fastboot.bat +++ b/flash-scripts/windows/fp3_install-from-fastboot.bat @@ -26,10 +26,10 @@ :: - 101 : ARCHIVE_PATH missing :: - 102 : archive could not be unpacked -set ARCHIVE_PATH=%~1 -set FASTBOOT_FOLDER_PATH=%~2 +set ARCHIVE_PATH="%~1" +set FASTBOOT_FOLDER_PATH="%~2" set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" -set JAVA_FOLDER_PATH=%~3 +set JAVA_FOLDER_PATH="%~3" set JAR_PATH="%JAVA_FOLDER_PATH%\bin\jar" if not defined %ARCHIVE_PATH ( @@ -53,13 +53,13 @@ cd "%ARCHIVE_FOLDER_PATH%" timeout 1 >nul 2>&1 -%JAR_PATH% -x -v -f "%ARCHIVE_PATH%" +"%JAR_PATH%" -x -v -f "%ARCHIVE_PATH%" if errorLevel 1 ( exit /b 102 ) echo "unpacked archive" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% -w +"%FASTBOOT_PATH%" -w if errorLevel 1 ( exit /b 1 ) echo "user data wiped" @@ -67,31 +67,31 @@ timeout 5 >nul 2>&1 echo "=== Flash slot A" -%FASTBOOT_PATH% flash system_a system.img -S 522239K +"%FASTBOOT_PATH%" flash system_a system.img -S 522239K if errorLevel 1 ( exit /b 2 ) echo "flashed system" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% flash boot_a boot.img +"%FASTBOOT_PATH%" flash boot_a boot.img if errorLevel 1 ( exit /b 2 ) echo "flashed boot" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% flash vendor_a vendor.img -S 522239K +"%FASTBOOT_PATH%" flash vendor_a vendor.img -S 522239K if errorLevel 1 ( exit /b 2 ) echo "flashed vendor" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% flash dtbo_a dtbo.img +"%FASTBOOT_PATH%" flash dtbo_a dtbo.img if errorLevel 1 ( exit /b 2 ) echo "flashed dtbo" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% flash vbmeta_a vbmeta.img +"%FASTBOOT_PATH%" flash vbmeta_a vbmeta.img if errorLevel 1 ( exit /b 2 ) echo "flashed vbmeta" @@ -99,31 +99,31 @@ timeout 1 >nul 2>&1 echo "=== Flash slot B" -%FASTBOOT_PATH% flash system_b system.img -S 522239K +"%FASTBOOT_PATH%" flash system_b system.img -S 522239K if errorLevel 1 ( exit /b 2 ) echo "flashed system" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% flash boot_b boot.img +"%FASTBOOT_PATH%" flash boot_b boot.img if errorLevel 1 ( exit /b 2 ) echo "flashed boot" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% flash vendor_b vendor.img -S 522239K +"%FASTBOOT_PATH%" flash vendor_b vendor.img -S 522239K if errorLevel 1 ( exit /b 2 ) echo "flashed vendor" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% flash dtbo_b dtbo.img +"%FASTBOOT_PATH%" flash dtbo_b dtbo.img if errorLevel 1 ( exit /b 2 ) echo "flashed dtbo" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% flash vbmeta_b vbmeta.img +"%FASTBOOT_PATH%" flash vbmeta_b vbmeta.img if errorLevel 1 ( exit /b 2 ) echo "flashed vbmeta" diff --git a/flash-scripts/windows/fp3_oem-unlock.bat b/flash-scripts/windows/fp3_oem-unlock.bat index 7adfb2ea..c3196a7a 100755 --- a/flash-scripts/windows/fp3_oem-unlock.bat +++ b/flash-scripts/windows/fp3_oem-unlock.bat @@ -21,11 +21,11 @@ :: - 0 : OEM unlocked on device :: - 10 : fastboot error -set FASTBOOT_FOLDER_PATH=%~1 +set FASTBOOT_FOLDER_PATH="%~1" set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" echo "FASTBOOT path:"%FASTBOOT_PATH% -%FASTBOOT_PATH% oem unlock +"%FASTBOOT_PATH%" oem unlock if errorLevel 1 ( echo "OEM-unlock fails" diff --git a/flash-scripts/windows/gs290-flashingUnlock.bat b/flash-scripts/windows/gs290-flashingUnlock.bat index 4036966b..963c81e2 100755 --- a/flash-scripts/windows/gs290-flashingUnlock.bat +++ b/flash-scripts/windows/gs290-flashingUnlock.bat @@ -25,7 +25,7 @@ :: - 102 : $FASTBOOT_FOLDER_PATH is missing set DEVICE_ID="%1" -set FASTBOOT_FOLDER_PATH=%~2 +set FASTBOOT_FOLDER_PATH="%~2" if not defined %DEVICE_ID ( exit /b 101 @@ -37,7 +37,7 @@ if not defined %FASTBOOT_FOLDER_PATH ( set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" -%FASTBOOT_PATH% -s %DEVICE_ID% flashing unlock +"%FASTBOOT_PATH%" -s %DEVICE_ID% flashing unlock if errorlevel 1 ( exit /b 2 ) timeout 1 >nul 2>&1 diff --git a/flash-scripts/windows/gs290-install-from-bootloader.bat b/flash-scripts/windows/gs290-install-from-bootloader.bat index 97f45c82..84f7bc7e 100755 --- a/flash-scripts/windows/gs290-install-from-bootloader.bat +++ b/flash-scripts/windows/gs290-install-from-bootloader.bat @@ -35,9 +35,9 @@ :: - 103 : fastboot folder path missing set DEVICE_ID="%1" -set ARCHIVE_PATH=%~2 -set FASTBOOT_FOLDER_PATH=%~3 -set JAVA_FOLDER_PATH=%~4 +set ARCHIVE_PATH="%~2" +set FASTBOOT_FOLDER_PATH="%~3" +set JAVA_FOLDER_PATH="%~4" if not defined %DEVICE_ID ( exit /b 101 @@ -63,51 +63,51 @@ set JAR_PATH="%JAVA_FOLDER_PATH%/bin/jar" :: Build archive folder path for %%a in ("%ARCHIVE_PATH%") do ( - set ARCHIVE_FOLDER_PATH=%%~dpa" + set ARCHIVE_FOLDER_PATH="%%~dpa" echo %ARCHIVE_FOLDER_PATH% ) :: unzip for system.img cd "%ARCHIVE_FOLDER_PATH%" -%JAR_PATH% -x -v -f "%ARCHIVE_PATH%" +"%JAR_PATH%" -x -v -f "%ARCHIVE_PATH%" if errorLevel 1 ( exit /b 10 ) echo "unpacked archive" timeout 1 >nul 2>&1 -%FASTBOOT_PATH% -w +"%FASTBOOT_PATH%" -w if errorLevel 1 ( exit /b 11 ) echo "user data wiped" timeout 5 >nul 2>&1 -%FASTBOOT_PATH% -s %DEVICE_ID% flash --disable-verity --disable-verification boot boot.img +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash --disable-verity --disable-verification boot boot.img if errorLevel 1 ( exit /b 12 ) timeout 1 >nul 2>&1 echo "Flashed boot" -%FASTBOOT_PATH% -s %DEVICE_ID% flash recovery recovery-e-latest-GS290.img +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash recovery recovery-e-latest-GS290.img if errorLevel 1 ( exit /b 13 ) timeout 1 >nul 2>&1 echo "Flashed recovery" -%FASTBOOT_PATH% -s %DEVICE_ID% flash system system.img +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash system system.img if errorLevel 1 ( exit /b 14 ) timeout 1 >nul 2>&1 echo "Flashed system" -%FASTBOOT_PATH% -s %DEVICE_ID% flash lk lk.img +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash lk lk.img if errorLevel 1 ( exit /b 15 ) timeout 1 >nul 2>&1 echo "Flashed lk" -%FASTBOOT_PATH% -s %DEVICE_ID% flash logo logo.bin +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash logo logo.bin if errorLevel 1 ( exit /b 16 ) diff --git a/flash-scripts/windows/gs290-wait-reboot-from-fastboot.bat b/flash-scripts/windows/gs290-wait-reboot-from-fastboot.bat index 99dc45aa..6b119b74 100755 --- a/flash-scripts/windows/gs290-wait-reboot-from-fastboot.bat +++ b/flash-scripts/windows/gs290-wait-reboot-from-fastboot.bat @@ -22,23 +22,22 @@ :: - 10 : fastboot reboot command failed :: - 101 : no device found in fastboot -set FASTBOOT_FOLDER_PATH=%~1 +set FASTBOOT_FOLDER_PATH="%~1" set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" echo "fastboot path: %FASTBOOT_FOLDER_PATH%" - -%FASTBOOT_PATH% devices 2>&1 | findstr fastboot +"%FASTBOOT_PATH%" devices 2>&1 | findstr fastboot if %errorLevel% NEQ 0 ( echo "Device not detected in fastboot" exit /b 101 ) -%FASTBOOT_PATH% reboot +"%FASTBOOT_PATH%" reboot if %errorlevel% NEQ 0 ( exit /b 10 ) :fastboot_detect -%FASTBOOT_PATH% devices 2>&1 | findstr fastboot +"%FASTBOOT_PATH%" devices 2>&1 | findstr fastboot if %errorLevel% EQU 0 ( ping 127.0.0.1 -n 2 -w 1000 >NUL goto :fastboot_detect diff --git a/flash-scripts/windows/install-from-bootloader-GS290.bat b/flash-scripts/windows/install-from-bootloader-GS290.bat index 452510cc..ae081211 100755 --- a/flash-scripts/windows/install-from-bootloader-GS290.bat +++ b/flash-scripts/windows/install-from-bootloader-GS290.bat @@ -29,8 +29,8 @@ set DEVICE_ID="%1" -set ARCHIVE_PATH=%~2 -set FASTBOOT_FOLDER_PATH=%~3 +set ARCHIVE_PATH="%~2" +set FASTBOOT_FOLDER_PATH="%~3" set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" if not defined %DEVICE_ID ( @@ -63,19 +63,19 @@ timeout 1 >nul 2>&1 # Should we unzip ? -%FASTBOOT_PATH% -s %DEVICE_ID% erase userdata +"%FASTBOOT_PATH%" -s %DEVICE_ID% erase userdata sleep 1 -%FASTBOOT_PATH% -s %DEVICE_ID% flash --disable-verity --disable-verification boot boot.img +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash --disable-verity --disable-verification boot boot.img sleep 1 -%FASTBOOT_PATH% -s %DEVICE_ID% flash recovery recovery-e-latest-GS290.img +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash recovery recovery-e-latest-GS290.img sleep 1 -%FASTBOOT_PATH% -s %DEVICE_ID% flash system system.img +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash system system.img sleep 1 -%FASTBOOT_PATH% -s %DEVICE_ID% flash lk lk.img +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash lk lk.img sleep 1 -%FASTBOOT_PATH% -s %DEVICE_ID% flash logo logo.bin +"%FASTBOOT_PATH%" -s %DEVICE_ID% flash logo logo.bin sleep 1 -%FASTBOOT_PATH% -s %DEVICE_ID% -w +"%FASTBOOT_PATH%" -s %DEVICE_ID% -w sleep 1 -%FASTBOOT_PATH% -s %DEVICE_ID% reboot +"%FASTBOOT_PATH%" -s %DEVICE_ID% reboot sleep 1 diff --git a/flash-scripts/windows/install-from-recovery.bat b/flash-scripts/windows/install-from-recovery.bat index 1559fce7..6725f1fa 100755 --- a/flash-scripts/windows/install-from-recovery.bat +++ b/flash-scripts/windows/install-from-recovery.bat @@ -28,7 +28,7 @@ set DEVICE_ID="%1" set ARCHIVE_PATH="%~2" -set ADB_FOLDER_PATH=%~3 +set ADB_FOLDER_PATH="%~3" set ADB_PATH="%ADB_FOLDER_PATH%adb" :: get basename of archive for %%a in ("%ARCHIVE_PATH%") do ( @@ -44,21 +44,21 @@ if not defined %ARCHIVE_PATH ( exit /b 102 ) -%ADB_PATH% -s %DEVICE_ID% shell twrp wipe system -%ADB_PATH% -s %DEVICE_ID% shell twrp wipe cache -%ADB_PATH% -s %DEVICE_ID% shell twrp wipe data -%ADB_PATH% -s %DEVICE_ID% push %ARCHIVE_PATH% sdcard +"%ADB_PATH%" -s %DEVICE_ID% shell twrp wipe system +"%ADB_PATH%" -s %DEVICE_ID% shell twrp wipe cache +"%ADB_PATH%" -s %DEVICE_ID% shell twrp wipe data +"%ADB_PATH%" -s %DEVICE_ID% push %ARCHIVE_PATH% sdcard if errorLevel 1 ( exit /b 2 ) -%ADB_PATH% -s %DEVICE_ID% shell twrp install /sdcard/%ARCHIVE_NAME% +"%ADB_PATH%" -s %DEVICE_ID% shell twrp install /sdcard/%ARCHIVE_NAME% if errorLevel 1 ( exit /b 3 ) ::Timeout 1 ping 127.0.0.1 -n 2 -w 1000 >NUL -%ADB_PATH% -s %DEVICE_ID% shell rm /sdcard/%ARCHIVE_NAME% +"%ADB_PATH%" -s %DEVICE_ID% shell rm /sdcard/%ARCHIVE_NAME% ping 127.0.0.1 -n 2 -w 1000 >NUL diff --git a/flash-scripts/windows/install-recovery.bat b/flash-scripts/windows/install-recovery.bat index e8c78962..71809abb 100755 --- a/flash-scripts/windows/install-recovery.bat +++ b/flash-scripts/windows/install-recovery.bat @@ -21,8 +21,8 @@ :: - 1 : No problems occurred (heimdall returns only 1 if an error occurs) :: - 101 : TWRP_IMAGE_PATH missing -set TWRP_IMAGE_PATH=%1 -set HEIMDALL_FOLDER=%~2 +set TWRP_IMAGE_PATH="%1" +set HEIMDALL_FOLDER="%~2" if not defined %TWRP_IMAGE_PATH ( exit /b 101 @@ -31,6 +31,6 @@ if not defined %TWRP_IMAGE_PATH ( ping 127.0.0.1 -n 3 -w 10000 >NUL set HEIMDALL_PATH="%HEIMDALL_FOLDER%heimdall" -%HEIMDALL_PATH% flash --RECOVERY %TWRP_IMAGE_PATH% --no-reboot +"%HEIMDALL_PATH%" flash --RECOVERY "%TWRP_IMAGE_PATH%" --no-reboot exit /b 0 \ No newline at end of file diff --git a/flash-scripts/windows/reboot-fastboot.bat b/flash-scripts/windows/reboot-fastboot.bat index b425fac7..881fad52 100755 --- a/flash-scripts/windows/reboot-fastboot.bat +++ b/flash-scripts/windows/reboot-fastboot.bat @@ -25,7 +25,7 @@ :: - 102: Missing path to adb and fastboot set DEVICE_ID="%1" -set ADBFASTBOOT_FOLDER_PATH=%~2 +set ADBFASTBOOT_FOLDER_PATH="%~2" if not defined %DEVICE_ID ( exit /b 101 @@ -39,12 +39,12 @@ set FASTBOOT_PATH="%ADBFASTBOOT_FOLDER_PATH%fastboot" set ADB_PATH="%ADBFASTBOOT_FOLDER_PATH%adb" -%ADB_PATH% -s %DEVICE_ID% reboot bootloader +"%ADB_PATH%" -s %DEVICE_ID% reboot bootloader if errorlevel 1 ( exit /b 10 ) :fastboot_detect -%FASTBOOT_PATH% devices 2>&1 | findstr fastboot +"%FASTBOOT_PATH%" devices 2>&1 | findstr fastboot if errorLevel 1 ( timeout 3 >nul 2>&1 goto :fastboot_detect diff --git a/flash-scripts/windows/verify-heimdall.bat b/flash-scripts/windows/verify-heimdall.bat index 8018cff5..27484d79 100755 --- a/flash-scripts/windows/verify-heimdall.bat +++ b/flash-scripts/windows/verify-heimdall.bat @@ -16,7 +16,7 @@ :: Exit status :: - 0 : OEM unlocked on device :: - 10 : heimdall error -set HEIMDALL_FOLDER=%~1 +set HEIMDALL_FOLDER="%~1" set HEIMDALL_PATH="%HEIMDALL_FOLDER%heimdall" @@ -24,7 +24,7 @@ set HEIMDALL_PATH="%HEIMDALL_FOLDER%heimdall" ping 127.0.0.1 -n 3 -w 10000 >NUL -%HEIMDALL_PATH% print-pit +"%HEIMDALL_PATH%" print-pit if errorLevel 1 ( EXIT /b 10 ) diff --git a/flash-scripts/windows/wait-download.bat b/flash-scripts/windows/wait-download.bat index 25a81756..d1212ef3 100755 --- a/flash-scripts/windows/wait-download.bat +++ b/flash-scripts/windows/wait-download.bat @@ -19,12 +19,12 @@ :: - 0 : Device in download mode detected :: - 1 : Error -set HEIMDALL_FOLDER=%~1 +set HEIMDALL_FOLDER="%~1" if not defined %HEIMDALL_FOLDER (EXIT /b 1) set HEIMDALL_PATH="%HEIMDALL_FOLDER%heimdall" :heimdall_detect -%HEIMDALL_PATH% detect >nul +"%HEIMDALL_PATH%" detect >nul if errorLevel 1 ( echo not found ping 127.0.0.1 -n 2 -w 1000 >NUL diff --git a/flash-scripts/windows/wait-fastboot-unlocked.bat b/flash-scripts/windows/wait-fastboot-unlocked.bat index 5db8ceb3..2f5fa35b 100755 --- a/flash-scripts/windows/wait-fastboot-unlocked.bat +++ b/flash-scripts/windows/wait-fastboot-unlocked.bat @@ -21,12 +21,12 @@ :: - 0 : Device in fastboot mode detected :: - 1 : Error -set FASTBOOT_FOLDER_PATH=%~1 +set FASTBOOT_FOLDER_PATH="%~1" set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" echo "FASTBOOT path:"%FASTBOOT_PATH% :fastboot_detect -%FASTBOOT_PATH% getvar unlocked 2>&1 | findstr yes +"%FASTBOOT_PATH%" getvar unlocked 2>&1 | findstr yes if errorLevel 1 ( timeout 2 >nul 2>&1 goto :fastboot_detect diff --git a/flash-scripts/windows/wait-fastboot.bat b/flash-scripts/windows/wait-fastboot.bat index 769a8ad5..bd7dc915 100755 --- a/flash-scripts/windows/wait-fastboot.bat +++ b/flash-scripts/windows/wait-fastboot.bat @@ -21,12 +21,12 @@ :: - 0 : Device in fastboot mode detected :: - 1 : Error -set FASTBOOT_FOLDER_PATH=%~1 +set FASTBOOT_FOLDER_PATH="%~1" set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" echo "FASTBOOT path:"%FASTBOOT_PATH% :fastboot_detect -%FASTBOOT_PATH% devices 2>&1 | findstr fastboot +"%FASTBOOT_PATH%" devices 2>&1 | findstr fastboot if errorLevel 1 ( timeout 1 >nul 2>&1 goto :fastboot_detect diff --git a/flash-scripts/windows/wait-reboot-from-fastboot.bat b/flash-scripts/windows/wait-reboot-from-fastboot.bat index 4748f041..6ce263ac 100755 --- a/flash-scripts/windows/wait-reboot-from-fastboot.bat +++ b/flash-scripts/windows/wait-reboot-from-fastboot.bat @@ -22,19 +22,19 @@ :: - 101: device not in fastboot anymore :: - 102: locking the bootloader failed -set FASTBOOT_FOLDER_PATH=%~1 +set FASTBOOT_FOLDER_PATH="%~1" set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot" echo "FASTBOOT path:"%FASTBOOT_PATH% :: check that device is in recovery mode -%FASTBOOT_PATH% devices 2>&1 | findstr "fastboot" +"%FASTBOOT_PATH%" devices 2>&1 | findstr "fastboot" if errorLevel 1 (exit /b 101) -%FASTBOOT_PATH% flashing lock +"%FASTBOOT_PATH%" flashing lock if errorLevel 1 ( exit /b 102 ) :wait-leave-fastboot -%FASTBOOT_PATH% devices 2>Nul | findstr fastboot +"%FASTBOOT_PATH%" devices 2>Nul | findstr fastboot if %errorLevel% == 0 ( ping 127.0.0.1 -n 2 -w 1000 >NUL goto :wait-leave-fastboot diff --git a/flash-scripts/windows/wait-reboot.bat b/flash-scripts/windows/wait-reboot.bat index 9bbd91a0..a353406d 100755 --- a/flash-scripts/windows/wait-reboot.bat +++ b/flash-scripts/windows/wait-reboot.bat @@ -24,23 +24,20 @@ :: - 101 : DEVICE_ID is not detected set DEVICE_ID="%1" -set ADB_FOLDER_PATH=%~2 +set ADB_FOLDER_PATH="%~2" set ADB_PATH="%ADB_FOLDER_PATH%adb" - echo "ADB path:"%ADB_PATH% if not defined %DEVICE_ID ( exit /b 10) - - :: On check that device is in recovery mode -%ADB_PATH% -s %DEVICE_ID% get-state 2>&1 | findstr "recovery" +"%ADB_PATH%" -s %DEVICE_ID% get-state 2>&1 | findstr "recovery" if errorLevel 1 (exit /b 101) :wait-leave-recovery -%ADB_PATH% -s %DEVICE_ID% get-state 2>Nul +"%ADB_PATH%" -s %DEVICE_ID% get-state 2>Nul if %errorLevel% == 0 ( ping 127.0.0.1 -n 2 -w 1000 >NUL goto :wait-leave-recovery diff --git a/flash-scripts/windows/wait-recovery.bat b/flash-scripts/windows/wait-recovery.bat index d21834ea..6e519ed9 100755 --- a/flash-scripts/windows/wait-recovery.bat +++ b/flash-scripts/windows/wait-recovery.bat @@ -27,7 +27,7 @@ :: - 101 : DEVICES_LOCKED_PATH missing set DEVICE_ID="%1" -set ADB_FOLDER_PATH=%~2 +set ADB_FOLDER_PATH="%~2" :: check device_ID est définit @@ -39,10 +39,10 @@ set ADB_PATH="%ADB_FOLDER_PATH%adb" echo "waiting for recovery" -%ADB_PATH% -s %DEVICE_ID% wait-for-recovery +"%ADB_PATH%" -s %DEVICE_ID% wait-for-recovery if not errorlevel 1 ( echo "device found in recovery" - %ADB_PATH% -s %DEVICE_ID% shell "twrp mount system" + "%ADB_PATH%" -s %DEVICE_ID% shell "twrp mount system" if errorlevel 1 ( echo "twrp mount system failed" exit /b 1 -- GitLab