diff options
Diffstat (limited to 'extract_utils.sh')
-rw-r--r-- | extract_utils.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/extract_utils.sh b/extract_utils.sh index eaf8f1c..f06d3c6 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -1550,6 +1550,29 @@ function extract() { SRC="$DUMPDIR" fi + if [ -d "$SRC" ] && [ -f "$SRC"/system.img ]; then + DUMPDIR="$TMPDIR"/system_dump + mkdir -p "$DUMPDIR" + + for PARTITION in "system" "odm" "product" "system_ext" "vendor" + do + echo "Extracting "$PARTITION"" + local IMAGE="$SRC"/"$PARTITION".img + if [ -f "$IMAGE" ]; then + if [[ $(file -b "$IMAGE") == Linux* ]]; then + extract_img_data "$IMAGE" "$DUMPDIR"/"$PARTITION" + elif [[ $(file -b "$IMAGE") == Android* ]]; then + simg2img "$IMAGE" "$DUMPDIR"/"$PARTITION".raw + extract_img_data "$DUMPDIR"/"$PARTITION".raw "$DUMPDIR"/"$PARTITION"/ + else + echo "Unsupported "$IMAGE"" + fi + fi + done + + SRC="$DUMPDIR" + fi + if [ "$VENDOR_STATE" -eq "0" ]; then echo "Cleaning output directory ($OUTPUT_ROOT).." rm -rf "${OUTPUT_TMP:?}" |