From 5e570034ce654beee2d8c5d54391af136af25550 Mon Sep 17 00:00:00 2001 From: nift4 Date: Mon, 21 Feb 2022 14:31:16 +0100 Subject: [PATCH] GS290: keymaster: Shim beanpod keymaster _ZN9keymaster19GenerateKeyResponseD1Ev is the destructor of the class. It got removed in 12, so it won't hurt empty-shimming it. Change-Id: Id13c17738ca3c8cb41da3217011242d2410bb195 --- device.mk | 3 ++- extract-files.sh | 3 +++ ims/Android.bp | 13 +++++++++++++ ims/libshim_beanpod.cpp | 9 +++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ims/libshim_beanpod.cpp diff --git a/device.mk b/device.mk index 5026520..116ca8d 100644 --- a/device.mk +++ b/device.mk @@ -253,7 +253,8 @@ PRODUCT_BOOT_JARS += \ PRODUCT_PACKAGES += \ ImsServiceBase \ libshim_vtservice \ - libshim_mtkcam.vendor + libshim_mtkcam.vendor \ + libshim_beanpod.vendor PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/ims/privapp-permissions-mediatek.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-mediatek.xml diff --git a/extract-files.sh b/extract-files.sh index 4a9a5db..a5b10df 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -42,6 +42,9 @@ function blob_fixup() { vendor/lib64/libmtkcam_stdutils.so) "${PATCHELF}" --add-needed "libshim_mtkcam.so" "${2}" ;; + vendor/bin/hw/android.hardware.keymaster@4.0-service.beanpod) + "${PATCHELF}" --add-needed "libshim_beanpod.so" "${2}" + ;; esac } diff --git a/ims/Android.bp b/ims/Android.bp index f523c53..5d3d3f6 100644 --- a/ims/Android.bp +++ b/ims/Android.bp @@ -45,6 +45,19 @@ cc_library_shared { ], } +cc_library_shared { + name: "libshim_beanpod", + srcs: ["libshim_beanpod.cpp"], + vendor_available: true, + shared_libs: [ + "libkeymaster_messages", + ], + header_libs: [ + "libhardware_headers", + ], + include_dirs: [ "system/keymaster/include" ], +} + java_library { name: "ImsServiceBase", installable: true, diff --git a/ims/libshim_beanpod.cpp b/ims/libshim_beanpod.cpp new file mode 100644 index 0000000..a4aec17 --- /dev/null +++ b/ims/libshim_beanpod.cpp @@ -0,0 +1,9 @@ +#include + +extern "C" { +void _ZN9keymaster19GenerateKeyResponseD1Ev() {} +void _ZN9keymaster17AttestKeyResponseD1Ev() {} +void _ZN9keymaster16ImportKeyRequest14SetKeyMaterialEPKvm(keymaster::ImportKeyRequest* thisptr, const uint8_t* key_material, size_t length) { + thisptr->key_data = keymaster::KeymasterKeyBlob(key_material, length); +} +} -- GitLab