Files
device_xiaomi_rosemary/extract-files.sh
Arian 577563da43 rosemary: Provide a shim for libsink
added opPackageName as a parameter to the constructor
  of AudioTrack which breaks our libsink which was compiled
  for an older libaudioclient.

* fixes the following error:
CANNOT LINK EXECUTABLE "/system/bin/vtservice": cannot locate symbol "_ZN7android10AudioTrackC1E19audio_stream_type_tj14audio_format_tjj20audio_output_flags_tPFviPvS4_ES4_i15audio_session_tNS0_13transfer_typeEPK20audio_offload_info_tjiPK18audio_attributes_tbfi" referenced by "/system/lib/libsink.so"

https: //github.com/LineageOS/android_frameworks_av/commit/fd90fdfe2a611ae824a32e236da288b1fdfd445d
Change-Id: I290e1beca02d46c4393d17356fa22741d771f847
2022-11-12 10:48:38 +03:00

82 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
DEVICE=rosemary
VENDOR=xiaomi
# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true
KANG=
SECTION=
while [ "${#}" -gt 0 ]; do
case "${1}" in
-n | --no-cleanup )
CLEAN_VENDOR=false
;;
-k | --kang )
KANG="--kang"
;;
-s | --section )
SECTION="${2}"; shift
CLEAN_VENDOR=false
;;
* )
SRC="${1}"
;;
esac
shift
done
if [ -z "${SRC}" ]; then
SRC="adb"
fi
function blob_fixup {
case "$1" in
vendor/lib*/hw/audio.primary.mt6785.so)
"${PATCHELF}" --add-needed "libshim_audio.so" "${2}"
;;
vendor/lib64/libwifi-hal-mtk.so)
"$PATCHELF" --set-soname libwifi-hal-mtk.so "${2}"
;;
vendor/bin/hw/android.hardware.keymaster@4.0-service.beanpod)
"${PATCHELF}" --add-needed "libshim_beanpod.so" "${2}"
;;
lib/libshowlogo.so)
"${PATCHELF}" --add-needed "libshim_showlogo.so" "${2}"
;;
lib/libsink.so)
"${PATCHELF}" --add-needed "libshim_vtservice.so" "${2}"
;;
esac
}
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
"${MY_DIR}/setup-makefiles.sh"