summaryrefslogtreecommitdiff
path: root/extract_utils.sh
diff options
context:
space:
mode:
authorChirayu Desai <chirayudesai1@gmail.com>2021-11-26 05:47:25 +0530
committerMichael Bestas <mkbestas@lineageos.org>2021-12-09 01:40:35 +0200
commit47851781e7cb9ee14ebaf613ddaaf839f7fb1ec6 (patch)
treec346be70163fc482de8485f9db266a2f41fc005d /extract_utils.sh
parent37be75976f5db803ab8a1f35fba411466d88114c (diff)
extract_utils: Support A/B OTAs
Change-Id: I52e66fa392f7a8fb5401db179b1242d5d216d137
Diffstat (limited to 'extract_utils.sh')
-rw-r--r--extract_utils.sh8
1 files changed, 5 insertions, 3 deletions
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 @@ function extract() {
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 @@ function extract() {
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