forked from LineageOS/android_device_nubia_nx609j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extract-files.sh
executable file
·76 lines (68 loc) · 3.06 KB
/
extract-files.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
function blob_fixup() {
case "${1}" in
# Patch blobs for VNDK
vendor/lib/hw/camera.msm8998.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --remove-needed "libgui.so" "${2}"
"${PATCHELF}" --remove-needed "libandroid.so" "${2}"
"${PATCHELF}" --remove-needed "android.hidl.base@1.0.so" "${2}"
;;
vendor/lib/libnubia_effect.so | vendor/lib64/libnubia_effect.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --remove-needed "libgui.so" "${2}"
;;
vendor/lib/libNubiaImageAlgorithm.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --remove-needed "libjnigraphics.so" "${2}"
"${PATCHELF}" --remove-needed "libnativehelper.so" "${2}"
"${PATCHELF}" --add-needed "libui_shim.so" "${2}"
"${PATCHELF}" --add-needed "libNubiaImageAlgorithm_shim.so" "${2}"
;;
vendor/lib/libarcsoft_picauto.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --remove-needed "libandroid.so" "${2}"
;;
vendor/lib64/libgf_hal.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --remove-needed "libpowermanager.so" "${2}"
;;
vendor/lib64/libgoodixfingerprintd_binder.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --add-needed "libbinder_shim.so" "${2}"
;;
vendor/lib64/android.hardware.gatekeeper@1.0.so | vendor/lib64/vendor.goodix.hardware.fingerprint@1.0.so)
[ "$2" = "" ] && return 0
grep -q libhidlbase_shim.so "${2}" || "${PATCHELF}" --add-needed "libhidlbase_shim.so" "${2}"
;;
vendor/lib/libSonyIMX318PdafLibrary.so | vendor/lib/libarcsoft_beautyshot.so | vendor/lib/libarcsoft_beautyshot_image_algorithm.so | vendor/lib/libarcsoft_beautyshot_video_algorithm.so | vendor/lib/libarcsoft_high_dynamic_range.so | vendor/lib/libarcsoft_low_light_shot.so | vendor/lib/libarcsoft_night_shot.so | vendor/lib/libarcsoft_picauto.so | vendor/lib64/libarcsoft_beautyshot.so | vendor/lib64/libarcsoft_beautyshot_image_algorithm.so | vendor/lib64/libarcsoft_beautyshot_video_algorithm.so | vendor/lib64/libarcsoft_low_light_shot.so | vendor/lib64/libarcsoft_night_shot.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --replace-needed "libstdc++.so" "libstdc++_vendor.so" "${2}"
;;
*)
return 1
;;
esac
return 0
}
function blob_fixup_dry() {
blob_fixup "$1" ""
}
# If we're being sourced by the common script that we called,
# stop right here. No need to go down the rabbit hole.
if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
return
fi
set -e
# Required!
export DEVICE=nx609j
export DEVICE_COMMON=msm8998-common
export VENDOR=nubia
export VENDOR_COMMON=${VENDOR}
export DEVICE_BRINGUP_YEAR=2017
"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@"