Loading flash-scripts/linux/wait-fastboot-unlocked-critical.sh +0 −27 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ # TODO: What if 2 devices detected? # Parameter # $1: The folder where fastboot runnable is stored # $2: The archive folder path # $3: THe model of the device # Exit status # - 0 : Device in fastboot mode detected and bootloader critically unlocked Loading @@ -30,31 +28,6 @@ FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot" echo "fastboot path: $FASTBOOT_PATH" ARCHIVE_PATH=$2 ARCHIVE_FOLDER_PATH=$(dirname "$2")"/" echo "Archive Path="$ARCHIVE_FOLDER_PATH device_model=$3 echo "Model="$device_model SECURITY_PATCH=${ARCHIVE_FOLDER_PATH}""${device_model}"-security-patch" ORIGINAL_SECURITY_PATCH=$(cat "$SECURITY_PATCH") # Assuming format is xxxx-yy-zz with otional extra info .. function versionToInt { printf "%03d%03d%03d%03d" $(echo "$1" | tr '-' ' '); } I_ORIGINAL_SECURITY_PATCH=$(versionToInt "$ORIGINAL_SECURITY_PATCH") I_MURENA__SECURITY_PATCH=$(versionToInt 2021-12-05) if [[ $I_MURENA__SECURITY_PATCH -ge $I_ORIGINAL_SECURITY_PATCH ]] then echo "GREATER OR EQUALS OR ORIGINAL ROM INFO NOT AVAILABLE => PROCESS" else echo "LOWER DO NOT PROCESS" exit 0 fi while [ "$($FASTBOOT_PATH oem device-info 2>&1 | grep -q "critical unlocked: true"; echo $?)" = 1 ] do Loading Loading
flash-scripts/linux/wait-fastboot-unlocked-critical.sh +0 −27 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ # TODO: What if 2 devices detected? # Parameter # $1: The folder where fastboot runnable is stored # $2: The archive folder path # $3: THe model of the device # Exit status # - 0 : Device in fastboot mode detected and bootloader critically unlocked Loading @@ -30,31 +28,6 @@ FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot" echo "fastboot path: $FASTBOOT_PATH" ARCHIVE_PATH=$2 ARCHIVE_FOLDER_PATH=$(dirname "$2")"/" echo "Archive Path="$ARCHIVE_FOLDER_PATH device_model=$3 echo "Model="$device_model SECURITY_PATCH=${ARCHIVE_FOLDER_PATH}""${device_model}"-security-patch" ORIGINAL_SECURITY_PATCH=$(cat "$SECURITY_PATCH") # Assuming format is xxxx-yy-zz with otional extra info .. function versionToInt { printf "%03d%03d%03d%03d" $(echo "$1" | tr '-' ' '); } I_ORIGINAL_SECURITY_PATCH=$(versionToInt "$ORIGINAL_SECURITY_PATCH") I_MURENA__SECURITY_PATCH=$(versionToInt 2021-12-05) if [[ $I_MURENA__SECURITY_PATCH -ge $I_ORIGINAL_SECURITY_PATCH ]] then echo "GREATER OR EQUALS OR ORIGINAL ROM INFO NOT AVAILABLE => PROCESS" else echo "LOWER DO NOT PROCESS" exit 0 fi while [ "$($FASTBOOT_PATH oem device-info 2>&1 | grep -q "critical unlocked: true"; echo $?)" = 1 ] do Loading