blob: 61ac2553bdb88c1f7e621d75ade0183f22a26ec8 [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
40RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsck
41RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/e2fsdroid
42RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mke2fs
43RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/tune2fs
44RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/resize2fs
45
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -040046#RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/twrpmtp
bigbiffad58e1b2020-07-06 20:24:34 -040047RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/android.hardware.fastboot@1.0.so
bigbiffad58e1b2020-07-06 20:24:34 -040048RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/ld-android.so
49RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libc.so
50RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libdl.so
51RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libm.so
52RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libfs_mgr.so
bigbiffa957f072021-03-07 18:20:29 -050053RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfscrypt.so
bigbiffad58e1b2020-07-06 20:24:34 -040054RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libgsi.so
55RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libkeyutils.so
56RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/liblogwrap.so
57RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/liblp.so
58RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libprocessgroup.so
59RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libprocessgroup_setup.so
60RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libadbd.so
61RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libadbd_services.so
62RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libcap.so
63RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libminijail.so
64RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libunwindstack.so
65RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libasyncio.so
66RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libbinderthreadstate.so
67RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libmdnssd.so
Captain Throwback12673e22020-10-20 11:46:39 -040068RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libinit.so
bigbiff91bd7a72021-01-03 17:33:01 -050069RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/bootstrap/libdl_android.so
Captain Throwback12673e22020-10-20 11:46:39 -040070RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-lite.so
71RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbinder.so
72RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libchrome.so
73RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libevent.so
74RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore
75RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore_cli_v2
76RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/hwservicemanager
77RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/servicemanager
78RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/vold_prepare_subdirs
Captain Throwback49df5472020-10-19 11:13:53 -040079RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.boot@1.0-service
bigbiffe2eae2f2021-03-07 18:47:06 -050080RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.boot@1.1-service
Captain Throwback12673e22020-10-20 11:46:39 -040081RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/vndservicemanager
82RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/toybox
bigbiff477006a2021-05-14 19:51:26 -040083RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.health@2.0-service
nebrassy9c1709b2021-04-18 23:31:36 +020084RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_EXECUTABLES)/hw/android.hardware.health@2.1-service
bigbiff20edca82020-07-03 09:55:28 -040085RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/charger
bigbiffad58e1b2020-07-06 20:24:34 -040086RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/ueventd
87RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/watchdogd
bigbiff1f9e4842020-10-31 11:33:15 -040088RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/minadbd
bigbiffad58e1b2020-07-06 20:24:34 -040089
90RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcutils.so
91RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrecovery.so
92RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libusbhost.so
93RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutils.so
94RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_com_err.so
95RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_e2p.so
96RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2fs.so
97RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_profile.so
98RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_uuid.so
99RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_misc.so
Ethan Yonker38c2ff82014-12-09 13:42:10 -0600100ifneq ($(wildcard external/e2fsprogs/lib/quota/Android.mk),)
bigbiffad58e1b2020-07-06 20:24:34 -0400101 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_quota.so
Ethan Yonker38c2ff82014-12-09 13:42:10 -0600102endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500103ifneq ($(wildcard external/e2fsprogs/lib/ext2fs/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400104 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2fs.so
Ethan Yonkerbcff1462015-01-04 22:01:33 -0600105endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500106ifneq ($(wildcard external/e2fsprogs/lib/blkid/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400107 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_blkid.so
Ethan Yonkerbcff1462015-01-04 22:01:33 -0600108endif
bigbiffad58e1b2020-07-06 20:24:34 -0400109RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpng.so
110RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblog.so
111RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstdc++.so
112RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminuitwrp.so
113RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libminadbd.so
114RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libz.so
115RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmtdutils.so
116RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtar.so
117RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwadbbu.so
118RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpdigest.so
119RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutil-linux.so
120RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libblkid.so
121RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libmmcutils.so
122RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbmlutils.so
123RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libflashutils.so
124RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfusesideload.so
bigbiffdf8436b2020-08-30 16:22:34 -0400125RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbootloader_message.so
D. Andrei Măceșb29a5e22016-12-22 06:19:44 -0500126
bigbiffad58e1b2020-07-06 20:24:34 -0400127RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \
128$(if $(WITH_CRYPTO_UTILS),$(TARGET_OUT_SHARED_LIBRARIES)/libcrypto_utils.so)
bigbiffdf8436b2020-08-30 16:22:34 -0400129
bigbiffad58e1b2020-07-06 20:24:34 -0400130RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/lib64/libbacktrace.so
131RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libunwind.so
132RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbase.so
133RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libc++.so
134RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libnetd_client.so
135
Captain Throwback12673e22020-10-20 11:46:39 -0400136RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/toolbox
bigbiffad58e1b2020-07-06 20:24:34 -0400137
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500138
Ethan Yonker03a42f62014-08-08 11:03:51 -0500139ifneq ($(TW_OEM_BUILD),true)
bigbiffad58e1b2020-07-06 20:24:34 -0400140 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/twrp
bigbiff bigbiffc7eee6f2014-09-02 18:59:01 -0400141else
142 TW_EXCLUDE_MTP := true
143endif
bigbiff bigbiffaf32bb92018-12-18 18:39:53 -0500144
bigbiffad58e1b2020-07-06 20:24:34 -0400145RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpmtp-ffs.so
146RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext4_utils.so
147RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libaosprecovery.so
Greg Wallaceace76232016-01-27 17:15:51 -0500148ifneq ($(TW_INCLUDE_JPEG),)
bigbiffad58e1b2020-07-06 20:24:34 -0400149 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libjpeg.so
Greg Wallaceace76232016-01-27 17:15:51 -0500150endif
bigbiffad58e1b2020-07-06 20:24:34 -0400151RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libselinux.so
152
Dees_Troyb05ddee2013-01-28 20:24:50 +0000153ifneq ($(TW_NO_EXFAT), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400154 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libexfat_twrp.so
Dees Troyb4bd6972014-10-09 18:47:00 +0000155else
Captain Throwback6a1acf22014-09-18 12:46:35 -0400156 TW_NO_EXFAT_FUSE := true
157endif
Mohd Faraz6e5c7582021-04-16 21:08:42 +0200158RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhardware.so
Dees_Troy51a0e822012-09-05 15:24:24 -0400159ifeq ($(TW_INCLUDE_CRYPTO), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400160 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfsfde.so
161 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libdexfile_support.so
162 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libf2fs_sparseblock.so
Captain Throwback12673e22020-10-20 11:46:39 -0400163 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.authsecret@1.0.so
164 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.oemlock@1.0.so
165 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libnos_transport.so
166 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libnos_datagram.so
bigbiffad58e1b2020-07-06 20:24:34 -0400167 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@3.0.so
168 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgpt_twrp.so
Dees Troyc657cc02015-01-16 22:48:47 +0000169 ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500170 ifeq ($(TARGET_CRYPTFS_HW_PATH),)
bigbiffad58e1b2020-07-06 20:24:34 -0400171 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/libcryptfs_hw.so
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500172 else
bigbiffad58e1b2020-07-06 20:24:34 -0400173 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfs_hw.so
Ethan Yonkerdcd9f3f2017-06-05 09:23:34 -0500174 endif
Dees Troyc657cc02015-01-16 22:48:47 +0000175 endif
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600176 # FBE files
177 ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400178 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtwrpfscrypt.so
bigbiffad58e1b2020-07-06 20:24:34 -0400179 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgatekeeper.so
180 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_messages.so
181 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore_binder.so
182 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libbinder.so
183 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-lite.so
184 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoftkeymasterdevice.so
185 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.gatekeeper@1.0.so
bigbiffad58e1b2020-07-06 20:24:34 -0400186 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/avbctl
187 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore
188 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/keystore_cli
bigbiffad58e1b2020-07-06 20:24:34 -0400189 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.system.wifi.keystore@1.0.so
190 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.0.so
191 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.1.so
192 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator@1.2.so
bigbiffa957f072021-03-07 18:20:29 -0500193 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstatslog.so
194 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoft_attestation_cert.so
195 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libxml2.so
Mohd Farazbc576cd2020-05-30 21:06:32 +0530196
bigbiffad58e1b2020-07-06 20:24:34 -0400197 ifneq ($(wildcard system/keymaster/keymaster_stl.cpp),)
198 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_portable.so
199 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_staging.so
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500200 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400201 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libwifikeystorehal.so
202 ifneq ($(wildcard hardware/interfaces/weaver/Android.bp),)
203 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.weaver@1.0.so
Ethan Yonker58f21322018-08-24 11:17:36 -0500204 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400205 ifneq ($(wildcard hardware/interfaces/weaver/1.0/Android.bp),)
206 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.weaver@1.0.so
207 endif
208 ifneq ($(wildcard hardware/interfaces/confirmationui/1.0/Android.bp),)
209 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.confirmationui@1.0.so
210 endif
211 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoftkeymaster.so
212 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@4.0.so
bigbiffa957f072021-03-07 18:20:29 -0500213 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.keymaster@4.1.so
bigbiffad58e1b2020-07-06 20:24:34 -0400214 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster4support.so
bigbiffa957f072021-03-07 18:20:29 -0500215 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster4_1support.so
bigbiffad58e1b2020-07-06 20:24:34 -0400216 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore_aidl.so
217 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore_parcelables.so
218 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libutilscallstack.so
219 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libdexfile.so
220 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libservices.so
221 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_portable.so
bigbiffa957f072021-03-07 18:20:29 -0500222 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhwbinder.so
223 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeystore-attestation-application-id.so
Ethan Yonker93382822018-11-01 15:25:31 -0500224 # 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 -0400225 #RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lshal
226 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblshal.so
227 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libssl.so
228 #RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidl-gen-hash.so
Ethan Yonkerbd7492d2016-12-07 13:55:01 -0600229 endif
Ethan Yonker4eca40d2014-11-11 14:52:28 -0600230endif
Ethan Yonker1b190162016-12-05 15:25:19 -0600231ifeq ($(AB_OTA_UPDATER), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400232 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/update_engine_sideload
233 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.boot@1.0.so
bigbiffe2eae2f2021-03-07 18:47:06 -0500234 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.boot@1.1.so
bigbiff5c083cc2021-06-10 19:55:18 -0400235 ifeq ($(TW_EXCLUDE_LPDUMP),)
236 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/bootctl
237 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lpdump
238 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lpdumpd
239 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblpdump.so
240 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblpdump_interface-V1-cpp.so
241 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so
242 endif
Ethan Yonker1b190162016-12-05 15:25:19 -0600243endif
bigbiffad58e1b2020-07-06 20:24:34 -0400244
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500245ifneq ($(wildcard system/core/libsparse/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400246 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsparse.so
Dees_Troy4546fe72013-01-10 14:33:27 +0000247endif
Dees_Troy83bd4832013-05-04 12:39:56 +0000248ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400249 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libopenaes.so
Dees_Troy83bd4832013-05-04 12:39:56 +0000250endif
Dees_Troye5017042013-08-29 16:38:55 +0000251ifeq ($(TARGET_USERIMAGES_USE_F2FS), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400252 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/make_f2fs
Captain Throwback57db2cc2020-09-09 15:38:13 -0400253 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.f2fs
bigbiffad58e1b2020-07-06 20:24:34 -0400254 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sload_f2fs
Dees_Troye5017042013-08-29 16:38:55 +0000255endif
Ethan Yonkerfefe5912017-09-30 22:22:13 -0500256ifneq ($(wildcard system/core/reboot/Android.*),)
bigbiffad58e1b2020-07-06 20:24:34 -0400257 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/system/bin/reboot
Dees Troy0226cd52013-11-04 14:12:35 +0000258endif
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200259ifneq ($(TW_DISABLE_TTF), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400260 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libft2.so
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200261endif
bigbiffad58e1b2020-07-06 20:24:34 -0400262ifneq ($(TW_RECOVERY_ADDITIONAL_RELINK_BINARY_FILES),)
263 RECOVERY_BINARY_SOURCE_FILES += $(TW_RECOVERY_ADDITIONAL_RELINK_BINARY_FILES)
264endif
265ifneq ($(TW_RECOVERY_ADDITIONAL_RELINK_LIBRARY_FILES),)
266 RECOVERY_LIBRARY_SOURCE_FILES += $(TW_RECOVERY_ADDITIONAL_RELINK_LIBRARY_FILES)
Ethan Yonker0e678372014-11-18 12:17:06 -0600267endif
Dees Troye176a652015-01-20 19:35:21 +0000268ifneq ($(wildcard external/pcre/Android.mk),)
bigbiffad58e1b2020-07-06 20:24:34 -0400269 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpcre.so
Dees Troye176a652015-01-20 19:35:21 +0000270endif
Ethan Yonkerb81d9052015-07-09 13:20:53 -0500271ifeq ($(TW_INCLUDE_NTFS_3G),true)
bigbiffad58e1b2020-07-06 20:24:34 -0400272 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mount.ntfs
273 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.ntfs
274 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkfs.ntfs
275 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libntfs-3g.so
276 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfuse-lite.so
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500277else
bigbiffad58e1b2020-07-06 20:24:34 -0400278 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ntfs-3g
279 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ntfsfix
280 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkntfs
Greg Wallaceb39e6c62015-12-29 00:55:26 -0500281endif
Ethan Yonker483e9f42016-01-11 22:21:18 -0600282ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
bigbiffad58e1b2020-07-06 20:24:34 -0400283 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sgdisk
Ethan Yonker483e9f42016-01-11 22:21:18 -0600284endif
Ctapchukfc35b152021-04-26 16:58:57 +0700285ifneq ($(TW_OZIP_DECRYPT_KEY),)
286 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ozip_decrypt
287endif
Captain Throwback1f127752016-01-19 17:30:20 -0500288ifeq ($(TWRP_INCLUDE_LOGCAT), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400289 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/logcat
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600290 ifeq ($(TARGET_USES_LOGD), true)
Captain Throwback12673e22020-10-20 11:46:39 -0400291 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/logd
bigbiffad58e1b2020-07-06 20:24:34 -0400292 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsysutils.so
293 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libnl.so
Ethan Yonkere5a288c2016-02-15 09:23:57 -0600294 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400295 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpcrecpp.so
296 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblogcat.so
297 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcap.so
Captain Throwback1f127752016-01-19 17:30:20 -0500298endif
bigbiffad58e1b2020-07-06 20:24:34 -0400299RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libvndksupport.so
300RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidlbase.so
301RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidltransport.so
302RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.frameworks.stats@1.0.so
303RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libziparchive.so
304RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_blkid.so
305RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_quota.so
306RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhidl-gen-utils.so
307RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libvintf.so
308RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libtinyxml2.so
309RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hidl.token@1.0.so
310ifneq ($(wildcard system/core/libkeyutils/Android.bp),)
311 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeyutils.so
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500312endif
bigbiffad58e1b2020-07-06 20:24:34 -0400313ifeq ($(TARGET_ARCH), arm64)
314 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-aarch64-android.so
315endif
316ifeq ($(TARGET_ARCH), arm)
317 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-arm-android.so
318endif
319ifeq ($(TARGET_ARCH), x86_64)
320 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-x86_64-android.so
321endif
322ifeq ($(TARGET_ARCH), x86)
323 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-i686-android.so
324endif
325ifeq ($(TARGET_ARCH), mips)
326 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-mips-android.so
327endif
328ifeq ($(TARGET_ARCH), mips64)
329 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.ubsan_standalone-mips64-android.so
330endif
331RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblogwrap.so
332RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext2_misc.so
Ethan Yonker58f21322018-08-24 11:17:36 -0500333
nebrassy50789652021-02-12 23:36:44 +0100334ifneq ($(TW_EXCLUDE_NANO), true)
335 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/nano
336 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libncurses.so
337 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libssh.so
338 RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libssl.so
339endif
340
DarthJabba9fba0cee2021-02-20 17:13:09 -0500341ifneq ($(TW_EXCLUDE_BASH), true)
342 RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/bash
343endif
344
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500345include $(CLEAR_VARS)
bigbiffad58e1b2020-07-06 20:24:34 -0400346LOCAL_MODULE := relink_libraries
bigbiffd58ba182020-03-23 10:02:29 -0400347LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500348LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400349LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
althafvly003401c2020-12-10 21:33:02 +0530350ifneq ($(TARGET_ARCH), arm64)
351 ifneq ($(TARGET_ARCH), x86_64)
352 LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib $(RECOVERY_LIBRARY_SOURCE_FILES)
353 else
354 LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib64 $(RECOVERY_LIBRARY_SOURCE_FILES)
355 endif
356else
bigbiffad58e1b2020-07-06 20:24:34 -0400357LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/lib64 $(RECOVERY_LIBRARY_SOURCE_FILES)
althafvly003401c2020-12-10 21:33:02 +0530358endif
bigbiffad58e1b2020-07-06 20:24:34 -0400359TARGET_LIBRARY_RELINK_FILES := $(notdir $(RECOVERY_LIBRARY_SOURCE_FILES))
360TARGET_BASE_LIBRARY_RELINK_MODULES := $(basename $(TARGET_LIBRARY_RELINK_FILES))
361TARGET_RELINK_LIBRARY_MODULES := $(filter-out libdexfile, $(TARGET_BASE_LIBRARY_RELINK_MODULES))
362LOCAL_REQUIRED_MODULES += $(TARGET_RELINK_LIBRARY_MODULES)
bigbiffd58ba182020-03-23 10:02:29 -0400363include $(BUILD_PHONY_PACKAGE)
364
bigbiffad58e1b2020-07-06 20:24:34 -0400365
366include $(CLEAR_VARS)
367LOCAL_MODULE := relink_binaries
368LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500369LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400370LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
371LOCAL_POST_INSTALL_CMD += $(RELINK) $(TARGET_RECOVERY_ROOT_OUT)/system/bin $(RECOVERY_BINARY_SOURCE_FILES)
Mohd Faraza791d122020-09-27 16:06:42 +0530372TARGET_BINARY_RELINK_FILES := $(filter-out bu, $(notdir $(RECOVERY_BINARY_SOURCE_FILES)))
bigbiffad58e1b2020-07-06 20:24:34 -0400373LOCAL_REQUIRED_MODULES += $(TARGET_BINARY_RELINK_FILES)
374include $(BUILD_PHONY_PACKAGE)
375
376#build out TWRP ramdisk
bigbiffd58ba182020-03-23 10:02:29 -0400377include $(CLEAR_VARS)
bigbiff7ba75002020-04-11 20:47:09 -0400378LOCAL_MODULE := twrp_ramdisk
bigbiffd58ba182020-03-23 10:02:29 -0400379LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500380LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffd58ba182020-03-23 10:02:29 -0400381LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
bigbiffad58e1b2020-07-06 20:24:34 -0400382LOCAL_POST_INSTALL_CMD += \
383 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin; ln -sf /system/bin/sh $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh && \
bigbiff7ba75002020-04-11 20:47:09 -0400384 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/ && \
Captain Throwback8bd1ac52020-10-19 13:09:17 -0400385 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/vendor/etc/selinux/ && \
386 cp $(TARGET_OUT_ETC)/selinux/plat_service_contexts $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/plat_service_contexts && \
387 cp $(TARGET_OUT_ETC)/selinux/plat_hwservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/system/etc/selinux/plat_hwservice_contexts && \
388 cp $(TARGET_OUT_VENDOR_ETC)/selinux/vndservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/vendor/etc/selinux/vndservice_contexts && \
389 cp $(TARGET_OUT_VENDOR_ETC)/selinux/vendor_hwservice_contexts $(TARGET_RECOVERY_ROOT_OUT)/vendor/etc/selinux/vendor_hwservice_contexts
390 ifeq ($(TARGET_USES_MKE2FS), true)
391 LOCAL_POST_INSTALL_CMD += \
392 && cp $(TARGET_OUT_ETC)/mke2fs.conf $(TARGET_RECOVERY_ROOT_OUT)/system/etc/mke2fs.conf
393 endif
bigbiffad58e1b2020-07-06 20:24:34 -0400394LOCAL_REQUIRED_MODULES += init_second_stage.recovery reboot.recovery plat_service_contexts plat_hardware_contexts vndservice_contexts
bigbiffd58ba182020-03-23 10:02:29 -0400395include $(BUILD_PHONY_PACKAGE)
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500396
Dees_Troy83bd4832013-05-04 12:39:56 +0000397# copy license file for OpenAES
398ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400399 include $(CLEAR_VARS)
400 LOCAL_MODULE := openaes_license
401 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500402 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400403 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/license/openaes
404 LOCAL_SRC_FILES := ../openaes/LICENSE
405 include $(BUILD_PREBUILT)
Dees_Troy83bd4832013-05-04 12:39:56 +0000406endif
407
Dees_Troy51a0e822012-09-05 15:24:24 -0400408ifeq ($(TW_INCLUDE_DUMLOCK), true)
bigbiffad58e1b2020-07-06 20:24:34 -0400409 #htcdumlock for /system for dumlock
410 include $(CLEAR_VARS)
411 LOCAL_MODULE := htcdumlocksys
412 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500413 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400414 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
415 LOCAL_SRC_FILES := $(LOCAL_MODULE)
416 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400417
bigbiffad58e1b2020-07-06 20:24:34 -0400418 #flash_image for /system for dumlock
419 include $(CLEAR_VARS)
420 LOCAL_MODULE := flash_imagesys
421 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500422 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400423 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
424 LOCAL_SRC_FILES := $(LOCAL_MODULE)
425 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400426
bigbiffad58e1b2020-07-06 20:24:34 -0400427 #dump_image for /system for dumlock
428 include $(CLEAR_VARS)
429 LOCAL_MODULE := dump_imagesys
430 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500431 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400432 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
433 LOCAL_SRC_FILES := $(LOCAL_MODULE)
434 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400435
bigbiffad58e1b2020-07-06 20:24:34 -0400436 #libbmlutils for /system for dumlock
437 include $(CLEAR_VARS)
438 LOCAL_MODULE := libbmlutils.so
439 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500440 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400441 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
442 LOCAL_SRC_FILES := $(LOCAL_MODULE)
443 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400444
bigbiffad58e1b2020-07-06 20:24:34 -0400445 #libflashutils for /system for dumlock
446 include $(CLEAR_VARS)
447 LOCAL_MODULE := libflashutils.so
448 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500449 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400450 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
451 LOCAL_SRC_FILES := $(LOCAL_MODULE)
452 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400453
bigbiffad58e1b2020-07-06 20:24:34 -0400454 #libmmcutils for /system for dumlock
455 include $(CLEAR_VARS)
456 LOCAL_MODULE := libmmcutils.so
457 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500458 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400459 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
460 LOCAL_SRC_FILES := $(LOCAL_MODULE)
461 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400462
bigbiffad58e1b2020-07-06 20:24:34 -0400463 #libmtdutils for /system for dumlock
464 include $(CLEAR_VARS)
465 LOCAL_MODULE := libmtdutils.so
466 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500467 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400468 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
469 LOCAL_SRC_FILES := $(LOCAL_MODULE)
470 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400471
bigbiffad58e1b2020-07-06 20:24:34 -0400472 #HTCDumlock.apk
473 include $(CLEAR_VARS)
474 LOCAL_MODULE := HTCDumlock.apk
475 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500476 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400477 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)$(TWHTCD_PATH)
478 LOCAL_SRC_FILES := $(LOCAL_MODULE)
479 include $(BUILD_PREBUILT)
Dees_Troy51a0e822012-09-05 15:24:24 -0400480endif
Dees_Troy6ef66352013-02-21 08:26:57 -0600481
bigbiff416fe3a2020-03-28 13:46:48 -0400482ifeq ($(TW_USE_TOOLBOX), true)
483 include $(CLEAR_VARS)
484 LOCAL_MODULE := mkshrc_twrp
485 LOCAL_MODULE_STEM := mkshrc
486 LOCAL_MODULE_TAGS := optional
487 LOCAL_MODULE_CLASS := ETC
bigbiffad58e1b2020-07-06 20:24:34 -0400488 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/etc
bigbiff416fe3a2020-03-28 13:46:48 -0400489 LOCAL_SRC_FILES := $(LOCAL_MODULE)
490 include $(BUILD_PREBUILT)
491endif
Captain Throwback5ab59642019-02-07 17:22:49 -0500492
Ethan Yonkerb4bff5e2016-12-16 07:47:58 -0600493#TWRP App "placeholder"
494include $(CLEAR_VARS)
495LOCAL_MODULE := me.twrp.twrpapp.apk
theimpulsond95dcd22020-03-23 18:27:29 +0000496LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500497LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400498LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Ethan Yonkerb4bff5e2016-12-16 07:47:58 -0600499LOCAL_SRC_FILES := $(LOCAL_MODULE)
500include $(BUILD_PREBUILT)
nijel82c821a82018-12-29 04:56:41 -0500501
Stefan Tauner6ad14572020-01-11 22:28:53 +0100502#TWRP App permissions for Android 9+
503include $(CLEAR_VARS)
504LOCAL_MODULE := privapp-permissions-twrpapp.xml
bigbifff654e842020-06-05 21:03:23 -0400505LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500506LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400507LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
Stefan Tauner6ad14572020-01-11 22:28:53 +0100508LOCAL_SRC_FILES := $(LOCAL_MODULE)
509include $(BUILD_PREBUILT)
510
nijel82c821a82018-12-29 04:56:41 -0500511ifeq ($(TW_INCLUDE_CRYPTO), true)
512 ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),)
bigbiffad58e1b2020-07-06 20:24:34 -0400513 # Prebuilt vdc_pie for pre-Pie SDK Platforms
514 include $(CLEAR_VARS)
515 LOCAL_MODULE := vdc_pie
516 LOCAL_MODULE_TAGS := optional
bigbiff673c7ae2020-12-02 19:44:56 -0500517 LOCAL_MODULE_CLASS := EXECUTABLES
bigbiffad58e1b2020-07-06 20:24:34 -0400518 LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
519 LOCAL_SRC_FILES := vdc_pie-$(TARGET_ARCH)
520 include $(BUILD_PREBUILT)
nijel82c821a82018-12-29 04:56:41 -0500521 endif
522endif
Ethan Yonker53796e72019-01-11 22:49:52 -0600523
Chaosmaster461e39f2020-02-07 01:48:13 +0100524ifneq (,$(filter $(TW_INCLUDE_REPACKTOOLS) $(TW_INCLUDE_RESETPROP) $(TW_INCLUDE_LIBRESETPROP), true))
Ethan Yonker53796e72019-01-11 22:49:52 -0600525 ifeq ($(wildcard external/magisk-prebuilt/Android.mk),)
mauronofrio76ef9f32019-12-23 20:29:24 +0100526 $(warning Magisk prebuilt tools not found!)
Ethan Yonker53796e72019-01-11 22:49:52 -0600527 $(warning Please place https://github.com/TeamWin/external_magisk-prebuilt)
528 $(warning into external/magisk-prebuilt)
529 $(error magiskboot prebuilts not present; exiting)
530 endif
531endif
Captain Throwback6443cef2021-01-30 12:26:25 -0500532
533# Include tzdata in TWRP to fix "__bionic_open_tzdata" log spam
534# Dummy file to apply post-install patch
535ifneq ($(TW_EXCLUDE_TZDATA), true)
536 include $(CLEAR_VARS)
537 LOCAL_MODULE := tzdata_twrp
538 LOCAL_MODULE_TAGS := optional
539 LOCAL_MODULE_CLASS := ETC
540 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
541 LOCAL_REQUIRED_MODULES := tzdata
542
543 LOCAL_POST_INSTALL_CMD += \
544 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/usr/share/zoneinfo; \
545 cp -f $(TARGET_OUT)/usr/share/zoneinfo/tzdata $(TARGET_RECOVERY_ROOT_OUT)/system/usr/share/zoneinfo/;
546 include $(BUILD_PHONY_PACKAGE)
547endif
nebrassy50789652021-02-12 23:36:44 +0100548
549include $(CLEAR_VARS)
550LOCAL_MODULE := nano_twrp
551LOCAL_MODULE_TAGS := optional
552LOCAL_MODULE_CLASS := ETC
553LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
554LOCAL_REQUIRED_MODULES := nano libncurses
555LOCAL_POST_INSTALL_CMD += \
556 cp -rf $(TARGET_OUT_ETC)/nano $(TARGET_RECOVERY_ROOT_OUT)/system/etc/; \
557 cp -rf external/libncurses/lib/terminfo $(TARGET_RECOVERY_ROOT_OUT)/system/etc/;
558include $(BUILD_PHONY_PACKAGE)
559
DarthJabba9fba0cee2021-02-20 17:13:09 -0500560ifneq ($(TW_EXCLUDE_BASH), true)
561 include $(CLEAR_VARS)
562 LOCAL_MODULE := bash_twrp
563 LOCAL_MODULE_TAGS := optional
564 LOCAL_MODULE_CLASS := ETC
565 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/system/bin
566 LOCAL_REQUIRED_MODULES := bash
567
568 LOCAL_POST_INSTALL_CMD += \
569 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/; \
Captain Throwback0265b252021-04-20 13:12:19 -0400570 cp -rf external/bash/etc/* $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/; \
DarthJabba9fba0cee2021-02-20 17:13:09 -0500571 sed -i 's/ro.lineage.device/ro.product.device/' $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/bashrc; \
572 sed -i '/export TERM/d' $(TARGET_RECOVERY_ROOT_OUT)/system/etc/bash/bashrc; \
573 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin; \
574 ln -sf /system/bin/bash $(TARGET_RECOVERY_ROOT_OUT)/sbin/bash;
575 include $(BUILD_PHONY_PACKAGE)
576endif
577