3 # Copyright (C) 2016 The CyanogenMod Project
4 # Copyright (C) 2017-2020 The LineageOS Project
6 # SPDX-License-Identifier: Apache-2.0
11 DEVICE_COMMON
=universal7580-common
14 # Load extract_utils and do some sanity checks
15 MY_DIR
="${BASH_SOURCE%/*}"
16 if [[ ! -d "${MY_DIR}" ]]; then MY_DIR
="${PWD}"; fi
18 ANDROID_ROOT
="${MY_DIR}/../../.."
20 HELPER
="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
21 if [ ! -f "${HELPER}" ]; then
22 echo "Unable to find helper script at ${HELPER}"
27 # Default to sanitizing the vendor folder before extraction
33 while [ "${#}" -gt 0 ]; do
52 if [ -z "${SRC}" ]; then
57 # Initialize the helper
58 setup_vendor
"${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
60 extract
"${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
62 # Fix proprietary blobs
63 BLOB_ROOT
="$ANDROID_ROOT"/vendor
/"$VENDOR"/"$DEVICE_COMMON"/proprietary
64 "${PATCHELF}" --replace-needed libgui.so libsensor.so
$BLOB_ROOT/vendor
/bin
/gpsd
66 # replace SSLv3_client_method with SSLv23_method
67 sed -i "s/SSLv3_client_method/SSLv23_method\x00\x00\x00\x00\x00\x00/" $BLOB_ROOT/vendor
/bin
/gpsd
70 "${MY_DIR}/setup-makefiles.sh"