From 693f0c57a3ab6abaf65fb9dc2dd9b6b70315e907 Mon Sep 17 00:00:00 2001 From: Bharath Date: Mon, 2 Dec 2024 20:51:08 +0530 Subject: [PATCH] fixup! flash_FPx_factory.sh: Check if phone is unlocked Not all host machines will have path to fastboot binary in their PATH environment variable. Hence, use the fastboot binary from the release package it self instead. --- flash/FP3/flash_FP3_factory.sh | 8 ++++---- flash/FP4/flash_FP4_factory.sh | 8 ++++---- flash/FP5/flash_FP5_factory.sh | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/flash/FP3/flash_FP3_factory.sh b/flash/FP3/flash_FP3_factory.sh index 566cedc..2a601ae 100755 --- a/flash/FP3/flash_FP3_factory.sh +++ b/flash/FP3/flash_FP3_factory.sh @@ -89,21 +89,21 @@ find_device() { # Check if the device is properly unlocked check_unlock_status() { PHONE_IS_READY=true - if (fastboot getvar is-userspace 2>&1 | grep -q yes); then + if ("${FASTBOOT_BIN}" getvar is-userspace 2>&1 | grep -q yes); then echo "Info: Your phone is in fastbootD mode." - if (fastboot getvar unlocked 2>&1 | grep -q no); then + if ("${FASTBOOT_BIN}" getvar unlocked 2>&1 | grep -q no); then echo "Error: Your phone is still locked." echo "Did you execute 'fastboot flashing unlock'?" PHONE_IS_READY=false fi else echo "Info: Your phone is in regular bootloader mode." - if (fastboot getvar unlocked 2>&1 | grep -q no); then + if ("${FASTBOOT_BIN}" getvar unlocked 2>&1 | grep -q no); then echo "Error: Your phone is still locked." echo "Did you execute 'fastboot flashing unlock'?" PHONE_IS_READY=false fi - if (fastboot oem device-info 2>&1 | grep -q "critical unlocked: false"); then + 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'?" PHONE_IS_READY=false diff --git a/flash/FP4/flash_FP4_factory.sh b/flash/FP4/flash_FP4_factory.sh index 608b770..3078fc6 100755 --- a/flash/FP4/flash_FP4_factory.sh +++ b/flash/FP4/flash_FP4_factory.sh @@ -84,21 +84,21 @@ find_device() { # Check if the device is properly unlocked check_unlock_status() { PHONE_IS_READY=true - if (fastboot getvar is-userspace 2>&1 | grep -q yes); then + if ("${FASTBOOT_BIN}" getvar is-userspace 2>&1 | grep -q yes); then echo "Info: Your phone is in fastbootD mode." - if (fastboot getvar unlocked 2>&1 | grep -q no); then + if ("${FASTBOOT_BIN}" getvar unlocked 2>&1 | grep -q no); then echo "Error: Your phone is still locked." echo "Did you execute 'fastboot flashing unlock'?" PHONE_IS_READY=false fi else echo "Info: Your phone is in regular bootloader mode." - if (fastboot getvar unlocked 2>&1 | grep -q no); then + if ("${FASTBOOT_BIN}" getvar unlocked 2>&1 | grep -q no); then echo "Error: Your phone is still locked." echo "Did you execute 'fastboot flashing unlock'?" PHONE_IS_READY=false fi - if (fastboot oem device-info 2>&1 | grep -q "critical unlocked: false"); then + 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'?" PHONE_IS_READY=false diff --git a/flash/FP5/flash_FP5_factory.sh b/flash/FP5/flash_FP5_factory.sh index 1220860..1a28d82 100755 --- a/flash/FP5/flash_FP5_factory.sh +++ b/flash/FP5/flash_FP5_factory.sh @@ -84,21 +84,21 @@ find_device() { # Check if the device is properly unlocked check_unlock_status() { PHONE_IS_READY=true - if (fastboot getvar is-userspace 2>&1 | grep -q yes); then + if ("${FASTBOOT_BIN}" getvar is-userspace 2>&1 | grep -q yes); then echo "Info: Your phone is in fastbootD mode." - if (fastboot getvar unlocked 2>&1 | grep -q no); then + if ("${FASTBOOT_BIN}" getvar unlocked 2>&1 | grep -q no); then echo "Error: Your phone is still locked." echo "Did you execute 'fastboot flashing unlock'?" PHONE_IS_READY=false fi else echo "Info: Your phone is in regular bootloader mode." - if (fastboot getvar unlocked 2>&1 | grep -q no); then + if ("${FASTBOOT_BIN}" getvar unlocked 2>&1 | grep -q no); then echo "Error: Your phone is still locked." echo "Did you execute 'fastboot flashing unlock'?" PHONE_IS_READY=false fi - if (fastboot oem device-info 2>&1 | grep -q "critical unlocked: false"); then + 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'?" PHONE_IS_READY=false -- GitLab