Ethan Yonker | bd7492d | 2016-12-07 13:55:01 -0600 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | ifeq ($(TW_INCLUDE_CRYPTO), true) |
| 3 | include $(CLEAR_VARS) |
| 4 | |
| 5 | LOCAL_MODULE := libe4crypt |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 6 | LOCAL_MODULE_TAGS := optional |
Ethan Yonker | bd7492d | 2016-12-07 13:55:01 -0600 | [diff] [blame] | 7 | LOCAL_CFLAGS := |
Ethan Yonker | e9afc3d | 2018-08-30 15:16:27 -0500 | [diff] [blame] | 8 | LOCAL_SRC_FILES := Decrypt.cpp ScryptParameters.cpp Utils.cpp HashPassword.cpp ext4_crypt.cpp |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 9 | LOCAL_SHARED_LIBRARIES := libselinux libc libc++ libext4_utils libbase libcrypto libcutils libkeymaster_messages libhardware libprotobuf-cpp-lite |
Ethan Yonker | bd7492d | 2016-12-07 13:55:01 -0600 | [diff] [blame] | 10 | LOCAL_STATIC_LIBRARIES := libscrypt_static |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 11 | LOCAL_C_INCLUDES := system/extras/ext4_utils \ |
| 12 | system/extras/ext4_utils/include/ext4_utils \ |
| 13 | external/scrypt/lib/crypto \ |
| 14 | system/security/keystore/include \ |
| 15 | hardware/libhardware/include/hardware \ |
| 16 | system/security/softkeymaster/include/keymaster \ |
| 17 | system/keymaster/include |
Ethan Yonker | bd7492d | 2016-12-07 13:55:01 -0600 | [diff] [blame] | 18 | |
| 19 | ifneq ($(wildcard hardware/libhardware/include/hardware/keymaster0.h),) |
| 20 | LOCAL_CFLAGS += -DTW_CRYPTO_HAVE_KEYMASTERX |
| 21 | LOCAL_C_INCLUDES += external/boringssl/src/include |
| 22 | endif |
Ethan Yonker | fefe591 | 2017-09-30 22:22:13 -0500 | [diff] [blame] | 23 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0) |
Ethan Yonker | e9afc3d | 2018-08-30 15:16:27 -0500 | [diff] [blame] | 24 | #8.0 or higher |
| 25 | LOCAL_CFLAGS += -DHAVE_GATEKEEPER1 |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 26 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 29; echo $$?),0) |
| 27 | LOCAL_SHARED_LIBRARIES += android.hardware.confirmationui@1.0 |
| 28 | # LOCAL_CFLAGS += -DUSE_ |
| 29 | endif |
Ethan Yonker | e9afc3d | 2018-08-30 15:16:27 -0500 | [diff] [blame] | 30 | LOCAL_SHARED_LIBRARIES += android.hardware.keymaster@3.0 libkeystore_binder libhidlbase libutils libbinder android.hardware.gatekeeper@1.0 |
| 31 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) |
| 32 | #9.0 rules |
| 33 | LOCAL_CFLAGS += -DUSE_KEYSTORAGE_4 -Wno-unused-variable -Wno-sign-compare -Wno-unused-parameter -Wno-comment |
Ethan Yonker | 9338282 | 2018-11-01 15:25:31 -0500 | [diff] [blame] | 34 | LOCAL_SRC_FILES += Ext4CryptPie.cpp Keymaster4.cpp KeyStorage4.cpp KeyUtil.cpp MetadataCrypt.cpp KeyBuffer.cpp |
Ethan Yonker | e9afc3d | 2018-08-30 15:16:27 -0500 | [diff] [blame] | 35 | LOCAL_SHARED_LIBRARIES += android.hardware.keymaster@4.0 libkeymaster4support |
| 36 | LOCAL_SHARED_LIBRARIES += android.hardware.gatekeeper@1.0 libkeystore_parcelables libkeystore_aidl |
Ethan Yonker | 31344a3 | 2017-11-29 12:13:41 -0600 | [diff] [blame] | 37 | LOCAL_CFLAGS += -DHAVE_SYNTH_PWD_SUPPORT |
| 38 | LOCAL_SRC_FILES += Weaver1.cpp |
| 39 | LOCAL_SHARED_LIBRARIES += android.hardware.weaver@1.0 |
Ethan Yonker | 31344a3 | 2017-11-29 12:13:41 -0600 | [diff] [blame] | 40 | LOCAL_CFLAGS += -DHAVE_LIBKEYUTILS |
| 41 | LOCAL_SHARED_LIBRARIES += libkeyutils |
Ethan Yonker | e9afc3d | 2018-08-30 15:16:27 -0500 | [diff] [blame] | 42 | else |
| 43 | #8.0 rules |
| 44 | LOCAL_CFLAGS += -DUSE_KEYSTORAGE_3 |
| 45 | LOCAL_SRC_FILES += Ext4Crypt.cpp Keymaster3.cpp KeyStorage3.cpp |
| 46 | ifneq ($(wildcard hardware/interfaces/weaver/Android.bp),) |
| 47 | #only present in some 8.0 trees and should be in all 8.1 trees |
| 48 | LOCAL_CFLAGS += -DHAVE_SYNTH_PWD_SUPPORT |
| 49 | LOCAL_SRC_FILES += Weaver1.cpp |
| 50 | LOCAL_SHARED_LIBRARIES += android.hardware.weaver@1.0 |
| 51 | endif |
| 52 | ifneq ($(wildcard system/core/libkeyutils/Android.bp),) |
| 53 | #only present in some 8.0 trees and should be in all 8.1 trees |
| 54 | LOCAL_CFLAGS += -DHAVE_LIBKEYUTILS |
| 55 | LOCAL_SHARED_LIBRARIES += libkeyutils |
| 56 | endif |
Ethan Yonker | 31344a3 | 2017-11-29 12:13:41 -0600 | [diff] [blame] | 57 | endif |
Ethan Yonker | abf1fb0 | 2019-04-24 16:09:07 -0500 | [diff] [blame] | 58 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) |
| 59 | LOCAL_REQUIRED_MODULES := keystore_auth |
| 60 | else |
| 61 | LOCAL_ADDITIONAL_DEPENDENCIES := keystore_auth |
| 62 | endif |
Ethan Yonker | fefe591 | 2017-09-30 22:22:13 -0500 | [diff] [blame] | 63 | else |
Ethan Yonker | e9afc3d | 2018-08-30 15:16:27 -0500 | [diff] [blame] | 64 | #7.x rules |
| 65 | LOCAL_SRC_FILES += Ext4Crypt.cpp Keymaster.cpp KeyStorage.cpp |
Ethan Yonker | fefe591 | 2017-09-30 22:22:13 -0500 | [diff] [blame] | 66 | endif |
Ethan Yonker | 58f2132 | 2018-08-24 11:17:36 -0500 | [diff] [blame] | 67 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 28; echo $$?),0) |
| 68 | LOCAL_SHARED_LIBRARIES += libsoftkeymaster |
| 69 | endif |
Ethan Yonker | bd7492d | 2016-12-07 13:55:01 -0600 | [diff] [blame] | 70 | |
| 71 | include $(BUILD_SHARED_LIBRARY) |
| 72 | |
| 73 | |
| 74 | |
| 75 | include $(CLEAR_VARS) |
| 76 | LOCAL_MODULE := twrpfbe |
| 77 | LOCAL_MODULE_TAGS := optional |
| 78 | LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES |
| 79 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin |
| 80 | LOCAL_SRC_FILES := main.cpp |
| 81 | LOCAL_SHARED_LIBRARIES := libe4crypt |
| 82 | #LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64 |
| 83 | |
| 84 | include $(BUILD_EXECUTABLE) |
| 85 | |
Ethan Yonker | 79f88bd | 2016-12-09 14:52:12 -0600 | [diff] [blame] | 86 | include $(CLEAR_VARS) |
| 87 | LOCAL_MODULE := e4policyget |
| 88 | LOCAL_MODULE_TAGS := optional |
| 89 | LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES |
| 90 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin |
| 91 | LOCAL_SRC_FILES := e4policyget.cpp |
| 92 | LOCAL_SHARED_LIBRARIES := libe4crypt |
| 93 | LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64 |
| 94 | |
| 95 | include $(BUILD_EXECUTABLE) |
| 96 | |
Ethan Yonker | e131bec | 2017-12-15 23:48:02 -0600 | [diff] [blame] | 97 | include $(CLEAR_VARS) |
| 98 | LOCAL_MODULE := keystore_auth |
| 99 | LOCAL_MODULE_TAGS := optional |
| 100 | LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES |
| 101 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin |
| 102 | LOCAL_SRC_FILES := keystore_auth.cpp |
| 103 | LOCAL_SHARED_LIBRARIES := libc libkeystore_binder libutils libbinder liblog |
Ethan Yonker | e9afc3d | 2018-08-30 15:16:27 -0500 | [diff] [blame] | 104 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0) |
| 105 | #9.0 |
| 106 | LOCAL_CFLAGS += -DUSE_SECURITY_NAMESPACE |
| 107 | LOCAL_SHARED_LIBRARIES += libkeystore_aidl |
| 108 | endif |
Ethan Yonker | e131bec | 2017-12-15 23:48:02 -0600 | [diff] [blame] | 109 | LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64 |
| 110 | |
| 111 | include $(BUILD_EXECUTABLE) |
| 112 | |
Ethan Yonker | bd7492d | 2016-12-07 13:55:01 -0600 | [diff] [blame] | 113 | endif |