blob: ca57e5f35e4be7684f83587d3864ab5283e31a3d [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001LOCAL_PATH := $(call my-dir)
2
3RELINK := $(LOCAL_PATH)/relink.sh
4
5#dummy file to trigger required modules
6include $(CLEAR_VARS)
bigbiffce8f83c2015-12-12 18:30:21 -05007
Dees_Troy51a0e822012-09-05 15:24:24 -04008LOCAL_MODULE := teamwin
theimpulsond95dcd22020-03-23 18:27:29 +00009LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -050010LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -040011LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
Dees_Troy51a0e822012-09-05 15:24:24 -040012
Matt Mowerfb1c4ff2014-04-16 13:43:36 -050013# Manage list
bigbiffad58e1b2020-07-06 20:24:34 -040014RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/dump_image
15RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/flash_image
16RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/erase_image
17RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/bu
bigbiff416fe3a2020-03-28 13:46:48 -040018
bigbiffad58e1b2020-07-06 20:24:34 -040019RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/sh
20
21LOCAL_POST_INSTALL_CMD += $(hide) if [ -e "$(TARGET_RECOVERY_ROOT_OUT)/system/bin/egrep" ]; then \
22 rm $(TARGET_RECOVERY_ROOT_OUT)/system/bin/egrep; fi; ln -s $(TARGET_RECOVERY_ROOT_OUT)/system/bin/grep $(TARGET_RECOVERY_ROOT_OUT)/system/bin/egrep; \
23 if [ -e "$(TARGET_RECOVERY_ROOT_OUT)/system/bin/fgrep" ]; then \
24 rm $(TARGET_RECOVERY_ROOT_OUT)/system/bin/fgrep; fi; ln -s $(TARGET_RECOVERY_ROOT_OUT)/system/bin/grep $(TARGET_RECOVERY_ROOT_OUT)/system/bin/fgrep;
25
26ifneq ($(wildcard external/zip/Android.mk),)
27 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/zip
bigbiff416fe3a2020-03-28 13:46:48 -040028endif
bigbiffad58e1b2020-07-06 20:24:34 -040029ifneq ($(wildcard external/unzip/Android.mk),)
30 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/unzip
31endif
nebrassy204e36e2021-11-14 23:27:51 +010032ifneq ($(wildcard system/libziparchive/Android.bp),)
bigbiffad58e1b2020-07-06 20:24:34 -040033 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/unzip
34endif
35ifneq ($(wildcard external/one-true-awk/Android.bp),)
36 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/awk
Ethan Yonker5c933692014-04-04 11:26:32 -050037endif
bigbiff416fe3a2020-03-28 13:46:48 -040038
me-cafebabe80c13262022-06-09 16:32:17 +080039ifneq ($(filter $(PRODUCT_USE_DYNAMIC_PARTITIONS) $(TW_INCLUDE_FASTBOOTD),true),)
bigbiffad58e1b2020-07-06 20:24:34 -040040RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/fastbootd
me-cafebabe80c13262022-06-09 16:32:17 +080041endif
bigbiffc5012c52021-07-04 13:57:47 -040042RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/bc
bigbiffad58e1b2020-07-06 20:24:34 -040043RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsck
44RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsdroid
45RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mke2fs
46RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/tune2fs
47RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/resize2fs
48
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040049#RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/twrpmtp
me-cafebabe80c13262022-06-09 16:32:17 +080050ifneq ($(filter $(PRODUCT_USE_DYNAMIC_PARTITIONS) $(TW_INCLUDE_FASTBOOTD),true),)
bigbiffad58e1b2020-07-06 20:24:34 -040051RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/android.hardware.fastboot@1.0.so
me-cafebabe80c13262022-06-09 16:32:17 +080052endif
bigbiffad58e1b2020-07-06 20:24:34 -040053RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/ld-android.so
nebrassy76224bd2021-04-05 11:52:44 +020054RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libandroid_runtime_lazy.so
bigbiffad58e1b2020-07-06 20:24:34 -040055RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libc.so
56RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libdl.so
57RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libm.so
58RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libfs_mgr.so
Mohd Farazf15d7382023-09-12 16:24:41 +053059RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfscrypttwrp.so
bigbiffad58e1b2020-07-06 20:24:34 -040060RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libgsi.so
61RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libkeyutils.so
62RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/liblogwrap.so
63RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/liblp.so
64RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libprocessgroup.so
65RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libprocessgroup_setup.so
66RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libadbd.so
67RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libadbd_services.so
68RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libcap.so
69RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libminijail.so
70RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libunwindstack.so
bigbiffad58e1b2020-07-06 20:24:34 -040071RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libbinderthreadstate.so
72RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libmdnssd.so
me-cafebabe8494d5f2022-06-09 17:55:39 +080073RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.boot@1.0.so
74RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.boot@1.1.so
Captain Throwback04132212022-06-25 16:45:33 -040075RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.boot@1.2.so
me-cafebabe8494d5f2022-06-09 17:55:39 +080076RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libasyncio.so
Captain Throwback12673e22020-10-20 11:46:39 -040077RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libinit.so
bigbiff91bd7a72021-01-03 17:33:01 -050078RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/bootstrap/libdl_android.so
Captain Throwback12673e22020-10-20 11:46:39 -040079RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-lite.so
80RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbinder.so
nebrassy76224bd2021-04-05 11:52:44 +020081RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbinder_ndk.so
Captain Throwback12673e22020-10-20 11:46:39 -040082RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libchrome.so
83RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libevent.so
84RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore
bigbiffdf53b6c2022-01-17 19:31:52 -050085RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore_auth
Captain Throwback12673e22020-10-20 11:46:39 -040086RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore_cli_v2
87RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/hwservicemanager
88RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/servicemanager
89RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/vold_prepare_subdirs
90RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/vndservicemanager
91RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/toybox
bigbiff477006a2021-05-14 19:51:26 -040092RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.health@2.0-service
nebrassy9c1709b2021-04-18 23:31:36 +020093RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.health@2.1-service
bigbiff20edca82020-07-03 09:55:28 -040094RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/charger
bigbiffad58e1b2020-07-06 20:24:34 -040095RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/ueventd
96RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/watchdogd
bigbiff1f9e4842020-10-31 11:33:15 -040097RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/minadbd
bigbiffad58e1b2020-07-06 20:24:34 -040098
99RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcutils.so
100RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrecovery.so
101RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libusbhost.so
102RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutils.so
103RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_com_err.so
104RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_e2p.so
105RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2fs.so
106RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_profile.so
107RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_uuid.so
108RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_misc.so
Ethan Yonker38c2ff82014-12-09 13:42:10 -0600109ifneq ($(wildcard external/e2fsprogs/lib/quota/Android.mk),)
bigbiffad58e1b2020-07-06 20:24:34 -0400110 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_quota.so
Ethan Yonker38c2ff82014-12-09 13:42:10 -0600111endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500112ifneq ($(wildcard external/e2fsprogs/lib/ext2fs/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400113 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2fs.so
Ethan Yonkerbcff1462015-01-04 22:01:33 -0600114endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500115ifneq ($(wildcard external/e2fsprogs/lib/blkid/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400116 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_blkid.so
Ethan Yonkerbcff1462015-01-04 22:01:33 -0600117endif
bigbiffad58e1b2020-07-06 20:24:34 -0400118RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpng.so
119RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblog.so
120RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstdc++.so
121RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminuitwrp.so
122RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminadbd.so
123RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libz.so
124RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmtdutils.so
125RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtar.so
126RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwadbbu.so
127RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpdigest.so
128RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutil-linux.so
129RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libblkid.so
130RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmmcutils.so
131RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbmlutils.so
132RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libflashutils.so
133RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfusesideload.so
bigbiffdf8436b2020-08-30 16:22:34 -0400134RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbootloader_message.so
D. Andrei Măceșb29a5e22016-12-22 06:19:44 -0500135
bigbiffad58e1b2020-07-06 20:24:34 -0400136RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \
137$(if $(WITH_CRYPTO_UTILS),$(TARGET_OUT_SHARED_LIBRARIES)/libcrypto_utils.so)
bigbiffdf8436b2020-08-30 16:22:34 -0400138
bigbiffad58e1b2020-07-06 20:24:34 -0400139RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libbacktrace.so
140RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libunwind.so
141RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbase.so
142RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libc++.so
143RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libnetd_client.so
144
Captain Throwback12673e22020-10-20 11:46:39 -0400145RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/toolbox
bigbiffad58e1b2020-07-06 20:24:34 -0400146
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500147
Ethan Yonker03a42f62014-08-08 11:03:51 -0500148ifneq ($(TW_OEM_BUILD),true)
bigbiffad58e1b2020-07-06 20:24:34 -0400149 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/twrp
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400150else
151 TW_EXCLUDE_MTP := true
152endif
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500153
bigbiffad58e1b2020-07-06 20:24:34 -0400154RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpmtp-ffs.so
155RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext4_utils.so
156RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libaosprecovery.so
Greg Wallaceace76232016-01-27 17:15:51 -0500157ifneq ($(TW_INCLUDE_JPEG),)
bigbiffad58e1b2020-07-06 20:24:34 -0400158 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libjpeg.so
Greg Wallaceace76232016-01-27 17:15:51 -0500159endif
bigbiffad58e1b2020-07-06 20:24:34 -0400160RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libselinux.so
161
Dees_Troyb05ddee2013-01-28 20:24:50 +0000162ifneq ($(TW_NO_EXFAT), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400163 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libexfat_twrp.so
Dees Troyb4bd6972014-10-09 18:47:00 +0000164else
Captain Throwback6a1acf22014-09-18 12:46:35 -0400165 TW_NO_EXFAT_FUSE := true
166endif
Mohd Faraz6e5c7582021-04-16 21:08:42 +0200167RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhardware.so
Dees_Troy51a0e822012-09-05 15:24:24 -0400168ifeq ($(TW_INCLUDE_CRYPTO), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400169 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfsfde.so
170 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libdexfile_support.so
171 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libf2fs_sparseblock.so
Captain Throwback12673e22020-10-20 11:46:39 -0400172 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.authsecret@1.0.so
173 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.oemlock@1.0.so
174 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libnos_transport.so
175 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libnos_datagram.so
bigbiffad58e1b2020-07-06 20:24:34 -0400176 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@3.0.so
177 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgpt_twrp.so
Dees Troyc657cc02015-01-16 22:48:47 +0000178 ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500179 ifeq ($(TARGET_CRYPTFS_HW_PATH),)
bigbiffad58e1b2020-07-06 20:24:34 -0400180 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libcryptfs_hw.so
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500181 else
bigbiffad58e1b2020-07-06 20:24:34 -0400182 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfs_hw.so
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500183 endif
Dees Troyc657cc02015-01-16 22:48:47 +0000184 endif
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600185 # FBE files
186 ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400187 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpfscrypt.so
bigbiffdf53b6c2022-01-17 19:31:52 -0500188 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.security.maintenance-ndk_platform.so
189 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.system.keystore2-V1-ndk_platform.so
190 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.security.apc-ndk_platform.so
191 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.security.authorization-ndk_platform.so
192 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymint_support.so
193 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.security.keymint-V1-ndk_platform.so
194 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.frameworks.stats-V1-ndk_platform.so
195 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.security.secureclock-V1-ndk_platform.so
bigbiffad58e1b2020-07-06 20:24:34 -0400196 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgatekeeper.so
bigbiffdf53b6c2022-01-17 19:31:52 -0500197 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgatekeeper_aidl.so
bigbiffad58e1b2020-07-06 20:24:34 -0400198 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_messages.so
bigbiffad58e1b2020-07-06 20:24:34 -0400199 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbinder.so
200 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-lite.so
201 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoftkeymasterdevice.so
202 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.gatekeeper@1.0.so
bigbiffdf53b6c2022-01-17 19:31:52 -0500203 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore2_aaid.so
204 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore2_apc_compat.so
205 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore2_crypto.so
206 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkm_compat_service.so
207 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore2_vintf_cpp.so
208 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.security.compat-ndk_platform.so
209 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkm_compat.so
210 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymint.so
211 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/lib_android_keymaster_keymint_utils.so
212 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcppbor_external.so
213 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcppbor.so
214 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpuresoftkeymasterdevice.so
215 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcppcose_rkp.so
216 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.security.sharedsecret-V1-ndk_platform.so
bigbiffad58e1b2020-07-06 20:24:34 -0400217 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/avbctl
218 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore
bigbiffdf53b6c2022-01-17 19:31:52 -0500219 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore2
bigbiffad58e1b2020-07-06 20:24:34 -0400220 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore_cli
bigbiffad58e1b2020-07-06 20:24:34 -0400221 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.system.wifi.keystore@1.0.so
222 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.0.so
223 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.1.so
224 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.2.so
nebrassy76224bd2021-04-05 11:52:44 +0200225 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator-V1-ndk_platform.so
226 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator-V1-cpp.so
bigbiffa957f072021-03-07 18:20:29 -0500227 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstatslog.so
228 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoft_attestation_cert.so
bigbiffdf53b6c2022-01-17 19:31:52 -0500229 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libdiskconfig.so
230 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhardware_legacy.so
231 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libincfs.so
232 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.health.storage@1.0.so
233 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.health.storage@1.0.so
234 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.health.storage-V1-ndk_platform.so
235 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhardware_legacy.so
236 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.system.suspend@1.0.so
237 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fscryptpolicyget
Captain Throwbackfcb95dc2023-08-24 11:53:24 -0400238 ifneq ($(TW_EXCLUDE_LIBXML2), true)
239 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libxml2.so
240 endif
Mohd Farazbc576cd2020-05-30 21:06:32 +0530241
bigbiffad58e1b2020-07-06 20:24:34 -0400242 ifneq ($(wildcard system/keymaster/keymaster_stl.cpp),)
243 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_portable.so
244 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_staging.so
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500245 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400246 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libwifikeystorehal.so
247 ifneq ($(wildcard hardware/interfaces/weaver/Android.bp),)
248 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.weaver@1.0.so
Ethan Yonker58f21322018-08-24 11:17:36 -0500249 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400250 ifneq ($(wildcard hardware/interfaces/weaver/1.0/Android.bp),)
251 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.weaver@1.0.so
252 endif
253 ifneq ($(wildcard hardware/interfaces/confirmationui/1.0/Android.bp),)
254 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.confirmationui@1.0.so
255 endif
256 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoftkeymaster.so
257 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@4.0.so
bigbiffa957f072021-03-07 18:20:29 -0500258 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@4.1.so
bigbiffad58e1b2020-07-06 20:24:34 -0400259 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster4support.so
bigbiffa957f072021-03-07 18:20:29 -0500260 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster4_1support.so
bigbiffad58e1b2020-07-06 20:24:34 -0400261 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutilscallstack.so
262 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libdexfile.so
263 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libservices.so
264 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_portable.so
bigbiffa957f072021-03-07 18:20:29 -0500265 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhwbinder.so
266 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore-attestation-application-id.so
Ethan Yonker93382822018-11-01 15:25:31 -0500267 # lshal can be useful for seeing if you have things like the keymaster working properly, but it isn't needed for TWRP to work
bigbiffad58e1b2020-07-06 20:24:34 -0400268 #RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lshal
269 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblshal.so
270 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libssl.so
271 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidl-gen-hash.so
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600272 endif
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600273endif
Captain Throwback10147a22023-11-23 14:09:01 -0500274ifneq ($(filter $(TW_INCLUDE_CRYPTO) $(TW_SUPPORT_INPUT_AIDL_HAPTICS), true),)
275 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator-V2-cpp.so
276 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator-V2-ndk_platform.so
277endif
Ethan Yonker1b190162016-12-05 15:25:19 -0600278ifeq ($(AB_OTA_UPDATER), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400279 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/update_engine_sideload
Captain Throwback04132212022-06-25 16:45:33 -0400280 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.boot@1.0-service
281 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.boot@1.1-service
282 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.boot@1.2-service
Captain Throwback0fd93ae2021-11-19 13:13:30 -0500283endif
284ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
Captain Throwbackaa3c77a2023-08-24 11:57:15 -0400285 ifneq ($(TW_INCLUDE_LPDUMP),)
bigbiff5c083cc2021-06-10 19:55:18 -0400286 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/bootctl
287 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lpdump
288 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lpdumpd
289 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblpdump.so
290 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblpdump_interface-V1-cpp.so
291 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so
bigbiff5c527f72021-12-12 20:45:24 -0500292 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblpdump_interface-cpp.so
bigbiff5c083cc2021-06-10 19:55:18 -0400293 endif
Captain Throwbackaa3c77a2023-08-24 11:57:15 -0400294 ifneq ($(TW_INCLUDE_LPTOOLS),)
Captain Throwbackd15051e2021-11-18 20:30:38 -0500295 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lptools
296 endif
Ethan Yonker1b190162016-12-05 15:25:19 -0600297endif
bigbiffad58e1b2020-07-06 20:24:34 -0400298
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500299ifneq ($(wildcard system/core/libsparse/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400300 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsparse.so
Dees_Troy4546fe72013-01-10 14:33:27 +0000301endif
Captain Throwback630fd662022-04-05 17:10:29 -0400302ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS),)
bigbiffad58e1b2020-07-06 20:24:34 -0400303 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libopenaes.so
Dees_Troy83bd4832013-05-04 12:39:56 +0000304endif
Dees_Troye5017042013-08-29 16:38:55 +0000305ifeq ($(TARGET_USERIMAGES_USE_F2FS), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400306 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/make_f2fs
Captain Throwback57db2cc2020-09-09 15:38:13 -0400307 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.f2fs
bigbiffad58e1b2020-07-06 20:24:34 -0400308 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sload_f2fs
nebrassy86c09dc2022-02-06 16:48:41 +0100309 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblz4.so
Dees_Troye5017042013-08-29 16:38:55 +0000310endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500311ifneq ($(wildcard system/core/reboot/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400312 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/reboot
Dees Troy0226cd52013-11-04 14:12:35 +0000313endif
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200314ifneq ($(TW_DISABLE_TTF), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400315 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libft2.so
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200316endif
bigbiffad58e1b2020-07-06 20:24:34 -0400317ifneq ($(TW_RECOVERY_ADDITIONAL_RELINK_BINARY_FILES),)
318 RECOVERY_BINARY_SOURCE_FILES += $(TW_RECOVERY_ADDITIONAL_RELINK_BINARY_FILES)
319endif
320ifneq ($(TW_RECOVERY_ADDITIONAL_RELINK_LIBRARY_FILES),)
321 RECOVERY_LIBRARY_SOURCE_FILES += $(TW_RECOVERY_ADDITIONAL_RELINK_LIBRARY_FILES)
Ethan Yonker0e678372014-11-18 12:17:06 -0600322endif
bigbiff4740bca2022-07-18 15:55:03 -0400323ifneq ($(TW_RECOVERY_ADDITIONAL_RELINK_VENDOR_HW_BINARY_FILES),)
324 RECOVERY_VENDOR_HW_BINARY_FILES += $(TW_RECOVERY_ADDITIONAL_RELINK_VENDOR_HW_BINARY_FILES)
325endif
Dees Troye176a652015-01-20 19:35:21 +0000326ifneq ($(wildcard external/pcre/Android.mk),)
bigbiffad58e1b2020-07-06 20:24:34 -0400327 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpcre.so
Dees Troye176a652015-01-20 19:35:21 +0000328endif
Ethan Yonkerb81d9052015-07-09 13:20:53 -0500329ifeq ($(TW_INCLUDE_NTFS_3G),true)
bigbiffad58e1b2020-07-06 20:24:34 -0400330 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mount.ntfs
331 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.ntfs
332 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkfs.ntfs
333 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libntfs-3g.so
334 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfuse-lite.so
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500335else
bigbiffad58e1b2020-07-06 20:24:34 -0400336 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ntfs-3g
337 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ntfsfix
338 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkntfs
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500339endif
Ethan Yonker483e9f42016-01-11 22:21:18 -0600340ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
bigbiffad58e1b2020-07-06 20:24:34 -0400341 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sgdisk
Ethan Yonker483e9f42016-01-11 22:21:18 -0600342endif
Ctapchukfc35b152021-04-26 16:58:57 +0700343ifneq ($(TW_OZIP_DECRYPT_KEY),)
344 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ozip_decrypt
345endif
Captain Throwback1f127752016-01-19 17:30:20 -0500346ifeq ($(TWRP_INCLUDE_LOGCAT), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400347 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/logcat
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600348 ifeq ($(TARGET_USES_LOGD), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400349 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/logd
bigbiffad58e1b2020-07-06 20:24:34 -0400350 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsysutils.so
351 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libnl.so
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600352 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400353 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpcrecpp.so
354 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblogcat.so
355 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcap.so
Captain Throwback1f127752016-01-19 17:30:20 -0500356endif
bigbiffad58e1b2020-07-06 20:24:34 -0400357RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libvndksupport.so
358RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidlbase.so
359RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidltransport.so
360RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.frameworks.stats@1.0.so
361RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libziparchive.so
362RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_blkid.so
363RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_quota.so
364RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidl-gen-utils.so
365RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libvintf.so
366RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtinyxml2.so
367RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hidl.token@1.0.so
368ifneq ($(wildcard system/core/libkeyutils/Android.bp),)
369 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeyutils.so
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500370endif
bigbiffad58e1b2020-07-06 20:24:34 -0400371ifeq ($(TARGET_ARCH), arm64)
372 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-aarch64-android.so
373endif
374ifeq ($(TARGET_ARCH), arm)
375 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-arm-android.so
376endif
377ifeq ($(TARGET_ARCH), x86_64)
378 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-x86_64-android.so
379endif
380ifeq ($(TARGET_ARCH), x86)
381 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-i686-android.so
382endif
383ifeq ($(TARGET_ARCH), mips)
384 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-mips-android.so
385endif
386ifeq ($(TARGET_ARCH), mips64)
387 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-mips64-android.so
388endif
389RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblogwrap.so
390RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_misc.so
Ethan Yonker58f21322018-08-24 11:17:36 -0500391
nebrassy50789652021-02-12 23:36:44 +0100392ifneq ($(TW_EXCLUDE_NANO), true)
Captain Throwback45494162022-04-05 10:15:08 -0400393 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_SYSTEM_EXT_EXECUTABLES)/nano
394 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SYSTEM_EXT_SHARED_LIBRARIES)/libncurses.so
395 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libssh.so
nebrassy50789652021-02-12 23:36:44 +0100396 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libssl.so
397endif
398
DarthJabba9fba0cee2021-02-20 17:13:09 -0500399ifneq ($(TW_EXCLUDE_BASH), true)
Captain Throwback45494162022-04-05 10:15:08 -0400400 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_SYSTEM_EXT_EXECUTABLES)/bash
401 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SYSTEM_EXT_SHARED_LIBRARIES)/libncurses.so
DarthJabba9fba0cee2021-02-20 17:13:09 -0500402endif
403
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500404include $(CLEAR_VARS)
bigbiffad58e1b2020-07-06 20:24:34 -0400405LOCAL_MODULE := relink_libraries
bigbiffd58ba182020-03-23 10:02:29 -0400406LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500407LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400408LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
althafvly003401c2020-12-10 21:33:02 +0530409ifneq ($(TARGET_ARCH), arm64)
410 ifneq ($(TARGET_ARCH), x86_64)
411 LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib $(RECOVERY_LIBRARY_SOURCE_FILES)
412 else
413 LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib64 $(RECOVERY_LIBRARY_SOURCE_FILES)
414 endif
415else
bigbiffad58e1b2020-07-06 20:24:34 -0400416LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib64 $(RECOVERY_LIBRARY_SOURCE_FILES)
althafvly003401c2020-12-10 21:33:02 +0530417endif
bigbiffad58e1b2020-07-06 20:24:34 -0400418TARGET_LIBRARY_RELINK_FILES := $(notdir $(RECOVERY_LIBRARY_SOURCE_FILES))
419TARGET_BASE_LIBRARY_RELINK_MODULES := $(basename $(TARGET_LIBRARY_RELINK_FILES))
420TARGET_RELINK_LIBRARY_MODULES := $(filter-out libdexfile, $(TARGET_BASE_LIBRARY_RELINK_MODULES))
421LOCAL_REQUIRED_MODULES += $(TARGET_RELINK_LIBRARY_MODULES)
bigbiffd58ba182020-03-23 10:02:29 -0400422include $(BUILD_PHONY_PACKAGE)
423
bigbiffad58e1b2020-07-06 20:24:34 -0400424
425include $(CLEAR_VARS)
426LOCAL_MODULE := relink_binaries
427LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500428LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400429LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
430LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/bin $(RECOVERY_BINARY_SOURCE_FILES)
Mohd Faraza791d122020-09-27 16:06:42 +0530431TARGET_BINARY_RELINK_FILES := $(filter-out bu, $(notdir $(RECOVERY_BINARY_SOURCE_FILES)))
bigbiffad58e1b2020-07-06 20:24:34 -0400432LOCAL_REQUIRED_MODULES += $(TARGET_BINARY_RELINK_FILES)
433include $(BUILD_PHONY_PACKAGE)
434
bigbiff4740bca2022-07-18 15:55:03 -0400435include $(CLEAR_VARS)
436LOCAL_MODULE := relink_vendor_hw_binaries
437LOCAL_MODULE_TAGS := optional
438LOCAL_MODULE_CLASS := EXECUTABLES
439LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
440LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/vendor/bin/hw $(RECOVERY_VENDOR_HW_BINARY_FILES)
441TARGET_VENDOR_BINARY_RELINK_FILES := $(notdir $(RECOVERY_VENDOR_HW_BINARY_FILES))
442LOCAL_REQUIRED_MODULES += $(TARGET_VENDOR_BINARY_RELINK_FILES)
443$(warning vendor_hw: $(LOCAL_POST_INSTALL_CMD))
444include $(BUILD_PHONY_PACKAGE)
445
bigbiffad58e1b2020-07-06 20:24:34 -0400446#build out TWRP ramdisk
bigbiffd58ba182020-03-23 10:02:29 -0400447include $(CLEAR_VARS)
bigbiff7ba75002020-04-11 20:47:09 -0400448LOCAL_MODULE := twrp_ramdisk
bigbiffd58ba182020-03-23 10:02:29 -0400449LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500450LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffd58ba182020-03-23 10:02:29 -0400451LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
bigbiffad58e1b2020-07-06 20:24:34 -0400452LOCAL_POST_INSTALL_CMD += \
453 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin; ln -sf /system/bin/sh $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh && \
bigbiff7ba75002020-04-11 20:47:09 -0400454 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/ && \
Captain Throwback8bd1ac52020-10-19 13:09:17 -0400455 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/vendor/etc/selinux/ && \
456 cp $(TARGET_OUT_ETC)/selinux/plat_service_contexts $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/plat_service_contexts && \
457 cp $(TARGET_OUT_ETC)/selinux/plat_hwservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/plat_hwservice_contexts && \
458 cp $(TARGET_OUT_VENDOR_ETC)/selinux/vndservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/vendor/etc/selinux/vndservice_contexts && \
bigbiffdf53b6c2022-01-17 19:31:52 -0500459 cp $(TARGET_OUT_VENDOR_ETC)/selinux/vendor_hwservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/vendor/etc/selinux/vendor_hwservice_contexts && \
460 cp $(TARGET_OUT_ETC)/selinux/plat_keystore2_key_contexts $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/plat_keystore2_key_contexts
Captain Throwback8bd1ac52020-10-19 13:09:17 -0400461 ifeq ($(TARGET_USES_MKE2FS), true)
462 LOCAL_POST_INSTALL_CMD += \
463 && cp $(TARGET_OUT_ETC)/mke2fs.conf $(TARGET_RECOVERY_ROOT_OUT)/system/etc/mke2fs.conf
464 endif
bigbiffdf53b6c2022-01-17 19:31:52 -0500465LOCAL_REQUIRED_MODULES += init_second_stage.recovery \
466 reboot.recovery \
467 plat_service_contexts \
468 plat_hwservice_contexts \
469 plat_hardware_contexts \
470 vndservice_contexts \
471 plat_keystore2_key_contexts \
472 vendor_hwservice_contexts
473
bigbiffd58ba182020-03-23 10:02:29 -0400474include $(BUILD_PHONY_PACKAGE)
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500475
Dees_Troy83bd4832013-05-04 12:39:56 +0000476# copy license file for OpenAES
Captain Throwback630fd662022-04-05 17:10:29 -0400477ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS),)
bigbiffad58e1b2020-07-06 20:24:34 -0400478 include $(CLEAR_VARS)
479 LOCAL_MODULE := openaes_license
480 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500481 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400482 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/license/openaes
483 LOCAL_SRC_FILES := ../openaes/LICENSE
484 include $(BUILD_PREBUILT)
Dees_Troy83bd4832013-05-04 12:39:56 +0000485endif
486
bigbiff416fe3a2020-03-28 13:46:48 -0400487ifeq ($(TW_USE_TOOLBOX), true)
488 include $(CLEAR_VARS)
489 LOCAL_MODULE := mkshrc_twrp
490 LOCAL_MODULE_STEM := mkshrc
491 LOCAL_MODULE_TAGS := optional
492 LOCAL_MODULE_CLASS := ETC
bigbiffad58e1b2020-07-06 20:24:34 -0400493 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/etc
bigbiff416fe3a2020-03-28 13:46:48 -0400494 LOCAL_SRC_FILES := $(LOCAL_MODULE)
495 include $(BUILD_PREBUILT)
496endif
Captain Throwback5ab59642019-02-07 17:22:49 -0500497
Ethan Yonkerb4bff5e2016-12-16 07:47:58 -0600498#TWRP App "placeholder"
499include $(CLEAR_VARS)
500LOCAL_MODULE := me.twrp.twrpapp.apk
theimpulsond95dcd22020-03-23 18:27:29 +0000501LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500502LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400503LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Ethan Yonkerb4bff5e2016-12-16 07:47:58 -0600504LOCAL_SRC_FILES := $(LOCAL_MODULE)
505include $(BUILD_PREBUILT)
nijel82c821a82018-12-29 04:56:41 -0500506
Stefan Tauner6ad14572020-01-11 22:28:53 +0100507#TWRP App permissions for Android 9+
508include $(CLEAR_VARS)
509LOCAL_MODULE := privapp-permissions-twrpapp.xml
bigbifff654e842020-06-05 21:03:23 -0400510LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500511LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400512LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Stefan Tauner6ad14572020-01-11 22:28:53 +0100513LOCAL_SRC_FILES := $(LOCAL_MODULE)
514include $(BUILD_PREBUILT)
515
Chaosmaster461e39f2020-02-07 01:48:13 +0100516ifneq (,$(filter $(TW_INCLUDE_REPACKTOOLS) $(TW_INCLUDE_RESETPROP) $(TW_INCLUDE_LIBRESETPROP), true))
Ethan Yonker53796e72019-01-11 22:49:52 -0600517 ifeq ($(wildcard external/magisk-prebuilt/Android.mk),)
mauronofrio76ef9f32019-12-23 20:29:24 +0100518 $(warning Magisk prebuilt tools not found!)
Ethan Yonker53796e72019-01-11 22:49:52 -0600519 $(warning Please place https://github.com/TeamWin/external_magisk-prebuilt)
520 $(warning into external/magisk-prebuilt)
521 $(error magiskboot prebuilts not present; exiting)
522 endif
523endif
Captain Throwback6443cef2021-01-30 12:26:25 -0500524
525# Include tzdata in TWRP to fix "__bionic_open_tzdata" log spam
526# Dummy file to apply post-install patch
527ifneq ($(TW_EXCLUDE_TZDATA), true)
528 include $(CLEAR_VARS)
529 LOCAL_MODULE := tzdata_twrp
530 LOCAL_MODULE_TAGS := optional
531 LOCAL_MODULE_CLASS := ETC
532 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
533 LOCAL_REQUIRED_MODULES := tzdata
534
535 LOCAL_POST_INSTALL_CMD += \
536 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/usr/share/zoneinfo; \
537 cp -f $(TARGET_OUT)/usr/share/zoneinfo/tzdata $(TARGET_RECOVERY_ROOT_OUT)/system/usr/share/zoneinfo/;
538 include $(BUILD_PHONY_PACKAGE)
539endif
nebrassy50789652021-02-12 23:36:44 +0100540
541include $(CLEAR_VARS)
542LOCAL_MODULE := nano_twrp
543LOCAL_MODULE_TAGS := optional
544LOCAL_MODULE_CLASS := ETC
545LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
546LOCAL_REQUIRED_MODULES := nano libncurses
547LOCAL_POST_INSTALL_CMD += \
Captain Throwback45494162022-04-05 10:15:08 -0400548 cp -rf $(TARGET_OUT_SYSTEM_EXT_ETC)/nano $(TARGET_RECOVERY_ROOT_OUT)/system/etc/; \
nebrassy50789652021-02-12 23:36:44 +0100549 cp -rf external/libncurses/lib/terminfo $(TARGET_RECOVERY_ROOT_OUT)/system/etc/;
550include $(BUILD_PHONY_PACKAGE)
551
DarthJabba9fba0cee2021-02-20 17:13:09 -0500552ifneq ($(TW_EXCLUDE_BASH), true)
553 include $(CLEAR_VARS)
554 LOCAL_MODULE := bash_twrp
555 LOCAL_MODULE_TAGS := optional
556 LOCAL_MODULE_CLASS := ETC
557 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
558 LOCAL_REQUIRED_MODULES := bash
559
560 LOCAL_POST_INSTALL_CMD += \
561 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/; \
Captain Throwback0265b252021-04-20 13:12:19 -0400562 cp -rf external/bash/etc/* $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/; \
DarthJabba9fba0cee2021-02-20 17:13:09 -0500563 sed -i 's/ro.lineage.device/ro.product.device/' $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/bashrc; \
564 sed -i '/export TERM/d' $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/bashrc; \
565 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin; \
566 ln -sf /system/bin/bash $(TARGET_RECOVERY_ROOT_OUT)/sbin/bash;
567 include $(BUILD_PHONY_PACKAGE)
568endif
569