From f33c681acf9aa798018fc102a7650dc96ee50b24 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Tue, 2 Jan 2024 23:08:02 +0200 Subject: [PATCH] extract_firmware: Unsparse images before copying Some OEMs like motorola ship sparse images which can't be flashed as-is Change-Id: I6f5a7e058e02167c242b0a5053fa4f6cc3a351ea --- extract_utils.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extract_utils.sh b/extract_utils.sh index 0d3d154..cac51b5 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -1969,6 +1969,10 @@ function extract_firmware() { elif [ -f "$SRC/$DST_FILE" ]; then COPY_FILE="$SRC/$DST_FILE" fi + if [[ $(file -b "$COPY_FILE") == Android* ]]; then + "$SIMG2IMG" "$COPY_FILE" "$SRC"/"$(basename "$COPY_FILE").raw" + COPY_FILE="$SRC"/"$(basename "$COPY_FILE").raw" + fi fi if [ -f "$COPY_FILE" ]; then