From 9cccca7472e8b2b7c13a06e69bc1350e6a1a9294 Mon Sep 17 00:00:00 2001 From: Dinesh K Garg Date: Thu, 11 Sep 2014 10:55:02 -0700 Subject: Port cryptfs_hw library to 64bit platform 64 bit platform generates library at a different path compared to 32 bit platform.Added macros to take care of both kind of platforms. Change-Id: Ie32b8edaeb9f8f34095c7f18c4add83fe957d82a --- Android.mk | 2 -- cryptfs_hw.c | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Android.mk b/Android.mk index 69ace0d..996947b 100644 --- a/Android.mk +++ b/Android.mk @@ -2,8 +2,6 @@ ifeq ($(TARGET_HW_DISK_ENCRYPTION),true) LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES) - sourceFiles := \ cryptfs_hw.c diff --git a/cryptfs_hw.c b/cryptfs_hw.c index 4a38e1b..84e81b4 100644 --- a/cryptfs_hw.c +++ b/cryptfs_hw.c @@ -37,6 +37,12 @@ #include "cutils/log.h" #include "cutils/android_reboot.h" +#if defined(__LP64__) +#define QSEECOM_LIBRARY_PATH "/vendor/lib64/libQSEEComAPI.so" +#else +#define QSEECOM_LIBRARY_PATH "/vendor/lib/libQSEEComAPI.so" +#endif + // When device comes up or when user tries to change the password, user can // try wrong password upto a certain number of times. If user enters wrong @@ -94,7 +100,7 @@ static int load_qseecom_library() if (loaded_library) return loaded_library; - void * handle = dlopen("/vendor/lib/libQSEEComAPI.so", RTLD_NOW); + void * handle = dlopen(QSEECOM_LIBRARY_PATH, RTLD_NOW); if(handle) { dlerror(); /* Clear any existing error */ *(void **) (&qseecom_create_key) = dlsym(handle,"QSEECom_create_key"); -- cgit v1.2.3