blob: 1659e8338d8bfd87ccbe2cbd019cb385a952737b [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 \
bigbiff7ba75002020-04-11 20:47:09 -0400384 awk \
bigbiffad58e1b2020-07-06 20:24:34 -0400385 toybox \
386 toolbox \
387 mkshrc_twrp
bigbiff7ba75002020-04-11 20:47:09 -0400388
389ifneq ($(TW_INCLUDE_CRYPTO),)
390TWRP_REQUIRED_MODULES += \
391 plat_service_contexts \
392 plat_hwservice_contexts \
393 vendor_hwservice_contexts \
bigbiff7ba75002020-04-11 20:47:09 -0400394 hwservicemanager \
395 servicemanager \
396 vndservicemanager \
397 vold_prepare_subdirs \
bigbiffad58e1b2020-07-06 20:24:34 -0400398 task_recovery_profiles.json \
bigbiff7ba75002020-04-11 20:47:09 -0400399 fscryptpolicyget
400endif
Matt Mower031163b2014-11-01 15:13:03 -0500401
bigbiff416fe3a2020-03-28 13:46:48 -0400402ifneq ($(wildcard external/zip/Android.mk),)
403 TWRP_REQUIRED_MODULES += zip
404endif
405ifneq ($(wildcard external/unzip/Android.mk),)
406 TWRP_REQUIRED_MODULES += unzip
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600407endif
Matt Mower84057612017-01-08 13:32:18 -0600408
Matt Mower20172792014-11-14 10:54:03 -0600409ifneq ($(TW_NO_EXFAT), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500410 TWRP_REQUIRED_MODULES += mkexfatfs fsckexfat
Ethan Yonker34741d92016-02-06 13:22:45 -0600411 ifneq ($(TW_NO_EXFAT_FUSE), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500412 TWRP_REQUIRED_MODULES += exfat-fuse
Ethan Yonker34741d92016-02-06 13:22:45 -0600413 endif
Matt Mower20172792014-11-14 10:54:03 -0600414endif
Matt Mower031163b2014-11-01 15:13:03 -0500415ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
bigbiffad58e1b2020-07-06 20:24:34 -0400416 TWRP_REQUIRED_MODULES += sgdisk
Matt Mower031163b2014-11-01 15:13:03 -0500417endif
418ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500419 TWRP_REQUIRED_MODULES += openaes openaes_license
Matt Mower031163b2014-11-01 15:13:03 -0500420endif
421ifeq ($(TW_INCLUDE_DUMLOCK), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500422 TWRP_REQUIRED_MODULES += \
Matt Mower031163b2014-11-01 15:13:03 -0500423 htcdumlock htcdumlocksys flash_imagesys dump_imagesys libbmlutils.so \
424 libflashutils.so libmmcutils.so libmtdutils.so HTCDumlock.apk
425endif
Matt Mower031163b2014-11-01 15:13:03 -0500426ifeq ($(TW_INCLUDE_FB2PNG), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500427 TWRP_REQUIRED_MODULES += fb2png
Matt Mower031163b2014-11-01 15:13:03 -0500428endif
429ifneq ($(TW_OEM_BUILD),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500430 TWRP_REQUIRED_MODULES += orscmd
Matt Mower031163b2014-11-01 15:13:03 -0500431endif
432ifeq ($(BOARD_USES_BML_OVER_MTD),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500433 TWRP_REQUIRED_MODULES += bml_over_mtd
Matt Mower031163b2014-11-01 15:13:03 -0500434endif
435ifeq ($(TW_INCLUDE_INJECTTWRP), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500436 TWRP_REQUIRED_MODULES += injecttwrp
Matt Mower031163b2014-11-01 15:13:03 -0500437endif
Matt Mowerec009e82015-01-30 13:00:49 -0600438ifneq ($(TW_EXCLUDE_DEFAULT_USB_INIT), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500439 TWRP_REQUIRED_MODULES += init.recovery.usb.rc
Matt Mowerec009e82015-01-30 13:00:49 -0600440endif
Captain Throwback1f127752016-01-19 17:30:20 -0500441ifeq ($(TWRP_INCLUDE_LOGCAT), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400442 TWRP_REQUIRED_MODULES += logcat event-log-tags
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600443 ifeq ($(TARGET_USES_LOGD), true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500444 TWRP_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600445 endif
Captain Throwback1f127752016-01-19 17:30:20 -0500446endif
Matt Mower031163b2014-11-01 15:13:03 -0500447# Allow devices to specify device-specific recovery dependencies
448ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500449 TWRP_REQUIRED_MODULES += $(TARGET_RECOVERY_DEVICE_MODULES)
Matt Mower031163b2014-11-01 15:13:03 -0500450endif
Dees Troy3454ade2015-01-20 19:21:04 +0000451LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
452LOCAL_CFLAGS += -DTWHTCD_PATH=\"$(TWHTCD_PATH)\"
Ethan Yonkerb81d9052015-07-09 13:20:53 -0500453ifeq ($(TW_INCLUDE_NTFS_3G),true)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -0500454 TWRP_REQUIRED_MODULES += \
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500455 mount.ntfs \
456 fsck.ntfs \
457 mkfs.ntfs
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500458endif
Matt Mower58294912015-12-10 11:54:28 -0600459ifeq ($(TARGET_USERIMAGES_USE_F2FS), true)
bigbiffd58ba182020-03-23 10:02:29 -0400460 TWRP_REQUIRED_MODULES += sload.f2fs \
461 libfs_mgr \
462 fs_mgr \
463 libinit
Ethan Yonker93382822018-11-01 15:25:31 -0500464endif
bigbiffad58e1b2020-07-06 20:24:34 -0400465
466TWRP_REQUIRED_MODULES += file_contexts_text
467
468ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
469 TWRP_REQUIRED_MODULES += recovery-persist recovery-refresh
Matt Mower58294912015-12-10 11:54:28 -0600470endif
Matt Mower031163b2014-11-01 15:13:03 -0500471
bigbiffad58e1b2020-07-06 20:24:34 -0400472LOCAL_REQUIRED_MODULES += $(TWRP_REQUIRED_MODULES)
Mark Salyzyn13aca592016-03-09 14:58:16 -0800473
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800474include $(BUILD_EXECUTABLE)
475
Matt Mowerd821c962017-02-15 12:36:18 -0600476# Symlink for file_contexts
477include $(CLEAR_VARS)
478
Captain Throwback3184b2f2017-03-07 12:07:40 -0500479LOCAL_MODULE := file_contexts_text
Matt Mowerd821c962017-02-15 12:36:18 -0600480LOCAL_MODULE_TAGS := optional
bigbiffad58e1b2020-07-06 20:24:34 -0400481LOCAL_REQUIRED_MODULES := file_contexts.bin
482
Matt Mowerd821c962017-02-15 12:36:18 -0600483LOCAL_POST_INSTALL_CMD := \
Ethan Yonker58f21322018-08-24 11:17:36 -0500484 $(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 -0600485
bigbiff416fe3a2020-03-28 13:46:48 -0400486include $(BUILD_PHONY_PACKAGE)
Dees_Troyc04dcf72012-10-02 10:46:37 -0400487
Mark Salyzyn13aca592016-03-09 14:58:16 -0800488# recovery-persist (system partition dynamic executable run after /data mounts)
489# ===============================
bigbiffad58e1b2020-07-06 20:24:34 -0400490include $(CLEAR_VARS)
491LOCAL_SRC_FILES := \
492 recovery-persist.cpp
493LOCAL_MODULE := recovery-persist
494LOCAL_SHARED_LIBRARIES := liblog libbase libmetricslogger
495LOCAL_STATIC_LIBRARIES := libotautil
496LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include
497LOCAL_C_INCLUDES += system/core/libmetricslogger/include \
498 system/core/libstats/include
499LOCAL_CFLAGS := -Werror
500LOCAL_INIT_RC := recovery-persist.rc
501include $(BUILD_EXECUTABLE)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800502
Mark Salyzyn13aca592016-03-09 14:58:16 -0800503# recovery-refresh (system partition dynamic executable run at init)
504# ===============================
bigbiffad58e1b2020-07-06 20:24:34 -0400505include $(CLEAR_VARS)
506LOCAL_SRC_FILES := \
507 recovery-refresh.cpp
508LOCAL_MODULE := recovery-refresh
509LOCAL_SHARED_LIBRARIES := liblog libbase
510LOCAL_STATIC_LIBRARIES := libotautil
511LOCAL_C_INCLUDES += $(LOCAL_PATH)/otautil/include
512LOCAL_CFLAGS := -Werror
513LOCAL_INIT_RC := recovery-refresh.rc
514include $(BUILD_EXECUTABLE)
Tao Bao42c45e22018-07-31 09:37:12 -0700515
Elliott Hughes63a31922016-06-09 17:41:22 -0700516# libmounts (static library)
517# ===============================
518include $(CLEAR_VARS)
519LOCAL_SRC_FILES := mounts.cpp
Tao Bao5f85d1f2017-03-28 21:12:36 -0700520LOCAL_CFLAGS := \
521 -Wall \
522 -Werror
Elliott Hughes63a31922016-06-09 17:41:22 -0700523LOCAL_MODULE := libmounts
Tao Bao5f85d1f2017-03-28 21:12:36 -0700524LOCAL_STATIC_LIBRARIES := libbase
Elliott Hughes63a31922016-06-09 17:41:22 -0700525include $(BUILD_STATIC_LIBRARY)
526
Tao Bao62e0bc72017-04-10 16:55:57 -0700527# librecovery (static library)
528# ===============================
529include $(CLEAR_VARS)
530LOCAL_SRC_FILES := \
531 install.cpp
Tao Baob24510c2017-04-20 17:54:27 -0700532LOCAL_CFLAGS := -Wall -Werror
Tao Bao62e0bc72017-04-10 16:55:57 -0700533LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
Tao Bao25dbe172017-04-12 23:52:20 -0700534
535ifeq ($(AB_OTA_UPDATER),true)
536 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
537endif
538
Tao Bao62e0bc72017-04-10 16:55:57 -0700539LOCAL_MODULE := librecovery
540LOCAL_STATIC_LIBRARIES := \
541 libminui \
Tao Baocfe53c22017-10-03 14:37:21 -0700542 libotautil \
bigbiff7ba75002020-04-11 20:47:09 -0400543 libvintf \
Tao Bao62e0bc72017-04-10 16:55:57 -0700544 libcrypto_utils \
545 libcrypto \
Elliott Hughese1bb7a52017-06-28 08:00:17 -0700546 libbase \
547 libziparchive \
Tao Bao62e0bc72017-04-10 16:55:57 -0700548
549include $(BUILD_STATIC_LIBRARY)
550
Ethan Yonker34ae4832016-08-24 15:32:18 -0500551# shared libaosprecovery for Apache code
552# ===============================
Dees_Troy2673cec2013-04-02 20:22:16 +0000553include $(CLEAR_VARS)
554
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -0800555
Dees_Troy2673cec2013-04-02 20:22:16 +0000556LOCAL_MODULE := libaosprecovery
bigbiffd58ba182020-03-23 10:02:29 -0400557LOCAL_MODULE_TAGS := optional
bigbiffad58e1b2020-07-06 20:24:34 -0400558
559LOCAL_SRC_FILES := install/adb_install.cpp install/asn1_decoder.cpp install/fuse_sdcard_install.cpp\
560 install/install.cpp install/installcommand.cpp install/legacy_property_service.cpp \
561 install/package.cpp install/verifier.cpp install/wipe_data.cpp install/tw_atomic.cpp \
562 install/set_metadata.cpp verifier28/verifier.cpp install/zipwrap.cpp install/ZipUtil.cpp
bigbiffd58ba182020-03-23 10:02:29 -0400563LOCAL_SHARED_LIBRARIES += libbase libbootloader_message libcrypto libext4_utils \
bigbiff7ba75002020-04-11 20:47:09 -0400564 libfs_mgr libfusesideload libhidl-gen-utils libhidlbase \
bigbiffd58ba182020-03-23 10:02:29 -0400565 liblog libselinux libtinyxml2 libutils libz libziparchive libcutils
Ethan Yonker941a8992016-12-05 09:04:30 -0600566LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
bigbiffad58e1b2020-07-06 20:24:34 -0400567LOCAL_SHARED_LIBRARIES += libc++
568LOCAL_CFLAGS := -std=gnu++2a
569LOCAL_C_INCLUDES += $(commands_TWRP_local_path)/install/include \
570 $(commands_TWRP_local_path)/recovery_ui/include \
571 $(commands_TWRP_local_path)/otautil/include \
572 $(commands_TWRP_local_path)/minadbd \
573 $(commands_TWRP_local_path)/minzip \
574 system/libvintf/include
575LOCAL_STATIC_LIBRARIES += libotautil libvintf_recovery libvintf libhidl-gen-utils
576LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
Tao Baoa92d8fb2017-06-20 18:11:21 -0700577
Ethan Yonker941a8992016-12-05 09:04:30 -0600578ifeq ($(AB_OTA_UPDATER),true)
579 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
580endif
bigbiffd58ba182020-03-23 10:02:29 -0400581
Dees_Troy2673cec2013-04-02 20:22:16 +0000582include $(BUILD_SHARED_LIBRARY)
bigbiffd58ba182020-03-23 10:02:29 -0400583
Tao Baod80a9982016-03-03 11:43:47 -0800584# libverifier (static library)
585# ===============================
Kenny Root7a4adb52013-10-09 10:14:35 -0700586include $(CLEAR_VARS)
Tao Bao80e46e02015-06-03 10:49:29 -0700587LOCAL_CLANG := true
Kenny Root7a4adb52013-10-09 10:14:35 -0700588LOCAL_MODULE := libverifier
Kenny Root7a4adb52013-10-09 10:14:35 -0700589LOCAL_SRC_FILES := \
Kenny Root7a4adb52013-10-09 10:14:35 -0700590 asn1_decoder.cpp \
Tao Baod7bf82e2017-03-18 09:24:11 -0700591 verifier.cpp
Tao Bao0ecbd762017-01-16 21:16:58 -0800592LOCAL_STATIC_LIBRARIES := \
Tao Bao09e468f2017-09-29 14:39:33 -0700593 libotautil \
Tao Bao0ecbd762017-01-16 21:16:58 -0800594 libcrypto_utils \
595 libcrypto \
596 libbase
Tianjie Xuc89d1e72017-08-28 14:15:07 -0700597LOCAL_CFLAGS := -Wall -Werror
Jed Estep43291862016-02-03 17:02:09 -0800598include $(BUILD_STATIC_LIBRARY)
Doug Zongker73ae31c2009-12-09 17:01:45 -0800599
Dees_Troy51a0e822012-09-05 15:24:24 -0400600commands_recovery_local_path := $(LOCAL_PATH)
Ethan Yonkerecbd3e82017-12-14 14:43:59 -0600601
Ethan Yonker58f21322018-08-24 11:17:36 -0500602# $(LOCAL_PATH)/edify/Android.mk
603# $(LOCAL_PATH)/otafault/Android.mk
bigbiffd58ba182020-03-23 10:02:29 -0400604
605 # $(commands_TWRP_local_path)/boot_control/Android.bp
bigbiffd58ba182020-03-23 10:02:29 -0400606 # $(commands_TWRP_local_path)/update_verifier/Android.mk
Yabin Cui2f272c02016-06-24 18:22:02 -0700607include \
Ethan Yonker58f21322018-08-24 11:17:36 -0500608 $(commands_TWRP_local_path)/updater/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500609 $(commands_TWRP_local_path)/bootloader_message_twrp/Android.mk
610
bigbiffad58e1b2020-07-06 20:24:34 -0400611include $(commands_TWRP_local_path)/mtp/ffs/Android.mk
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500612
Matt Mowerf746dbb2015-05-13 22:56:31 -0500613ifeq ($(wildcard system/core/uncrypt/Android.mk),)
Ethan Yonker58f21322018-08-24 11:17:36 -0500614 #include $(commands_TWRP_local_path)/uncrypt/Android.mk
Matt Mowerf746dbb2015-05-13 22:56:31 -0500615endif
616
bigbiffad58e1b2020-07-06 20:24:34 -0400617include $(commands_TWRP_local_path)/minadbd/Android.mk \
618 $(commands_TWRP_local_path)/minui/Android.mk
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500619
bigbiffad58e1b2020-07-06 20:24:34 -0400620# $(commands_TWRP_local_path)/otautil/Android.mk \
bigbiffd58ba182020-03-23 10:02:29 -0400621
Dees_Troy51a0e822012-09-05 15:24:24 -0400622#includes for TWRP
Ethan Yonker58f21322018-08-24 11:17:36 -0500623include $(commands_TWRP_local_path)/injecttwrp/Android.mk \
624 $(commands_TWRP_local_path)/htcdumlock/Android.mk \
625 $(commands_TWRP_local_path)/gui/Android.mk \
626 $(commands_TWRP_local_path)/mmcutils/Android.mk \
627 $(commands_TWRP_local_path)/bmlutils/Android.mk \
628 $(commands_TWRP_local_path)/prebuilt/Android.mk \
629 $(commands_TWRP_local_path)/mtdutils/Android.mk \
630 $(commands_TWRP_local_path)/flashutils/Android.mk \
631 $(commands_TWRP_local_path)/pigz/Android.mk \
632 $(commands_TWRP_local_path)/libtar/Android.mk \
633 $(commands_TWRP_local_path)/libcrecovery/Android.mk \
634 $(commands_TWRP_local_path)/libblkid/Android.mk \
635 $(commands_TWRP_local_path)/minuitwrp/Android.mk \
636 $(commands_TWRP_local_path)/openaes/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500637 $(commands_TWRP_local_path)/twrpTarMain/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500638 $(commands_TWRP_local_path)/minzip/Android.mk \
639 $(commands_TWRP_local_path)/dosfstools/Android.mk \
640 $(commands_TWRP_local_path)/etc/Android.mk \
Ethan Yonker58f21322018-08-24 11:17:36 -0500641 $(commands_TWRP_local_path)/simg2img/Android.mk \
642 $(commands_TWRP_local_path)/adbbu/Android.mk \
643 $(commands_TWRP_local_path)/libpixelflinger/Android.mk \
644 $(commands_TWRP_local_path)/twrpDigest/Android.mk \
645 $(commands_TWRP_local_path)/attr/Android.mk
Ethan Yonkerbcc502c2014-11-10 11:22:10 -0600646
mauronofrio6d3bf892019-10-26 19:47:55 +0200647ifneq ($(TW_OZIP_DECRYPT_KEY),)
648 TWRP_REQUIRED_MODULES += ozip_decrypt
649 include $(commands_TWRP_local_path)/ozip_decrypt/Android.mk
650endif
651
Ethan Yonker253368a2014-11-25 15:00:52 -0600652ifeq ($(TW_INCLUDE_CRYPTO), true)
Ethan Yonker98661c12018-10-17 08:39:28 -0500653 include $(commands_TWRP_local_path)/crypto/fde/Android.mk
Ethan Yonker58f21322018-08-24 11:17:36 -0500654 include $(commands_TWRP_local_path)/crypto/scrypt/Android.mk
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600655 ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400656 include $(commands_TWRP_local_path)/crypto/fscrypt/Android.mk
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600657 endif
nkk7171c6c502017-01-05 23:55:05 +0200658 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),)
659 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),false)
Ethan Yonker58f21322018-08-24 11:17:36 -0500660 include $(commands_TWRP_local_path)/crypto/vold_decrypt/Android.mk
nkk7171c6c502017-01-05 23:55:05 +0200661 endif
662 endif
Ethan Yonker58f21322018-08-24 11:17:36 -0500663 include $(commands_TWRP_local_path)/gpt/Android.mk
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600664endif
Vojtech Bocek7cc278b2013-02-24 01:40:19 +0100665ifeq ($(BUILD_ID), GINGERBREAD)
666 TW_NO_EXFAT := true
667endif
Dees_Troyb05ddee2013-01-28 20:24:50 +0000668ifneq ($(TW_NO_EXFAT), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500669 include $(commands_TWRP_local_path)/exfat/mkfs/Android.mk \
670 $(commands_TWRP_local_path)/exfat/fsck/Android.mk \
671 $(commands_TWRP_local_path)/fuse/Android.mk \
672 $(commands_TWRP_local_path)/exfat/libexfat/Android.mk
Ethan Yonker34741d92016-02-06 13:22:45 -0600673 ifneq ($(TW_NO_EXFAT_FUSE), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500674 include $(commands_TWRP_local_path)/exfat/fuse/Android.mk
Ethan Yonker34741d92016-02-06 13:22:45 -0600675 endif
Captain Throwback6a1acf22014-09-18 12:46:35 -0400676endif
Ethan Yonker03a42f62014-08-08 11:03:51 -0500677ifneq ($(TW_OEM_BUILD),true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500678 include $(commands_TWRP_local_path)/orscmd/Android.mk
Ethan Yonker03a42f62014-08-08 11:03:51 -0500679endif
bigbiff bigbiff9c754052013-01-09 09:09:08 -0500680
Talustus3019a912013-04-06 11:50:07 +0200681# FB2PNG
682ifeq ($(TW_INCLUDE_FB2PNG), true)
Ethan Yonker58f21322018-08-24 11:17:36 -0500683 include $(commands_TWRP_local_path)/fb2png/Android.mk
Talustus3019a912013-04-06 11:50:07 +0200684endif
Matt Mower55c75ca2014-08-31 11:30:15 -0500685
Matt Mower55c75ca2014-08-31 11:30:15 -0500686endif
Ethan Yonker58f21322018-08-24 11:17:36 -0500687
688commands_TWRP_local_path :=