blob: aed16e219d845dc2d284ae7100c38827da6b216e [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
32ifneq ($(wildcard system/core/libziparchive/Android.bp),)
33 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
bigbiffad58e1b2020-07-06 20:24:34 -040039RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/fastbootd
bigbiffc5012c52021-07-04 13:57:47 -040040RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/bc
bigbiffad58e1b2020-07-06 20:24:34 -040041RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsck
42RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsdroid
43RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mke2fs
44RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/tune2fs
45RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/resize2fs
46
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040047#RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/twrpmtp
bigbiffad58e1b2020-07-06 20:24:34 -040048RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/android.hardware.fastboot@1.0.so
bigbiffad58e1b2020-07-06 20:24:34 -040049RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/ld-android.so
nebrassy76224bd2021-04-05 11:52:44 +020050RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libandroid_runtime_lazy.so
bigbiffad58e1b2020-07-06 20:24:34 -040051RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libc.so
52RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libdl.so
53RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libm.so
54RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libfs_mgr.so
bigbiffa957f072021-03-07 18:20:29 -050055RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfscrypt.so
bigbiffad58e1b2020-07-06 20:24:34 -040056RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libgsi.so
57RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libkeyutils.so
58RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/liblogwrap.so
59RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/liblp.so
60RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libprocessgroup.so
61RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libprocessgroup_setup.so
62RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libadbd.so
63RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libadbd_services.so
64RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libcap.so
65RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libminijail.so
66RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libunwindstack.so
67RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libasyncio.so
68RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libbinderthreadstate.so
69RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libmdnssd.so
Captain Throwback12673e22020-10-20 11:46:39 -040070RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libinit.so
bigbiff91bd7a72021-01-03 17:33:01 -050071RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/bootstrap/libdl_android.so
Captain Throwback12673e22020-10-20 11:46:39 -040072RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-lite.so
73RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbinder.so
nebrassy76224bd2021-04-05 11:52:44 +020074RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbinder_ndk.so
Captain Throwback12673e22020-10-20 11:46:39 -040075RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libchrome.so
76RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libevent.so
77RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore
78RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore_cli_v2
79RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/hwservicemanager
80RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/servicemanager
81RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/vold_prepare_subdirs
Captain Throwback49df5472020-10-19 11:13:53 -040082RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.boot@1.0-service
bigbiffe2eae2f2021-03-07 18:47:06 -050083RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.boot@1.1-service
Captain Throwback12673e22020-10-20 11:46:39 -040084RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/vndservicemanager
85RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/toybox
bigbiff477006a2021-05-14 19:51:26 -040086RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.health@2.0-service
nebrassy9c1709b2021-04-18 23:31:36 +020087RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.health@2.1-service
bigbiff20edca82020-07-03 09:55:28 -040088RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/charger
bigbiffad58e1b2020-07-06 20:24:34 -040089RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/ueventd
90RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/watchdogd
bigbiff1f9e4842020-10-31 11:33:15 -040091RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/minadbd
bigbiffad58e1b2020-07-06 20:24:34 -040092
93RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcutils.so
94RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrecovery.so
95RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libusbhost.so
96RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutils.so
97RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_com_err.so
98RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_e2p.so
99RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2fs.so
100RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_profile.so
101RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_uuid.so
102RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_misc.so
Ethan Yonker38c2ff82014-12-09 13:42:10 -0600103ifneq ($(wildcard external/e2fsprogs/lib/quota/Android.mk),)
bigbiffad58e1b2020-07-06 20:24:34 -0400104 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_quota.so
Ethan Yonker38c2ff82014-12-09 13:42:10 -0600105endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500106ifneq ($(wildcard external/e2fsprogs/lib/ext2fs/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400107 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2fs.so
Ethan Yonkerbcff1462015-01-04 22:01:33 -0600108endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500109ifneq ($(wildcard external/e2fsprogs/lib/blkid/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400110 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_blkid.so
Ethan Yonkerbcff1462015-01-04 22:01:33 -0600111endif
bigbiffad58e1b2020-07-06 20:24:34 -0400112RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpng.so
113RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblog.so
114RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstdc++.so
115RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminuitwrp.so
116RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminadbd.so
117RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libz.so
118RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmtdutils.so
119RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtar.so
120RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwadbbu.so
121RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpdigest.so
122RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutil-linux.so
123RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libblkid.so
124RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmmcutils.so
125RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbmlutils.so
126RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libflashutils.so
127RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfusesideload.so
bigbiffdf8436b2020-08-30 16:22:34 -0400128RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbootloader_message.so
D. Andrei Măceșb29a5e22016-12-22 06:19:44 -0500129
bigbiffad58e1b2020-07-06 20:24:34 -0400130RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \
131$(if $(WITH_CRYPTO_UTILS),$(TARGET_OUT_SHARED_LIBRARIES)/libcrypto_utils.so)
bigbiffdf8436b2020-08-30 16:22:34 -0400132
bigbiffad58e1b2020-07-06 20:24:34 -0400133RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libbacktrace.so
134RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libunwind.so
135RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbase.so
136RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libc++.so
137RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libnetd_client.so
138
Captain Throwback12673e22020-10-20 11:46:39 -0400139RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/toolbox
bigbiffad58e1b2020-07-06 20:24:34 -0400140
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500141
Ethan Yonker03a42f62014-08-08 11:03:51 -0500142ifneq ($(TW_OEM_BUILD),true)
bigbiffad58e1b2020-07-06 20:24:34 -0400143 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/twrp
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400144else
145 TW_EXCLUDE_MTP := true
146endif
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500147
bigbiffad58e1b2020-07-06 20:24:34 -0400148RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpmtp-ffs.so
149RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext4_utils.so
150RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libaosprecovery.so
Greg Wallaceace76232016-01-27 17:15:51 -0500151ifneq ($(TW_INCLUDE_JPEG),)
bigbiffad58e1b2020-07-06 20:24:34 -0400152 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libjpeg.so
Greg Wallaceace76232016-01-27 17:15:51 -0500153endif
bigbiffad58e1b2020-07-06 20:24:34 -0400154RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libselinux.so
155
Dees_Troyb05ddee2013-01-28 20:24:50 +0000156ifneq ($(TW_NO_EXFAT), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400157 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libexfat_twrp.so
Dees Troyb4bd6972014-10-09 18:47:00 +0000158else
Captain Throwback6a1acf22014-09-18 12:46:35 -0400159 TW_NO_EXFAT_FUSE := true
160endif
Mohd Faraz6e5c7582021-04-16 21:08:42 +0200161RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhardware.so
Dees_Troy51a0e822012-09-05 15:24:24 -0400162ifeq ($(TW_INCLUDE_CRYPTO), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400163 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfsfde.so
164 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libdexfile_support.so
165 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libf2fs_sparseblock.so
Captain Throwback12673e22020-10-20 11:46:39 -0400166 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.authsecret@1.0.so
167 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.oemlock@1.0.so
168 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libnos_transport.so
169 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libnos_datagram.so
bigbiffad58e1b2020-07-06 20:24:34 -0400170 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@3.0.so
171 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgpt_twrp.so
Dees Troyc657cc02015-01-16 22:48:47 +0000172 ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500173 ifeq ($(TARGET_CRYPTFS_HW_PATH),)
bigbiffad58e1b2020-07-06 20:24:34 -0400174 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libcryptfs_hw.so
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500175 else
bigbiffad58e1b2020-07-06 20:24:34 -0400176 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfs_hw.so
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500177 endif
Dees Troyc657cc02015-01-16 22:48:47 +0000178 endif
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600179 # FBE files
180 ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400181 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpfscrypt.so
bigbiffad58e1b2020-07-06 20:24:34 -0400182 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgatekeeper.so
183 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_messages.so
184 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore_binder.so
185 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbinder.so
186 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-lite.so
187 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoftkeymasterdevice.so
188 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.gatekeeper@1.0.so
bigbiffad58e1b2020-07-06 20:24:34 -0400189 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/avbctl
190 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore
191 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore_cli
bigbiffad58e1b2020-07-06 20:24:34 -0400192 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.system.wifi.keystore@1.0.so
193 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.0.so
194 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.1.so
195 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.2.so
nebrassy76224bd2021-04-05 11:52:44 +0200196 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator-V1-ndk_platform.so
197 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator-V1-cpp.so
bigbiffa957f072021-03-07 18:20:29 -0500198 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstatslog.so
199 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoft_attestation_cert.so
Captain Throwback79331312023-08-24 11:53:24 -0400200 ifneq ($(TW_EXCLUDE_LIBXML2), true)
201 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libxml2.so
202 endif
Mohd Farazbc576cd2020-05-30 21:06:32 +0530203
bigbiffad58e1b2020-07-06 20:24:34 -0400204 ifneq ($(wildcard system/keymaster/keymaster_stl.cpp),)
205 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_portable.so
206 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_staging.so
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500207 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400208 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libwifikeystorehal.so
209 ifneq ($(wildcard hardware/interfaces/weaver/Android.bp),)
210 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.weaver@1.0.so
Ethan Yonker58f21322018-08-24 11:17:36 -0500211 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400212 ifneq ($(wildcard hardware/interfaces/weaver/1.0/Android.bp),)
213 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.weaver@1.0.so
214 endif
215 ifneq ($(wildcard hardware/interfaces/confirmationui/1.0/Android.bp),)
216 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.confirmationui@1.0.so
217 endif
218 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoftkeymaster.so
219 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@4.0.so
bigbiffa957f072021-03-07 18:20:29 -0500220 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@4.1.so
bigbiffad58e1b2020-07-06 20:24:34 -0400221 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster4support.so
bigbiffa957f072021-03-07 18:20:29 -0500222 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster4_1support.so
bigbiffad58e1b2020-07-06 20:24:34 -0400223 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore_aidl.so
224 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore_parcelables.so
225 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutilscallstack.so
226 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libdexfile.so
227 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libservices.so
228 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_portable.so
bigbiffa957f072021-03-07 18:20:29 -0500229 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhwbinder.so
230 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore-attestation-application-id.so
Ethan Yonker93382822018-11-01 15:25:31 -0500231 # 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 -0400232 #RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lshal
233 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblshal.so
234 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libssl.so
235 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidl-gen-hash.so
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600236 endif
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600237endif
Ethan Yonker1b190162016-12-05 15:25:19 -0600238ifeq ($(AB_OTA_UPDATER), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400239 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/update_engine_sideload
240 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.boot@1.0.so
bigbiffe2eae2f2021-03-07 18:47:06 -0500241 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.boot@1.1.so
Captain Throwbacka866b442021-11-19 13:13:30 -0500242endif
243ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
bigbiff5c083cc2021-06-10 19:55:18 -0400244 ifeq ($(TW_EXCLUDE_LPDUMP),)
245 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/bootctl
246 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lpdump
247 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lpdumpd
248 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblpdump.so
249 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblpdump_interface-V1-cpp.so
250 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so
251 endif
Captain Throwback4f19caa2021-11-18 20:30:38 -0500252 ifeq ($(TW_EXCLUDE_LPTOOLS),)
253 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lptools
254 endif
Ethan Yonker1b190162016-12-05 15:25:19 -0600255endif
bigbiffad58e1b2020-07-06 20:24:34 -0400256
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500257ifneq ($(wildcard system/core/libsparse/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400258 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsparse.so
Dees_Troy4546fe72013-01-10 14:33:27 +0000259endif
Captain Throwbackace11212022-04-05 17:10:29 -0400260ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS),)
bigbiffad58e1b2020-07-06 20:24:34 -0400261 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libopenaes.so
Dees_Troy83bd4832013-05-04 12:39:56 +0000262endif
Dees_Troye5017042013-08-29 16:38:55 +0000263ifeq ($(TARGET_USERIMAGES_USE_F2FS), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400264 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/make_f2fs
Captain Throwback57db2cc2020-09-09 15:38:13 -0400265 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.f2fs
bigbiffad58e1b2020-07-06 20:24:34 -0400266 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sload_f2fs
Dees_Troye5017042013-08-29 16:38:55 +0000267endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500268ifneq ($(wildcard system/core/reboot/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400269 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/reboot
Dees Troy0226cd52013-11-04 14:12:35 +0000270endif
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200271ifneq ($(TW_DISABLE_TTF), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400272 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libft2.so
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200273endif
bigbiffad58e1b2020-07-06 20:24:34 -0400274ifneq ($(TW_RECOVERY_ADDITIONAL_RELINK_BINARY_FILES),)
275 RECOVERY_BINARY_SOURCE_FILES += $(TW_RECOVERY_ADDITIONAL_RELINK_BINARY_FILES)
276endif
277ifneq ($(TW_RECOVERY_ADDITIONAL_RELINK_LIBRARY_FILES),)
278 RECOVERY_LIBRARY_SOURCE_FILES += $(TW_RECOVERY_ADDITIONAL_RELINK_LIBRARY_FILES)
Ethan Yonker0e678372014-11-18 12:17:06 -0600279endif
bigbiff948f3962022-07-18 15:55:03 -0400280ifneq ($(TW_RECOVERY_ADDITIONAL_RELINK_VENDOR_HW_BINARY_FILES),)
281 RECOVERY_VENDOR_HW_BINARY_FILES += $(TW_RECOVERY_ADDITIONAL_RELINK_VENDOR_HW_BINARY_FILES)
282endif
Dees Troye176a652015-01-20 19:35:21 +0000283ifneq ($(wildcard external/pcre/Android.mk),)
bigbiffad58e1b2020-07-06 20:24:34 -0400284 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpcre.so
Dees Troye176a652015-01-20 19:35:21 +0000285endif
Ethan Yonkerb81d9052015-07-09 13:20:53 -0500286ifeq ($(TW_INCLUDE_NTFS_3G),true)
bigbiffad58e1b2020-07-06 20:24:34 -0400287 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mount.ntfs
288 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.ntfs
289 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkfs.ntfs
290 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libntfs-3g.so
291 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfuse-lite.so
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500292else
bigbiffad58e1b2020-07-06 20:24:34 -0400293 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ntfs-3g
294 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ntfsfix
295 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkntfs
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500296endif
Ethan Yonker483e9f42016-01-11 22:21:18 -0600297ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
bigbiffad58e1b2020-07-06 20:24:34 -0400298 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sgdisk
Ethan Yonker483e9f42016-01-11 22:21:18 -0600299endif
Ctapchukfc35b152021-04-26 16:58:57 +0700300ifneq ($(TW_OZIP_DECRYPT_KEY),)
301 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ozip_decrypt
302endif
Captain Throwback1f127752016-01-19 17:30:20 -0500303ifeq ($(TWRP_INCLUDE_LOGCAT), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400304 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/logcat
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600305 ifeq ($(TARGET_USES_LOGD), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400306 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/logd
bigbiffad58e1b2020-07-06 20:24:34 -0400307 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsysutils.so
308 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libnl.so
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600309 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400310 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpcrecpp.so
311 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblogcat.so
312 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcap.so
Captain Throwback1f127752016-01-19 17:30:20 -0500313endif
bigbiffad58e1b2020-07-06 20:24:34 -0400314RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libvndksupport.so
315RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidlbase.so
316RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidltransport.so
317RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.frameworks.stats@1.0.so
318RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libziparchive.so
319RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_blkid.so
320RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_quota.so
321RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidl-gen-utils.so
322RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libvintf.so
323RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtinyxml2.so
324RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hidl.token@1.0.so
325ifneq ($(wildcard system/core/libkeyutils/Android.bp),)
326 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeyutils.so
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500327endif
bigbiffad58e1b2020-07-06 20:24:34 -0400328ifeq ($(TARGET_ARCH), arm64)
329 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-aarch64-android.so
330endif
331ifeq ($(TARGET_ARCH), arm)
332 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-arm-android.so
333endif
334ifeq ($(TARGET_ARCH), x86_64)
335 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-x86_64-android.so
336endif
337ifeq ($(TARGET_ARCH), x86)
338 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-i686-android.so
339endif
340ifeq ($(TARGET_ARCH), mips)
341 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-mips-android.so
342endif
343ifeq ($(TARGET_ARCH), mips64)
344 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-mips64-android.so
345endif
346RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblogwrap.so
347RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_misc.so
Ethan Yonker58f21322018-08-24 11:17:36 -0500348
nebrassy50789652021-02-12 23:36:44 +0100349ifneq ($(TW_EXCLUDE_NANO), true)
350 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/nano
351 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libncurses.so
352 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libssh.so
353 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libssl.so
354endif
355
DarthJabba9fba0cee2021-02-20 17:13:09 -0500356ifneq ($(TW_EXCLUDE_BASH), true)
357 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/bash
358endif
359
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500360include $(CLEAR_VARS)
bigbiffad58e1b2020-07-06 20:24:34 -0400361LOCAL_MODULE := relink_libraries
bigbiffd58ba182020-03-23 10:02:29 -0400362LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500363LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400364LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
althafvly003401c2020-12-10 21:33:02 +0530365ifneq ($(TARGET_ARCH), arm64)
366 ifneq ($(TARGET_ARCH), x86_64)
367 LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib $(RECOVERY_LIBRARY_SOURCE_FILES)
368 else
369 LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib64 $(RECOVERY_LIBRARY_SOURCE_FILES)
370 endif
371else
bigbiffad58e1b2020-07-06 20:24:34 -0400372LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib64 $(RECOVERY_LIBRARY_SOURCE_FILES)
althafvly003401c2020-12-10 21:33:02 +0530373endif
bigbiffad58e1b2020-07-06 20:24:34 -0400374TARGET_LIBRARY_RELINK_FILES := $(notdir $(RECOVERY_LIBRARY_SOURCE_FILES))
375TARGET_BASE_LIBRARY_RELINK_MODULES := $(basename $(TARGET_LIBRARY_RELINK_FILES))
376TARGET_RELINK_LIBRARY_MODULES := $(filter-out libdexfile, $(TARGET_BASE_LIBRARY_RELINK_MODULES))
377LOCAL_REQUIRED_MODULES += $(TARGET_RELINK_LIBRARY_MODULES)
bigbiffd58ba182020-03-23 10:02:29 -0400378include $(BUILD_PHONY_PACKAGE)
379
bigbiffad58e1b2020-07-06 20:24:34 -0400380
381include $(CLEAR_VARS)
382LOCAL_MODULE := relink_binaries
383LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500384LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400385LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
386LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/bin $(RECOVERY_BINARY_SOURCE_FILES)
Mohd Faraza791d122020-09-27 16:06:42 +0530387TARGET_BINARY_RELINK_FILES := $(filter-out bu, $(notdir $(RECOVERY_BINARY_SOURCE_FILES)))
bigbiffad58e1b2020-07-06 20:24:34 -0400388LOCAL_REQUIRED_MODULES += $(TARGET_BINARY_RELINK_FILES)
389include $(BUILD_PHONY_PACKAGE)
390
bigbiff948f3962022-07-18 15:55:03 -0400391include $(CLEAR_VARS)
392LOCAL_MODULE := relink_vendor_hw_binaries
393LOCAL_MODULE_TAGS := optional
394LOCAL_MODULE_CLASS := EXECUTABLES
395LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
396LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/vendor/bin/hw $(RECOVERY_VENDOR_HW_BINARY_FILES)
397TARGET_VENDOR_BINARY_RELINK_FILES := $(notdir $(RECOVERY_VENDOR_HW_BINARY_FILES))
398LOCAL_REQUIRED_MODULES += $(TARGET_VENDOR_BINARY_RELINK_FILES)
399$(warning vendor_hw: $(LOCAL_POST_INSTALL_CMD))
400include $(BUILD_PHONY_PACKAGE)
401
bigbiffad58e1b2020-07-06 20:24:34 -0400402#build out TWRP ramdisk
bigbiffd58ba182020-03-23 10:02:29 -0400403include $(CLEAR_VARS)
bigbiff7ba75002020-04-11 20:47:09 -0400404LOCAL_MODULE := twrp_ramdisk
bigbiffd58ba182020-03-23 10:02:29 -0400405LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500406LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffd58ba182020-03-23 10:02:29 -0400407LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
bigbiffad58e1b2020-07-06 20:24:34 -0400408LOCAL_POST_INSTALL_CMD += \
409 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin; ln -sf /system/bin/sh $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh && \
bigbiff7ba75002020-04-11 20:47:09 -0400410 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/ && \
Aaron Kling03989a82022-04-18 21:00:38 -0500411 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/$(TARGET_COPY_OUT_VENDOR)/etc/selinux/ && \
Captain Throwback8bd1ac52020-10-19 13:09:17 -0400412 cp $(TARGET_OUT_ETC)/selinux/plat_service_contexts $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/plat_service_contexts && \
413 cp $(TARGET_OUT_ETC)/selinux/plat_hwservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/plat_hwservice_contexts && \
Aaron Kling03989a82022-04-18 21:00:38 -0500414 cp $(TARGET_OUT_VENDOR_ETC)/selinux/vndservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/$(TARGET_COPY_OUT_VENDOR)/etc/selinux/vndservice_contexts && \
415 cp $(TARGET_OUT_VENDOR_ETC)/selinux/vendor_hwservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/$(TARGET_COPY_OUT_VENDOR)/etc/selinux/vendor_hwservice_contexts
Captain Throwback8bd1ac52020-10-19 13:09:17 -0400416 ifeq ($(TARGET_USES_MKE2FS), true)
417 LOCAL_POST_INSTALL_CMD += \
418 && cp $(TARGET_OUT_ETC)/mke2fs.conf $(TARGET_RECOVERY_ROOT_OUT)/system/etc/mke2fs.conf
419 endif
Captain Throwback25cee822022-04-15 10:39:32 -0400420LOCAL_REQUIRED_MODULES += init_second_stage.recovery reboot.recovery plat_service_contexts plat_hwservice_contexts plat_hardware_contexts vndservice_contexts vendor_hwservice_contexts twrp_soong
bigbiffd58ba182020-03-23 10:02:29 -0400421include $(BUILD_PHONY_PACKAGE)
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500422
Dees_Troy83bd4832013-05-04 12:39:56 +0000423# copy license file for OpenAES
Captain Throwbackace11212022-04-05 17:10:29 -0400424ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS),)
bigbiffad58e1b2020-07-06 20:24:34 -0400425 include $(CLEAR_VARS)
426 LOCAL_MODULE := openaes_license
427 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500428 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400429 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/license/openaes
430 LOCAL_SRC_FILES := ../openaes/LICENSE
431 include $(BUILD_PREBUILT)
Dees_Troy83bd4832013-05-04 12:39:56 +0000432endif
433
Dees_Troy51a0e822012-09-05 15:24:24 -0400434ifeq ($(TW_INCLUDE_DUMLOCK), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400435 #htcdumlock for /system for dumlock
436 include $(CLEAR_VARS)
437 LOCAL_MODULE := htcdumlocksys
438 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500439 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400440 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
441 LOCAL_SRC_FILES := $(LOCAL_MODULE)
442 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400443
bigbiffad58e1b2020-07-06 20:24:34 -0400444 #flash_image for /system for dumlock
445 include $(CLEAR_VARS)
446 LOCAL_MODULE := flash_imagesys
447 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500448 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400449 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
450 LOCAL_SRC_FILES := $(LOCAL_MODULE)
451 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400452
bigbiffad58e1b2020-07-06 20:24:34 -0400453 #dump_image for /system for dumlock
454 include $(CLEAR_VARS)
455 LOCAL_MODULE := dump_imagesys
456 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500457 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400458 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
459 LOCAL_SRC_FILES := $(LOCAL_MODULE)
460 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400461
bigbiffad58e1b2020-07-06 20:24:34 -0400462 #libbmlutils for /system for dumlock
463 include $(CLEAR_VARS)
464 LOCAL_MODULE := libbmlutils.so
465 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500466 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400467 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
468 LOCAL_SRC_FILES := $(LOCAL_MODULE)
469 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400470
bigbiffad58e1b2020-07-06 20:24:34 -0400471 #libflashutils for /system for dumlock
472 include $(CLEAR_VARS)
473 LOCAL_MODULE := libflashutils.so
474 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500475 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400476 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
477 LOCAL_SRC_FILES := $(LOCAL_MODULE)
478 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400479
bigbiffad58e1b2020-07-06 20:24:34 -0400480 #libmmcutils for /system for dumlock
481 include $(CLEAR_VARS)
482 LOCAL_MODULE := libmmcutils.so
483 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500484 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400485 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
486 LOCAL_SRC_FILES := $(LOCAL_MODULE)
487 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400488
bigbiffad58e1b2020-07-06 20:24:34 -0400489 #libmtdutils for /system for dumlock
490 include $(CLEAR_VARS)
491 LOCAL_MODULE := libmtdutils.so
492 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500493 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400494 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
495 LOCAL_SRC_FILES := $(LOCAL_MODULE)
496 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400497
bigbiffad58e1b2020-07-06 20:24:34 -0400498 #HTCDumlock.apk
499 include $(CLEAR_VARS)
500 LOCAL_MODULE := HTCDumlock.apk
501 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500502 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400503 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
504 LOCAL_SRC_FILES := $(LOCAL_MODULE)
505 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400506endif
Dees_Troy6ef66352013-02-21 08:26:57 -0600507
bigbiff416fe3a2020-03-28 13:46:48 -0400508ifeq ($(TW_USE_TOOLBOX), true)
509 include $(CLEAR_VARS)
510 LOCAL_MODULE := mkshrc_twrp
511 LOCAL_MODULE_STEM := mkshrc
512 LOCAL_MODULE_TAGS := optional
513 LOCAL_MODULE_CLASS := ETC
bigbiffad58e1b2020-07-06 20:24:34 -0400514 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/etc
bigbiff416fe3a2020-03-28 13:46:48 -0400515 LOCAL_SRC_FILES := $(LOCAL_MODULE)
516 include $(BUILD_PREBUILT)
517endif
Captain Throwback5ab59642019-02-07 17:22:49 -0500518
Ethan Yonkerb4bff5e2016-12-16 07:47:58 -0600519#TWRP App "placeholder"
520include $(CLEAR_VARS)
521LOCAL_MODULE := me.twrp.twrpapp.apk
theimpulsond95dcd22020-03-23 18:27:29 +0000522LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500523LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400524LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Ethan Yonkerb4bff5e2016-12-16 07:47:58 -0600525LOCAL_SRC_FILES := $(LOCAL_MODULE)
526include $(BUILD_PREBUILT)
nijel82c821a82018-12-29 04:56:41 -0500527
Stefan Tauner6ad14572020-01-11 22:28:53 +0100528#TWRP App permissions for Android 9+
529include $(CLEAR_VARS)
530LOCAL_MODULE := privapp-permissions-twrpapp.xml
bigbifff654e842020-06-05 21:03:23 -0400531LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500532LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400533LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Stefan Tauner6ad14572020-01-11 22:28:53 +0100534LOCAL_SRC_FILES := $(LOCAL_MODULE)
535include $(BUILD_PREBUILT)
536
nijel82c821a82018-12-29 04:56:41 -0500537ifeq ($(TW_INCLUDE_CRYPTO), true)
538 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),)
bigbiffad58e1b2020-07-06 20:24:34 -0400539 # Prebuilt vdc_pie for pre-Pie SDK Platforms
540 include $(CLEAR_VARS)
541 LOCAL_MODULE := vdc_pie
542 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500543 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400544 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
545 LOCAL_SRC_FILES := vdc_pie-$(TARGET_ARCH)
546 include $(BUILD_PREBUILT)
nijel82c821a82018-12-29 04:56:41 -0500547 endif
548endif
Ethan Yonker53796e72019-01-11 22:49:52 -0600549
Chaosmaster461e39f2020-02-07 01:48:13 +0100550ifneq (,$(filter $(TW_INCLUDE_REPACKTOOLS) $(TW_INCLUDE_RESETPROP) $(TW_INCLUDE_LIBRESETPROP), true))
Ethan Yonker53796e72019-01-11 22:49:52 -0600551 ifeq ($(wildcard external/magisk-prebuilt/Android.mk),)
mauronofrio76ef9f32019-12-23 20:29:24 +0100552 $(warning Magisk prebuilt tools not found!)
Ethan Yonker53796e72019-01-11 22:49:52 -0600553 $(warning Please place https://github.com/TeamWin/external_magisk-prebuilt)
554 $(warning into external/magisk-prebuilt)
555 $(error magiskboot prebuilts not present; exiting)
556 endif
557endif
Captain Throwback6443cef2021-01-30 12:26:25 -0500558
559# Include tzdata in TWRP to fix "__bionic_open_tzdata" log spam
560# Dummy file to apply post-install patch
561ifneq ($(TW_EXCLUDE_TZDATA), true)
562 include $(CLEAR_VARS)
563 LOCAL_MODULE := tzdata_twrp
564 LOCAL_MODULE_TAGS := optional
565 LOCAL_MODULE_CLASS := ETC
566 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
567 LOCAL_REQUIRED_MODULES := tzdata
568
569 LOCAL_POST_INSTALL_CMD += \
570 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/usr/share/zoneinfo; \
571 cp -f $(TARGET_OUT)/usr/share/zoneinfo/tzdata $(TARGET_RECOVERY_ROOT_OUT)/system/usr/share/zoneinfo/;
572 include $(BUILD_PHONY_PACKAGE)
573endif
nebrassy50789652021-02-12 23:36:44 +0100574
575include $(CLEAR_VARS)
576LOCAL_MODULE := nano_twrp
577LOCAL_MODULE_TAGS := optional
578LOCAL_MODULE_CLASS := ETC
579LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
580LOCAL_REQUIRED_MODULES := nano libncurses
581LOCAL_POST_INSTALL_CMD += \
582 cp -rf $(TARGET_OUT_ETC)/nano $(TARGET_RECOVERY_ROOT_OUT)/system/etc/; \
583 cp -rf external/libncurses/lib/terminfo $(TARGET_RECOVERY_ROOT_OUT)/system/etc/;
584include $(BUILD_PHONY_PACKAGE)
585
DarthJabba9fba0cee2021-02-20 17:13:09 -0500586ifneq ($(TW_EXCLUDE_BASH), true)
587 include $(CLEAR_VARS)
588 LOCAL_MODULE := bash_twrp
589 LOCAL_MODULE_TAGS := optional
590 LOCAL_MODULE_CLASS := ETC
591 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
592 LOCAL_REQUIRED_MODULES := bash
593
594 LOCAL_POST_INSTALL_CMD += \
595 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/; \
Captain Throwback0265b252021-04-20 13:12:19 -0400596 cp -rf external/bash/etc/* $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/; \
DarthJabba9fba0cee2021-02-20 17:13:09 -0500597 sed -i 's/ro.lineage.device/ro.product.device/' $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/bashrc; \
598 sed -i '/export TERM/d' $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/bashrc; \
599 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin; \
600 ln -sf /system/bin/bash $(TARGET_RECOVERY_ROOT_OUT)/sbin/bash;
601 include $(BUILD_PHONY_PACKAGE)
602endif
603