#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#

PRODUCT_COPY_FILES_LIST=()
PRODUCT_COPY_FILES_HASHES=()
PRODUCT_COPY_FILES_FIXUP_HASHES=()
PRODUCT_PACKAGES_LIST=()
PRODUCT_PACKAGES_HASHES=()
PRODUCT_PACKAGES_FIXUP_HASHES=()
PACKAGE_LIST=()
VENDOR_STATE=-1
VENDOR_RADIO_STATE=-1
COMMON=-1
ARCHES=
FULLY_DEODEXED=-1

TMPDIR=$(mktemp -d)
HOST="$(uname | tr '[:upper:]' '[:lower:]')"

#
# cleanup
#
# kill our tmpfiles with fire on exit
#
function cleanup() {
    rm -rf "${TMPDIR:?}"
}

trap cleanup 0

#
# setup_vendor
#
# $1: device name
# $2: vendor name
# $3: Android root directory
# $4: is common device - optional, default to false
# $5: cleanup - optional, default to true
# $6: custom vendor makefile name - optional, default to false
#
# Must be called before any other functions can be used. This
# sets up the internal state for a new vendor configuration.
#
function setup_vendor() {
    local DEVICE="$1"
    if [ -z "$DEVICE" ]; then
        echo "\$DEVICE must be set before including this script!"
        exit 1
    fi

    export VENDOR="$2"
    if [ -z "$VENDOR" ]; then
        echo "\$VENDOR must be set before including this script!"
        exit 1
    fi

    export ANDROID_ROOT="$3"
    if [ ! -d "$ANDROID_ROOT" ]; then
        echo "\$ANDROID_ROOT must be set and valid before including this script!"
        exit 1
    fi

    export OUTDIR=vendor/"$VENDOR"/"$DEVICE"
    if [ ! -d "$ANDROID_ROOT/$OUTDIR" ]; then
        mkdir -p "$ANDROID_ROOT/$OUTDIR"
    fi

    VNDNAME="$6"
    if [ -z "$VNDNAME" ]; then
        VNDNAME="$DEVICE"
    fi

    export PRODUCTMK="$ANDROID_ROOT"/"$OUTDIR"/"$VNDNAME"-vendor.mk
    export ANDROIDBP="$ANDROID_ROOT"/"$OUTDIR"/Android.bp
    export ANDROIDMK="$ANDROID_ROOT"/"$OUTDIR"/Android.mk
    export BOARDMK="$ANDROID_ROOT"/"$OUTDIR"/BoardConfigVendor.mk

    if [ "$4" == "true" ] || [ "$4" == "1" ]; then
        COMMON=1
    else
        COMMON=0
    fi

    if [ "$5" == "false" ] || [ "$5" == "0" ]; then
        VENDOR_STATE=1
        VENDOR_RADIO_STATE=1
    else
        VENDOR_STATE=0
        VENDOR_RADIO_STATE=0
    fi

    export BINARIES_LOCATION="$ANDROID_ROOT"/prebuilts/extract-tools/${HOST}-x86/bin

    for version in 0_8 0_9; do
        export PATCHELF_${version}="$BINARIES_LOCATION"/patchelf-"${version}"
    done

    if [ -z "$PATCHELF_VERSION" ]; then
        export PATCHELF_VERSION=0_9
    fi

    if [ -z "$PATCHELF" ]; then
        local patchelf_variable="PATCHELF_${PATCHELF_VERSION}"
        export PATCHELF=${!patchelf_variable}
    fi
}

# Helper functions for parsing a spec.
# notes: an optional "|SHA1" that may appear in the format is stripped
#        early from the spec in the parse_file_list function, and
#        should not be present inside the input parameter passed
#        to these functions.

#
# input: spec in the form of "src[:dst][;args]"
# output: "src"
#
function src_file() {
    local SPEC="$1"
    local SPLIT=(${SPEC//:/ })
    local ARGS="$(target_args ${SPEC})"
    # Regardless of there being a ":" delimiter or not in the spec,
    # the source file is always either the first, or the only entry.
    local SRC="${SPLIT[0]}"
    # Remove target_args suffix, if present
    echo "${SRC%;${ARGS}}"
}

#
# input: spec in the form of "src[:dst][;args]"
# output: "dst" if present, "src" otherwise.
#
function target_file() {
    local SPEC="${1%%;*}"
    local SPLIT=(${SPEC//:/ })
    local ARGS="$(target_args ${SPEC})"
    local DST=
    case ${#SPLIT[@]} in
    1)
        # The spec doesn't have a : delimiter
        DST="${SPLIT[0]}"
        ;;
    *)
        # The spec actually has a src:dst format
        DST="${SPLIT[1]}"
        ;;
    esac
    # Remove target_args suffix, if present
    echo "${DST%;${ARGS}}"
}

#
# input: spec in the form of "src[:dst][;args]"
# output: "args" if present, "" otherwise.
#
function target_args() {
    local SPEC="$1"
    local SPLIT=(${SPEC//;/ })
    local ARGS=
    case ${#SPLIT[@]} in
    1)
        # No ";" delimiter in the spec.
        ;;
    *)
        # The "args" are whatever comes after the ";" character.
        # Basically the spec stripped of whatever is to the left of ";".
        ARGS="${SPEC#${SPLIT[0]};}"
        ;;
    esac
    echo "${ARGS}"
}

#
# prefix_match:
#
# input:
#   - $1: prefix
#   - (global variable) PRODUCT_PACKAGES_LIST: array of [src:]dst[;args] specs.
# output:
#   - new array consisting of dst[;args] entries where $1 is a prefix of ${dst}.
#
function prefix_match() {
    local PREFIX="$1"
    for LINE in "${PRODUCT_PACKAGES_LIST[@]}"; do
        local FILE=$(target_file "$LINE")
        if [[ "$FILE" =~ ^"$PREFIX" ]]; then
            local ARGS=$(target_args "$LINE")
            if [ -z "${ARGS}" ]; then
                echo "${FILE#$PREFIX}"
            else
                echo "${FILE#$PREFIX};${ARGS}"
            fi
        fi
    done
}

#
# prefix_match_file:
#
# $1: the prefix to match on
# $2: the file to match the prefix for
#
# Internal function which returns true if a filename contains the
# specified prefix.
#
function prefix_match_file() {
    local PREFIX="$1"
    local FILE="$2"
    if [[ "$FILE" =~ ^"$PREFIX" ]]; then
        return 0
    else
        return 1
    fi
}

#
# suffix_match_file:
#
# $1: the suffix to match on
# $2: the file to match the suffix for
#
# Internal function which returns true if a filename contains the
# specified suffix.
#
function suffix_match_file() {
    local SUFFIX="$1"
    local FILE="$2"
    if [[ "$FILE" = *"$SUFFIX" ]]; then
        return 0
    else
        return 1
    fi
}

#
# truncate_file
#
# $1: the filename to truncate
# $2: the argument to output the truncated filename to
#
# Internal function which truncates a filename by removing the first dir
# in the path. ex. vendor/lib/libsdmextension.so -> lib/libsdmextension.so
#
function truncate_file() {
    local FILE="$1"
    RETURN_FILE="$2"
    local FIND="${FILE%%/*}"
    local LOCATION="${#FIND}+1"
    echo ${FILE:$LOCATION}
}

#
# write_product_copy_files:
#
# $1: make treble compatible makefile - optional and deprecated, default to true
#
# Creates the PRODUCT_COPY_FILES section in the product makefile for all
# items in the list which do not start with a dash (-).
#
function write_product_copy_files() {
    local COUNT=${#PRODUCT_COPY_FILES_LIST[@]}
    local TARGET=
    local FILE=
    local LINEEND=
    local TREBLE_COMPAT=$1

    if [ "$COUNT" -eq "0" ]; then
        return 0
    fi

    printf '%s\n' "PRODUCT_COPY_FILES += \\" >> "$PRODUCTMK"
    for (( i=1; i<COUNT+1; i++ )); do
        FILE="${PRODUCT_COPY_FILES_LIST[$i-1]}"
        LINEEND=" \\"
        if [ "$i" -eq "$COUNT" ]; then
            LINEEND=""
        fi

        TARGET=$(target_file "$FILE")
        if prefix_match_file "product/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_PRODUCT)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "system/product/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_PRODUCT)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "system_ext/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_SYSTEM_EXT)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "system/system_ext/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_SYSTEM_EXT)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "odm/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_ODM)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "vendor/odm/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_ODM)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "system/vendor/odm/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_ODM)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "vendor/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_VENDOR)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "system/vendor/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_VENDOR)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        elif prefix_match_file "system/" $TARGET ; then
            local OUTTARGET=$(truncate_file $TARGET)
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_SYSTEM)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$OUTTARGET" "$LINEEND" >> "$PRODUCTMK"
        else
            printf '    %s/proprietary/%s:$(TARGET_COPY_OUT_SYSTEM)/%s%s\n' \
                "$OUTDIR" "$TARGET" "$TARGET" "$LINEEND" >> "$PRODUCTMK"
        fi
    done
    return 0
}

