miuicamera: Sync extract scripts with templates

Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc
This commit is contained in:
Michael Bestas 2024-08-27 22:51:30 +03:00 committed by basamaryan
parent 18bcc482e7
commit 7d90015f98
No known key found for this signature in database
GPG Key ID: 707BA6C82329E8F9
2 changed files with 29 additions and 23 deletions

View File

@ -1,8 +1,7 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
@ -32,19 +31,20 @@ 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}"
;;
-n | --no-cleanup)
CLEAN_VENDOR=false
;;
-k | --kang)
KANG="--kang"
;;
-s | --section)
SECTION="${2}"
shift
CLEAN_VENDOR=false
;;
*)
SRC="${1}"
;;
esac
shift
done
@ -56,21 +56,28 @@ fi
function blob_fixup() {
case "${1}" in
system/priv-app/MiuiCamera/MiuiCamera.apk)
[ "$2" = "" ] && return 0
apktool_patch "${2}" "$MY_DIR/blob-patches"
;;
system/lib64/libcamera_algoup_jni.xiaomi.so|system/lib64/libcamera_mianode_jni.xiaomi.so)
[ "$2" = "" ] && return 0
grep -q "libgui_shim_miuicamera.so" "${2}" || "${PATCHELF}" --add-needed "libgui_shim_miuicamera.so" "${2}"
;;
system/lib64/libmicampostproc_client.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --remove-needed "libhidltransport.so" "${2}"
;;
*)
return 1
;;
esac
return 0
}
if [ -z "$SRC" ]; then
echo "Path to system dump not specified! Specify one with --path"
exit 1
fi
function blob_fixup_dry() {
blob_fixup "$1" ""
}
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"

View File

@ -1,8 +1,7 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#