blob: d9fb6ef5f22e520eff0021a39d7f091c50cd75d2 [file] [log] [blame]
bigbiff7ba75002020-04-11 20:47:09 -04001LOCAL_PATH := $(call my-dir)
2ifeq ($(TW_INCLUDE_CRYPTO), true)
3include $(CLEAR_VARS)
4
5LOCAL_MODULE := libtwrpfscrypt
6LOCAL_MODULE_TAGS := optional
7LOCAL_CFLAGS := -Wno-unused-variable -Wno-sign-compare -Wno-unused-parameter -Wno-comment -Wno-missing-field-initializers \
bigbiffa957f072021-03-07 18:20:29 -05008 -DHAVE_LIBKEYUTILS -std=gnu++2a -Wno-macro-redefined -Wno-unused-function -fpic
9LOCAL_SRC_FILES := FsCrypt.cpp Decrypt.cpp ScryptParameters.cpp fscrypt_policy.cpp Utils.cpp HashPassword.cpp \
10 KeyUtil.cpp Keymaster.cpp KeyStorage.cpp MetadataCrypt.cpp KeyBuffer.cpp \
11 Process.cpp EncryptInplace.cpp Weaver1.cpp cryptfs.cpp Checkpoint.cpp CryptoType.cpp VoldUtil.cpp
bigbiff7ba75002020-04-11 20:47:09 -040012LOCAL_SHARED_LIBRARIES := libselinux libc libc++ libext4_utils libbase libcrypto libcutils \
13libkeymaster_messages libhardware libprotobuf-cpp-lite libfscrypt android.hardware.confirmationui@1.0 \
14android.hardware.keymaster@3.0 libkeystore_binder libhidlbase libutils libbinder android.hardware.gatekeeper@1.0 \
bigbiffa957f072021-03-07 18:20:29 -050015libfs_mgr android.hardware.keymaster@4.0 android.hardware.keymaster@4.1 libkeymaster4support libkeymaster4_1support \
16libf2fs_sparseblock libkeystore_parcelables libkeystore_aidl android.hardware.weaver@1.0 libkeyutils liblog libhwbinder \
17libchrome android.hardware.boot@1.0 libbootloader_message
18LOCAL_STATIC_LIBRARIES := libscrypt_static libvold_binder libc++fs
bigbiff7ba75002020-04-11 20:47:09 -040019LOCAL_C_INCLUDES := system/extras/ext4_utils \
20 system/extras/ext4_utils/include/ext4_utils \
21 external/scrypt/lib/crypto \
22 system/security/keystore/include \
23 hardware/libhardware/include/hardware \
24 system/security/softkeymaster/include/keymaster \
25 system/keymaster/include \
26 system/extras/libfscrypt/include \
27 system/core/fs_mgr/libfs_avb/include/ \
28 system/core/fs_mgr/include_fstab/ \
29 system/core/fs_mgr/include/ \
30 system/core/fs_mgr/libdm/include/ \
31 system/core/fs_mgr/liblp/include/ \
32 system/gsid/include/ \
33 system/core/init/ \
34 system/vold/model \
35 system/vold/ \
bigbiffa957f072021-03-07 18:20:29 -050036 system/extras/f2fs_utils/ \
37 bootable/recovery/bootloader_message/include
bigbiff7ba75002020-04-11 20:47:09 -040038
bigbiff2e344ab2021-05-07 10:41:55 -040039ifeq ($(TW_USE_FSCRYPT_POLICY), 1)
40 LOCAL_CFLAGS += -DUSE_FSCRYPT_POLICY_V1
41else
42 LOCAL_CFLAGS += -DUSE_FSCRYPT_POLICY_V2
43endif
44
bigbiff7ba75002020-04-11 20:47:09 -040045ifneq ($(wildcard hardware/libhardware/include/hardware/keymaster0.h),)
46 LOCAL_CFLAGS += -DTW_CRYPTO_HAVE_KEYMASTERX
47 LOCAL_C_INCLUDES += external/boringssl/src/include
48endif
49
50LOCAL_REQUIRED_MODULES := keystore_auth keystore
51LOCAL_CLANG := true
52include $(BUILD_SHARED_LIBRARY)
53
bigbiffa957f072021-03-07 18:20:29 -050054include $(CLEAR_VARS)
55LOCAL_MODULE := fscryptpolicyget
56LOCAL_MODULE_TAGS := optional
57LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
58LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
59LOCAL_C_INCLUDES += system/extras/libfscrypt/include
60LOCAL_SRC_FILES := fscryptpolicyget.cpp
61LOCAL_SHARED_LIBRARIES := libtwrpfscrypt
bigbiff7ba75002020-04-11 20:47:09 -040062
bigbiffa957f072021-03-07 18:20:29 -050063include $(BUILD_EXECUTABLE)
bigbiff7ba75002020-04-11 20:47:09 -040064
65include $(CLEAR_VARS)
66LOCAL_MODULE := twrpfbe
67LOCAL_MODULE_TAGS := optional
68LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -040069LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
bigbiff7ba75002020-04-11 20:47:09 -040070LOCAL_SRC_FILES := main.cpp
71LOCAL_SHARED_LIBRARIES := libtwrpfscrypt
72
73include $(BUILD_EXECUTABLE)
74
75include $(CLEAR_VARS)
bigbiff7ba75002020-04-11 20:47:09 -040076LOCAL_MODULE := keystore_auth
77LOCAL_MODULE_TAGS := optional
78LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -040079LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
bigbiff7ba75002020-04-11 20:47:09 -040080LOCAL_SRC_FILES := keystore_auth.cpp
81LOCAL_SHARED_LIBRARIES := libc libkeystore_binder libutils libbinder liblog
82LOCAL_CFLAGS += -DUSE_SECURITY_NAMESPACE
83LOCAL_SHARED_LIBRARIES += libkeystore_aidl
bigbiff7ba75002020-04-11 20:47:09 -040084
85include $(BUILD_EXECUTABLE)
86
87endif