#
# write_blueprint_packages:
#
# $1: The LOCAL_MODULE_CLASS for the given module list
# $2: /system, /odm, /product, /system_ext, or /vendor partition
# $3: type-specific extra flags
# $4: Name of the array holding the target list
#
# Internal function which writes out the BUILD_PREBUILT stanzas
# for all modules in the list. This is called by write_product_packages
# after the modules are categorized.
#
function write_blueprint_packages() {

    local CLASS="$1"
    local PARTITION="$2"
    local EXTRA="$3"

    # Yes, this is a horrible hack - we create a new array using indirection
    local ARR_NAME="$4[@]"
    local FILELIST=("${!ARR_NAME}")

    local FILE=
    local ARGS=
    local BASENAME=
    local EXTENSION=
    local PKGNAME=
    local SRC=
    local OVERRIDEPKG=

    for P in "${FILELIST[@]}"; do
        FILE=$(target_file "$P")
        ARGS=$(target_args "$P")

        BASENAME=$(basename "$FILE")
        DIRNAME=$(dirname "$FILE")
        EXTENSION=${BASENAME##*.}
        PKGNAME=${BASENAME%.*}

        # Add to final package list
        PACKAGE_LIST+=("$PKGNAME")

        SRC="proprietary"
        if [ "$PARTITION" = "system" ]; then
            SRC+="/system"
        elif [ "$PARTITION" = "vendor" ]; then
            SRC+="/vendor"
        elif [ "$PARTITION" = "product" ]; then
            SRC+="/product"
        elif [ "$PARTITION" = "system_ext" ]; then
            SRC+="/system_ext"
        elif [ "$PARTITION" = "odm" ]; then
            SRC+="/odm"
        fi

        if [ "$CLASS" = "SHARED_LIBRARIES" ]; then
            printf 'cc_prebuilt_library_shared {\n'
            printf '\tname: "%s",\n' "$PKGNAME"
            printf '\towner: "%s",\n' "$VENDOR"
            printf '\tstrip: {\n'
            printf '\t\tnone: true,\n'
            printf '\t},\n'
            printf '\ttarget: {\n'
            if [ "$EXTRA" = "both" ]; then
                printf '\t\tandroid_arm: {\n'
                printf '\t\t\tsrcs: ["%s/lib/%s"],\n' "$SRC" "$FILE"
                printf '\t\t},\n'
                printf '\t\tandroid_arm64: {\n'
                printf '\t\t\tsrcs: ["%s/lib64/%s"],\n' "$SRC" "$FILE"
                printf '\t\t},\n'
            elif [ "$EXTRA" = "64" ]; then
                printf '\t\tandroid_arm64: {\n'
                printf '\t\t\tsrcs: ["%s/lib64/%s"],\n' "$SRC" "$FILE"
                printf '\t\t},\n'
            else
                printf '\t\tandroid_arm: {\n'
                printf '\t\t\tsrcs: ["%s/lib/%s"],\n' "$SRC" "$FILE"
                printf '\t\t},\n'
            fi
            printf '\t},\n'
            if [ "$EXTRA" != "none" ]; then
                printf '\tcompile_multilib: "%s",\n' "$EXTRA"
            fi
            printf '\tcheck_elf_files: false,\n'
        elif [ "$CLASS" = "APPS" ]; then
            printf 'android_app_import {\n'
            printf '\tname: "%s",\n' "$PKGNAME"
            printf '\towner: "%s",\n' "$VENDOR"
            if [ "$EXTRA" = "priv-app" ]; then
                SRC="$SRC/priv-app"
            else
                SRC="$SRC/app"
            fi
            printf '\tapk: "%s/%s",\n' "$SRC" "$FILE"
            ARGS=(${ARGS//;/ })
            USE_PLATFORM_CERTIFICATE="true"
            for ARG in "${ARGS[@]}"; do
                if [ "$ARG" = "PRESIGNED" ]; then
                    USE_PLATFORM_CERTIFICATE="false"
                    printf '\tpresigned: true,\n'
                elif [[ "$ARG" =~ "OVERRIDES" ]]; then
                    OVERRIDEPKG=${ARG#*=}
                    OVERRIDEPKG=${OVERRIDEPKG//,/ }
                    printf '\toverrides: ["%s"],\n' "$OVERRIDEPKG"
                elif [ ! -z "$ARG" ]; then
                    USE_PLATFORM_CERTIFICATE="false"
                    printf '\tcertificate: "%s",\n' "$ARG"
                fi
            done
            if [ "$USE_PLATFORM_CERTIFICATE" = "true" ]; then
                printf '\tcertificate: "platform",\n'
            fi
        elif [ "$CLASS" = "JAVA_LIBRARIES" ]; then
            printf 'dex_import {\n'
            printf '\tname: "%s",\n' "$PKGNAME"
            printf '\towner: "%s",\n' "$VENDOR"
            printf '\tjars: ["%s/framework/%s"],\n' "$SRC" "$FILE"
        elif [ "$CLASS" = "ETC" ]; then
            if [ "$EXTENSION" = "xml" ]; then
                printf 'prebuilt_etc_xml {\n'
            else
                printf 'prebuilt_etc {\n'
            fi
            printf '\tname: "%s",\n' "$PKGNAME"
            printf '\towner: "%s",\n' "$VENDOR"
            printf '\tsrc: "%s/etc/%s",\n' "$SRC" "$FILE"
            printf '\tfilename_from_src: true,\n'
        elif [ "$CLASS" = "EXECUTABLES" ]; then
            if [ "$EXTENSION" = "sh" ]; then
                printf 'sh_binary {\n'
            else
                printf 'cc_prebuilt_binary {\n'
            fi
            printf '\tname: "%s",\n' "$PKGNAME"
            printf '\towner: "%s",\n' "$VENDOR"
            if [ "$ARGS" = "rootfs" ]; then
                SRC="$SRC/rootfs"
                if [ "$EXTRA" = "sbin" ]; then
                    SRC="$SRC/sbin"
                    printf '\tdist {\n'
                    printf '\t\tdest: "%s",\n' "root/sbin"
                    printf '\t},'
                fi
            else
                SRC="$SRC/bin"
            fi
            printf '\tsrcs: ["%s/%s"],\n' "$SRC" "$FILE"
            if [ "$EXTENSION" != "sh" ]; then
                printf '\tcheck_elf_files: false,\n'
            fi
            unset EXTENSION
        else
            printf '\tsrcs: ["%s/%s"],\n' "$SRC" "$FILE"
        fi
        if [ "$CLASS" = "APPS" ]; then
            printf '\tdex_preopt: {\n'
            printf '\t\tenabled: false,\n'
            printf '\t},\n'
        fi
        if [ "$CLASS" = "SHARED_LIBRARIES" ] || [ "$CLASS" = "EXECUTABLES" ] ; then
            if [ "$DIRNAME" != "." ]; then
                printf '\trelative_install_path: "%s",\n' "$DIRNAME"
            fi
        fi
        if [ "$CLASS" = "ETC" ] ; then
            if [ "$DIRNAME" != "." ]; then
                printf '\tsub_dir: "%s",\n' "$DIRNAME"
            fi
        fi
        if [ "$CLASS" = "SHARED_LIBRARIES" ] || [ "$CLASS" = "EXECUTABLES" ] ; then
            printf '\tprefer: true,\n'
        fi
        if [ "$EXTRA" = "priv-app" ]; then
            printf '\tprivileged: true,\n'
        fi
        if [ "$PARTITION" = "vendor" ]; then
            printf '\tsoc_specific: true,\n'
        elif [ "$PARTITION" = "product" ]; then
            printf '\tproduct_specific: true,\n'
        elif [ "$PARTITION" = "system_ext" ]; then
            printf '\tsystem_ext_specific: true,\n'
        elif [ "$PARTITION" = "odm" ]; then
            printf '\tdevice_specific: true,\n'
        fi
        printf '}\n\n'
    done
}

#
# write_makefile_packages:
#
# $1: The LOCAL_MODULE_CLASS for the given module list
# $2: /odm, /product, /system_ext, or /vendor partition
# $3: type-specific extra flags
# $4: Name of the array holding the target list
#
# Internal function which writes out the BUILD_PREBUILT stanzas
# for all modules in the list. This is called by write_product_packages
# after the modules are categorized.
#
function write_makefile_packages() {

    local CLASS="$1"
    local PARTITION="$2"
    local EXTRA="$3"

    # Yes, this is a horrible hack - we create a new array using indirection
    local ARR_NAME="$4[@]"
    local FILELIST=("${!ARR_NAME}")

    local FILE=
    local ARGS=
    local BASENAME=
    local EXTENSION=
    local PKGNAME=
    local SRC=

    for P in "${FILELIST[@]}"; do
        FILE=$(target_file "$P")
        ARGS=$(target_args "$P")

        BASENAME=$(basename "$FILE")
        DIRNAME=$(dirname "$FILE")
        EXTENSION=${BASENAME##*.}
        EXTENSION="."$EXTENSION
        if [ "$EXTENSION" = ".jar" ]; then
                EXTENSION="\$(COMMON_JAVA_PACKAGE_SUFFIX)"
        elif [ "$EXTENSION" = ".apk" ]; then
                EXTENSION="\$(COMMON_ANDROID_PACKAGE_SUFFIX)"
        fi
        PKGNAME=${BASENAME%.*}

        # Add to final package list
        PACKAGE_LIST+=("$PKGNAME")

        SRC="proprietary"
        if [ "$PARTITION" = "system" ]; then
            SRC+="/system"
        elif [ "$PARTITION" = "vendor" ]; then
            SRC+="/vendor"
        elif [ "$PARTITION" = "product" ]; then
            SRC+="/product"
        elif [ "$PARTITION" = "system_ext" ]; then
            SRC+="/system_ext"
        elif [ "$PARTITION" = "odm" ]; then
            SRC+="/odm"
        fi

        printf 'include $(CLEAR_VARS)\n'
        printf 'LOCAL_MODULE := %s\n' "$PKGNAME"
        printf 'LOCAL_MODULE_OWNER := %s\n' "$VENDOR"
        if [ "$CLASS" = "SHARED_LIBRARIES" ]; then
            if [ "$EXTRA" = "both" ]; then
                printf 'LOCAL_SRC_FILES_64 := %s/lib64/%s\n' "$SRC" "$FILE"
                printf 'LOCAL_SRC_FILES_32 := %s/lib/%s\n' "$SRC" "$FILE"
                #if [ "$VENDOR_PKG" = "true" ]; then
                #    echo "LOCAL_MODULE_PATH_64 := \$(TARGET_OUT_VENDOR_SHARED_LIBRARIES)"
                #    echo "LOCAL_MODULE_PATH_32 := \$(2ND_TARGET_OUT_VENDOR_SHARED_LIBRARIES)"
                #else
                #    echo "LOCAL_MODULE_PATH_64 := \$(TARGET_OUT_SHARED_LIBRARIES)"
                #    echo "LOCAL_MODULE_PATH_32 := \$(2ND_TARGET_OUT_SHARED_LIBRARIES)"
                #fi
            elif [ "$EXTRA" = "64" ]; then
                printf 'LOCAL_SRC_FILES := %s/lib64/%s\n' "$SRC" "$FILE"
            else
                printf 'LOCAL_SRC_FILES := %s/lib/%s\n' "$SRC" "$FILE"
            fi
            if [ "$EXTRA" != "none" ]; then
                printf 'LOCAL_MULTILIB := %s\n' "$EXTRA"
            fi
        elif [ "$CLASS" = "APPS" ]; then
            if [ "$EXTRA" = "priv-app" ]; then
                SRC="$SRC/priv-app"
            else
                SRC="$SRC/app"
            fi
            printf 'LOCAL_SRC_FILES := %s/%s\n' "$SRC" "$FILE"
            local CERT=platform
            if [ ! -z "$ARGS" ]; then
                CERT="$ARGS"
            fi
            printf 'LOCAL_CERTIFICATE := %s\n' "$CERT"
        elif [ "$CLASS" = "JAVA_LIBRARIES" ]; then
            printf 'LOCAL_SRC_FILES := %s/framework/%s\n' "$SRC" "$FILE"
            local CERT=platform
            if [ ! -z "$ARGS" ]; then
                CERT="$ARGS"
            fi
            printf 'LOCAL_CERTIFICATE := %s\n' "$CERT"
        elif [ "$CLASS" = "ETC" ]; then
            printf 'LOCAL_SRC_FILES := %s/etc/%s\n' "$SRC" "$FILE"
        elif [ "$CLASS" = "EXECUTABLES" ]; then
            if [ "$ARGS" = "rootfs" ]; then
                SRC="$SRC/rootfs"
                if [ "$EXTRA" = "sbin" ]; then
                    SRC="$SRC/sbin"
                    printf '%s\n' "LOCAL_MODULE_PATH := \$(TARGET_ROOT_OUT_SBIN)"
                    printf '%s\n' "LOCAL_UNSTRIPPED_PATH := \$(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)"
                fi
            else
                SRC="$SRC/bin"
            fi
            printf 'LOCAL_SRC_FILES := %s/%s\n' "$SRC" "$FILE"
            unset EXTENSION
        else
            printf 'LOCAL_SRC_FILES := %s/%s\n' "$SRC" "$FILE"
        fi
        printf 'LOCAL_MODULE_TAGS := optional\n'
        printf 'LOCAL_MODULE_CLASS := %s\n' "$CLASS"
        if [ "$CLASS" = "APPS" ]; then
            printf 'LOCAL_DEX_PREOPT := false\n'
        fi
        if [ ! -z "$EXTENSION" ]; then
            printf 'LOCAL_MODULE_SUFFIX := %s\n' "$EXTENSION"
        fi
        if [ "$CLASS" = "SHARED_LIBRARIES" ] || [ "$CLASS" = "EXECUTABLES" ]; then
            if [ "$DIRNAME" != "." ]; then
                printf 'LOCAL_MODULE_RELATIVE_PATH := %s\n' "$DIRNAME"
            fi
        fi
        if [ "$EXTRA" = "priv-app" ]; then
            printf 'LOCAL_PRIVILEGED_MODULE := true\n'
        fi
        if [ "$PARTITION" = "vendor" ]; then
            printf 'LOCAL_VENDOR_MODULE := true\n'
        elif [ "$PARTITION" = "product" ]; then
            printf 'LOCAL_PRODUCT_MODULE := true\n'
        elif [ "$PARTITION" = "system_ext" ]; then
            printf 'LOCAL_SYSTEM_EXT_MODULE := true\n'
        elif [ "$PARTITION" = "odm" ]; then
            printf 'LOCAL_ODM_MODULE := true\n'
        fi
        printf 'include $(BUILD_PREBUILT)\n\n'
    done
}

#
# write_product_packages:
#
# This function will create prebuilt entries in the
# Android.bp and associated PRODUCT_PACKAGES list in the
# product makefile for all files in the blob list which
# start with a single dash (-) character.
#
function write_product_packages() {
    PACKAGE_LIST=()

    local COUNT=${#PRODUCT_PACKAGES_LIST[@]}

    if [ "$COUNT" = "0" ]; then
        return 0
    fi

    # Figure out what's 32-bit, what's 64-bit, and what's multilib
    # I really should not be doing this in bash due to shitty array passing :(
    local T_LIB32=( $(prefix_match "lib/") )
    local T_LIB64=( $(prefix_match "lib64/") )
    local MULTILIBS=( $(comm -12 <(printf '%s\n' "${T_LIB32[@]}") <(printf '%s\n' "${T_LIB64[@]}")) )
    local LIB32=( $(comm -23 <(printf '%s\n'  "${T_LIB32[@]}") <(printf '%s\n' "${MULTILIBS[@]}")) )
    local LIB64=( $(comm -23 <(printf '%s\n' "${T_LIB64[@]}") <(printf '%s\n' "${MULTILIBS[@]}")) )

    if [ "${#MULTILIBS[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "" "both" "MULTILIBS" >> "$ANDROIDBP"
    fi
    if [ "${#LIB32[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "" "32" "LIB32" >> "$ANDROIDBP"
    fi
    if [ "${#LIB64[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "" "64" "LIB64" >> "$ANDROIDBP"
    fi

    local T_S_LIB32=( $(prefix_match "system/lib/") )
    local T_S_LIB64=( $(prefix_match "system/lib64/") )
    local S_MULTILIBS=( $(comm -12 <(printf '%s\n' "${T_S_LIB32[@]}") <(printf '%s\n' "${T_S_LIB64[@]}")) )
    local S_LIB32=( $(comm -23 <(printf '%s\n'  "${T_S_LIB32[@]}") <(printf '%s\n' "${S_MULTILIBS[@]}")) )
    local S_LIB64=( $(comm -23 <(printf '%s\n' "${T_S_LIB64[@]}") <(printf '%s\n' "${S_MULTILIBS[@]}")) )

    if [ "${#S_MULTILIBS[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "system" "both" "S_MULTILIBS" >> "$ANDROIDBP"
    fi
    if [ "${#S_LIB32[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "system" "32" "S_LIB32" >> "$ANDROIDBP"
    fi
    if [ "${#S_LIB64[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "system" "64" "S_LIB64" >> "$ANDROIDBP"
    fi

    local T_V_LIB32=( $(prefix_match "vendor/lib/") )
    local T_V_LIB64=( $(prefix_match "vendor/lib64/") )
    local V_MULTILIBS=( $(comm -12 <(printf '%s\n' "${T_V_LIB32[@]}") <(printf '%s\n' "${T_V_LIB64[@]}")) )
    local V_LIB32=( $(comm -23 <(printf '%s\n' "${T_V_LIB32[@]}") <(printf '%s\n' "${V_MULTILIBS[@]}")) )
    local V_LIB64=( $(comm -23 <(printf '%s\n' "${T_V_LIB64[@]}") <(printf '%s\n' "${V_MULTILIBS[@]}")) )

    if [ "${#V_MULTILIBS[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "vendor" "both" "V_MULTILIBS" >> "$ANDROIDBP"
    fi
    if [ "${#V_LIB32[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "vendor" "32" "V_LIB32" >> "$ANDROIDBP"
    fi
    if [ "${#V_LIB64[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "vendor" "64" "V_LIB64" >> "$ANDROIDBP"
    fi

    local T_P_LIB32=( $(prefix_match "product/lib/") )
    local T_P_LIB64=( $(prefix_match "product/lib64/") )
    local P_MULTILIBS=( $(comm -12 <(printf '%s\n' "${T_P_LIB32[@]}") <(printf '%s\n' "${T_P_LIB64[@]}")) )
    local P_LIB32=( $(comm -23 <(printf '%s\n' "${T_P_LIB32[@]}") <(printf '%s\n' "${P_MULTILIBS[@]}")) )
    local P_LIB64=( $(comm -23 <(printf '%s\n' "${T_P_LIB64[@]}") <(printf '%s\n' "${P_MULTILIBS[@]}")) )

    if [ "${#P_MULTILIBS[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "product" "both" "P_MULTILIBS" >> "$ANDROIDBP"
    fi
    if [ "${#P_LIB32[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "product" "32" "P_LIB32" >> "$ANDROIDBP"
    fi
    if [ "${#P_LIB64[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "product" "64" "P_LIB64" >> "$ANDROIDBP"
    fi

    local T_SE_LIB32=( $(prefix_match "system_ext/lib/") )
    local T_SE_LIB64=( $(prefix_match "system_ext/lib64/") )
    local SE_MULTILIBS=( $(comm -12 <(printf '%s\n' "${T_SE_LIB32[@]}") <(printf '%s\n' "${T_SE_LIB64[@]}")) )
    local SE_LIB32=( $(comm -23 <(printf '%s\n' "${T_SE_LIB32[@]}") <(printf '%s\n' "${SE_MULTILIBS[@]}")) )
    local SE_LIB64=( $(comm -23 <(printf '%s\n' "${T_SE_LIB64[@]}") <(printf '%s\n' "${SE_MULTILIBS[@]}")) )

    if [ "${#SE_MULTILIBS[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "system_ext" "both" "SE_MULTILIBS" >> "$ANDROIDBP"
    fi
    if [ "${#SE_LIB32[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "system_ext" "32" "SE_LIB32" >> "$ANDROIDBP"
    fi
    if [ "${#SE_LIB64[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "system_ext" "64" "SE_LIB64" >> "$ANDROIDBP"
    fi

    local T_O_LIB32=( $(prefix_match "odm/lib/") )
    local T_O_LIB64=( $(prefix_match "odm/lib64/") )
    local O_MULTILIBS=( $(comm -12 <(printf '%s\n' "${T_O_LIB32[@]}") <(printf '%s\n' "${T_O_LIB64[@]}")) )
    local O_LIB32=( $(comm -23 <(printf '%s\n' "${T_O_LIB32[@]}") <(printf '%s\n' "${O_MULTILIBS[@]}")) )
    local O_LIB64=( $(comm -23 <(printf '%s\n' "${T_O_LIB64[@]}") <(printf '%s\n' "${O_MULTILIBS[@]}")) )

    if [ "${#O_MULTILIBS[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "odm" "both" "O_MULTILIBS" >> "$ANDROIDBP"
    fi
    if [ "${#O_LIB32[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "odm" "32" "O_LIB32" >> "$ANDROIDBP"
    fi
    if [ "${#O_LIB64[@]}" -gt "0" ]; then
        write_blueprint_packages "SHARED_LIBRARIES" "odm" "64" "O_LIB64" >> "$ANDROIDBP"
    fi

    # Apps
    local APPS=( $(prefix_match "app/") )
    if [ "${#APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "" "" "APPS" >> "$ANDROIDBP"
    fi
    local PRIV_APPS=( $(prefix_match "priv-app/") )
    if [ "${#PRIV_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "" "priv-app" "PRIV_APPS" >> "$ANDROIDBP"
    fi
    local S_APPS=( $(prefix_match "system/app/") )
    if [ "${#S_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "system" "" "S_APPS" >> "$ANDROIDBP"
    fi
    local S_PRIV_APPS=( $(prefix_match "system/priv-app/") )
    if [ "${#S_PRIV_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "system" "priv-app" "S_PRIV_APPS" >> "$ANDROIDBP"
    fi
    local V_APPS=( $(prefix_match "vendor/app/") )
    if [ "${#V_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "vendor" "" "V_APPS" >> "$ANDROIDBP"
    fi
    local V_PRIV_APPS=( $(prefix_match "vendor/priv-app/") )
    if [ "${#V_PRIV_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "vendor" "priv-app" "V_PRIV_APPS" >> "$ANDROIDBP"
    fi
    local P_APPS=( $(prefix_match "product/app/") )
    if [ "${#P_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "product" "" "P_APPS" >> "$ANDROIDBP"
    fi
    local P_PRIV_APPS=( $(prefix_match "product/priv-app/") )
    if [ "${#P_PRIV_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "product" "priv-app" "P_PRIV_APPS" >> "$ANDROIDBP"
    fi
    local SE_APPS=( $(prefix_match "system_ext/app/") )
    if [ "${#SE_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "system_ext" "" "SE_APPS" >> "$ANDROIDBP"
    fi
    local SE_PRIV_APPS=( $(prefix_match "system_ext/priv-app/") )
    if [ "${#SE_PRIV_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "system_ext" "priv-app" "SE_PRIV_APPS" >> "$ANDROIDBP"
    fi
    local O_APPS=( $(prefix_match "odm/app/") )
    if [ "${#O_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "odm" "" "O_APPS" >> "$ANDROIDBP"
    fi
    local O_PRIV_APPS=( $(prefix_match "odm/priv-app/") )
    if [ "${#O_PRIV_APPS[@]}" -gt "0" ]; then
        write_blueprint_packages "APPS" "odm" "priv-app" "O_PRIV_APPS" >> "$ANDROIDBP"
    fi

    # Framework
    local FRAMEWORK=( $(prefix_match "framework/") )
    if [ "${#FRAMEWORK[@]}" -gt "0" ]; then
        write_blueprint_packages "JAVA_LIBRARIES" "" "" "FRAMEWORK" >> "$ANDROIDBP"
    fi
    local S_FRAMEWORK=( $(prefix_match "system/framework/") )
    if [ "${#S_FRAMEWORK[@]}" -gt "0" ]; then
        write_blueprint_packages "JAVA_LIBRARIES" "system" "" "S_FRAMEWORK" >> "$ANDROIDBP"
    fi
    local V_FRAMEWORK=( $(prefix_match "vendor/framework/") )
    if [ "${#V_FRAMEWORK[@]}" -gt "0" ]; then
        write_blueprint_packages "JAVA_LIBRARIES" "vendor" "" "V_FRAMEWORK" >> "$ANDROIDBP"
    fi
    local P_FRAMEWORK=( $(prefix_match "product/framework/") )
    if [ "${#P_FRAMEWORK[@]}" -gt "0" ]; then
        write_blueprint_packages "JAVA_LIBRARIES" "product" "" "P_FRAMEWORK" >> "$ANDROIDBP"
    fi
    local SE_FRAMEWORK=( $(prefix_match "system_ext/framework/") )
    if [ "${#SE_FRAMEWORK[@]}" -gt "0" ]; then
        write_blueprint_packages "JAVA_LIBRARIES" "system_ext" "" "SE_FRAMEWORK" >> "$ANDROIDBP"
    fi
    local O_FRAMEWORK=( $(prefix_match "odm/framework/") )
    if [ "${#O_FRAMEWORK[@]}" -gt "0" ]; then
        write_blueprint_packages "JAVA_LIBRARIES" "odm" "" "O_FRAMEWORK" >> "$ANDROIDBP"
    fi

    # Etc
    local ETC=( $(prefix_match "etc/") )
    if [ "${#ETC[@]}" -gt "0" ]; then
        write_blueprint_packages "ETC" "" "" "ETC" >> "$ANDROIDBP"
    fi
    local S_ETC=( $(prefix_match "system/etc/") )
    if [ "${#ETC[@]}" -gt "0" ]; then
        write_blueprint_packages "ETC" "system" "" "S_ETC" >> "$ANDROIDBP"
    fi
    local V_ETC=( $(prefix_match "vendor/etc/") )
    if [ "${#V_ETC[@]}" -gt "0" ]; then
        write_blueprint_packages "ETC" "vendor" "" "V_ETC" >> "$ANDROIDBP"
    fi
    local P_ETC=( $(prefix_match "product/etc/") )
    if [ "${#P_ETC[@]}" -gt "0" ]; then
        write_blueprint_packages "ETC" "product" "" "P_ETC" >> "$ANDROIDBP"
    fi
    local SE_ETC=( $(prefix_match "system_ext/etc/") )
    if [ "${#SE_ETC[@]}" -gt "0" ]; then
        write_blueprint_packages "ETC" "system_ext" "" "SE_ETC" >> "$ANDROIDBP"
    fi
    local O_ETC=( $(prefix_match "odm/etc/") )
    if [ "${#O_ETC[@]}" -gt "0" ]; then
        write_blueprint_packages "ETC" "odm" "" "O_ETC" >> "$ANDROIDBP"
    fi

    # Executables
    local BIN=( $(prefix_match "bin/") )
    if [ "${#BIN[@]}" -gt "0"  ]; then
        write_blueprint_packages "EXECUTABLES" "" "" "BIN" >> "$ANDROIDBP"
    fi
    local S_BIN=( $(prefix_match "system/bin/") )
    if [ "${#BIN[@]}" -gt "0"  ]; then
        write_blueprint_packages "EXECUTABLES" "system" "" "S_BIN" >> "$ANDROIDBP"
    fi
    local V_BIN=( $(prefix_match "vendor/bin/") )
    if [ "${#V_BIN[@]}" -gt "0" ]; then
        write_blueprint_packages "EXECUTABLES" "vendor" "" "V_BIN" >> "$ANDROIDBP"
    fi
    local P_BIN=( $(prefix_match "product/bin/") )
    if [ "${#P_BIN[@]}" -gt "0" ]; then
        write_blueprint_packages "EXECUTABLES" "product" "" "P_BIN" >> "$ANDROIDBP"
    fi
    local SE_BIN=( $(prefix_match "system_ext/bin/") )
    if [ "${#SE_BIN[@]}" -gt "0" ]; then
        write_blueprint_packages "EXECUTABLES" "system_ext" "" "SE_BIN" >> "$ANDROIDBP"
    fi
    local O_BIN=( $(prefix_match "odm/bin/") )
    if [ "${#O_BIN[@]}" -gt "0" ]; then
        write_blueprint_packages "EXECUTABLES" "odm" "" "O_BIN" >> "$ANDROIDBP"
    fi
    local SBIN=( $(prefix_match "sbin/") )
    if [ "${#SBIN[@]}" -gt "0" ]; then
        write_makefile_packages "EXECUTABLES" "" "sbin" "SBIN" >> "$ANDROIDMK"
    fi


    # Actually write out the final PRODUCT_PACKAGES list
    local PACKAGE_COUNT=${#PACKAGE_LIST[@]}

    if [ "$PACKAGE_COUNT" -eq "0" ]; then
        return 0
    fi

    printf '\n%s\n' "PRODUCT_PACKAGES += \\" >> "$PRODUCTMK"
    for (( i=1; i<PACKAGE_COUNT+1; i++ )); do
        local LINEEND=" \\"
        if [ "$i" -eq "$PACKAGE_COUNT" ]; then
            LINEEND=""
        fi
        printf '    %s%s\n' "${PACKAGE_LIST[$i-1]}" "$LINEEND" >> "$PRODUCTMK"
    done
}

#
# write_blueprint_header:
#
# $1: file which will be written to
#
# writes out the warning message regarding manual file modifications.
# note that this is not an append operation, and should
# be executed first!
#
function write_blueprint_header() {
    if [ -f $1 ]; then
        rm $1
    fi

    [ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON"

    cat << EOF >> $1
// Automatically generated file. DO NOT MODIFY
//
// This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh

EOF
}

#
# write_makefile_header:
#
# $1: file which will be written to
#
# writes out the warning message regarding manual file modifications.
# note that this is not an append operation, and should
# be executed first!
#
function write_makefile_header() {
    if [ -f $1 ]; then
        rm $1
    fi

    [ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON"

    cat << EOF >> $1
# Automatically generated file. DO NOT MODIFY
#
# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh

EOF
}

#
# write_headers:
#
# $1: devices falling under common to be added to guard - optional
# $2: custom guard - optional
#
# Calls write_makefile_header for each of the makefiles and
# write_blueprint_header for Android.bp and creates the initial
# path declaration and device guard for the Android.mk
#
function write_headers() {
    write_makefile_header "$ANDROIDMK"

    GUARD="$2"
    if [ -z "$GUARD" ]; then
        GUARD="TARGET_DEVICE"
    fi

    cat << EOF >> "$ANDROIDMK"
LOCAL_PATH := \$(call my-dir)

EOF
    if [ "$COMMON" -ne 1 ]; then
        cat << EOF >> "$ANDROIDMK"
ifeq (\$($GUARD),$DEVICE)

EOF
    else
        if [ -z "$1" ]; then
            echo "Argument with devices to be added to guard must be set!"
            exit 1
        fi
        cat << EOF >> "$ANDROIDMK"
ifneq (\$(filter $1,\$($GUARD)),)

EOF
    fi

    write_makefile_header "$BOARDMK"
    write_makefile_header "$PRODUCTMK"
    write_blueprint_header "$ANDROIDBP"

    cat << EOF >> "$ANDROIDBP"
soong_namespace {
}

EOF

    [ "$COMMON" -eq 1 ] && local DEVICE="$DEVICE_COMMON"
    cat << EOF >> "$PRODUCTMK"
PRODUCT_SOONG_NAMESPACES += \\
    vendor/$VENDOR/$DEVICE

EOF
}

#
# write_footers:
#
# Closes the inital guard and any other finalization tasks. Must
# be called as the final step.
#
function write_footers() {
    cat << EOF >> "$ANDROIDMK"
endif
EOF
}

# Return success if adb is up and not in recovery
function _adb_connected {
    {
        if [[ "$(adb get-state)" == device ]]
        then
            return 0
        fi
    } 2>/dev/null

    return 1
};

#
# parse_file_list:
#
# $1: input file
# $2: blob section in file - optional
#
# Sets PRODUCT_PACKAGES and PRODUCT_COPY_FILES while parsing the input file
#
function parse_file_list() {
    if [ -z "$1" ]; then
        echo "An input file is expected!"
        exit 1
    elif [ ! -f "$1" ]; then
        echo "Input file "$1" does not exist!"
        exit 1
    fi

    if [ -n "$2" ]; then
        echo "Using section \"$2\""
        LIST=$TMPDIR/files.txt
        # Match all lines starting with first line found to start* with '#'
        # comment and contain** $2, and ending with first line to be empty*.
        # *whitespaces (tabs, spaces) at the beginning of lines are discarded
        # **the $2 match is case-insensitive
        cat $1 | sed -n '/^[[:space:]]*#.*'"$2"'/I,/^[[:space:]]*$/ p' > $LIST
    else
        LIST=$1
    fi


    PRODUCT_PACKAGES_LIST=()
    PRODUCT_PACKAGES_HASHES=()
    PRODUCT_PACKAGES_FIXUP_HASHES=()
    PRODUCT_COPY_FILES_LIST=()
    PRODUCT_COPY_FILES_HASHES=()
    PRODUCT_COPY_FILES_FIXUP_HASHES=()

    while read -r line; do
        if [ -z "$line" ]; then continue; fi

        # If the line has a pipe delimiter, a sha1 hash should follow.
        # This indicates the file should be pinned and not overwritten
        # when extracting files.
        local SPLIT=(${line//\|/ })
        local COUNT=${#SPLIT[@]}
        local SPEC=${SPLIT[0]}
        local HASH="x"
        local FIXUP_HASH="x"
        if [ "$COUNT" -gt "1" ]; then
            HASH=${SPLIT[1]}
        fi
        if [ "$COUNT" -gt "2" ]; then
            FIXUP_HASH=${SPLIT[2]}
        fi

        # if line starts with a dash, it needs to be packaged
        if [[ "$SPEC" =~ ^- ]]; then
            PRODUCT_PACKAGES_LIST+=("${SPEC#-}")
            PRODUCT_PACKAGES_HASHES+=("$HASH")
            PRODUCT_PACKAGES_FIXUP_HASHES+=("$FIXUP_HASH")
        else
            PRODUCT_COPY_FILES_LIST+=("$SPEC")
            PRODUCT_COPY_FILES_HASHES+=("$HASH")
            PRODUCT_COPY_FILES_FIXUP_HASHES+=("$FIXUP_HASH")
        fi

    done < <(egrep -v '(^#|^[[:space:]]*$)' "$LIST" | LC_ALL=C sort | uniq)
}

#
# write_makefiles:
#
# $1: file containing the list of items to extract
# $2: make treble compatible makefile - optional
#
# Calls write_product_copy_files and write_product_packages on
# the given file and appends to the Android.bp as well as
# the product makefile.
#
function write_makefiles() {
    parse_file_list "$1"
    write_product_copy_files "$2"
    write_product_packages
}

#
# append_firmware_calls_to_makefiles:
#
# Appends to Android.mk the calls to all images present in radio folder
# (filesmap file used by releasetools to map firmware images should be kept in the device tree)
#
function append_firmware_calls_to_makefiles() {
    cat << EOF >> "$ANDROIDMK"
ifeq (\$(LOCAL_PATH)/radio, \$(wildcard \$(LOCAL_PATH)/radio))

RADIO_FILES := \$(wildcard \$(LOCAL_PATH)/radio/*)
\$(foreach f, \$(notdir \$(RADIO_FILES)), \\
    \$(call add-radio-file,radio/\$(f)))
\$(call add-radio-file,../../../device/$VENDOR/$DEVICE/radio/filesmap)

endif

EOF
}

#
# get_file:
#
# $1: input file
# $2: target file/folder
# $3: source of the file (can be "adb" or a local folder)
#
# Silently extracts the input file to defined target
# Returns success if file can be pulled from the device or found locally
#
function get_file() {
    local SRC="$3"

    if [ "$SRC" = "adb" ]; then
        # try to pull
        adb pull "$1" "$2" >/dev/null 2>&1 && return 0

        return 1
    else
        # try to copy
        cp -r "$SRC/$1"           "$2" 2>/dev/null && return 0
        cp -r "$SRC/${1#/system}" "$2" 2>/dev/null && return 0
        cp -r "$SRC/system/$1"    "$2" 2>/dev/null && return 0

        return 1
    fi
};

#
# oat2dex:
#
# $1: extracted apk|jar (to check if deodex is required)
# $2: odexed apk|jar to deodex
# $3: source of the odexed apk|jar
#
# Convert apk|jar .odex in the corresposing classes.dex
#
function oat2dex() {
    local CUSTOM_TARGET="$1"
    local OEM_TARGET="$2"
    local SRC="$3"
    local TARGET=
    local OAT=

    if [ -z "$BAKSMALIJAR" ] || [ -z "$SMALIJAR" ]; then
        export BAKSMALIJAR="$ANDROID_ROOT"/prebuilts/extract-tools/common/smali/baksmali.jar
        export SMALIJAR="$ANDROID_ROOT"/prebuilts/extract-tools/common/smali/smali.jar
    fi

    if [ -z "$VDEXEXTRACTOR" ]; then
        export VDEXEXTRACTOR="$ANDROID_ROOT"/prebuilts/extract-tools/${HOST}-x86/bin/vdexExtractor
    fi

    if [ -z "$CDEXCONVERTER" ]; then
        export CDEXCONVERTER="$ANDROID_ROOT"/prebuilts/extract-tools/${HOST}-x86/bin/compact_dex_converter
    fi

    # Extract existing boot.oats to the temp folder
    if [ -z "$ARCHES" ]; then
        echo "Checking if system is odexed and locating boot.oats..."
        for ARCH in "arm64" "arm" "x86_64" "x86"; do
            mkdir -p "$TMPDIR/system/framework/$ARCH"
            if get_file "/system/framework/$ARCH" "$TMPDIR/system/framework/" "$SRC"; then
                ARCHES+="$ARCH "
            else
                rmdir "$TMPDIR/system/framework/$ARCH"
            fi
        done
    fi

    if [ -z "$ARCHES" ]; then
        FULLY_DEODEXED=1 && return 0 # system is fully deodexed, return
    fi

    if [ ! -f "$CUSTOM_TARGET" ]; then
        return;
    fi

    if grep "classes.dex" "$CUSTOM_TARGET" >/dev/null; then
        return 0 # target apk|jar is already odexed, return
    fi

    for ARCH in $ARCHES; do
        BOOTOAT="$TMPDIR/system/framework/$ARCH/boot.oat"

        local OAT="$(dirname "$OEM_TARGET")/oat/$ARCH/$(basename "$OEM_TARGET" ."${OEM_TARGET##*.}").odex"
        local VDEX="$(dirname "$OEM_TARGET")/oat/$ARCH/$(basename "$OEM_TARGET" ."${OEM_TARGET##*.}").vdex"

        if get_file "$OAT" "$TMPDIR" "$SRC"; then
            if get_file "$VDEX" "$TMPDIR" "$SRC"; then
                "$VDEXEXTRACTOR" -o "$TMPDIR/" -i "$TMPDIR/$(basename "$VDEX")" > /dev/null
                CLASSES=$(ls "$TMPDIR/$(basename "${OEM_TARGET%.*}")_classes"*)
                for CLASS in $CLASSES; do
                    NEWCLASS=$(echo "$CLASS" | sed 's/.*_//;s/cdex/dex/')
                    # Check if we have to deal with CompactDex
                    if [[ "$CLASS" == *.cdex ]]; then
                        "$CDEXCONVERTER" "$CLASS" &>/dev/null
                        mv "$CLASS.new" "$TMPDIR/$NEWCLASS"
                    else
                        mv "$CLASS" "$TMPDIR/$NEWCLASS"
                    fi
                done
            else
                java -jar "$BAKSMALIJAR" deodex -o "$TMPDIR/dexout" -b "$BOOTOAT" -d "$TMPDIR" "$TMPDIR/$(basename "$OAT")"
                java -jar "$SMALIJAR" assemble "$TMPDIR/dexout" -o "$TMPDIR/classes.dex"
            fi
        elif [[ "$CUSTOM_TARGET" =~ .jar$ ]]; then
            JAROAT="$TMPDIR/system/framework/$ARCH/boot-$(basename ${OEM_TARGET%.*}).oat"
            JARVDEX="/system/framework/boot-$(basename ${OEM_TARGET%.*}).vdex"
            if [ ! -f "$JAROAT" ]; then
                JAROAT=$BOOTOAT
            fi
            # try to extract classes.dex from boot.vdex for frameworks jars
            # fallback to boot.oat if vdex is not available
            if get_file "$JARVDEX" "$TMPDIR" "$SRC"; then
                "$VDEXEXTRACTOR" -o "$TMPDIR/" -i "$TMPDIR/$(basename "$JARVDEX")" > /dev/null
                CLASSES=$(ls "$TMPDIR/$(basename "${JARVDEX%.*}")_classes"*)
                for CLASS in $CLASSES; do
                    NEWCLASS=$(echo "$CLASS" | sed 's/.*_//;s/cdex/dex/')
                    # Check if we have to deal with CompactDex
                    if [[ "$CLASS" == *.cdex ]]; then
                        "$CDEXCONVERTER" "$CLASS" &>/dev/null
                        mv "$CLASS.new" "$TMPDIR/$NEWCLASS"
                    else
                        mv "$CLASS" "$TMPDIR/$NEWCLASS"
                    fi
                done
            else
                java -jar "$BAKSMALIJAR" deodex -o "$TMPDIR/dexout" -b "$BOOTOAT" -d "$TMPDIR" "$JAROAT/$OEM_TARGET"
                java -jar "$SMALIJAR" assemble "$TMPDIR/dexout" -o "$TMPDIR/classes.dex"
            fi
        else
            continue
        fi

    done

    rm -rf "$TMPDIR/dexout"
}

#
# init_adb_connection:
#
# Starts adb server and waits for the device
#
function init_adb_connection() {
    adb start-server # Prevent unexpected starting server message from adb get-state in the next line
    if ! _adb_connected; then
        echo "No device is online. Waiting for one..."
        echo "Please connect USB and/or enable USB debugging"
        until _adb_connected; do
            sleep 1
        done
        echo "Device Found."
    fi

    # Retrieve IP and PORT info if we're using a TCP connection
    TCPIPPORT=$(adb devices | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+[^0-9]+' \
        | head -1 | awk '{print $1}')
    adb root &> /dev/null
    sleep 0.3
    if [ -n "$TCPIPPORT" ]; then
        # adb root just killed our connection
        # so reconnect...
        adb connect "$TCPIPPORT"
    fi
    adb wait-for-device &> /dev/null
    sleep 0.3
}

#
# fix_xml:
#
# $1: xml file to fix
#
function fix_xml() {
    local XML="$1"
    local TEMP_XML="$TMPDIR/`basename "$XML"`.temp"

    grep -a '^<?xml version' "$XML" > "$TEMP_XML"
    grep -av '^<?xml version' "$XML" >> "$TEMP_XML"

    mv "$TEMP_XML" "$XML"
}

function get_hash() {
    local FILE="$1"

    if [ "$(uname)" == "Darwin" ]; then
        shasum "${FILE}" | awk '{print $1}'
    else
        sha1sum "${FILE}" | awk '{print $1}'
    fi
}

function print_spec() {
    local SPEC_PRODUCT_PACKAGE="$1"
    local SPEC_SRC_FILE="$2"
    local SPEC_DST_FILE="$3"
    local SPEC_ARGS="$4"
    local SPEC_HASH="$5"
    local SPEC_FIXUP_HASH="$6"

    local PRODUCT_PACKAGE=""
    if [ ${SPEC_PRODUCT_PACKAGE} = true ]; then
        PRODUCT_PACKAGE="-"
    fi
    local SRC=""
    if [ ! -z "${SPEC_SRC_FILE}" ] && [ "${SPEC_SRC_FILE}" != "${SPEC_DST_FILE}" ]; then
        SRC="${SPEC_SRC_FILE}:"
    fi
    local DST=""
    if [ ! -z "${SPEC_DST_FILE}" ]; then
        DST="${SPEC_DST_FILE}"
    fi
    local ARGS=""
    if [ ! -z "${SPEC_ARGS}" ]; then
        ARGS=";${SPEC_ARGS}"
    fi
    local HASH=""
    if [ ! -z "${SPEC_HASH}" ] && [ "${SPEC_HASH}" != "x" ]; then
        HASH="|${SPEC_HASH}"
    fi
    local FIXUP_HASH=""
    if [ ! -z "${SPEC_FIXUP_HASH}" ] && [ "${SPEC_FIXUP_HASH}" != "x" ] && [ "${SPEC_FIXUP_HASH}" != "${SPEC_HASH}" ]; then
        FIXUP_HASH="|${SPEC_FIXUP_HASH}"
    fi
    printf '%s%s%s%s%s%s\n' "${PRODUCT_PACKAGE}" "${SRC}" "${DST}" "${ARGS}" "${HASH}" "${FIXUP_HASH}"
}

# To be overridden by device-level extract-files.sh
# Parameters:
#   $1: spec name of a blob. Can be used for filtering.
#       If the spec is "src:dest", then $1 is "dest".
#       If the spec is "src", then $1 is "src".
#   $2: path to blob file. Can be used for fixups.
#
function blob_fixup() {
    :
}

#
# extract:
#
# Positional parameters:
# $1: file containing the list of items to extract (aka proprietary-files.txt)
# $2: path to extracted system folder, an ota zip file, or "adb" to extract from device
# $3: section in list file to extract - optional. Setting section via $3 is deprecated.
#
# Non-positional parameters (coming after $2):
# --section: preferred way of selecting the portion to parse and extract from
#            proprietary-files.txt
# --kang: if present, this option will activate the printing of hashes for the
#         extracted blobs. Useful with --section for subsequent pinning of
#         blobs taken from other origins.
#
function extract() {
    # Consume positional parameters
    local PROPRIETARY_FILES_TXT="$1"; shift
    local SRC="$1"; shift
    local SECTION=""
    local KANG=false

    # Consume optional, non-positional parameters
    while [ "$#" -gt 0 ]; do
        case "$1" in
        -s|--section)
            SECTION="$2"; shift
            ;;
        -k|--kang)
            KANG=true
            DISABLE_PINNING=1
            ;;
        *)
            # Backwards-compatibility with the old behavior, where $3, if
            # present, denoted an optional positional ${SECTION} argument.
            # Users of ${SECTION} are encouraged to migrate from setting it as
            # positional $3, to non-positional --section ${SECTION}, the
            # reason being that it doesn't scale to have more than 1 optional
            # positional argument.
            SECTION="$1"
            ;;
        esac
        shift
    done

    if [ -z "$OUTDIR" ]; then
        echo "Output dir not set!"
        exit 1
    fi

    parse_file_list "${PROPRIETARY_FILES_TXT}" "${SECTION}"

    # Allow failing, so we can try $DEST and/or $FILE
    set +e

    local FILELIST=( ${PRODUCT_COPY_FILES_LIST[@]} ${PRODUCT_PACKAGES_LIST[@]} )
    local HASHLIST=( ${PRODUCT_COPY_FILES_HASHES[@]} ${PRODUCT_PACKAGES_HASHES[@]} )
    local FIXUP_HASHLIST=( ${PRODUCT_COPY_FILES_FIXUP_HASHES[@]} ${PRODUCT_PACKAGES_FIXUP_HASHES[@]} )
    local PRODUCT_COPY_FILES_COUNT=${#PRODUCT_COPY_FILES_LIST[@]}
    local COUNT=${#FILELIST[@]}
    local OUTPUT_ROOT="$ANDROID_ROOT"/"$OUTDIR"/proprietary
    local OUTPUT_TMP="$TMPDIR"/"$OUTDIR"/proprietary

    if [ "$SRC" = "adb" ]; then
        init_adb_connection
    fi

    if [ -f "$SRC" ] && [ "${SRC##*.}" == "zip" ]; then
        DUMPDIR="$TMPDIR"/system_dump

        # Check if we're working with the same zip that was passed last time.
        # If so, let's just use what's already extracted.
        MD5=`md5sum "$SRC"| awk '{print $1}'`
        OLDMD5=`cat "$DUMPDIR"/zipmd5.txt`

        if [ "$MD5" != "$OLDMD5" ]; then
            rm -rf "$DUMPDIR"
            mkdir "$DUMPDIR"
            unzip "$SRC" -d "$DUMPDIR"
            echo "$MD5" > "$DUMPDIR"/zipmd5.txt

            # Stop if an A/B OTA zip is detected. We cannot extract these.
            if [ -a "$DUMPDIR"/payload.bin ]; then
                echo "A/B style OTA zip detected. This is not supported at this time. Stopping..."
                exit 1
            fi

            for PARTITION in "system" "odm" "product" "system_ext" "vendor"
            do
                # If OTA is block based, extract it.
                if [ -a "$DUMPDIR"/"$PARTITION".new.dat.br ]; then
                    echo "Converting "$PARTITION".new.dat.br to "$PARTITION".new.dat"
                    brotli -d "$DUMPDIR"/"$PARTITION".new.dat.br
                    rm "$DUMPDIR"/"$PARTITION".new.dat.br
                fi
                if [ -a "$DUMPDIR"/"$PARTITION".new.dat ]; then
                    echo "Converting "$PARTITION".new.dat to "$PARTITION".img"
                    python "$ANDROID_ROOT"/tools/extract-utils/sdat2img.py "$DUMPDIR"/"$PARTITION".transfer.list "$DUMPDIR"/"$PARTITION".new.dat "$DUMPDIR"/"$PARTITION".img 2>&1
                    rm -rf "$DUMPDIR"/"$PARTITION".new.dat "$DUMPDIR"/"$PARTITION"
                    mkdir "$DUMPDIR"/"$PARTITION" "$DUMPDIR"/tmp
                    echo "Requesting sudo access to mount the "$PARTITION".img"
                    sudo mount -o loop "$DUMPDIR"/"$PARTITION".img "$DUMPDIR"/tmp
                    cp -r "$DUMPDIR"/tmp/* "$DUMPDIR"/"$PARTITION"/
                    sudo umount "$DUMPDIR"/tmp
                    rm -rf "$DUMPDIR"/tmp "$DUMPDIR"/"$PARTITION".img
                fi
            done
        fi

        SRC="$DUMPDIR"
    fi

    if [ "$VENDOR_STATE" -eq "0" ]; then
        echo "Cleaning output directory ($OUTPUT_ROOT).."
        rm -rf "${OUTPUT_TMP:?}"
        mkdir -p "${OUTPUT_TMP:?}"
        if [ -d "$OUTPUT_ROOT" ]; then
            mv "${OUTPUT_ROOT:?}/"* "${OUTPUT_TMP:?}/"
        fi
        VENDOR_STATE=1
    fi

    echo "Extracting ${COUNT} files in ${PROPRIETARY_FILES_TXT} from ${SRC}:"

    for (( i=1; i<COUNT+1; i++ )); do

        local SPEC_SRC_FILE=$(src_file "${FILELIST[$i-1]}")
        local SPEC_DST_FILE=$(target_file "${FILELIST[$i-1]}")
        local SPEC_ARGS=$(target_args "${FILELIST[$i-1]}")
        local OUTPUT_DIR=
        local TMP_DIR=
        local SRC_FILE=
        local DST_FILE=
        local IS_PRODUCT_PACKAGE=false

        # Note: this relies on the fact that the ${FILELIST[@]} array
        # contains first ${PRODUCT_COPY_FILES_LIST[@]}, then ${PRODUCT_PACKAGES_LIST[@]}.
        if [ "${i}" -gt "${PRODUCT_COPY_FILES_COUNT}" ]; then
            IS_PRODUCT_PACKAGE=true
        fi

        if [ "${SPEC_ARGS}" = "rootfs" ]; then
            OUTPUT_DIR="${OUTPUT_ROOT}/rootfs"
            TMP_DIR="${OUTPUT_TMP}/rootfs"
            SRC_FILE="/${SPEC_SRC_FILE}"
            DST_FILE="/${SPEC_DST_FILE}"
        else
            OUTPUT_DIR="${OUTPUT_ROOT}"
            TMP_DIR="${OUTPUT_TMP}"
            SRC_FILE="/system/${SPEC_SRC_FILE}"
            DST_FILE="/system/${SPEC_DST_FILE}"
        fi

        # Strip the file path in the vendor repo of "system", if present
        local BLOB_DISPLAY_NAME="${DST_FILE#/system/}"
        local VENDOR_REPO_FILE="$OUTPUT_DIR/${BLOB_DISPLAY_NAME}"
        mkdir -p $(dirname "${VENDOR_REPO_FILE}")

        # Check pinned files
        local HASH="$(echo ${HASHLIST[$i-1]} | awk '{ print tolower($0); }')"
        local FIXUP_HASH="$(echo ${FIXUP_HASHLIST[$i-1]} | awk '{ print tolower($0); }')"
        local KEEP=""
        if [ "$DISABLE_PINNING" != "1" ] && [ "$HASH" != "x" ]; then
            if [ -f "${VENDOR_REPO_FILE}" ]; then
                local PINNED="${VENDOR_REPO_FILE}"
            else
                local PINNED="${TMP_DIR}${DST_FILE#/system}"
            fi
            if [ -f "$PINNED" ]; then
                local TMP_HASH=$(get_hash "${PINNED}")
                if [ "${TMP_HASH}" = "${HASH}" ] || [ "${TMP_HASH}" = "${FIXUP_HASH}" ]; then
                    KEEP="1"
                    if [ ! -f "${VENDOR_REPO_FILE}" ]; then
                        cp -p "$PINNED" "${VENDOR_REPO_FILE}"
                    fi
                fi
            fi
        fi

        if [ "${KANG}" = false ]; then
            printf '  - %s\n' "${BLOB_DISPLAY_NAME}"
        fi

        if [ "$KEEP" = "1" ]; then
            printf '    + keeping pinned file with hash %s\n' "${HASH}"
        else
            FOUND=false
            # Try custom target first.
            # Also try to search for files stripped of
            # the "/system" prefix, if we're actually extracting
            # from a system image.
            for CANDIDATE in "${DST_FILE}" "${SRC_FILE}"; do
                get_file ${CANDIDATE} ${VENDOR_REPO_FILE} ${SRC} && {
                    FOUND=true
                    break
                }
            done

            if [ "${FOUND}" = false ]; then
                colored_echo red "    !! ${BLOB_DISPLAY_NAME}: file not found in source"
                continue
            fi
        fi

        # Blob fixup pipeline has 2 parts: one that is fixed and
        # one that is user-configurable
        local PRE_FIXUP_HASH=$(get_hash ${VENDOR_REPO_FILE})
        # Deodex apk|jar if that's the case
        if [[ "$FULLY_DEODEXED" -ne "1" && "${VENDOR_REPO_FILE}" =~ .(apk|jar)$ ]]; then
            oat2dex "${VENDOR_REPO_FILE}" "${SRC_FILE}" "$SRC"
            if [ -f "$TMPDIR/classes.dex" ]; then
                touch -t 200901010000 "$TMPDIR/classes"*
                zip -gjq "${VENDOR_REPO_FILE}" "$TMPDIR/classes"*
                rm "$TMPDIR/classes"*
                printf '    (updated %s from odex files)\n' "${SRC_FILE}"
            fi
        elif [[ "${VENDOR_REPO_FILE}" =~ .xml$ ]]; then
            fix_xml "${VENDOR_REPO_FILE}"
        fi
        # Now run user-supplied fixup function
        blob_fixup "${BLOB_DISPLAY_NAME}" "${VENDOR_REPO_FILE}"
        local POST_FIXUP_HASH=$(get_hash ${VENDOR_REPO_FILE})

        if [ -f "${VENDOR_REPO_FILE}" ]; then
            local DIR=$(dirname "${VENDOR_REPO_FILE}")
            local TYPE="${DIR##*/}"
            if [ "$TYPE" = "bin" -o "$TYPE" = "sbin" ]; then
                chmod 755 "${VENDOR_REPO_FILE}"
            else
                chmod 644 "${VENDOR_REPO_FILE}"
            fi
        fi

        if [ "${KANG}" =  true ]; then
            print_spec "${IS_PRODUCT_PACKAGE}" "${SPEC_SRC_FILE}" "${SPEC_DST_FILE}" "${SPEC_ARGS}" "${PRE_FIXUP_HASH}" "${POST_FIXUP_HASH}"
        fi

        # Check and print whether the fixup pipeline actually did anything.
        # This isn't done right after the fixup pipeline because we want this print
        # to come after print_spec above, when in kang mode.
        if [ "${PRE_FIXUP_HASH}" != "${POST_FIXUP_HASH}" ]; then
            printf "    + Fixed up %s\n" "${BLOB_DISPLAY_NAME}"
            # Now sanity-check the spec for this blob.
            if [ "${KANG}" = false ] && [ "${FIXUP_HASH}" = "x" ] && [ "${HASH}" != "x" ]; then
                colored_echo yellow "WARNING: The ${BLOB_DISPLAY_NAME} file was fixed up, but it is pinned."
                colored_echo yellow "This is a mistake and you want to either remove the hash completely, or add an extra one."
            fi
        fi

    done

    # Don't allow failing
    set -e
}

#
# extract_firmware:
#
# $1: file containing the list of items to extract
# $2: path to extracted radio folder
#
function extract_firmware() {
    if [ -z "$OUTDIR" ]; then
        echo "Output dir not set!"
        exit 1
    fi

    parse_file_list "$1"

    # Don't allow failing
    set -e

    local FILELIST=( ${PRODUCT_COPY_FILES_LIST[@]} )
    local COUNT=${#FILELIST[@]}
    local SRC="$2"
    local OUTPUT_DIR="$ANDROID_ROOT"/"$OUTDIR"/radio

    if [ "$VENDOR_RADIO_STATE" -eq "0" ]; then
        echo "Cleaning firmware output directory ($OUTPUT_DIR).."
        rm -rf "${OUTPUT_DIR:?}/"*
        VENDOR_RADIO_STATE=1
    fi

    echo "Extracting $COUNT files in $1 from $SRC:"

    for (( i=1; i<COUNT+1; i++ )); do
        local FILE="${FILELIST[$i-1]}"
        printf '  - %s \n' "/radio/$FILE"

        if [ ! -d "$OUTPUT_DIR" ]; then
            mkdir -p "$OUTPUT_DIR"
        fi
        cp "$SRC/$FILE" "$OUTPUT_DIR/$FILE"
        chmod 644 "$OUTPUT_DIR/$FILE"
    done
}

function extract_img_data() {
    local image_file="$1"
    local out_dir="$2"
    local logFile="$TMPDIR/debugfs.log"

    if [ ! -d "$out_dir" ]; then
        mkdir -p "$out_dir"
    fi

    if [[ "$HOST_OS" == "Darwin" ]]; then
        debugfs -R "rdump / \"$out_dir\"" "$image_file" &> "$logFile" || {
            echo "[-] Failed to extract data from '$image_file'"
            abort 1
        }
    else
        debugfs -R 'ls -p' "$image_file" 2>/dev/null | cut -d '/' -f6 | while read -r entry
        do
            debugfs -R "rdump \"$entry\" \"$out_dir\"" "$image_file" >> "$logFile" 2>&1 || {
                echo "[-] Failed to extract data from '$image_file'"
                abort 1
            }
        done
    fi

    local symlink_err="rdump: Attempt to read block from filesystem resulted in short read while reading symlink"
    if grep -Fq "$symlink_err" "$logFile"; then
        echo "[-] Symlinks have not been properly processed from $image_file"
        echo "[!] If you don't have a compatible debugfs version, modify 'execute-all.sh' to disable 'USE_DEBUGFS' flag"
        abort 1
    fi
}

declare -ra VENDOR_SKIP_FILES=(
  "bin/toybox_vendor"
  "bin/toolbox"
  "bin/grep"
  "build.prop"
  "compatibility_matrix.xml"
  "default.prop"
  "etc/NOTICE.xml.gz"
  "etc/vintf/compatibility_matrix.xml"
  "etc/vintf/manifest.xml"
  "etc/wifi/wpa_supplicant.conf"
  "manifest.xml"
  "overlay/DisplayCutoutEmulationCorner/DisplayCutoutEmulationCornerOverlay.apk"
  "overlay/DisplayCutoutEmulationDouble/DisplayCutoutEmulationDoubleOverlay.apk"
  "overlay/DisplayCutoutEmulationTall/DisplayCutoutEmulationTallOverlay.apk"
  "overlay/DisplayCutoutNoCutout/NoCutoutOverlay.apk"
  "overlay/framework-res__auto_generated_rro.apk"
  "overlay/SysuiDarkTheme/SysuiDarkThemeOverlay.apk"
)

function array_contains() {
    local element
    for element in "${@:2}"; do [[ "$element" == "$1" ]] && return 0; done
    return 1
}

function generate_prop_list_from_image() {
    local image_file="$1"
    local image_dir="$TMPDIR/image-temp"
    local output_list="$2"
    local output_list_tmp="$TMPDIR/_proprietary-blobs.txt"
    local -n skipped_vendor_files="$3"

    extract_img_data "$image_file" "$image_dir"

    find "$image_dir" -not -type d | sed "s#^$image_dir/##" | while read -r FILE
    do
        if suffix_match_file ".odex" "$FILE" || suffix_match_file ".vdex" "$FILE" ; then
            continue
        fi
        # Skip VENDOR_SKIP_FILES since it will be re-generated at build time
        if array_contains "$FILE" "${VENDOR_SKIP_FILES[@]}"; then
            continue
        fi
        # Skip device defined skipped files since they will be re-generated at build time
        if array_contains "$FILE" "${skipped_vendor_files[@]}"; then
            continue
        fi
        if suffix_match_file ".apk" "$FILE" ; then
            echo "-vendor/$FILE" >> "$output_list_tmp"
        else
            echo "vendor/$FILE" >> "$output_list_tmp"
        fi
    done

    # Sort merged file with all lists
    sort -u "$output_list_tmp" > "$output_list"

    # Clean-up
    rm -f "$output_list_tmp"
}

function colored_echo() {
    IFS=" "
    local color=$1;
    shift
    if ! [[ $color =~ '^[0-9]$' ]] ; then
        case $(echo $color | tr '[:upper:]' '[:lower:]') in
        black) color=0 ;;
        red) color=1 ;;
        green) color=2 ;;
        yellow) color=3 ;;
        blue) color=4 ;;
        magenta) color=5 ;;
        cyan) color=6 ;;
        white|*) color=7 ;; # white or invalid color
        esac
    fi
    if [ -t 1 ] ; then tput setaf $color; fi
    printf '%s\n' "$*"
    if [ -t 1 ] ; then tput sgr0; fi
}
