extract-files.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. #
  3. # SPDX-FileCopyrightText: 2016 The CyanogenMod Project
  4. # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
  5. # SPDX-License-Identifier: Apache-2.0
  6. #
  7. function blob_fixup() {
  8. case "${1}" in
  9. vendor/etc/camera/cupid_enhance_motiontuning.xml|vendor/etc/camera/cupid_motiontuning.xml)
  10. [ "$2" = "" ] && return 0
  11. sed -i 's/xml=version/xml version/g' "${2}"
  12. ;;
  13. vendor/etc/camera/pureShot_parameter.xml|vendor/etc/camera/pureView_parameter.xml)
  14. [ "$2" = "" ] && return 0
  15. sed -i 's/=\([0-9]\+\)>/="\1">/g' "${2}"
  16. ;;
  17. vendor/lib64/libcamximageformatutils.so)
  18. [ "$2" = "" ] && return 0
  19. "${PATCHELF_0_17_2}" --replace-needed "vendor.qti.hardware.display.config-V2-ndk_platform.so" "vendor.qti.hardware.display.config-V2-ndk.so" "${2}"
  20. ;;
  21. vendor/lib64/libkaraokepal.so)
  22. [ "$2" = "" ] && return 0
  23. "${PATCHELF_0_17_2}" --replace-needed "audio.primary.taro.so" "audio.primary.taro-cupid.so" "${2}"
  24. ;;
  25. *)
  26. return 1
  27. ;;
  28. esac
  29. }
  30. function blob_fixup_dry() {
  31. blob_fixup "$1" ""
  32. }
  33. # If we're being sourced by the common script that we called,
  34. # stop right here. No need to go down the rabbit hole.
  35. if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
  36. return
  37. fi
  38. set -e
  39. export DEVICE=cupid
  40. export DEVICE_COMMON=sm8450-common
  41. export VENDOR=xiaomi
  42. export VENDOR_COMMON=${VENDOR}
  43. "./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@"