blob: af5ab3af03dfd538ee53a564eef6af989773fcb3 [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 Yonkerfefe5912017-09-30 22:22:13 -050031else
32 LOCAL_SRC_FILES += Keymaster.cpp KeyStorage.cpp
33endif
Ethan Yonkerbd7492d2016-12-07 13:55:01 -060034
35include $(BUILD_SHARED_LIBRARY)
36
37
38
39include $(CLEAR_VARS)
40LOCAL_MODULE := twrpfbe
41LOCAL_MODULE_TAGS := optional
42LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
43LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
44LOCAL_SRC_FILES := main.cpp
45LOCAL_SHARED_LIBRARIES := libe4crypt
46#LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
47
48include $(BUILD_EXECUTABLE)
49
Ethan Yonker79f88bd2016-12-09 14:52:12 -060050include $(CLEAR_VARS)
51LOCAL_MODULE := e4policyget
52LOCAL_MODULE_TAGS := optional
53LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
54LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
55LOCAL_SRC_FILES := e4policyget.cpp
56LOCAL_SHARED_LIBRARIES := libe4crypt
57LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
58
59include $(BUILD_EXECUTABLE)
60
Ethan Yonkerbd7492d2016-12-07 13:55:01 -060061endif