blob: 8000d5e1978129be1393a434545ac427f814aac8 [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 \
8 -DHAVE_LIBKEYUTILS -std=gnu++2a -Wno-macro-redefined -Wno-unused-function
9LOCAL_SRC_FILES := Decrypt.cpp ScryptParameters.cpp Utils.cpp HashPassword.cpp \
10 FsCrypt.cpp KeyUtil.cpp Keymaster.cpp KeyStorage.cpp MetadataCrypt.cpp KeyBuffer.cpp \
11 Process.cpp EncryptInplace.cpp Weaver1.cpp fscrypt_policy.cpp
12LOCAL_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 \
15libfs_mgr android.hardware.keymaster@4.0 libkeymaster4support libf2fs_sparseblock libkeystore_parcelables \
16libkeystore_aidl android.hardware.weaver@1.0 libkeyutils liblog libhwbinder libchrome
17LOCAL_STATIC_LIBRARIES := libscrypt_static
18LOCAL_C_INCLUDES := system/extras/ext4_utils \
19 system/extras/ext4_utils/include/ext4_utils \
20 external/scrypt/lib/crypto \
21 system/security/keystore/include \
22 hardware/libhardware/include/hardware \
23 system/security/softkeymaster/include/keymaster \
24 system/keymaster/include \
25 system/extras/libfscrypt/include \
26 system/core/fs_mgr/libfs_avb/include/ \
27 system/core/fs_mgr/include_fstab/ \
28 system/core/fs_mgr/include/ \
29 system/core/fs_mgr/libdm/include/ \
30 system/core/fs_mgr/liblp/include/ \
31 system/gsid/include/ \
32 system/core/init/ \
33 system/vold/model \
34 system/vold/ \
35 system/extras/f2fs_utils/
36
37ifneq ($(wildcard hardware/libhardware/include/hardware/keymaster0.h),)
38 LOCAL_CFLAGS += -DTW_CRYPTO_HAVE_KEYMASTERX
39 LOCAL_C_INCLUDES += external/boringssl/src/include
40endif
41
42LOCAL_REQUIRED_MODULES := keystore_auth keystore
43LOCAL_CLANG := true
44include $(BUILD_SHARED_LIBRARY)
45
46
47
48include $(CLEAR_VARS)
49LOCAL_MODULE := twrpfbe
50LOCAL_MODULE_TAGS := optional
51LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
52LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
53LOCAL_SRC_FILES := main.cpp
54LOCAL_SHARED_LIBRARIES := libtwrpfscrypt
55
56include $(BUILD_EXECUTABLE)
57
58include $(CLEAR_VARS)
59LOCAL_MODULE := fscryptpolicyget
60LOCAL_MODULE_TAGS := optional
61LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
62LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
63LOCAL_SRC_FILES := fscryptpolicyget.cpp
64LOCAL_SHARED_LIBRARIES := libtwrpfscrypt
65LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
66
67include $(BUILD_EXECUTABLE)
68
69include $(CLEAR_VARS)
70LOCAL_MODULE := keystore_auth
71LOCAL_MODULE_TAGS := optional
72LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
73LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
74LOCAL_SRC_FILES := keystore_auth.cpp
75LOCAL_SHARED_LIBRARIES := libc libkeystore_binder libutils libbinder liblog
76LOCAL_CFLAGS += -DUSE_SECURITY_NAMESPACE
77LOCAL_SHARED_LIBRARIES += libkeystore_aidl
78LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
79
80include $(BUILD_EXECUTABLE)
81
82endif