blob: f536f1a7e6c76bcf816db49c500174df8adda9b0 [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 \
Dees_Troy32c8eb82012-09-11 15:28:06 -040071 twinstall.cpp \
Dees_Troy812660f2012-09-20 09:55:17 -040072 twrp-functions.cpp \
bigbiff bigbiff56cf5642016-08-19 17:43:45 -040073 twrpDigestDriver.cpp \
Dees_Troye34c1332013-02-06 19:13:00 +000074 openrecoveryscript.cpp \
bigbiff bigbiff19fb79c2016-09-05 21:04:51 -040075 tarWrite.c \
bigbiff32cbabe2020-04-12 19:16:19 -040076 twrpAdbBuFifo.cpp \
bigbiffad58e1b2020-07-06 20:24:34 -040077 twrpApex.cpp \
78 twrpRepacker.cpp
Dees_Troy51a0e822012-09-05 15:24:24 -040079
bigbiffad58e1b2020-07-06 20:24:34 -040080LOCAL_STATIC_LIBRARIES += libavb
81LOCAL_SHARED_LIBRARIES += libfs_mgr libinit
82ifeq ($(TW_INCLUDE_CRYPTO),true)
83 LOCAL_CFLAGS += -DUSE_FSCRYPT -Wno-macro-redefined
84 LOCAL_C_INCLUDES += bootable/recovery/crypto/fscrypt \
85 bootable/recovery/crypto
bigbiffee7b7ff2020-03-23 15:08:27 -040086endif
bigbiffad58e1b2020-07-06 20:24:34 -040087LOCAL_C_INCLUDES += \
88 system/core/fs_mgr/libfs_avb/include/ \
89 system/core/fs_mgr/include_fstab/ \
90 system/core/fs_mgr/include/ \
91 system/core/fs_mgr/libdm/include/ \
92 system/core/fs_mgr/liblp/include/ \
93 system/gsid/include/ \
94 system/core/init/ \
95 system/extras/ext4_utils/include
bigbiffee7b7ff2020-03-23 15:08:27 -040096
Dees_Troya58bead2012-09-27 09:49:29 -040097ifneq ($(TARGET_RECOVERY_REBOOT_SRC),)
Dees_Troy51a0e822012-09-05 15:24:24 -040098 LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC)
99endif
100
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800101LOCAL_MODULE := recovery
102
Doug Zongkere08991e2010-02-02 13:09:52 -0800103RECOVERY_API_VERSION := 3
Ken Sumrallf35d1ce2013-02-13 12:59:35 -0800104RECOVERY_FSTAB_VERSION := 2
Doug Zongkerfb2e3af2009-06-17 17:29:40 -0700105LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
bigbiff7ba75002020-04-11 20:47:09 -0400106LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
Tao Bao80e46e02015-06-03 10:49:29 -0700107LOCAL_CLANG := true
Doug Zongkerfb2e3af2009-06-17 17:29:40 -0700108
Dan Albert1ddd3502015-02-18 15:58:15 -0800109LOCAL_C_INCLUDES += \
bigbiffad58e1b2020-07-06 20:24:34 -0400110 bionic \
Dan Albert1ddd3502015-02-18 15:58:15 -0800111 system/vold \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500112 system/extras \
Dan Albert1ddd3502015-02-18 15:58:15 -0800113 system/core/adb \
bigbiffce8f83c2015-12-12 18:30:21 -0500114 system/core/libsparse \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500115 external/zlib \
bigbiffd58ba182020-03-23 10:02:29 -0400116 system/core/libpixelflinger/include \
bigbiffad58e1b2020-07-06 20:24:34 -0400117 system/core/libziparchive/include \
bigbiffd58ba182020-03-23 10:02:29 -0400118 external/freetype/include \
bigbiffad58e1b2020-07-06 20:24:34 -0400119 external/boringssl/include \
120 external/libcxx/include \
121 external/libselinux/include \
bigbiffd58ba182020-03-23 10:02:29 -0400122 $(LOCAL_PATH)/bootloader_message_twrp/include \
123 $(LOCAL_PATH)/recovery_ui/include \
124 $(LOCAL_PATH)/otautil/include \
bigbiffad58e1b2020-07-06 20:24:34 -0400125 $(LOCAL_PATH)/install/include \
126 $(LOCAL_PATH)/fuse_sideload/include \
127 $(LOCAL_PATH)/install/include \
128 $(LOCAL_PATH)/verifier28/
Dees_Troy51a0e822012-09-05 15:24:24 -0400129
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600130LOCAL_STATIC_LIBRARIES += libguitwrp
bigbiffd58ba182020-03-23 10:02:29 -0400131LOCAL_SHARED_LIBRARIES += libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libtwadbbu libbootloader_message_twrp
bigbiffad58e1b2020-07-06 20:24:34 -0400132LOCAL_SHARED_LIBRARIES += libcrecovery libtwadbbu libtwrpdigest libc++ libaosprecovery libinit libcrypto libbase libziparchive libselinux
133LOCAL_CFLAGS += -DUSE_28_VERIFIER
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500134
Dees_Troy4546fe72013-01-10 14:33:27 +0000135ifneq ($(wildcard system/core/libsparse/Android.mk),)
136LOCAL_SHARED_LIBRARIES += libsparse
137endif
138
Ethan Yonker7af51ce2014-04-04 13:33:30 -0500139ifeq ($(TW_OEM_BUILD),true)
140 LOCAL_CFLAGS += -DTW_OEM_BUILD
141 BOARD_HAS_NO_REAL_SDCARD := true
142 TW_USE_TOOLBOX := true
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400143 TW_EXCLUDE_MTP := true
Ethan Yonker7af51ce2014-04-04 13:33:30 -0500144endif
Yabin Cui99281df2016-02-17 12:21:52 -0800145
Elliott Hughes01fcbe12016-05-23 17:43:41 -0700146ifeq ($(AB_OTA_UPDATER),true)
147 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
bigbiff bigbiffc630cee2019-01-03 20:14:06 -0500148 LOCAL_SHARED_LIBRARIES += libhardware android.hardware.boot@1.0
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500149 TWRP_REQUIRED_MODULES += libhardware
Elliott Hughes01fcbe12016-05-23 17:43:41 -0700150endif
151
bigbiffee7b7ff2020-03-23 15:08:27 -0400152ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
153 LOCAL_CFLAGS += -DPRODUCT_USE_DYNAMIC_PARTITIONS=1
154endif
155
bigbiff32cbabe2020-04-12 19:16:19 -0400156ifeq ($(TW_NO_BIND_SYSTEM),true)
157 LOCAL_CFLAGS += -DTW_NO_BIND_SYSTEM
158endif
159
bigbiffad58e1b2020-07-06 20:24:34 -0400160LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800161
Ethan Yonker93382822018-11-01 15:25:31 -0500162ifeq ($(TARGET_RECOVERY_TWRP_LIB),)
163 LOCAL_SRC_FILES += BasePartition.cpp
164else
165 LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_TWRP_LIB)
166endif
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800167
Doug Zongkercc8cd3f2010-09-20 12:16:13 -0700168LOCAL_C_INCLUDES += system/extras/ext4_utils
169
that0e2140e2016-08-10 21:04:26 +0200170tw_git_revision := $(shell git -C $(LOCAL_PATH) rev-parse --short=8 HEAD 2>/dev/null)
171ifeq ($(shell git -C $(LOCAL_PATH) diff --quiet; echo $$?),1)
172 tw_git_revision := $(tw_git_revision)-dirty
173endif
174LOCAL_CFLAGS += -DTW_GIT_REVISION='"$(tw_git_revision)"'
175
mauronofriobabc15e2020-03-16 14:59:39 +0000176ifeq ($(TW_FORCE_USE_BUSYBOX), true)
177 TW_USE_TOOLBOX := false
178else
179 TW_USE_TOOLBOX := true
180endif
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500181ifeq ($(TW_EXCLUDE_MTP),)
182 LOCAL_SHARED_LIBRARIES += libtwrpmtp-ffs
183endif
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500184
Dees_Troy51a0e822012-09-05 15:24:24 -0400185#TWRP Build Flags
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400186ifeq ($(TW_EXCLUDE_MTP),)
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400187 LOCAL_CFLAGS += -DTW_HAS_MTP
188endif
Ricardo Gomezc9ecd442013-07-05 16:13:52 -0700189ifneq ($(TW_NO_SCREEN_TIMEOUT),)
190 LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
191endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400192ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true)
193 LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD
194endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400195ifneq ($(RECOVERY_SDCARD_ON_DATA),)
196 LOCAL_CFLAGS += -DRECOVERY_SDCARD_ON_DATA
197endif
198ifneq ($(TW_INCLUDE_DUMLOCK),)
199 LOCAL_CFLAGS += -DTW_INCLUDE_DUMLOCK
200endif
201ifneq ($(TW_INTERNAL_STORAGE_PATH),)
202 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_PATH=$(TW_INTERNAL_STORAGE_PATH)
203endif
204ifneq ($(TW_INTERNAL_STORAGE_MOUNT_POINT),)
205 LOCAL_CFLAGS += -DTW_INTERNAL_STORAGE_MOUNT_POINT=$(TW_INTERNAL_STORAGE_MOUNT_POINT)
206endif
207ifneq ($(TW_EXTERNAL_STORAGE_PATH),)
208 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_PATH=$(TW_EXTERNAL_STORAGE_PATH)
209endif
210ifneq ($(TW_EXTERNAL_STORAGE_MOUNT_POINT),)
211 LOCAL_CFLAGS += -DTW_EXTERNAL_STORAGE_MOUNT_POINT=$(TW_EXTERNAL_STORAGE_MOUNT_POINT)
212endif
ChampionSwimmercf33e4d2013-02-03 13:59:22 +0530213ifeq ($(TW_HAS_NO_BOOT_PARTITION), true)
214 LOCAL_CFLAGS += -DTW_HAS_NO_BOOT_PARTITION
215endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400216ifeq ($(TW_NO_REBOOT_BOOTLOADER), true)
217 LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER
218endif
219ifeq ($(TW_NO_REBOOT_RECOVERY), true)
220 LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY
221endif
222ifeq ($(TW_NO_BATT_PERCENT), true)
223 LOCAL_CFLAGS += -DTW_NO_BATT_PERCENT
224endif
Jenkins1710bf22014-10-02 20:22:21 -0400225ifeq ($(TW_NO_CPU_TEMP), true)
226 LOCAL_CFLAGS += -DTW_NO_CPU_TEMP
227endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400228ifneq ($(TW_CUSTOM_POWER_BUTTON),)
229 LOCAL_CFLAGS += -DTW_CUSTOM_POWER_BUTTON=$(TW_CUSTOM_POWER_BUTTON)
230endif
231ifeq ($(TW_ALWAYS_RMRF), true)
232 LOCAL_CFLAGS += -DTW_ALWAYS_RMRF
233endif
234ifeq ($(TW_NEVER_UNMOUNT_SYSTEM), true)
235 LOCAL_CFLAGS += -DTW_NEVER_UNMOUNT_SYSTEM
236endif
237ifeq ($(TW_NO_USB_STORAGE), true)
238 LOCAL_CFLAGS += -DTW_NO_USB_STORAGE
239endif
240ifeq ($(TW_INCLUDE_INJECTTWRP), true)
241 LOCAL_CFLAGS += -DTW_INCLUDE_INJECTTWRP
242endif
243ifeq ($(TW_INCLUDE_BLOBPACK), true)
244 LOCAL_CFLAGS += -DTW_INCLUDE_BLOBPACK
245endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400246ifneq ($(TARGET_USE_CUSTOM_LUN_FILE_PATH),)
247 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(TARGET_USE_CUSTOM_LUN_FILE_PATH)\"
248endif
249ifneq ($(BOARD_UMS_LUNFILE),)
250 LOCAL_CFLAGS += -DCUSTOM_LUN_FILE=\"$(BOARD_UMS_LUNFILE)\"
251endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400252ifeq ($(TW_HAS_DOWNLOAD_MODE), true)
253 LOCAL_CFLAGS += -DTW_HAS_DOWNLOAD_MODE
254endif
mauronofrioe9a49ef2018-10-03 13:38:16 +0200255ifeq ($(TW_HAS_EDL_MODE), true)
256 LOCAL_CFLAGS += -DTW_HAS_EDL_MODE
257endif
bigbiff bigbiff87940362013-03-09 09:58:50 -0500258ifeq ($(TW_NO_SCREEN_BLANK), true)
259 LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
260endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400261ifeq ($(TW_SDEXT_NO_EXT4), true)
262 LOCAL_CFLAGS += -DTW_SDEXT_NO_EXT4
263endif
Dees_Troyfdf5fcc2012-09-11 10:27:01 -0400264ifeq ($(TW_FORCE_CPUINFO_FOR_DEVICE_ID), true)
265 LOCAL_CFLAGS += -DTW_FORCE_CPUINFO_FOR_DEVICE_ID
266endif
Dees_Troy3f5c4e82013-02-01 15:16:59 +0000267ifeq ($(TW_NO_EXFAT_FUSE), true)
268 LOCAL_CFLAGS += -DTW_NO_EXFAT_FUSE
269endif
bigbiff bigbiff3ed778a2019-03-12 19:28:31 -0400270ifeq ($(TW_NO_HAPTICS), true)
271 LOCAL_CFLAGS += -DTW_NO_HAPTICS
272endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400273ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
Ethan Yonker253368a2014-11-25 15:00:52 -0600274 TW_INCLUDE_CRYPTO := true
Dees_Troy51a0e822012-09-05 15:24:24 -0400275endif
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600276ifeq ($(TW_INCLUDE_L_CRYPTO), true)
Ethan Yonker253368a2014-11-25 15:00:52 -0600277 TW_INCLUDE_CRYPTO := true
278endif
279ifeq ($(TW_INCLUDE_CRYPTO), true)
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600280 LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
Ethan Yonker98661c12018-10-17 08:39:28 -0500281 LOCAL_SHARED_LIBRARIES += libcryptfsfde libgpt_twrp
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500282 LOCAL_C_INCLUDES += external/boringssl/src/include
bigbiffad58e1b2020-07-06 20:24:34 -0400283 TW_INCLUDE_CRYPTO_FBE := true
284 LOCAL_CFLAGS += -DTW_INCLUDE_FBE
285 LOCAL_SHARED_LIBRARIES += libtwrpfscrypt android.frameworks.stats@1.0 android.hardware.authsecret@1.0 \
286 android.hardware.oemlock@1.0
287 LOCAL_CFLAGS += -DTW_INCLUDE_FBE_METADATA_DECRYPT
nkk7171c6c502017-01-05 23:55:05 +0200288 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),)
289 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),false)
bigbiffad58e1b2020-07-06 20:24:34 -0400290 TW_INCLUDE_LIBRESETPROP := true
nkk7171c6c502017-01-05 23:55:05 +0200291 LOCAL_CFLAGS += -DTW_CRYPTO_USE_SYSTEM_VOLD
292 LOCAL_STATIC_LIBRARIES += libvolddecrypt
293 endif
294 endif
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600295endif
D. Andrei Măceșb29a5e22016-12-22 06:19:44 -0500296WITH_CRYPTO_UTILS := \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500297 $(if $(wildcard system/core/libcrypto_utils/android_pubkey.c),true)
Anatoly Smaznov10c11f62013-02-12 13:33:40 +0700298ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
299 LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
300endif
lambdadroidfc0b16d2017-08-04 17:16:53 +0200301ifeq ($(TW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID), true)
302 LOCAL_CFLAGS += -DTW_USE_SERIALNO_PROPERTY_FOR_DEVICE_ID
303endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600304ifneq ($(TW_BRIGHTNESS_PATH),)
305 LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH)
306endif
xNUTxe85f02d2014-07-18 01:30:58 +0200307ifneq ($(TW_SECONDARY_BRIGHTNESS_PATH),)
308 LOCAL_CFLAGS += -DTW_SECONDARY_BRIGHTNESS_PATH=$(TW_SECONDARY_BRIGHTNESS_PATH)
309endif
Dees_Troy2f9117a2013-02-17 19:52:09 -0600310ifneq ($(TW_MAX_BRIGHTNESS),)
311 LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
312endif
Greg Wallace36ade452015-11-08 13:54:25 -0500313ifneq ($(TW_DEFAULT_BRIGHTNESS),)
314 LOCAL_CFLAGS += -DTW_DEFAULT_BRIGHTNESS=$(TW_DEFAULT_BRIGHTNESS)
315endif
Dees_Troyf33b4902013-03-01 00:51:39 +0000316ifneq ($(TW_CUSTOM_BATTERY_PATH),)
317 LOCAL_CFLAGS += -DTW_CUSTOM_BATTERY_PATH=$(TW_CUSTOM_BATTERY_PATH)
318endif
Jenkins1710bf22014-10-02 20:22:21 -0400319ifneq ($(TW_CUSTOM_CPU_TEMP_PATH),)
320 LOCAL_CFLAGS += -DTW_CUSTOM_CPU_TEMP_PATH=$(TW_CUSTOM_CPU_TEMP_PATH)
321endif
Dees_Troy83bd4832013-05-04 12:39:56 +0000322ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
323 LOCAL_SHARED_LIBRARIES += libopenaes
324else
325 LOCAL_CFLAGS += -DTW_EXCLUDE_ENCRYPTED_BACKUPS
326endif
Vojtech Bocekd0e38bc2014-02-03 23:36:57 +0100327ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),)
Michael Bestas4a185582017-04-28 15:45:26 +0300328 ifneq ($(filter msm8226 msm8x26 msm8610 msm8974 msm8x74 msm8084 msm8x84 apq8084 msm8909 msm8916 msm8992 msm8994 msm8952 msm8996 msm8937 msm8953 msm8998,$(TARGET_BOARD_PLATFORM)),)
329 LOCAL_CFLAGS += -DQCOM_RTC_FIX
330 else ifeq ($(TARGET_CPU_VARIANT),krait)
Vojtech Bocekd0e38bc2014-02-03 23:36:57 +0100331 LOCAL_CFLAGS += -DQCOM_RTC_FIX
332 endif
333else ifeq ($(TARGET_RECOVERY_QCOM_RTC_FIX),true)
334 LOCAL_CFLAGS += -DQCOM_RTC_FIX
335endif
Matt Mower6883d732014-03-20 17:28:13 -0500336ifneq ($(TW_NO_LEGACY_PROPS),)
337 LOCAL_CFLAGS += -DTW_NO_LEGACY_PROPS
338endif
Dees Troy4159aed2014-02-28 17:24:43 +0000339ifneq ($(wildcard bionic/libc/include/sys/capability.h),)
340 LOCAL_CFLAGS += -DHAVE_CAPABILITIES
341endif
Matt Mowerec009e82015-01-30 13:00:49 -0600342ifneq ($(TARGET_RECOVERY_INITRC),)
343 TW_EXCLUDE_DEFAULT_USB_INIT := true
344endif
bigbiffad58e1b2020-07-06 20:24:34 -0400345LOCAL_CFLAGS += -DTW_USE_NEW_MINADBD
Ethan Yonker74db1572015-10-28 12:44:49 -0500346ifneq ($(TW_DEFAULT_LANGUAGE),)
347 LOCAL_CFLAGS += -DTW_DEFAULT_LANGUAGE=$(TW_DEFAULT_LANGUAGE)
348else
349 LOCAL_CFLAGS += -DTW_DEFAULT_LANGUAGE=en
350endif
Phoenix591e444d112018-02-03 07:23:54 +0000351ifneq ($(TW_CLOCK_OFFSET),)
352 LOCAL_CFLAGS += -DTW_CLOCK_OFFSET=$(TW_CLOCK_OFFSET)
353endif
Chaosmaster461e39f2020-02-07 01:48:13 +0100354ifneq ($(TW_OVERRIDE_SYSTEM_PROPS),)
355 TW_INCLUDE_LIBRESETPROP := true
356 LOCAL_CFLAGS += -DTW_OVERRIDE_SYSTEM_PROPS=$(TW_OVERRIDE_SYSTEM_PROPS)
357endif
358ifneq ($(TW_INCLUDE_LIBRESETPROP),)
bigbiffad58e1b2020-07-06 20:24:34 -0400359 LOCAL_SHARED_LIBRARIES += libresetprop
360 LOCAL_C_INCLUDES += external/magisk-prebuilt/include
361 LOCAL_CFLAGS += -DTW_INCLUDE_LIBRESETPROP
Chaosmaster461e39f2020-02-07 01:48:13 +0100362endif
363
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500364TWRP_REQUIRED_MODULES += \
bigbiffad58e1b2020-07-06 20:24:34 -0400365 relink_libraries \
366 relink_binaries \
bigbiff7ba75002020-04-11 20:47:09 -0400367 twrp_ramdisk \
Matt Mower031163b2014-11-01 15:13:03 -0500368 dump_image \
369 erase_image \
370 flash_image \
Matt Mower031163b2014-11-01 15:13:03 -0500371 mke2fs.conf \
Matt Mower031163b2014-11-01 15:13:03 -0500372 pigz \
373 teamwin \
Matt Mower031163b2014-11-01 15:13:03 -0500374 twrp \
Matt Mower18794c82015-11-11 16:22:45 -0600375 fsck.fat \
376 fatlabel \
377 mkfs.fat \
HashBanged974bb2016-01-30 14:20:09 -0500378 permissive.sh \
Ethan Yonkerf1179622016-08-25 15:32:21 -0500379 simg2img_twrp \
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500380 libbootloader_message_twrp \
381 init.recovery.hlthchrg.rc \
bigbiff973167a2020-04-06 15:44:20 -0400382 init.recovery.service.rc \
383 init.recovery.ldconfig.rc \
Captain Throwbackca2ba932020-10-14 12:45:52 -0400384 hwservicemanager.rc \
385 servicemanager.rc \
bigbiff7ba75002020-04-11 20:47:09 -0400386 awk \
bigbiffad58e1b2020-07-06 20:24:34 -0400387 toybox \
388 toolbox \
389 mkshrc_twrp
bigbiff7ba75002020-04-11 20:47:09 -0400390
391ifneq ($(TW_INCLUDE_CRYPTO),)
392TWRP_REQUIRED_MODULES += \
393 plat_service_contexts \
394 plat_hwservice_contexts \
395 vendor_hwservice_contexts \
bigbiff7ba75002020-04-11 20:47:09 -0400396 hwservicemanager \
397 servicemanager \
398 vndservicemanager \
399 vold_prepare_subdirs \
bigbiffad58e1b2020-07-06 20:24:34 -0400400 task_recovery_profiles.json \
bigbiff7ba75002020-04-11 20:47:09 -0400401 fscryptpolicyget
402endif
Matt Mower031163b2014-11-01 15:13:03 -0500403
bigbiff416fe3a2020-03-28 13:46:48 -0400404ifneq ($(wildcard external/zip/Android.mk),)
405 TWRP_REQUIRED_MODULES += zip
406endif
407ifneq ($(wildcard external/unzip/Android.mk),)
408 TWRP_REQUIRED_MODULES += unzip
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600409endif
Matt Mower84057612017-01-08 13:32:18 -0600410
Matt Mower20172792014-11-14 10:54:03 -0600411ifneq ($(TW_NO_EXFAT), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500412 TWRP_REQUIRED_MODULES += mkexfatfs fsckexfat
Ethan Yonker34741d92016-02-06 13:22:45 -0600413 ifneq ($(TW_NO_EXFAT_FUSE), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500414 TWRP_REQUIRED_MODULES += exfat-fuse
Ethan Yonker34741d92016-02-06 13:22:45 -0600415 endif
Matt Mower20172792014-11-14 10:54:03 -0600416endif
Matt Mower031163b2014-11-01 15:13:03 -0500417ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
bigbiffad58e1b2020-07-06 20:24:34 -0400418 TWRP_REQUIRED_MODULES += sgdisk
Matt Mower031163b2014-11-01 15:13:03 -0500419endif
420ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500421 TWRP_REQUIRED_MODULES += openaes openaes_license
Matt Mower031163b2014-11-01 15:13:03 -0500422endif
423ifeq ($(TW_INCLUDE_DUMLOCK), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500424 TWRP_REQUIRED_MODULES += \
Matt Mower031163b2014-11-01 15:13:03 -0500425 htcdumlock htcdumlocksys flash_imagesys dump_imagesys libbmlutils.so \
426 libflashutils.so libmmcutils.so libmtdutils.so HTCDumlock.apk
427endif
Matt Mower031163b2014-11-01 15:13:03 -0500428ifeq ($(TW_INCLUDE_FB2PNG), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500429 TWRP_REQUIRED_MODULES += fb2png
Matt Mower031163b2014-11-01 15:13:03 -0500430endif
431ifneq ($(TW_OEM_BUILD),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500432 TWRP_REQUIRED_MODULES += orscmd
Matt Mower031163b2014-11-01 15:13:03 -0500433endif
434ifeq ($(BOARD_USES_BML_OVER_MTD),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500435 TWRP_REQUIRED_MODULES += bml_over_mtd
Matt Mower031163b2014-11-01 15:13:03 -0500436endif
437ifeq ($(TW_INCLUDE_INJECTTWRP), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500438 TWRP_REQUIRED_MODULES += injecttwrp
Matt Mower031163b2014-11-01 15:13:03 -0500439endif
Matt Mowerec009e82015-01-30 13:00:49 -0600440ifneq ($(TW_EXCLUDE_DEFAULT_USB_INIT), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500441 TWRP_REQUIRED_MODULES += init.recovery.usb.rc
Matt Mowerec009e82015-01-30 13:00:49 -0600442endif
Captain Throwback1f127752016-01-19 17:30:20 -0500443ifeq ($(TWRP_INCLUDE_LOGCAT), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400444 TWRP_REQUIRED_MODULES += logcat event-log-tags
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600445 ifeq ($(TARGET_USES_LOGD), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500446 TWRP_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600447 endif
Captain Throwback1f127752016-01-19 17:30:20 -0500448endif
Matt Mower031163b2014-11-01 15:13:03 -0500449# Allow devices to specify device-specific recovery dependencies
450ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500451 TWRP_REQUIRED_MODULES += $(TARGET_RECOVERY_DEVICE_MODULES)
Matt Mower031163b2014-11-01 15:13:03 -0500452endif
Dees Troy3454ade2015-01-20 19:21:04 +0000453LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
454LOCAL_CFLAGS += -DTWHTCD_PATH=\"$(TWHTCD_PATH)\"
Ethan Yonkerb81d9052015-07-09 13:20:53 -0500455ifeq ($(TW_INCLUDE_NTFS_3G),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500456 TWRP_REQUIRED_MODULES += \
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500457 mount.ntfs \
458 fsck.ntfs \
459 mkfs.ntfs
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500460endif
Matt Mower58294912015-12-10 11:54:28 -0600461ifeq ($(TARGET_USERIMAGES_USE_F2FS), true)
bigbiffd58ba182020-03-23 10:02:29 -0400462 TWRP_REQUIRED_MODULES += sload.f2fs \
463 libfs_mgr \
464 fs_mgr \
465 libinit
Ethan Yonker93382822018-11-01 15:25:31 -0500466endif
bigbiffad58e1b2020-07-06 20:24:34 -0400467
468TWRP_REQUIRED_MODULES += file_contexts_text
469
470ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
471 TWRP_REQUIRED_MODULES += recovery-persist recovery-refresh
Matt Mower58294912015-12-10 11:54:28 -0600472endif
Matt Mower031163b2014-11-01 15:13:03 -0500473
bigbiffad58e1b2020-07-06 20:24:34 -0400474LOCAL_REQUIRED_MODULES += $(TWRP_REQUIRED_MODULES)
Mark Salyzyn13aca592016-03-09 14:58:16 -0800475
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800476include $(BUILD_EXECUTABLE)
477
Matt Mowerd821c962017-02-15 12:36:18 -0600478# Symlink for file_contexts
479include $(CLEAR_VARS)
480
Captain Throwback3184b2f2017-03-07 12:07:40 -0500481LOCAL_MODULE := file_contexts_text
Matt Mowerd821c962017-02-15 12:36:18 -0600482LOCAL_MODULE_TAGS := optional
bigbiffad58e1b2020-07-06 20:24:34 -0400483LOCAL_REQUIRED_MODULES := file_contexts.bin
484
Matt Mowerd821c962017-02-15 12:36:18 -0600485LOCAL_POST_INSTALL_CMD := \
Ethan Yonker58f21322018-08-24 11:17:36 -0500486 $(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 -0600487
bigbiff416fe3a2020-03-28 13:46:48 -0400488include $(BUILD_PHONY_PACKAGE)
Dees_Troyc04dcf72012-10-02 10:46:37 -0400489
Mark Salyzyn13aca592016-03-09 14:58:16 -0800490# recovery-persist (system partition dynamic executable run after /data mounts)
491# ===============================
bigbiffad58e1b2020-07-06 20:24:34 -0400492include $(CLEAR_VARS)
493LOCAL_SRC_FILES := \
494 recovery-persist.cpp
495LOCAL_MODULE := recovery-persist
496LOCAL_SHARED_LIBRARIES := liblog libbase libmetricslogger
497LOCAL_STATIC_LIBRARIES := libotautil
498LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include
499LOCAL_C_INCLUDES += system/core/libmetricslogger/include \
500 system/core/libstats/include
501LOCAL_CFLAGS := -Werror
502LOCAL_INIT_RC := recovery-persist.rc
503include $(BUILD_EXECUTABLE)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800504
Mark Salyzyn13aca592016-03-09 14:58:16 -0800505# recovery-refresh (system partition dynamic executable run at init)
506# ===============================
bigbiffad58e1b2020-07-06 20:24:34 -0400507include $(CLEAR_VARS)
508LOCAL_SRC_FILES := \
509 recovery-refresh.cpp
510LOCAL_MODULE := recovery-refresh
511LOCAL_SHARED_LIBRARIES := liblog libbase
512LOCAL_STATIC_LIBRARIES := libotautil
513LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include
514LOCAL_CFLAGS := -Werror
515LOCAL_INIT_RC := recovery-refresh.rc
516include $(BUILD_EXECUTABLE)
Tao Bao42c45e22018-07-31 09:37:12 -0700517
Elliott Hughes63a31922016-06-09 17:41:22 -0700518# libmounts (static library)
519# ===============================
520include $(CLEAR_VARS)
521LOCAL_SRC_FILES := mounts.cpp
Tao Bao5f85d1f2017-03-28 21:12:36 -0700522LOCAL_CFLAGS := \
523 -Wall \
524 -Werror
Elliott Hughes63a31922016-06-09 17:41:22 -0700525LOCAL_MODULE := libmounts
Tao Bao5f85d1f2017-03-28 21:12:36 -0700526LOCAL_STATIC_LIBRARIES := libbase
Elliott Hughes63a31922016-06-09 17:41:22 -0700527include $(BUILD_STATIC_LIBRARY)
528
Tao Bao62e0bc72017-04-10 16:55:57 -0700529# librecovery (static library)
530# ===============================
531include $(CLEAR_VARS)
532LOCAL_SRC_FILES := \
533 install.cpp
Tao Baob24510c2017-04-20 17:54:27 -0700534LOCAL_CFLAGS := -Wall -Werror
Tao Bao62e0bc72017-04-10 16:55:57 -0700535LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
Tao Bao25dbe172017-04-12 23:52:20 -0700536
537ifeq ($(AB_OTA_UPDATER),true)
538 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
539endif
540
Tao Bao62e0bc72017-04-10 16:55:57 -0700541LOCAL_MODULE := librecovery
542LOCAL_STATIC_LIBRARIES := \
543 libminui \
Tao Baocfe53c22017-10-03 14:37:21 -0700544 libotautil \
bigbiff7ba75002020-04-11 20:47:09 -0400545 libvintf \
Tao Bao62e0bc72017-04-10 16:55:57 -0700546 libcrypto_utils \
547 libcrypto \
Elliott Hughese1bb7a52017-06-28 08:00:17 -0700548 libbase \
549 libziparchive \
Tao Bao62e0bc72017-04-10 16:55:57 -0700550
551include $(BUILD_STATIC_LIBRARY)
552
Ethan Yonker34ae4832016-08-24 15:32:18 -0500553# shared libaosprecovery for Apache code
554# ===============================
Dees_Troy2673cec2013-04-02 20:22:16 +0000555include $(CLEAR_VARS)
556
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800557
Dees_Troy2673cec2013-04-02 20:22:16 +0000558LOCAL_MODULE := libaosprecovery
bigbiffd58ba182020-03-23 10:02:29 -0400559LOCAL_MODULE_TAGS := optional
bigbiffad58e1b2020-07-06 20:24:34 -0400560
561LOCAL_SRC_FILES := install/adb_install.cpp install/asn1_decoder.cpp install/fuse_sdcard_install.cpp\
562 install/install.cpp install/installcommand.cpp install/legacy_property_service.cpp \
563 install/package.cpp install/verifier.cpp install/wipe_data.cpp install/tw_atomic.cpp \
564 install/set_metadata.cpp verifier28/verifier.cpp install/zipwrap.cpp install/ZipUtil.cpp
bigbiffd58ba182020-03-23 10:02:29 -0400565LOCAL_SHARED_LIBRARIES += libbase libbootloader_message libcrypto libext4_utils \
bigbiff7ba75002020-04-11 20:47:09 -0400566 libfs_mgr libfusesideload libhidl-gen-utils libhidlbase \
bigbiffd58ba182020-03-23 10:02:29 -0400567 liblog libselinux libtinyxml2 libutils libz libziparchive libcutils
Ethan Yonker941a8992016-12-05 09:04:30 -0600568LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
bigbiffad58e1b2020-07-06 20:24:34 -0400569LOCAL_SHARED_LIBRARIES += libc++
570LOCAL_CFLAGS := -std=gnu++2a
571LOCAL_C_INCLUDES += $(commands_TWRP_local_path)/install/include \
572 $(commands_TWRP_local_path)/recovery_ui/include \
573 $(commands_TWRP_local_path)/otautil/include \
574 $(commands_TWRP_local_path)/minadbd \
575 $(commands_TWRP_local_path)/minzip \
576 system/libvintf/include
577LOCAL_STATIC_LIBRARIES += libotautil libvintf_recovery libvintf libhidl-gen-utils
578LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
Tao Baoa92d8fb2017-06-20 18:11:21 -0700579
Ethan Yonker941a8992016-12-05 09:04:30 -0600580ifeq ($(AB_OTA_UPDATER),true)
581 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
582endif
bigbiffd58ba182020-03-23 10:02:29 -0400583
Dees_Troy2673cec2013-04-02 20:22:16 +0000584include $(BUILD_SHARED_LIBRARY)
bigbiffd58ba182020-03-23 10:02:29 -0400585
Tao Baod80a9982016-03-03 11:43:47 -0800586# libverifier (static library)
587# ===============================
Kenny Root7a4adb52013-10-09 10:14:35 -0700588include $(CLEAR_VARS)
Tao Bao80e46e02015-06-03 10:49:29 -0700589LOCAL_CLANG := true
Kenny Root7a4adb52013-10-09 10:14:35 -0700590LOCAL_MODULE := libverifier
Kenny Root7a4adb52013-10-09 10:14:35 -0700591LOCAL_SRC_FILES := \
Kenny Root7a4adb52013-10-09 10:14:35 -0700592 asn1_decoder.cpp \
Tao Baod7bf82e2017-03-18 09:24:11 -0700593 verifier.cpp
Tao Bao0ecbd762017-01-16 21:16:58 -0800594LOCAL_STATIC_LIBRARIES := \
Tao Bao09e468f2017-09-29 14:39:33 -0700595 libotautil \
Tao Bao0ecbd762017-01-16 21:16:58 -0800596 libcrypto_utils \
597 libcrypto \
598 libbase
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700599LOCAL_CFLAGS := -Wall -Werror
Jed Estep43291862016-02-03 17:02:09 -0800600include $(BUILD_STATIC_LIBRARY)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800601
Dees_Troy51a0e822012-09-05 15:24:24 -0400602commands_recovery_local_path := $(LOCAL_PATH)
Ethan Yonkerecbd3e82017-12-14 14:43:59 -0600603
Ethan Yonker58f21322018-08-24 11:17:36 -0500604# $(LOCAL_PATH)/edify/Android.mk
605# $(LOCAL_PATH)/otafault/Android.mk
bigbiffd58ba182020-03-23 10:02:29 -0400606
607 # $(commands_TWRP_local_path)/boot_control/Android.bp
bigbiffd58ba182020-03-23 10:02:29 -0400608 # $(commands_TWRP_local_path)/update_verifier/Android.mk
Yabin Cui2f272c02016-06-24 18:22:02 -0700609include \
Ethan Yonker58f21322018-08-24 11:17:36 -0500610 $(commands_TWRP_local_path)/updater/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500611 $(commands_TWRP_local_path)/bootloader_message_twrp/Android.mk
612
bigbiffad58e1b2020-07-06 20:24:34 -0400613include $(commands_TWRP_local_path)/mtp/ffs/Android.mk
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500614
Matt Mowerf746dbb2015-05-13 22:56:31 -0500615ifeq ($(wildcard system/core/uncrypt/Android.mk),)
Ethan Yonker58f21322018-08-24 11:17:36 -0500616 #include $(commands_TWRP_local_path)/uncrypt/Android.mk
Matt Mowerf746dbb2015-05-13 22:56:31 -0500617endif
618
bigbiffad58e1b2020-07-06 20:24:34 -0400619include $(commands_TWRP_local_path)/minadbd/Android.mk \
620 $(commands_TWRP_local_path)/minui/Android.mk
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500621
bigbiffad58e1b2020-07-06 20:24:34 -0400622# $(commands_TWRP_local_path)/otautil/Android.mk \
bigbiffd58ba182020-03-23 10:02:29 -0400623
Dees_Troy51a0e822012-09-05 15:24:24 -0400624#includes for TWRP
Ethan Yonker58f21322018-08-24 11:17:36 -0500625include $(commands_TWRP_local_path)/injecttwrp/Android.mk \
626 $(commands_TWRP_local_path)/htcdumlock/Android.mk \
627 $(commands_TWRP_local_path)/gui/Android.mk \
628 $(commands_TWRP_local_path)/mmcutils/Android.mk \
629 $(commands_TWRP_local_path)/bmlutils/Android.mk \
630 $(commands_TWRP_local_path)/prebuilt/Android.mk \
631 $(commands_TWRP_local_path)/mtdutils/Android.mk \
632 $(commands_TWRP_local_path)/flashutils/Android.mk \
633 $(commands_TWRP_local_path)/pigz/Android.mk \
634 $(commands_TWRP_local_path)/libtar/Android.mk \
635 $(commands_TWRP_local_path)/libcrecovery/Android.mk \
636 $(commands_TWRP_local_path)/libblkid/Android.mk \
637 $(commands_TWRP_local_path)/minuitwrp/Android.mk \
638 $(commands_TWRP_local_path)/openaes/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500639 $(commands_TWRP_local_path)/twrpTarMain/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500640 $(commands_TWRP_local_path)/minzip/Android.mk \
641 $(commands_TWRP_local_path)/dosfstools/Android.mk \
642 $(commands_TWRP_local_path)/etc/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500643 $(commands_TWRP_local_path)/simg2img/Android.mk \
644 $(commands_TWRP_local_path)/adbbu/Android.mk \
645 $(commands_TWRP_local_path)/libpixelflinger/Android.mk \
646 $(commands_TWRP_local_path)/twrpDigest/Android.mk \
647 $(commands_TWRP_local_path)/attr/Android.mk
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600648
mauronofrio6d3bf892019-10-26 19:47:55 +0200649ifneq ($(TW_OZIP_DECRYPT_KEY),)
650 TWRP_REQUIRED_MODULES += ozip_decrypt
651 include $(commands_TWRP_local_path)/ozip_decrypt/Android.mk
652endif
653
Ethan Yonker253368a2014-11-25 15:00:52 -0600654ifeq ($(TW_INCLUDE_CRYPTO), true)
Ethan Yonker98661c12018-10-17 08:39:28 -0500655 include $(commands_TWRP_local_path)/crypto/fde/Android.mk
Ethan Yonker58f21322018-08-24 11:17:36 -0500656 include $(commands_TWRP_local_path)/crypto/scrypt/Android.mk
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600657 ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400658 include $(commands_TWRP_local_path)/crypto/fscrypt/Android.mk
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600659 endif
nkk7171c6c502017-01-05 23:55:05 +0200660 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),)
661 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),false)
Ethan Yonker58f21322018-08-24 11:17:36 -0500662 include $(commands_TWRP_local_path)/crypto/vold_decrypt/Android.mk
nkk7171c6c502017-01-05 23:55:05 +0200663 endif
664 endif
Ethan Yonker58f21322018-08-24 11:17:36 -0500665 include $(commands_TWRP_local_path)/gpt/Android.mk
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600666endif
Vojtech Bocek7cc278b2013-02-24 01:40:19 +0100667ifeq ($(BUILD_ID), GINGERBREAD)
668 TW_NO_EXFAT := true
669endif
Dees_Troyb05ddee2013-01-28 20:24:50 +0000670ifneq ($(TW_NO_EXFAT), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500671 include $(commands_TWRP_local_path)/exfat/mkfs/Android.mk \
672 $(commands_TWRP_local_path)/exfat/fsck/Android.mk \
673 $(commands_TWRP_local_path)/fuse/Android.mk \
674 $(commands_TWRP_local_path)/exfat/libexfat/Android.mk
Ethan Yonker34741d92016-02-06 13:22:45 -0600675 ifneq ($(TW_NO_EXFAT_FUSE), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500676 include $(commands_TWRP_local_path)/exfat/fuse/Android.mk
Ethan Yonker34741d92016-02-06 13:22:45 -0600677 endif
Captain Throwback6a1acf22014-09-18 12:46:35 -0400678endif
Ethan Yonker03a42f62014-08-08 11:03:51 -0500679ifneq ($(TW_OEM_BUILD),true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500680 include $(commands_TWRP_local_path)/orscmd/Android.mk
Ethan Yonker03a42f62014-08-08 11:03:51 -0500681endif
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500682
Talustus3019a912013-04-06 11:50:07 +0200683# FB2PNG
684ifeq ($(TW_INCLUDE_FB2PNG), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500685 include $(commands_TWRP_local_path)/fb2png/Android.mk
Talustus3019a912013-04-06 11:50:07 +0200686endif
Matt Mower55c75ca2014-08-31 11:30:15 -0500687
Matt Mower55c75ca2014-08-31 11:30:15 -0500688endif
Ethan Yonker58f21322018-08-24 11:17:36 -0500689
690commands_TWRP_local_path :=