diff --git a/flash/factory.common b/flash/factory.common index 9131a7d209d506f8a6eb45c4bf8ec3da5377ff17..7067a33d6bb53ba43c31c3cc9a33b1d31c261665 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