blob: 86a53d345097d2bf4669031388bbbbf7e2cf4af4 [file] [log] [blame]
Joe Onorato6396e702012-05-31 23:21:46 -07001# Copyright (C) 2007 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080014
Joe Onorato6396e702012-05-31 23:21:46 -070015LOCAL_PATH := $(call my-dir)
Ethan Yonker58f21322018-08-24 11:17:36 -050016commands_TWRP_local_path := $(LOCAL_PATH)
Joe Onorato6396e702012-05-31 23:21:46 -070017
Ethan Yonker66bcd492018-12-20 09:03:17 -060018ifneq ($(project-path-for),)
Matt Mower66766fe2014-10-06 18:03:39 -050019 ifeq ($(LOCAL_PATH),$(call project-path-for,recovery))
20 PROJECT_PATH_AGREES := true
Andrea Mennillof591c872015-11-03 20:58:11 +010021 BOARD_SEPOLICY_DIRS += $(call project-path-for,recovery)/sepolicy
Matt Mower66766fe2014-10-06 18:03:39 -050022 endif
23else
24 ifeq ($(LOCAL_PATH),bootable/recovery)
25 PROJECT_PATH_AGREES := true
Ethan Yonker11309e92015-07-01 07:58:56 -050026 BOARD_SEPOLICY_DIRS += bootable/recovery/sepolicy
Ethan Yonkerf0a7e592019-04-04 10:06:41 -050027 else
28 ifeq ($(LOCAL_PATH),bootable/recovery-twrp)
29 ifeq ($(RECOVERY_VARIANT),twrp)
30 PROJECT_PATH_AGREES := true
31 BOARD_SEPOLICY_DIRS += bootable/recovery-twrp/sepolicy
32 endif
33 endif
Matt Mower66766fe2014-10-06 18:03:39 -050034 endif
Matt Mower55c75ca2014-08-31 11:30:15 -050035endif
36
Matt Mower66766fe2014-10-06 18:03:39 -050037ifeq ($(PROJECT_PATH_AGREES),true)
Matt Mower55c75ca2014-08-31 11:30:15 -050038
Michael Bestas0cc23762018-07-13 21:37:56 +030039ifeq ($(CM_PLATFORM_SDK_VERSION),)
40 CM_PLATFORM_SDK_VERSION := 0
41endif
42
Motorhead199175b6f662014-06-12 15:58:33 -070043include $(CLEAR_VARS)
44
Matt Mower1777cdc2015-09-26 15:56:56 -050045TWRES_PATH := /twres/
Dees Troy3454ade2015-01-20 19:21:04 +000046TWHTCD_PATH := $(TWRES_PATH)htcd/
47
Dees_Troy51a0e822012-09-05 15:24:24 -040048TARGET_RECOVERY_GUI := true
Joe Onorato6396e702012-05-31 23:21:46 -070049
bigbiffee7b7ff2020-03-23 15:08:27 -040050LOCAL_STATIC_LIBRARIES :=
51LOCAL_SHARED_LIBRARIES :=
52
bigbiff bigbiff584b9772016-12-08 21:21:17 -050053ifneq ($(TW_DEVICE_VERSION),)
54 LOCAL_CFLAGS += -DTW_DEVICE_VERSION='"-$(TW_DEVICE_VERSION)"'
55else
56 LOCAL_CFLAGS += -DTW_DEVICE_VERSION='"-0"'
57endif
dianlujitao4879b372018-12-03 18:45:47 +080058LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
bigbiff bigbiff584b9772016-12-08 21:21:17 -050059
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080060LOCAL_SRC_FILES := \
Dees_Troy2673cec2013-04-02 20:22:16 +000061 twrp.cpp \
Ethan Yonkerb5fab762016-01-28 14:03:33 -060062 fixContexts.cpp \
bigbiff bigbiff9c754052013-01-09 09:09:08 -050063 twrpTar.cpp \
Ethan Yonker3fdcda42016-11-30 12:29:37 -060064 exclude.cpp \
Ethan Yonker1b7a31b2014-07-03 15:09:22 -050065 find_file.cpp \
bigbiff bigbiff56cf5642016-08-19 17:43:45 -040066 infomanager.cpp \
Dees_Troy51a0e822012-09-05 15:24:24 -040067 data.cpp \
Dees_Troy51a0e822012-09-05 15:24:24 -040068 partition.cpp \
69 partitionmanager.cpp \
Ethan Yonker472f5062016-02-25 13:47:30 -060070 progresstracking.cpp \
bigbiffdf8436b2020-08-30 16:22:34 -040071 startupArgs.cpp \
Dees_Troy32c8eb82012-09-11 15:28:06 -040072 twinstall.cpp \
Dees_Troy812660f2012-09-20 09:55:17 -040073 twrp-functions.cpp \
bigbiff bigbiff56cf5642016-08-19 17:43:45 -040074 twrpDigestDriver.cpp \
Dees_Troye34c1332013-02-06 19:13:00 +000075 openrecoveryscript.cpp \
bigbiff bigbiff19fb79c2016-09-05 21:04:51 -040076 tarWrite.c \
bigbiff32cbabe2020-04-12 19:16:19 -040077 twrpAdbBuFifo.cpp \
bigbiffad58e1b2020-07-06 20:24:34 -040078 twrpApex.cpp \
79 twrpRepacker.cpp
Dees_Troy51a0e822012-09-05 15:24:24 -040080
bigbiffad58e1b2020-07-06 20:24:34 -040081LOCAL_STATIC_LIBRARIES += libavb
82LOCAL_SHARED_LIBRARIES += libfs_mgr libinit
bigbiffad58e1b2020-07-06 20:24:34 -040083LOCAL_C_INCLUDES += \
84 system/core/fs_mgr/libfs_avb/include/ \
85 system/core/fs_mgr/include_fstab/ \
86 system/core/fs_mgr/include/ \
87 system/core/fs_mgr/libdm/include/ \
88 system/core/fs_mgr/liblp/include/ \
89 system/gsid/include/ \
90 system/core/init/ \
91 system/extras/ext4_utils/include
bigbiffee7b7ff2020-03-23 15:08:27 -040092
Dees_Troya58bead2012-09-27 09:49:29 -040093ifneq ($(TARGET_RECOVERY_REBOOT_SRC),)
Dees_Troy51a0e822012-09-05 15:24:24 -040094 LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC)
95endif
96
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080097LOCAL_MODULE := recovery
98
Doug Zongkere08991e2010-02-02 13:09:52 -080099RECOVERY_API_VERSION := 3
Ken Sumrallf35d1ce2013-02-13 12:59:35 -0800100RECOVERY_FSTAB_VERSION := 2
Doug Zongkerfb2e3af2009-06-17 17:29:40 -0700101LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
bigbiff7ba75002020-04-11 20:47:09 -0400102LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
Tao Bao80e46e02015-06-03 10:49:29 -0700103LOCAL_CLANG := true
Doug Zongkerfb2e3af2009-06-17 17:29:40 -0700104
Dan Albert1ddd3502015-02-18 15:58:15 -0800105LOCAL_C_INCLUDES += \
bigbiffad58e1b2020-07-06 20:24:34 -0400106 bionic \
Dan Albert1ddd3502015-02-18 15:58:15 -0800107 system/vold \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500108 system/extras \
Dan Albert1ddd3502015-02-18 15:58:15 -0800109 system/core/adb \
bigbiffce8f83c2015-12-12 18:30:21 -0500110 system/core/libsparse \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500111 external/zlib \
bigbiffd58ba182020-03-23 10:02:29 -0400112 system/core/libpixelflinger/include \
bigbiffad58e1b2020-07-06 20:24:34 -0400113 system/core/libziparchive/include \
bigbiffd58ba182020-03-23 10:02:29 -0400114 external/freetype/include \
bigbiffad58e1b2020-07-06 20:24:34 -0400115 external/boringssl/include \
116 external/libcxx/include \
117 external/libselinux/include \
bigbiffd58ba182020-03-23 10:02:29 -0400118 $(LOCAL_PATH)/recovery_ui/include \
119 $(LOCAL_PATH)/otautil/include \
bigbiffad58e1b2020-07-06 20:24:34 -0400120 $(LOCAL_PATH)/install/include \
121 $(LOCAL_PATH)/fuse_sideload/include \
122 $(LOCAL_PATH)/install/include \
123 $(LOCAL_PATH)/verifier28/
Dees_Troy51a0e822012-09-05 15:24:24 -0400124
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600125LOCAL_STATIC_LIBRARIES += libguitwrp
bigbiffdf8436b2020-08-30 16:22:34 -0400126LOCAL_SHARED_LIBRARIES += libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libtwadbbu libbootloader_message
bigbiffad58e1b2020-07-06 20:24:34 -0400127LOCAL_SHARED_LIBRARIES += libcrecovery libtwadbbu libtwrpdigest libc++ libaosprecovery libinit libcrypto libbase libziparchive libselinux
128LOCAL_CFLAGS += -DUSE_28_VERIFIER
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500129
Dees_Troy4546fe72013-01-10 14:33:27 +0000130ifneq ($(wildcard system/core/libsparse/Android.mk),)
131LOCAL_SHARED_LIBRARIES += libsparse
132endif
133
Ethan Yonker7af51ce2014-04-04 13:33:30 -0500134ifeq ($(TW_OEM_BUILD),true)
135 LOCAL_CFLAGS += -DTW_OEM_BUILD
136 BOARD_HAS_NO_REAL_SDCARD := true
137 TW_USE_TOOLBOX := true
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400138 TW_EXCLUDE_MTP := true
Ethan Yonker7af51ce2014-04-04 13:33:30 -0500139endif
Yabin Cui99281df2016-02-17 12:21:52 -0800140
Elliott Hughes01fcbe12016-05-23 17:43:41 -0700141ifeq ($(AB_OTA_UPDATER),true)
142 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
bigbiff bigbiffc630cee2019-01-03 20:14:06 -0500143 LOCAL_SHARED_LIBRARIES += libhardware android.hardware.boot@1.0
Captain Throwback49df5472020-10-19 11:13:53 -0400144 TWRP_REQUIRED_MODULES += libhardware android.hardware.boot@1.0-service android.hardware.boot@1.0-service.rc
Elliott Hughes01fcbe12016-05-23 17:43:41 -0700145endif
146
bigbiffee7b7ff2020-03-23 15:08:27 -0400147ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
148 LOCAL_CFLAGS += -DPRODUCT_USE_DYNAMIC_PARTITIONS=1
Captain Throwbackddb0a402020-11-01 12:52:21 -0500149 TWRP_REQUIRED_MODULES += android.hardware.health@2.0-service android.hardware.health@2.0-service.rc
bigbiffee7b7ff2020-03-23 15:08:27 -0400150endif
151
Mohd Faraz9a4ef262020-10-18 23:58:21 +0530152ifeq ($(TW_USES_VENDOR_LIBS),true)
153 LOCAL_CFLAGS += -DUSE_VENDOR_LIBS=1
154endif
155
Ian Macdonald160e8d32020-09-29 20:47:31 +0200156ifneq ($(BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST),)
157 BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST := $(BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST)
158else ifneq ($(BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST),)
159 BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST := $(BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST)
Mohammad Afaneh2d9953a2020-10-24 13:33:26 +0300160else ifneq ($(BOARD_SAMSUNG_DYNAMIC_PARTITIONS_PARTITION_LIST),)
161 BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST := $(BOARD_SAMSUNG_DYNAMIC_PARTITIONS_PARTITION_LIST)
Ian Macdonald160e8d32020-09-29 20:47:31 +0200162endif
163ifneq ($(BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST),)
164 LOCAL_CFLAGS += "-DBOARD_DYNAMIC_PARTITIONS_PARTITION_LIST=\"$(shell echo $(BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST) | sed -r 's/\b(.)/\u\1/g' | sed -e 's/ \+/, /g')\""
165endif
166
bigbiff32cbabe2020-04-12 19:16:19 -0400167ifeq ($(TW_NO_BIND_SYSTEM),true)
168 LOCAL_CFLAGS += -DTW_NO_BIND_SYSTEM
169endif
170
bigbiffad58e1b2020-07-06 20:24:34 -0400171LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800172
Ethan Yonker93382822018-11-01 15:25:31 -0500173ifeq ($(TARGET_RECOVERY_TWRP_LIB),)
174 LOCAL_SRC_FILES += BasePartition.cpp
175else
176 LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_TWRP_LIB)
177endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800178
Doug Zongkercc8cd3f2010-09-20 12:16:13 -0700179LOCAL_C_INCLUDES += system/extras/ext4_utils
180
that0e2140e2016-08-10 21:04:26 +0200181tw_git_revision := $(shell git -C $(LOCAL_PATH) rev-parse --short=8 HEAD 2>/dev/null)
182ifeq ($(shell git -C $(LOCAL_PATH) diff --quiet; echo $$?),1)
183 tw_git_revision := $(tw_git_revision)-dirty
184endif
185LOCAL_CFLAGS += -DTW_GIT_REVISION='"$(tw_git_revision)"'
186
mauronofriobabc15e2020-03-16 14:59:39 +0000187ifeq ($(TW_FORCE_USE_BUSYBOX), true)
188 TW_USE_TOOLBOX := false
189else
190 TW_USE_TOOLBOX := true
191endif
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500192ifeq ($(TW_EXCLUDE_MTP),)
193 LOCAL_SHARED_LIBRARIES += libtwrpmtp-ffs
194endif
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500195
Dees_Troy51a0e822012-09-05 15:24:24 -0400196#TWRP Build Flags
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400197ifeq ($(TW_EXCLUDE_MTP),)
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400198 LOCAL_CFLAGS += -DTW_HAS_MTP
199endif
Ricardo Gomezc9ecd442013-07-05 16:13:52 -0700200ifneq ($(TW_NO_SCREEN_TIMEOUT),)
201 LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
202endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400203ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true)
204 LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD
205endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400206ifneq ($(RECOVERY_SDCARD_ON_DATA),)
207 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
208endif
209ifneq ($(TW_INCLUDE_DUMLOCK),)
210 LOCAL_CFLAGS += -DTW_INCLUDE_DUMLOCK
211endif
212ifneq ($(TW_INTERNAL_STORAGE_PATH),)
213 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_PATH=$(TW_INTERNAL_STORAGE_PATH)
214endif
215ifneq ($(TW_INTERNAL_STORAGE_MOUNT_POINT),)
216 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_MOUNT_POINT=$(TW_INTERNAL_STORAGE_MOUNT_POINT)
217endif
218ifneq ($(TW_EXTERNAL_STORAGE_PATH),)
219 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH)
220endif
221ifneq ($(TW_EXTERNAL_STORAGE_MOUNT_POINT),)
222 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_MOUNT_POINT=$(TW_EXTERNAL_STORAGE_MOUNT_POINT)
223endif
ChampionSwimmercf33e4d2013-02-03 13:59:22 +0530224ifeq ($(TW_HAS_NO_BOOT_PARTITION), true)
225 LOCAL_CFLAGS += -DTW_HAS_NO_BOOT_PARTITION
226endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400227ifeq ($(TW_NO_REBOOT_BOOTLOADER), true)
228 LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER
229endif
230ifeq ($(TW_NO_REBOOT_RECOVERY), true)
231 LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY
232endif
233ifeq ($(TW_NO_BATT_PERCENT), true)
234 LOCAL_CFLAGS += -DTW_NO_BATT_PERCENT
235endif
Jenkins1710bf22014-10-02 20:22:21 -0400236ifeq ($(TW_NO_CPU_TEMP), true)
237 LOCAL_CFLAGS += -DTW_NO_CPU_TEMP
238endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400239ifneq ($(TW_CUSTOM_POWER_BUTTON),)
240 LOCAL_CFLAGS += -DTW_CUSTOM_POWER_BUTTON=$(TW_CUSTOM_POWER_BUTTON)
241endif
242ifeq ($(TW_ALWAYS_RMRF), true)
243 LOCAL_CFLAGS += -DTW_ALWAYS_RMRF
244endif
245ifeq ($(TW_NEVER_UNMOUNT_SYSTEM), true)
246 LOCAL_CFLAGS += -DTW_NEVER_UNMOUNT_SYSTEM
247endif
248ifeq ($(TW_NO_USB_STORAGE), true)
249 LOCAL_CFLAGS += -DTW_NO_USB_STORAGE
250endif
251ifeq ($(TW_INCLUDE_INJECTTWRP), true)
252 LOCAL_CFLAGS += -DTW_INCLUDE_INJECTTWRP
253endif
254ifeq ($(TW_INCLUDE_BLOBPACK), true)
255 LOCAL_CFLAGS += -DTW_INCLUDE_BLOBPACK
256endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400257ifneq ($(TARGET_USE_CUSTOM_LUN_FILE_PATH),)
258 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(TARGET_USE_CUSTOM_LUN_FILE_PATH)\"
259endif
260ifneq ($(BOARD_UMS_LUNFILE),)
261 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(BOARD_UMS_LUNFILE)\"
262endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400263ifeq ($(TW_HAS_DOWNLOAD_MODE), true)
264 LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE
265endif
mauronofrioe9a49ef2018-10-03 13:38:16 +0200266ifeq ($(TW_HAS_EDL_MODE), true)
267 LOCAL_CFLAGS += -DTW_HAS_EDL_MODE
268endif
bigbiff bigbiff87940362013-03-09 09:58:50 -0500269ifeq ($(TW_NO_SCREEN_BLANK), true)
270 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
271endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400272ifeq ($(TW_SDEXT_NO_EXT4), true)
273 LOCAL_CFLAGS += -DTW_SDEXT_NO_EXT4
274endif
Dees_Troyfdf5fcc2012-09-11 10:27:01 -0400275ifeq ($(TW_FORCE_CPUINFO_FOR_DEVICE_ID), true)
276 LOCAL_CFLAGS += -DTW_FORCE_CPUINFO_FOR_DEVICE_ID
277endif
Dees_Troy3f5c4e82013-02-01 15:16:59 +0000278ifeq ($(TW_NO_EXFAT_FUSE), true)
279 LOCAL_CFLAGS += -DTW_NO_EXFAT_FUSE
280endif
bigbiff bigbiff3ed778a2019-03-12 19:28:31 -0400281ifeq ($(TW_NO_HAPTICS), true)
282 LOCAL_CFLAGS += -DTW_NO_HAPTICS
283endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400284ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
Ethan Yonker253368a2014-11-25 15:00:52 -0600285 TW_INCLUDE_CRYPTO := true
Dees_Troy51a0e822012-09-05 15:24:24 -0400286endif
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600287ifeq ($(TW_INCLUDE_L_CRYPTO), true)
Ethan Yonker253368a2014-11-25 15:00:52 -0600288 TW_INCLUDE_CRYPTO := true
289endif
290ifeq ($(TW_INCLUDE_CRYPTO), true)
Captain Throwbackddb0a402020-11-01 12:52:21 -0500291 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO -DUSE_FSCRYPT -Wno-macro-redefined
Ethan Yonker98661c12018-10-17 08:39:28 -0500292 LOCAL_SHARED_LIBRARIES += libcryptfsfde libgpt_twrp
Captain Throwbackddb0a402020-11-01 12:52:21 -0500293 LOCAL_C_INCLUDES += external/boringssl/src/include bootable/recovery/crypto/fscrypt \
294 bootable/recovery/crypto
bigbiffad58e1b2020-07-06 20:24:34 -0400295 TW_INCLUDE_CRYPTO_FBE := true
296 LOCAL_CFLAGS += -DTW_INCLUDE_FBE
297 LOCAL_SHARED_LIBRARIES += libtwrpfscrypt android.frameworks.stats@1.0 android.hardware.authsecret@1.0 \
298 android.hardware.oemlock@1.0
299 LOCAL_CFLAGS += -DTW_INCLUDE_FBE_METADATA_DECRYPT
nkk7171c6c502017-01-05 23:55:05 +0200300 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),)
301 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),false)
bigbiffad58e1b2020-07-06 20:24:34 -0400302 TW_INCLUDE_LIBRESETPROP := true
nkk7171c6c502017-01-05 23:55:05 +0200303 LOCAL_CFLAGS += -DTW_CRYPTO_USE_SYSTEM_VOLD
304 LOCAL_STATIC_LIBRARIES += libvolddecrypt
305 endif
306 endif
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600307endif
D. Andrei Măceșb29a5e22016-12-22 06:19:44 -0500308WITH_CRYPTO_UTILS := \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500309 $(if $(wildcard system/core/libcrypto_utils/android_pubkey.c),true)
Anatoly Smaznov10c11f62013-02-12 13:33:40 +0700310ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
311 LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
312endif
lambdadroidfc0b16d2017-08-04 17:16:53 +0200313ifeq ($(TW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID), true)
314 LOCAL_CFLAGS += -DTW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID
315endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600316ifneq ($(TW_BRIGHTNESS_PATH),)
317 LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH)
318endif
xNUTxe85f02d2014-07-18 01:30:58 +0200319ifneq ($(TW_SECONDARY_BRIGHTNESS_PATH),)
320 LOCAL_CFLAGS += -DTW_SECONDARY_BRIGHTNESS_PATH=$(TW_SECONDARY_BRIGHTNESS_PATH)
321endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600322ifneq ($(TW_MAX_BRIGHTNESS),)
323 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
324endif
Greg Wallace36ade452015-11-08 13:54:25 -0500325ifneq ($(TW_DEFAULT_BRIGHTNESS),)
326 LOCAL_CFLAGS += -DTW_DEFAULT_BRIGHTNESS=$(TW_DEFAULT_BRIGHTNESS)
327endif
Dees_Troyf33b4902013-03-01 00:51:39 +0000328ifneq ($(TW_CUSTOM_BATTERY_PATH),)
329 LOCAL_CFLAGS += -DTW_CUSTOM_BATTERY_PATH=$(TW_CUSTOM_BATTERY_PATH)
330endif
Jenkins1710bf22014-10-02 20:22:21 -0400331ifneq ($(TW_CUSTOM_CPU_TEMP_PATH),)
332 LOCAL_CFLAGS += -DTW_CUSTOM_CPU_TEMP_PATH=$(TW_CUSTOM_CPU_TEMP_PATH)
333endif
Dees_Troy83bd4832013-05-04 12:39:56 +0000334ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
335 LOCAL_SHARED_LIBRARIES += libopenaes
336else
337 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
338endif
Vojtech Bocekd0e38bc2014-02-03 23:36:57 +0100339ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),)
Michael Bestas4a185582017-04-28 15:45:26 +0300340 ifneq ($(filter msm8226 msm8x26 msm8610 msm8974 msm8x74 msm8084 msm8x84 apq8084 msm8909 msm8916 msm8992 msm8994 msm8952 msm8996 msm8937 msm8953 msm8998,$(TARGET_BOARD_PLATFORM)),)
341 LOCAL_CFLAGS += -DQCOM_RTC_FIX
342 else ifeq ($(TARGET_CPU_VARIANT),krait)
Vojtech Bocekd0e38bc2014-02-03 23:36:57 +0100343 LOCAL_CFLAGS += -DQCOM_RTC_FIX
344 endif
345else ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),true)
346 LOCAL_CFLAGS += -DQCOM_RTC_FIX
347endif
Matt Mower6883d732014-03-20 17:28:13 -0500348ifneq ($(TW_NO_LEGACY_PROPS),)
349 LOCAL_CFLAGS += -DTW_NO_LEGACY_PROPS
350endif
Dees Troy4159aed2014-02-28 17:24:43 +0000351ifneq ($(wildcard bionic/libc/include/sys/capability.h),)
352 LOCAL_CFLAGS += -DHAVE_CAPABILITIES
353endif
Matt Mowerec009e82015-01-30 13:00:49 -0600354ifneq ($(TARGET_RECOVERY_INITRC),)
355 TW_EXCLUDE_DEFAULT_USB_INIT := true
356endif
bigbiffad58e1b2020-07-06 20:24:34 -0400357LOCAL_CFLAGS += -DTW_USE_NEW_MINADBD
Ethan Yonker74db1572015-10-28 12:44:49 -0500358ifneq ($(TW_DEFAULT_LANGUAGE),)
359 LOCAL_CFLAGS += -DTW_DEFAULT_LANGUAGE=$(TW_DEFAULT_LANGUAGE)
360else
361 LOCAL_CFLAGS += -DTW_DEFAULT_LANGUAGE=en
362endif
Phoenix591e444d112018-02-03 07:23:54 +0000363ifneq ($(TW_CLOCK_OFFSET),)
364 LOCAL_CFLAGS += -DTW_CLOCK_OFFSET=$(TW_CLOCK_OFFSET)
365endif
Chaosmaster461e39f2020-02-07 01:48:13 +0100366ifneq ($(TW_OVERRIDE_SYSTEM_PROPS),)
367 TW_INCLUDE_LIBRESETPROP := true
368 LOCAL_CFLAGS += -DTW_OVERRIDE_SYSTEM_PROPS=$(TW_OVERRIDE_SYSTEM_PROPS)
369endif
370ifneq ($(TW_INCLUDE_LIBRESETPROP),)
bigbiffad58e1b2020-07-06 20:24:34 -0400371 LOCAL_SHARED_LIBRARIES += libresetprop
372 LOCAL_C_INCLUDES += external/magisk-prebuilt/include
373 LOCAL_CFLAGS += -DTW_INCLUDE_LIBRESETPROP
Chaosmaster461e39f2020-02-07 01:48:13 +0100374endif
375
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500376TWRP_REQUIRED_MODULES += \
bigbiffad58e1b2020-07-06 20:24:34 -0400377 relink_libraries \
378 relink_binaries \
bigbiff7ba75002020-04-11 20:47:09 -0400379 twrp_ramdisk \
Matt Mower031163b2014-11-01 15:13:03 -0500380 dump_image \
381 erase_image \
382 flash_image \
Matt Mower031163b2014-11-01 15:13:03 -0500383 mke2fs.conf \
Matt Mower031163b2014-11-01 15:13:03 -0500384 pigz \
385 teamwin \
Matt Mower031163b2014-11-01 15:13:03 -0500386 twrp \
Matt Mower18794c82015-11-11 16:22:45 -0600387 fsck.fat \
388 fatlabel \
389 mkfs.fat \
HashBanged974bb2016-01-30 14:20:09 -0500390 permissive.sh \
Ethan Yonkerf1179622016-08-25 15:32:21 -0500391 simg2img_twrp \
bigbiffdf8436b2020-08-30 16:22:34 -0400392 libbootloader_message \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500393 init.recovery.hlthchrg.rc \
bigbiff973167a2020-04-06 15:44:20 -0400394 init.recovery.service.rc \
395 init.recovery.ldconfig.rc \
bigbiff7ba75002020-04-11 20:47:09 -0400396 awk \
bigbiffad58e1b2020-07-06 20:24:34 -0400397 toybox \
398 toolbox \
bigbiffdf8436b2020-08-30 16:22:34 -0400399 mkshrc_twrp \
Mohammad Afaneh3150f1e2020-10-16 00:45:03 +0300400 plat_hwservice_contexts \
401 vendor_hwservice_contexts
bigbiff7ba75002020-04-11 20:47:09 -0400402
403ifneq ($(TW_INCLUDE_CRYPTO),)
404TWRP_REQUIRED_MODULES += \
Captain Throwbackddb0a402020-11-01 12:52:21 -0500405 hwservicemanager \
406 hwservicemanager.rc \
bigbiff7ba75002020-04-11 20:47:09 -0400407 vndservicemanager \
Captain Throwback49df5472020-10-19 11:13:53 -0400408 vndservicemanager.rc \
bigbiff7ba75002020-04-11 20:47:09 -0400409 vold_prepare_subdirs \
bigbiffad58e1b2020-07-06 20:24:34 -0400410 task_recovery_profiles.json \
bigbiff7ba75002020-04-11 20:47:09 -0400411 fscryptpolicyget
Captain Throwbackddb0a402020-11-01 12:52:21 -0500412 ifneq ($(TW_INCLUDE_CRYPTO_FBE),)
413 TWRP_REQUIRED_MODULES += \
414 plat_service_contexts \
415 servicemanager \
416 servicemanager.rc
417 endif
bigbiff7ba75002020-04-11 20:47:09 -0400418endif
Matt Mower031163b2014-11-01 15:13:03 -0500419
bigbiff416fe3a2020-03-28 13:46:48 -0400420ifneq ($(wildcard external/zip/Android.mk),)
421 TWRP_REQUIRED_MODULES += zip
422endif
423ifneq ($(wildcard external/unzip/Android.mk),)
424 TWRP_REQUIRED_MODULES += unzip
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600425endif
Matt Mower84057612017-01-08 13:32:18 -0600426
Matt Mower20172792014-11-14 10:54:03 -0600427ifneq ($(TW_NO_EXFAT), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500428 TWRP_REQUIRED_MODULES += mkexfatfs fsckexfat
Ethan Yonker34741d92016-02-06 13:22:45 -0600429 ifneq ($(TW_NO_EXFAT_FUSE), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500430 TWRP_REQUIRED_MODULES += exfat-fuse
Ethan Yonker34741d92016-02-06 13:22:45 -0600431 endif
Matt Mower20172792014-11-14 10:54:03 -0600432endif
Matt Mower031163b2014-11-01 15:13:03 -0500433ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
bigbiffad58e1b2020-07-06 20:24:34 -0400434 TWRP_REQUIRED_MODULES += sgdisk
Matt Mower031163b2014-11-01 15:13:03 -0500435endif
436ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500437 TWRP_REQUIRED_MODULES += openaes openaes_license
Matt Mower031163b2014-11-01 15:13:03 -0500438endif
439ifeq ($(TW_INCLUDE_DUMLOCK), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500440 TWRP_REQUIRED_MODULES += \
Matt Mower031163b2014-11-01 15:13:03 -0500441 htcdumlock htcdumlocksys flash_imagesys dump_imagesys libbmlutils.so \
442 libflashutils.so libmmcutils.so libmtdutils.so HTCDumlock.apk
443endif
Matt Mower031163b2014-11-01 15:13:03 -0500444ifeq ($(TW_INCLUDE_FB2PNG), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500445 TWRP_REQUIRED_MODULES += fb2png
Matt Mower031163b2014-11-01 15:13:03 -0500446endif
447ifneq ($(TW_OEM_BUILD),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500448 TWRP_REQUIRED_MODULES += orscmd
Matt Mower031163b2014-11-01 15:13:03 -0500449endif
450ifeq ($(BOARD_USES_BML_OVER_MTD),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500451 TWRP_REQUIRED_MODULES += bml_over_mtd
Matt Mower031163b2014-11-01 15:13:03 -0500452endif
453ifeq ($(TW_INCLUDE_INJECTTWRP), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500454 TWRP_REQUIRED_MODULES += injecttwrp
Matt Mower031163b2014-11-01 15:13:03 -0500455endif
Matt Mowerec009e82015-01-30 13:00:49 -0600456ifneq ($(TW_EXCLUDE_DEFAULT_USB_INIT), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500457 TWRP_REQUIRED_MODULES += init.recovery.usb.rc
Matt Mowerec009e82015-01-30 13:00:49 -0600458endif
Captain Throwback1f127752016-01-19 17:30:20 -0500459ifeq ($(TWRP_INCLUDE_LOGCAT), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400460 TWRP_REQUIRED_MODULES += logcat event-log-tags
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600461 ifeq ($(TARGET_USES_LOGD), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500462 TWRP_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600463 endif
Captain Throwback1f127752016-01-19 17:30:20 -0500464endif
Matt Mower031163b2014-11-01 15:13:03 -0500465# Allow devices to specify device-specific recovery dependencies
466ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500467 TWRP_REQUIRED_MODULES += $(TARGET_RECOVERY_DEVICE_MODULES)
Matt Mower031163b2014-11-01 15:13:03 -0500468endif
Dees Troy3454ade2015-01-20 19:21:04 +0000469LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
470LOCAL_CFLAGS += -DTWHTCD_PATH=\"$(TWHTCD_PATH)\"
Ethan Yonkerb81d9052015-07-09 13:20:53 -0500471ifeq ($(TW_INCLUDE_NTFS_3G),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500472 TWRP_REQUIRED_MODULES += \
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500473 mount.ntfs \
474 fsck.ntfs \
475 mkfs.ntfs
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500476endif
Matt Mower58294912015-12-10 11:54:28 -0600477ifeq ($(TARGET_USERIMAGES_USE_F2FS), true)
bigbiffd58ba182020-03-23 10:02:29 -0400478 TWRP_REQUIRED_MODULES += sload.f2fs \
479 libfs_mgr \
480 fs_mgr \
481 libinit
Ethan Yonker93382822018-11-01 15:25:31 -0500482endif
bigbiffad58e1b2020-07-06 20:24:34 -0400483
484TWRP_REQUIRED_MODULES += file_contexts_text
485
486ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
487 TWRP_REQUIRED_MODULES += recovery-persist recovery-refresh
Matt Mower58294912015-12-10 11:54:28 -0600488endif
Matt Mower031163b2014-11-01 15:13:03 -0500489
bigbiffad58e1b2020-07-06 20:24:34 -0400490LOCAL_REQUIRED_MODULES += $(TWRP_REQUIRED_MODULES)
Mark Salyzyn13aca592016-03-09 14:58:16 -0800491
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800492include $(BUILD_EXECUTABLE)
493
Matt Mowerd821c962017-02-15 12:36:18 -0600494# Symlink for file_contexts
495include $(CLEAR_VARS)
496
Captain Throwback3184b2f2017-03-07 12:07:40 -0500497LOCAL_MODULE := file_contexts_text
Matt Mowerd821c962017-02-15 12:36:18 -0600498LOCAL_MODULE_TAGS := optional
bigbiffad58e1b2020-07-06 20:24:34 -0400499LOCAL_REQUIRED_MODULES := file_contexts.bin
500
Matt Mowerd821c962017-02-15 12:36:18 -0600501LOCAL_POST_INSTALL_CMD := \
Ethan Yonker58f21322018-08-24 11:17:36 -0500502 $(hide) cp -f $(PRODUCT_OUT)/obj/ETC/file_contexts.bin_intermediates/file_contexts.concat.tmp $(TARGET_RECOVERY_ROOT_OUT)/file_contexts
Matt Mowerd821c962017-02-15 12:36:18 -0600503
bigbiff416fe3a2020-03-28 13:46:48 -0400504include $(BUILD_PHONY_PACKAGE)
Dees_Troyc04dcf72012-10-02 10:46:37 -0400505
Mark Salyzyn13aca592016-03-09 14:58:16 -0800506# recovery-persist (system partition dynamic executable run after /data mounts)
507# ===============================
bigbiffad58e1b2020-07-06 20:24:34 -0400508include $(CLEAR_VARS)
509LOCAL_SRC_FILES := \
510 recovery-persist.cpp
511LOCAL_MODULE := recovery-persist
512LOCAL_SHARED_LIBRARIES := liblog libbase libmetricslogger
513LOCAL_STATIC_LIBRARIES := libotautil
514LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include
515LOCAL_C_INCLUDES += system/core/libmetricslogger/include \
516 system/core/libstats/include
517LOCAL_CFLAGS := -Werror
518LOCAL_INIT_RC := recovery-persist.rc
519include $(BUILD_EXECUTABLE)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800520
Mark Salyzyn13aca592016-03-09 14:58:16 -0800521# recovery-refresh (system partition dynamic executable run at init)
522# ===============================
bigbiffad58e1b2020-07-06 20:24:34 -0400523include $(CLEAR_VARS)
524LOCAL_SRC_FILES := \
525 recovery-refresh.cpp
526LOCAL_MODULE := recovery-refresh
527LOCAL_SHARED_LIBRARIES := liblog libbase
528LOCAL_STATIC_LIBRARIES := libotautil
529LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include
530LOCAL_CFLAGS := -Werror
531LOCAL_INIT_RC := recovery-refresh.rc
532include $(BUILD_EXECUTABLE)
Tao Bao42c45e22018-07-31 09:37:12 -0700533
Elliott Hughes63a31922016-06-09 17:41:22 -0700534# libmounts (static library)
535# ===============================
536include $(CLEAR_VARS)
537LOCAL_SRC_FILES := mounts.cpp
Tao Bao5f85d1f2017-03-28 21:12:36 -0700538LOCAL_CFLAGS := \
539 -Wall \
540 -Werror
Elliott Hughes63a31922016-06-09 17:41:22 -0700541LOCAL_MODULE := libmounts
Tao Bao5f85d1f2017-03-28 21:12:36 -0700542LOCAL_STATIC_LIBRARIES := libbase
Elliott Hughes63a31922016-06-09 17:41:22 -0700543include $(BUILD_STATIC_LIBRARY)
544
Tao Bao62e0bc72017-04-10 16:55:57 -0700545# librecovery (static library)
546# ===============================
547include $(CLEAR_VARS)
548LOCAL_SRC_FILES := \
549 install.cpp
Tao Baob24510c2017-04-20 17:54:27 -0700550LOCAL_CFLAGS := -Wall -Werror
Tao Bao62e0bc72017-04-10 16:55:57 -0700551LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
Tao Bao25dbe172017-04-12 23:52:20 -0700552
553ifeq ($(AB_OTA_UPDATER),true)
554 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
555endif
556
Tao Bao62e0bc72017-04-10 16:55:57 -0700557LOCAL_MODULE := librecovery
558LOCAL_STATIC_LIBRARIES := \
559 libminui \
Tao Baocfe53c22017-10-03 14:37:21 -0700560 libotautil \
bigbiff7ba75002020-04-11 20:47:09 -0400561 libvintf \
Tao Bao62e0bc72017-04-10 16:55:57 -0700562 libcrypto_utils \
563 libcrypto \
Elliott Hughese1bb7a52017-06-28 08:00:17 -0700564 libbase \
565 libziparchive \
Tao Bao62e0bc72017-04-10 16:55:57 -0700566
567include $(BUILD_STATIC_LIBRARY)
568
Ethan Yonker34ae4832016-08-24 15:32:18 -0500569# shared libaosprecovery for Apache code
570# ===============================
Dees_Troy2673cec2013-04-02 20:22:16 +0000571include $(CLEAR_VARS)
572
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800573
Dees_Troy2673cec2013-04-02 20:22:16 +0000574LOCAL_MODULE := libaosprecovery
bigbiffd58ba182020-03-23 10:02:29 -0400575LOCAL_MODULE_TAGS := optional
bigbiffad58e1b2020-07-06 20:24:34 -0400576
bigbiffdf8436b2020-08-30 16:22:34 -0400577LOCAL_SRC_FILES := install/adb_install.cpp install/asn1_decoder.cpp install/fuse_sdcard_install.cpp \
578 install/get_args.cpp install/install.cpp install/installcommand.cpp install/legacy_property_service.cpp \
bigbiffad58e1b2020-07-06 20:24:34 -0400579 install/package.cpp install/verifier.cpp install/wipe_data.cpp install/tw_atomic.cpp \
580 install/set_metadata.cpp verifier28/verifier.cpp install/zipwrap.cpp install/ZipUtil.cpp
bigbiffd58ba182020-03-23 10:02:29 -0400581LOCAL_SHARED_LIBRARIES += libbase libbootloader_message libcrypto libext4_utils \
bigbiff7ba75002020-04-11 20:47:09 -0400582 libfs_mgr libfusesideload libhidl-gen-utils libhidlbase \
bigbiffd58ba182020-03-23 10:02:29 -0400583 liblog libselinux libtinyxml2 libutils libz libziparchive libcutils
Ethan Yonker941a8992016-12-05 09:04:30 -0600584LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
bigbiffad58e1b2020-07-06 20:24:34 -0400585LOCAL_SHARED_LIBRARIES += libc++
586LOCAL_CFLAGS := -std=gnu++2a
587LOCAL_C_INCLUDES += $(commands_TWRP_local_path)/install/include \
588 $(commands_TWRP_local_path)/recovery_ui/include \
589 $(commands_TWRP_local_path)/otautil/include \
590 $(commands_TWRP_local_path)/minadbd \
591 $(commands_TWRP_local_path)/minzip \
592 system/libvintf/include
593LOCAL_STATIC_LIBRARIES += libotautil libvintf_recovery libvintf libhidl-gen-utils
594LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
Tao Baoa92d8fb2017-06-20 18:11:21 -0700595
Ethan Yonker941a8992016-12-05 09:04:30 -0600596ifeq ($(AB_OTA_UPDATER),true)
597 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
598endif
bigbiffd58ba182020-03-23 10:02:29 -0400599
Dees_Troy2673cec2013-04-02 20:22:16 +0000600include $(BUILD_SHARED_LIBRARY)
bigbiffd58ba182020-03-23 10:02:29 -0400601
Tao Baod80a9982016-03-03 11:43:47 -0800602# libverifier (static library)
603# ===============================
Kenny Root7a4adb52013-10-09 10:14:35 -0700604include $(CLEAR_VARS)
Tao Bao80e46e02015-06-03 10:49:29 -0700605LOCAL_CLANG := true
Kenny Root7a4adb52013-10-09 10:14:35 -0700606LOCAL_MODULE := libverifier
Kenny Root7a4adb52013-10-09 10:14:35 -0700607LOCAL_SRC_FILES := \
Kenny Root7a4adb52013-10-09 10:14:35 -0700608 asn1_decoder.cpp \
Tao Baod7bf82e2017-03-18 09:24:11 -0700609 verifier.cpp
Tao Bao0ecbd762017-01-16 21:16:58 -0800610LOCAL_STATIC_LIBRARIES := \
Tao Bao09e468f2017-09-29 14:39:33 -0700611 libotautil \
Tao Bao0ecbd762017-01-16 21:16:58 -0800612 libcrypto_utils \
613 libcrypto \
614 libbase
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700615LOCAL_CFLAGS := -Wall -Werror
Jed Estep43291862016-02-03 17:02:09 -0800616include $(BUILD_STATIC_LIBRARY)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800617
Dees_Troy51a0e822012-09-05 15:24:24 -0400618commands_recovery_local_path := $(LOCAL_PATH)
Ethan Yonkerecbd3e82017-12-14 14:43:59 -0600619
Ethan Yonker58f21322018-08-24 11:17:36 -0500620# $(LOCAL_PATH)/edify/Android.mk
621# $(LOCAL_PATH)/otafault/Android.mk
bigbiffd58ba182020-03-23 10:02:29 -0400622
623 # $(commands_TWRP_local_path)/boot_control/Android.bp
bigbiffd58ba182020-03-23 10:02:29 -0400624 # $(commands_TWRP_local_path)/update_verifier/Android.mk
Yabin Cui2f272c02016-06-24 18:22:02 -0700625include \
bigbiffdf8436b2020-08-30 16:22:34 -0400626 $(commands_TWRP_local_path)/updater/Android.mk
Ethan Yonker58f21322018-08-24 11:17:36 -0500627
bigbiffad58e1b2020-07-06 20:24:34 -0400628include $(commands_TWRP_local_path)/mtp/ffs/Android.mk
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500629
Matt Mowerf746dbb2015-05-13 22:56:31 -0500630ifeq ($(wildcard system/core/uncrypt/Android.mk),)
Ethan Yonker58f21322018-08-24 11:17:36 -0500631 #include $(commands_TWRP_local_path)/uncrypt/Android.mk
Matt Mowerf746dbb2015-05-13 22:56:31 -0500632endif
633
bigbiffad58e1b2020-07-06 20:24:34 -0400634include $(commands_TWRP_local_path)/minadbd/Android.mk \
635 $(commands_TWRP_local_path)/minui/Android.mk
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500636
bigbiffad58e1b2020-07-06 20:24:34 -0400637# $(commands_TWRP_local_path)/otautil/Android.mk \
bigbiffd58ba182020-03-23 10:02:29 -0400638
Dees_Troy51a0e822012-09-05 15:24:24 -0400639#includes for TWRP
Ethan Yonker58f21322018-08-24 11:17:36 -0500640include $(commands_TWRP_local_path)/injecttwrp/Android.mk \
641 $(commands_TWRP_local_path)/htcdumlock/Android.mk \
642 $(commands_TWRP_local_path)/gui/Android.mk \
643 $(commands_TWRP_local_path)/mmcutils/Android.mk \
644 $(commands_TWRP_local_path)/bmlutils/Android.mk \
645 $(commands_TWRP_local_path)/prebuilt/Android.mk \
646 $(commands_TWRP_local_path)/mtdutils/Android.mk \
647 $(commands_TWRP_local_path)/flashutils/Android.mk \
648 $(commands_TWRP_local_path)/pigz/Android.mk \
649 $(commands_TWRP_local_path)/libtar/Android.mk \
650 $(commands_TWRP_local_path)/libcrecovery/Android.mk \
651 $(commands_TWRP_local_path)/libblkid/Android.mk \
652 $(commands_TWRP_local_path)/minuitwrp/Android.mk \
653 $(commands_TWRP_local_path)/openaes/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500654 $(commands_TWRP_local_path)/twrpTarMain/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500655 $(commands_TWRP_local_path)/minzip/Android.mk \
656 $(commands_TWRP_local_path)/dosfstools/Android.mk \
657 $(commands_TWRP_local_path)/etc/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500658 $(commands_TWRP_local_path)/simg2img/Android.mk \
659 $(commands_TWRP_local_path)/adbbu/Android.mk \
660 $(commands_TWRP_local_path)/libpixelflinger/Android.mk \
661 $(commands_TWRP_local_path)/twrpDigest/Android.mk \
662 $(commands_TWRP_local_path)/attr/Android.mk
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600663
mauronofrio6d3bf892019-10-26 19:47:55 +0200664ifneq ($(TW_OZIP_DECRYPT_KEY),)
665 TWRP_REQUIRED_MODULES += ozip_decrypt
666 include $(commands_TWRP_local_path)/ozip_decrypt/Android.mk
667endif
668
Ethan Yonker253368a2014-11-25 15:00:52 -0600669ifeq ($(TW_INCLUDE_CRYPTO), true)
Ethan Yonker98661c12018-10-17 08:39:28 -0500670 include $(commands_TWRP_local_path)/crypto/fde/Android.mk
Ethan Yonker58f21322018-08-24 11:17:36 -0500671 include $(commands_TWRP_local_path)/crypto/scrypt/Android.mk
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600672 ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400673 include $(commands_TWRP_local_path)/crypto/fscrypt/Android.mk
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600674 endif
nkk7171c6c502017-01-05 23:55:05 +0200675 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),)
676 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),false)
Ethan Yonker58f21322018-08-24 11:17:36 -0500677 include $(commands_TWRP_local_path)/crypto/vold_decrypt/Android.mk
nkk7171c6c502017-01-05 23:55:05 +0200678 endif
679 endif
Ethan Yonker58f21322018-08-24 11:17:36 -0500680 include $(commands_TWRP_local_path)/gpt/Android.mk
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600681endif
Vojtech Bocek7cc278b2013-02-24 01:40:19 +0100682ifeq ($(BUILD_ID), GINGERBREAD)
683 TW_NO_EXFAT := true
684endif
Dees_Troyb05ddee2013-01-28 20:24:50 +0000685ifneq ($(TW_NO_EXFAT), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500686 include $(commands_TWRP_local_path)/exfat/mkfs/Android.mk \
687 $(commands_TWRP_local_path)/exfat/fsck/Android.mk \
688 $(commands_TWRP_local_path)/fuse/Android.mk \
689 $(commands_TWRP_local_path)/exfat/libexfat/Android.mk
Ethan Yonker34741d92016-02-06 13:22:45 -0600690 ifneq ($(TW_NO_EXFAT_FUSE), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500691 include $(commands_TWRP_local_path)/exfat/fuse/Android.mk
Ethan Yonker34741d92016-02-06 13:22:45 -0600692 endif
Captain Throwback6a1acf22014-09-18 12:46:35 -0400693endif
Ethan Yonker03a42f62014-08-08 11:03:51 -0500694ifneq ($(TW_OEM_BUILD),true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500695 include $(commands_TWRP_local_path)/orscmd/Android.mk
Ethan Yonker03a42f62014-08-08 11:03:51 -0500696endif
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500697
Talustus3019a912013-04-06 11:50:07 +0200698# FB2PNG
699ifeq ($(TW_INCLUDE_FB2PNG), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500700 include $(commands_TWRP_local_path)/fb2png/Android.mk
Talustus3019a912013-04-06 11:50:07 +0200701endif
Matt Mower55c75ca2014-08-31 11:30:15 -0500702
Matt Mower55c75ca2014-08-31 11:30:15 -0500703endif
Ethan Yonker58f21322018-08-24 11:17:36 -0500704
705commands_TWRP_local_path :=