blob: 693b675186fe34325e01efb2b0808bcb7bcc473d [file] [log] [blame]
Ethan Yonkerbd7492d2016-12-07 13:55:01 -06001LOCAL_PATH := $(call my-dir)
2ifeq ($(TW_INCLUDE_CRYPTO), true)
3include $(CLEAR_VARS)
4
5LOCAL_MODULE := libe4crypt
6LOCAL_MODULE_TAGS := eng optional
7LOCAL_CFLAGS :=
Ethan Yonkerfefe5912017-09-30 22:22:13 -05008LOCAL_SRC_FILES := Decrypt.cpp Ext4Crypt.cpp ScryptParameters.cpp Utils.cpp HashPassword.cpp ext4_crypt.cpp
Ethan Yonkerbd7492d2016-12-07 13:55:01 -06009LOCAL_SHARED_LIBRARIES := libselinux libc libc++ libext4_utils libsoftkeymaster libbase libcrypto libcutils libkeymaster_messages libhardware libprotobuf-cpp-lite
10LOCAL_STATIC_LIBRARIES := libscrypt_static
Ethan Yonker95e80072017-08-24 21:45:50 -050011LOCAL_C_INCLUDES := system/extras/ext4_utils system/extras/ext4_utils/include/ext4_utils external/scrypt/lib/crypto system/security/keystore hardware/libhardware/include/hardware system/security/softkeymaster/include/keymaster system/keymaster/include
Ethan Yonkerbd7492d2016-12-07 13:55:01 -060012
13ifneq ($(wildcard hardware/libhardware/include/hardware/keymaster0.h),)
14 LOCAL_CFLAGS += -DTW_CRYPTO_HAVE_KEYMASTERX
15 LOCAL_C_INCLUDES += external/boringssl/src/include
16endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -050017ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
Ethan Yonker31344a32017-11-29 12:13:41 -060018 LOCAL_CFLAGS += -DUSE_KEYSTORAGE_3 -DHAVE_GATEKEEPER1
Ethan Yonkerfefe5912017-09-30 22:22:13 -050019 LOCAL_SRC_FILES += Keymaster3.cpp KeyStorage3.cpp
Ethan Yonker31344a32017-11-29 12:13:41 -060020 LOCAL_SHARED_LIBRARIES += android.hardware.keymaster@3.0 libkeystore_binder libhidlbase libutils libbinder
Ethan Yonkerfefe5912017-09-30 22:22:13 -050021 LOCAL_SHARED_LIBRARIES += android.hardware.gatekeeper@1.0
Ethan Yonker31344a32017-11-29 12:13:41 -060022 ifneq ($(wildcard hardware/interfaces/weaver/Android.bp),)
23 LOCAL_CFLAGS += -DHAVE_SYNTH_PWD_SUPPORT
24 LOCAL_SRC_FILES += Weaver1.cpp
25 LOCAL_SHARED_LIBRARIES += android.hardware.weaver@1.0
26 endif
27 ifneq ($(wildcard system/core/libkeyutils/Android.bp),)
28 LOCAL_CFLAGS += -DHAVE_LIBKEYUTILS
29 LOCAL_SHARED_LIBRARIES += libkeyutils
30 endif
Ethan Yonkere131bec2017-12-15 23:48:02 -060031 LOCAL_ADDITIONAL_DEPENDENCIES := keystore_auth
Ethan Yonkerfefe5912017-09-30 22:22:13 -050032else
33 LOCAL_SRC_FILES += Keymaster.cpp KeyStorage.cpp
34endif
Ethan Yonkerbd7492d2016-12-07 13:55:01 -060035
36include $(BUILD_SHARED_LIBRARY)
37
38
39
40include $(CLEAR_VARS)
41LOCAL_MODULE := twrpfbe
42LOCAL_MODULE_TAGS := optional
43LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
44LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
45LOCAL_SRC_FILES := main.cpp
46LOCAL_SHARED_LIBRARIES := libe4crypt
47#LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
48
49include $(BUILD_EXECUTABLE)
50
Ethan Yonker79f88bd2016-12-09 14:52:12 -060051include $(CLEAR_VARS)
52LOCAL_MODULE := e4policyget
53LOCAL_MODULE_TAGS := optional
54LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
55LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
56LOCAL_SRC_FILES := e4policyget.cpp
57LOCAL_SHARED_LIBRARIES := libe4crypt
58LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
59
60include $(BUILD_EXECUTABLE)
61
Ethan Yonkere131bec2017-12-15 23:48:02 -060062include $(CLEAR_VARS)
63LOCAL_MODULE := keystore_auth
64LOCAL_MODULE_TAGS := optional
65LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
66LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
67LOCAL_SRC_FILES := keystore_auth.cpp
68LOCAL_SHARED_LIBRARIES := libc libkeystore_binder libutils libbinder liblog
69LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
70
71include $(BUILD_EXECUTABLE)
72
Ethan Yonkerbd7492d2016-12-07 13:55:01 -060073endif