From 77e6010c66f1579adf1dfce024c1d6a2a54be833 Mon Sep 17 00:00:00 2001 From: Silesh K Nair Date: Mon, 15 Dec 2025 23:20:33 +0100 Subject: [PATCH] redwood: Import libmisight for citsensorservice error: vendor/xiaomi/redwood/Android.bp:11001:1: "vendor.xiaomi.hardware.citsensorservice@1.1-impl" depends on undefined module "libmisight". Also, E vndksupport: Could not load /vendor/lib64/hw/vendor.xiaomi.hardware.citsensorservice@1.1-impl.so from default namespace: dlopen failed: cannot locate symbol "_ZN4Json5ValueaSES0_" referenced by "/vendor/lib64/libmisight.so".... E vndksupport: Could not load /vendor/lib64/hw/vendor.xiaomi.hardware.citsensorservice@1.1-impl.so from default namespace: dlopen failed: cannot locate symbol "_ZN4Json5ValueC1Ex" referenced by "/vendor/lib64/libmisight.so".... Signed-off-by: thepriyanshujangid --- device.mk | 4 ++++ extract-files.py | 3 +++ proprietary-files.txt | 1 + shim/Android.bp | 15 +++++++++++++++ shim/libmisightjson/json_value.cpp | 12 ++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 shim/Android.bp create mode 100644 shim/libmisightjson/json_value.cpp diff --git a/device.mk b/device.mk index 579dfb6..6475526 100644 --- a/device.mk +++ b/device.mk @@ -487,6 +487,10 @@ PRODUCT_PACKAGES += \ vendor.qti.hardware.display.mapper@1.1.vendor \ vendor.qti.hardware.memtrack-service +# Shim +PRODUCT_PACKAGES += \ + libmisightjson_shim + PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \ diff --git a/extract-files.py b/extract-files.py index 92c09d9..cd9d904 100755 --- a/extract-files.py +++ b/extract-files.py @@ -77,6 +77,9 @@ blob_fixups: blob_fixups_user_type = { .clear_symbol_version('remote_handle_close') .clear_symbol_version('remote_handle_invoke') .clear_symbol_version('remote_handle_open'), + 'vendor/lib64/libmisight.so': blob_fixup() + .add_needed('libjsoncpp_shim.so') + .add_needed('libmisightjson_shim.so'), 'vendor/lib64/libsensor_cal_v2.so': blob_fixup() .add_needed('libjsoncpp_shim.so'), ('vendor/lib/hw/audio.primary.lahaina.so', 'vendor/lib/libaudioroute_ext.so'): blob_fixup() diff --git a/proprietary-files.txt b/proprietary-files.txt index 231e09a..a30cfad 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1234,6 +1234,7 @@ vendor/bin/hw/vendor.xiaomi.hardware.citsensorservice@1.1-service vendor/etc/init/vendor.xiaomi.hardware.citsensorservice@1.1-service.rc vendor/etc/vintf/manifest/vendor.xiaomi.hardware.citsensorservice@1.1-service.xml vendor/lib64/hw/vendor.xiaomi.hardware.citsensorservice@1.1-impl.so +vendor/lib64/libmisight.so vendor/lib64/vendor.xiaomi.hardware.citsensorservice@1.0.so vendor/lib64/vendor.xiaomi.hardware.citsensorservice@1.1.so diff --git a/shim/Android.bp b/shim/Android.bp new file mode 100644 index 0000000..4cd1e87 --- /dev/null +++ b/shim/Android.bp @@ -0,0 +1,15 @@ +// +// Copyright (C) 2022-2025 The LineageOS Project +// +// SPDX-License-Identifier: Apache-2.0 +// + +cc_library { + name: "libmisightjson_shim", + srcs: [ + "libmisightjson/json_value.cpp", + ], + shared_libs: ["libjsoncpp"], + compile_multilib: "both", + vendor: true, +} diff --git a/shim/libmisightjson/json_value.cpp b/shim/libmisightjson/json_value.cpp new file mode 100644 index 0000000..e0f4497 --- /dev/null +++ b/shim/libmisightjson/json_value.cpp @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2024 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +extern "C" Json::Value* _ZN4Json5ValueC1Ex(Json::Value* thisptr, Json::Value other) { + *thisptr = other; + return thisptr; +}