From 7d90015f98196959398f22a7fce76f49e0b76c53 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Tue, 27 Aug 2024 22:51:30 +0300 Subject: [PATCH] miuicamera: Sync extract scripts with templates Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc --- extract-files.sh | 47 ++++++++++++++++++++++++++-------------------- setup-makefiles.sh | 5 ++--- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index ade0ccd..8528477 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -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}" diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 39cca1a..efc2c62 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -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 #