4 Commits
udc ... vic

Author SHA1 Message Date
Fabian Leutenegger
86ad59e434 Add more modern camera icon overlay
Change-Id: I25c5d8d8a842f32f78c8760c655ca31aacb8b876
2025-02-02 11:50:31 +09:00
Arian
1a7b7446ba miuicamera-venus: Patch algo jni lib to use correct Surface::connect method
In android 15 QPR1, Google has removed a public method of the Surface class.
Our jni lib used that method and relies on the offset remaining the same, so
patch the lib to load it with the smaller offset.
6a5fdc1d5f

Change-Id: I97e7ca9f24adad3ede69b599f8d44fdc96646048
Signed-off-by: ralph950412 <ralph950412@gmail.com>
2025-01-22 13:51:26 +01:00
ralph950412
0caaaa1c85 miuicamera-venus: Update from V816.0.10.0.UKBMIXM
Change-Id: I87461b8d10074431c48a6772447a0a9ac5546672
2025-01-22 13:49:48 +01:00
Arian
494a6c075d miuicamera-venus: Move to python extract-utils
Change-Id: I77cbcd41dc08ac111f83e619c49e2e330412b84c
2025-01-22 13:46:10 +01:00
6 changed files with 61 additions and 110 deletions

View File

@@ -7,6 +7,10 @@
# Inherit from the proprietary version
$(call inherit-product, vendor/xiaomi/miuicamera-venus/miuicamera-venus-vendor.mk)
# Overlays
PRODUCT_PACKAGES += \
MiuiCameraOverlay
# Overlays
PRODUCT_PACKAGES += \
MiuiCameraOverlay

54
extract-files.py Normal file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
from extract_utils.fixups_blob import (
blob_fixup,
blob_fixups_user_type,
)
from extract_utils.fixups_lib import (
lib_fixups,
lib_fixups_user_type,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
namespace_imports = [
'device/xiaomi/miuicamera-venus',
]
def lib_fixup_system_suffix(lib: str, partition: str, *args, **kwargs):
return f'{lib}_{partition}' if partition == 'system' else None
lib_fixups: lib_fixups_user_type = {
**lib_fixups,
'vendor.xiaomi.hardware.campostproc@1.0': lib_fixup_system_suffix,
}
blob_fixups: blob_fixups_user_type = {
'system/lib64/libcamera_algoup_jni.xiaomi.so': blob_fixup()
.add_needed('libgui_shim_miuicamera.so')
.sig_replace('08 AD 40 F9', '08 A9 40 F9'),
'system/lib64/libcamera_mianode_jni.xiaomi.so': blob_fixup()
.add_needed('libgui_shim_miuicamera.so'),
'system/lib64/libmicampostproc_client.so': blob_fixup()
.remove_needed('libhidltransport.so'),
} # fmt: skip
module = ExtractUtilsModule(
'miuicamera-venus',
'xiaomi',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
)
if __name__ == '__main__':
utils = ExtractUtils.device(module)
utils.run()

View File

@@ -1,72 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
DEVICE=miuicamera-venus
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
system/lib64/libcamera_algoup_jni.xiaomi.so|system/lib64/libcamera_mianode_jni.xiaomi.so)
"${PATCHELF}" --add-needed "libgui_shim_miuicamera.so" "${2}"
;;
system/lib64/libmicampostproc_client.so)
"${PATCHELF}" --remove-needed "libhidltransport.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"

View File

@@ -1,8 +1,8 @@
# All unpinned blobs below are extracted from venus V816.0.2.0.UKBMIXM
# All unpinned blobs below are extracted from venus V816.0.10.0.UKBMIXM
product/priv-app/MiuiCamera/MiuiCamera.apk:system/priv-app/MiuiCamera/MiuiCamera.apk;OVERRIDES=Aperture,Camera,Camera2,GoogleCameraGo|2f6e5926632fb549e4b0291f0916656e48867163
system_ext/lib64/libcamera_algoup_jni.xiaomi.so:system/lib64/libcamera_algoup_jni.xiaomi.so
system_ext/lib64/libcamera_mianode_jni.xiaomi.so:system/lib64/libcamera_mianode_jni.xiaomi.so
system_ext/lib64/libmicampostproc_client.so:system/lib64/libmicampostproc_client.so
system_ext/lib64/vendor.xiaomi.hardware.campostproc@1.0.so:system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so
system_ext/lib64/vendor.xiaomi.hardware.campostproc@1.0.so:system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so;MODULE_SUFFIX=_system
vendor/etc/camera/sceneDetection.xml

1
setup-makefiles.py Normal file
View File

@@ -0,0 +1 @@
#!./extract-files.py --regenerate_makefiles

View File

@@ -1,36 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
DEVICE=miuicamera-venus
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}"
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
# Warning headers and guards
write_headers
write_makefiles "${MY_DIR}/proprietary-files.txt" true
# Finish
write_footers