From bda050fa27c793572f60a1691a6536066d7560ad Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Sun, 19 Apr 2026 19:21:37 +0530 Subject: [PATCH] flash: factory.common: Don't break flashing if oem device-info is not supported --- flash/factory.common | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flash/factory.common b/flash/factory.common index 49b0e3e..fb740c4 100755 --- a/flash/factory.common +++ b/flash/factory.common @@ -30,8 +30,10 @@ check_unlock_status() { echo "Please follow the instructions to unlock the bootloader!" PHONE_IS_READY=false fi - DEVICE_INFO_OUTPUT=$("${FASTBOOT_BIN}" oem device-info 2>&1) - if [[ $DEVICE_INFO_OUTPUT != *"Device critical unlocked: true"* ]]; then + DEVICE_INFO_OUTPUT=$("${FASTBOOT_BIN}" oem device-info 2>&1 || true) + if [[ $DEVICE_INFO_OUTPUT == *"unknown command"* ]] || [[ $DEVICE_INFO_OUTPUT == *"FAILED"* ]]; then + echo "Info: Device does not support 'oem device-info', skipping critical unlock check." + elif [[ $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 -- GitLab