extract_utils: Support A/B OTAs
Change-Id: I52e66fa392f7a8fb5401db179b1242d5d216d137
diff --git a/extract_utils.sh b/extract_utils.sh
index c77a4d6..2010546 100644
--- a/extract_utils.sh
+++ b/extract_utils.sh
@@ -1519,10 +1519,9 @@
unzip "$SRC" -d "$DUMPDIR"
echo "$MD5" > "$DUMPDIR"/zipmd5.txt
- # Stop if an A/B OTA zip is detected. We cannot extract these.
+ # Extract A/B OTA
if [ -a "$DUMPDIR"/payload.bin ]; then
- echo "A/B style OTA zip detected. This is not supported at this time. Stopping..."
- exit 1
+ python3 "$ANDROID_ROOT"/tools/extract-utils/extract_ota.py "$DUMPDIR"/payload.bin -o "$DUMPDIR" -p "system" "odm" "product" "system_ext" "vendor" 2>&1
fi
for PARTITION in "system" "odm" "product" "system_ext" "vendor"
@@ -1541,6 +1540,9 @@
extract_img_data "$DUMPDIR"/"$PARTITION".img "$DUMPDIR"/"$PARTITION"/
rm "$DUMPDIR"/"$PARTITION".img
fi
+ if [ -a "$DUMPDIR"/"$PARTITION".img ]; then
+ extract_img_data "$DUMPDIR"/"$PARTITION".img "$DUMPDIR"/"$PARTITION"/
+ fi
done
fi