From ee47c9a78e2190aa8dcfa21f3b6f4690a521bb69 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Sun, 19 Apr 2026 19:21:37 +0530 Subject: [PATCH 1/2] 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 a9fc7c7..53ef88a 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 From 395de5c068797180e5fb7c3b1ea0e7fe3194efc1 Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Sun, 19 Apr 2026 22:25:48 +0530 Subject: [PATCH 2/2] flash: factory.common: Skip super-wipe if system is logical * There's a weird behaviour on retrotfit dynamic, if system is already logical wipe-super fails. * We obviously still need wipe-super when upgrading from A12 to A15. --- flash/factory.common | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flash/factory.common b/flash/factory.common index 53ef88a..ef198e2 100755 --- a/flash/factory.common +++ b/flash/factory.common @@ -166,8 +166,13 @@ fi if [ "${WIPE_SUPER}" = "true" ] then - echo "INFO: Wiping super image" - "${FASTBOOT_BIN}" -s "${sn}" wipe-super "${IMAGES_DIR}/super_empty.img" + IS_LOGICAL=$("${FASTBOOT_BIN}" -s "${sn}" getvar is-logical:system 2>&1 | grep "is-logical:system" | awk '{print $2}') + if [ "${IS_LOGICAL}" != "yes" ]; then + echo "INFO: Wiping super image" + "${FASTBOOT_BIN}" -s "${sn}" wipe-super "${IMAGES_DIR}/super_empty.img" + else + echo "INFO: System partition is already logical, skipping wipe-super" + fi fi flash_images_ab_or_abort "${sn}" "${FLASH_AB_IMGS}" -- GitLab