From e581d911af922846404fae0c121e4617cda721db Mon Sep 17 00:00:00 2001 From: Jackeagle Date: Mon, 13 Apr 2026 15:16:55 +0530 Subject: [PATCH] flash: Fix critical unlock check hanging the flash script The critical unlock check used a subshell pipe that caused the script to hang indefinitely on certain devices (e.g. FP3). Replace it with variable capture approach aligned with FPOS flashing script, and check for positive unlock string instead of negative to handle unexpected output safely. Signed-off-by: Jackeagle --- flash/factory.common | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flash/factory.common b/flash/factory.common index 9131a7d..7067a33 100755 --- a/flash/factory.common +++ b/flash/factory.common @@ -30,9 +30,10 @@ check_unlock_status() { echo "Please follow the instructions to unlock the bootloader!" PHONE_IS_READY=false fi - if ("${FASTBOOT_BIN}" oem device-info 2>&1 | grep -q "critical unlocked: false"); then - echo "Error: Critical partitions are still locked." - echo "Did you execute 'fastboot flashing unlock_critical'?" + DEVICE_INFO_OUTPUT=$("${FASTBOOT_BIN}" oem device-info 2>&1) + if [[ $DEVICE_INFO_OUTPUT != *"Device critical unlocked: true"* ]]; then + echo "Error: Critical partitions are not unlocked." + echo "Please execute 'fastboot flashing unlock_critical' first!" PHONE_IS_READY=false fi fi -- GitLab