Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
189bd27
language: italian: Fix rename_stock typo
alviteri Sep 30, 2018
ff33d13
twinstall: exploit compat with karnak
xyzz Jan 21, 2019
b2b9658
amonet: make logging prettier
xyzz Jan 27, 2019
157b01f
Update default settings for amonet
xyzz Jan 27, 2019
671afae
update amonet-exploit for ford
chaosmaster Feb 11, 2019
6ee2f6a
also patch recovery and with flash image
chaosmaster Feb 13, 2019
97950c3
Add Button to enter Hacked BL
chaosmaster Feb 13, 2019
ffe97f8
Make amonet selectable using TW_AMONET and update microloader
chaosmaster Feb 14, 2019
eb5ac6f
Add flag TW_NO_SCREEN to support devices without screen
chaosmaster Feb 27, 2019
2ef4ae0
no-screen: don't print errors for unknown objects
chaosmaster Mar 10, 2019
730634b
update microloader for tank
chaosmaster Mar 10, 2019
f95d2e5
Make hacked_bl_button selectable without enabling amonet
chaosmaster Mar 20, 2019
cab1cde
Add hacked_bl_button to portrait theme
chaosmaster Mar 20, 2019
0eca2ab
enable selecting hacked_bl_button without enabling amonet 2/2
chaosmaster Mar 20, 2019
b790f95
Make TWRP wipe userdata if no valid filesystem is found
chaosmaster Mar 20, 2019
63bf63c
Make amonet more generic / Move microloader to device tree
chaosmaster Mar 23, 2019
9e2bdc6
Fix build in 5.1 tree
Dees-Troy Mar 21, 2019
d48ee0a
Fix build in 5.1 tree 2/2
chaosmaster Mar 23, 2019
3fc5a99
reenable system_rw prompt, don't have dm-verity
chaosmaster Mar 25, 2019
2f98f03
add newlines to gui_prints (not added on cmdline)
chaosmaster Mar 25, 2019
81e8f0c
Make amonet more generic, use microloader from recovery-partition
chaosmaster Apr 24, 2019
a883105
Don't enable HACKED BL Button if amonet is enabled
chaosmaster Jul 15, 2019
fe323a7
Add build-flag to define default backup_list
chaosmaster Jul 16, 2019
b4029b0
Merge branch 'android-9.0' into amonet-9.0
chaosmaster Jul 17, 2019
8046aa0
Add bootmenu for firestick
chaosmaster Sep 29, 2019
a957df4
Make bootmenu only show if OTG is connected
chaosmaster Oct 5, 2019
2923def
/sbin should come first in the linker search path.
ianmacd Dec 4, 2019
7ec5fd9
recovery: Move bldrmsg offset symbols to bootloader_message.cpp
aleasto Oct 12, 2018
d331705
android-5.1: use char constructor for default on c++ streams
bigbiff Dec 22, 2019
5667feb
recovery: wipe bootloader message from index 0 when using custom offsets
aleasto May 4, 2019
f9156ea
Complete overhaul of Dutch translation:
ianmacd Jun 17, 2019
9632f30
Removing fake error: E: recv error on uevent
mauronofrio Aug 4, 2019
15434cd
Merge "android-5.1: use char constructor for default on c++ streams" …
bigbiff Dec 23, 2019
49cfb7e
crypto: add some missing newlines
CaptainThrowback Jan 28, 2020
0864aa5
Prevent errors caused by /data/per_boot/
DarthJabba9 Jan 14, 2020
990168b
bootable: read all asserts in case there are more than one.
Herna1994 Feb 27, 2019
2c2d559
Merge "Removing fake error: E: recv error on uevent" into android-9.0
bigbiff Feb 16, 2020
6d5d08a
Move decryption error from logerror to loginfo
mauronofrio Dec 3, 2019
d54e1da
partitionmanager: add /etc to Local_Path
CaptainThrowback Mar 4, 2020
f8d0e21
openrecoveryscript: do not skip decryption even if using block.map
CaptainThrowback Jul 4, 2019
a5283b3
crypto: add more missing newlines
CaptainThrowback Feb 19, 2020
8a411c8
Fix ORS backup and restore for system-as-root
moetayuko Jan 7, 2020
915bbd2
Fix building libuuid
cryptomilk Mar 6, 2020
191a694
crypto: fde: decrypt master key first
AndroiableDroid Feb 15, 2020
07f991a
system mount: unmount system after checking for TWRP app
bigbiff Mar 11, 2020
c630b38
Fix 'system/etc/ld.config.txt' not found error
MartinX3 Dec 30, 2019
901141c
language: turkish update
Mar 14, 2020
ec350e9
init: ueventd already needs /acct
cryptomilk Mar 11, 2020
fec60c3
Merge "Fix building libuuid" into android-9.0
bigbiff Apr 26, 2020
77a3191
partitionmanager: Unmount all directories mounted to same block
AndroiableDroid Apr 21, 2020
76ef9f3
Create a flag to include resetprop in the TWRP
mauronofrio Dec 23, 2019
58f1a63
Properly detect system-as-root
moetayuko Jan 16, 2020
3b68273
Set system-partition mount point to proper location
chaosmaster Jan 25, 2020
3b3b634
ORS Make mount/unmount system mount system_root on SAR
chaosmaster Jan 25, 2020
ff4f958
Add option to automatically unmount system before installing ZIP
chaosmaster Jan 26, 2020
da97480
Create/Remove system_root/system bind mount, when mounting System
chaosmaster Jan 26, 2020
f6e42ce
Implement autodetection for SAR, based on the installed system
chaosmaster Jan 26, 2020
aaa9e64
Merge "Create a flag to include resetprop in the TWRP" into android-9.0
bigbiff May 10, 2020
461e39f
Add TWFunc::Property_Override(name, value) to override properties
chaosmaster Feb 7, 2020
01a1799
Add flag for overwriting properties with system values
chaosmaster Feb 7, 2020
97c4541
libresetprop: not available for Android < 7
chaosmaster Feb 15, 2020
0d9a62e
Remove Extra spaces occured while using multiline string variable
AndroiableDroid Feb 19, 2020
65633a4
Add optional PartitionManager and Mount_Point to
chaosmaster Feb 5, 2020
b76a73a
Fix backup and restore after autodetection for SAR
moetayuko Apr 30, 2020
3284a66
vold_decrypt: automatically set Android version & patch level
CaptainThrowback Feb 4, 2020
31cba20
Merge "system mount: unmount system after checking for TWRP app" into…
bigbiff May 11, 2020
7bf8df5
Mount system and vendor for A/B installs for backuptool to work
chaosmaster Feb 3, 2020
40ed06e
partition: set fbe.data.wrappedkey automatically via flag
PeterCxy May 24, 2019
1db9432
Encryption: don't try wrapped key if not needed
mauronofrio Nov 23, 2019
a2bd7b7
factory reset: restore ext4 policy on /data/cache
bigbiff May 8, 2020
1913bf3
Make the twrp verify the pre-device among several props
mauronofrio Nov 14, 2019
76390d7
Add option to display IP Address.
chaosmaster May 16, 2020
df5e48b
Add socket transport to minadb.
androidrbox Feb 6, 2016
7884eac
twrptar: fix backup freeze with pigz and openaes
fbellet Dec 15, 2019
5343a3c
Add info that flashing AB zip will flash to the inactive slot
chaosmaster Feb 7, 2020
90df3de
Replace "Reboot System" with "Reboot" for A/B devices
chaosmaster Feb 7, 2020
ab16437
Rework progressbar logic, implement scoped/split progressbar
chaosmaster Feb 3, 2020
8ff93eb
Set toolbox as default for android 9+ TWRPs
mauronofrio Mar 16, 2020
5db50de
vold_decrypt: add missing includes for ext4 policies
bigbiff May 18, 2020
f62d249
includes: update includes for base and ext4 policies
bigbiff May 20, 2020
5738d3d
Fix ro.twrp.sar, as was originally intended in #1883
chaosmaster May 20, 2020
5a79f67
Add support for multi-user decryption
noahajac Apr 28, 2019
ab30544
Merge "includes: update includes for base and ext4 policies" into and…
bigbiff May 21, 2020
28d8dec
bootable: Change how blank screen works
deadman96385 Jul 15, 2018
ffc9896
Little fix of double includes
mauronofrio May 24, 2020
ef675d1
debug: remove extra debug statements
bigbiff May 25, 2020
b51f4af
crypto: Update crypto fde
AndroiableDroid Feb 11, 2020
5738e76
partitionmanager: magisk update sytnax as per new binaries
AndroiableDroid May 9, 2020
589daae
Remove /system -> /system_root/system symlink in ZIP-install
chaosmaster Jun 5, 2020
bf0b0fb
multiuser: Parse users only when Decrypt_DE runs successfully
noahajac Jun 5, 2020
86a4370
Add and install permission file for Android 9+
stefanct Jan 11, 2020
e0e4340
twrp version update: update to 3.4.0 release notes are on twrp.me
bigbiff Jun 5, 2020
4e37953
Fix build in 5.1 tree. to_string doesn't exist in bionic in 5.1.
CaptainThrowback Jun 6, 2020
909daa9
TWRP: Enable qti input haptics vibrators support
AndroiableDroid May 30, 2020
186eb70
ext4crypt: fix include location for recovery-twrp in lineage
bigbiff Jun 8, 2020
314cbd5
add support for TSPDRV vibration
LameMonster82 Jun 4, 2020
3754fab
fix flashing issue after restore policy issue
AndroiableDroid Jun 6, 2020
0cd6be9
gui: Repair OEM build
Fighter19 Jun 6, 2020
2702094
Allow Gui File Selector filter to check among more extensions
mauronofrio Jan 10, 2020
cf0dffc
FBE: set TW_IS_FBE based on whether key version path exists
CaptainThrowback Feb 17, 2020
0ff5984
Add ozip decryption for Oppo/Realme device
mauronofrio Oct 26, 2019
425e7bb
Merge "Add ozip decryption for Oppo/Realme device" into android-9.0
bigbiff Jun 10, 2020
2df2490
Is_Data_Wiped: simplify function signature
bigbiff Jun 19, 2020
349ea55
log storage: change AB device log storage to /data/recovery
bigbiff Jun 19, 2020
c6e2cfe
minuitwrp ev_init: delay start if specified in board
bigbiff Jun 26, 2020
4881c9e
Update the Spanish translation.
R0rt1z2 Jun 30, 2020
25371a7
Fix up cache wipe issue in A-Only device
AndroiableDroid Jun 14, 2020
13b07f8
Exclude the dumpsys dumps from backups, to avoid error 255 when resto…
DarthJabba9 Aug 4, 2020
6c70991
lang: Updated German language strings
4ndyZ Aug 11, 2020
ace7eec
persist logs: remove persist from available log directories in
bigbiff Aug 30, 2020
35475b1
Choose hwrotation at runtime
webgeek1234 Jun 30, 2019
e8f7ea3
fix compile in api 24
AndroiableDroid Jun 12, 2020
9d07818
vold_decrypt: don't show error if unmount fails
CaptainThrowback Oct 23, 2020
3ad80f4
multiuser: Warn when not all users are decrypted
noahajac Jul 21, 2020
6e80600
fde: set ro.crypto.type to block
CaptainThrowback Oct 24, 2020
07b8e05
fde: move crypto state & type setting to function
CaptainThrowback Oct 29, 2020
674bb0c
set crypto state/type when detected
nebrassy Oct 24, 2020
9c5a5f6
Add missing Chinese tanslate
Whyle Nov 8, 2020
5318039
variables: add branch to TWRP version number
CaptainThrowback Nov 29, 2020
81acef1
Update lock pattern types for android 11
AlexanderS Dec 15, 2020
3eee31a
also set crypto state for non-metadata FBE
nebrassy Dec 16, 2020
97829df
gui: update reboot page to listbox
bigbiff Dec 20, 2020
268091d
gui: bump theme version to 4
CaptainThrowback Oct 22, 2020
cbd4e0c
Remove TWRP app prompt from reboot flow
Dees-Troy Dec 17, 2020
cc9746b
twrpapp: restore system mount to previous state
CaptainThrowback Dec 21, 2020
4165cc6
logd: add event-log-tags and include in build
CaptainThrowback Nov 5, 2020
e931e74
Updated Russian localization
Dec 23, 2020
4a78bda
gui: fix listbox on reboot page in landscape theme
CaptainThrowback Dec 26, 2020
8f58a29
twrp release: 3.5.0 Android 9 release
bigbiff Dec 25, 2020
83c2234
wrappedkey: only run check on FBE devices
CaptainThrowback Dec 29, 2020
9d930a2
reduced the checkforapp function call to reduce unwanted log info
epicX67 Dec 28, 2020
d3cdfc9
logd: only copy event-log-tags on sdk < 28
CaptainThrowback Dec 28, 2020
df529d0
Merge "reduced the checkforapp function call to reduce unwanted log i…
bigbiff Dec 31, 2020
ccdf45c
(2/2) zip: fix build in 7.1 tree with TW_USE_TOOLBOX
CaptainThrowback Jan 1, 2021
0c6a626
ors: Refresh the system details after sideload and wipe system
AdrianDC Jan 5, 2021
11a26ff
extra-languages: update Chinese translation
betaxab Dec 2, 2020
6ce1543
Remove duplicate PackageExtractFileFn
klabit87 Jan 2, 2021
7a45b89
cryptfs: add support for keymaster 2
PeterCxy Nov 2, 2019
3ca062d
logd: remove logd-reinit service
CaptainThrowback Jan 8, 2021
aaedfa8
SAR: update script name for clarity when run in TWRP console
CaptainThrowback Jan 8, 2021
2f7afe1
tzdata: add to TWRP build automatically
CaptainThrowback Jan 30, 2021
35d2bfd
android root: restore context for android system root
bigbiff Jan 23, 2021
c50044b
partitionmanager: support delayed adopted storage mount
PeterCxy Oct 17, 2019
39881ab
partition: add support dm_use_original_path
PeterCxy Nov 2, 2019
8303e6d
cryptfs: only include keymaster 2 if tree supports it
CaptainThrowback Feb 16, 2021
3c25ab3
Added Support for terminal from filemanager
AndroiableDroid Aug 12, 2020
d3242eb
Include nano in TWRP by default
nebrassy Feb 12, 2021
3b55610
nano: Add File Manager option to edit selected file
CaptainThrowback Feb 13, 2021
15430b6
Include common names for Magisk app in list of flashable zip files.
ianmacd Jan 23, 2021
261350c
nano: copy files directly from source folder
CaptainThrowback Feb 21, 2021
98053c3
Add support to change TWRP Folder
epicX67 Jan 4, 2021
8ed5615
bash: add to TWRP
DarthJabba9 Feb 21, 2021
df224ce
SAR: don't follow symbolic links for system slot
bigbiff Feb 27, 2021
fb61038
Fixes for Add support to change TWRP Folder
epicX67 Feb 28, 2021
3b3bd12
ors: Implement 'twrp format data' to format the data partition
AdrianDC Jan 5, 2021
a112cb5
Strip strings containing '--' before conversion to XML comments.
ianmacd Mar 1, 2021
d259b37
Fix unlocalised string.
ianmacd Mar 1, 2021
b733737
Added support for flash image in both slots
epicX67 Feb 24, 2021
e248171
New, missing and improved strings for Dutch translation.
ianmacd Mar 6, 2021
5f0845c
Fix ungrammatical sentence.
ianmacd Mar 6, 2021
02b4f2f
twrp release: 3.5.1_9
bigbiff Mar 6, 2021
327684a
Allow all extension while checking for digest verification
epicX67 Mar 12, 2021
050a22a
Updated Russian language
Mar 18, 2021
40b7f7a
Normalized digest check before installing zip
epicX67 Mar 20, 2021
2bc3ecc
twrp release: 3.5.2 a9
bigbiff Apr 4, 2021
63e5a5f
ext4crypt: add missing endlines for keymaster 4
CaptainThrowback Apr 7, 2021
a5a1241
languages: add indonesian language
Xdisk-Translator Apr 19, 2021
4a65b70
bash: Relink libncurses.so
JarlPenguin Apr 25, 2021
69e6e77
Update Russian language, sync with en.xml
Ctapchuk Jul 12, 2021
84e7e69
Merge remote-tracking branch 'teamwin/android-9.0' into amonet
R0rt1z2 Jul 20, 2021
41dd0a0
Don't rely on just seconds for detecting changes to /dev/input
chaosmaster Aug 11, 2021
94f667d
fde: add missing newline
CaptainThrowback Nov 1, 2021
56b02eb
repack: update repacking
bigbiff Jul 7, 2020
774f7a1
Repacker: refresh sizes before backing up boot
nebrassy Jul 26, 2021
6e2f366
repacker: override slot for flashing images instead of using bootctrl
bigbiff Jul 31, 2021
fc9e438
repack: fix bad rebase
bigbiff Aug 7, 2021
fe1c237
Add an option to one click flash current booted TWRP ramdisk
nebrassy May 20, 2021
3490f65
en.xml: fix capitalization
CaptainThrowback Oct 1, 2021
363497b
repack: correctly recompress ramdisk to the format of boot image
nebrassy Aug 6, 2021
0b77d46
theme: Capitalize EDL
mistersmee Nov 8, 2021
4bce54b
Add exclusion criteria for "Fix Recovery Bootloop"
CaptainThrowback Sep 16, 2021
a1ad7eb
crypto: only set crypto state and type if not already set
CaptainThrowback Oct 6, 2021
0f7f9a1
fbe formatting: add warning for fbe devices and remove unused string
bigbiff Jul 10, 2021
dfeab0d
mtp: don't create storage device after format data
CaptainThrowback Oct 3, 2021
cfa637e
gui: add canceldecrypt page
CaptainThrowback Feb 10, 2021
202df17
copy log: add option to include logcat
CaptainThrowback Sep 5, 2021
5c1c24e
repacker: add root overwrite warning
CaptainThrowback Oct 3, 2021
c13796a
keyboard: add num template for PIN input
CaptainThrowback Nov 4, 2021
22be9c1
Handle XML files format properly
zhenyolka Nov 8, 2021
b7fd1ea
twrp release: 3.6.0 for a9
bigbiff Nov 13, 2021
36aca76
tzdata: remove any old symlinks in out folder
CaptainThrowback Nov 15, 2021
fd445a7
nano: Copy nano-related files to /sbin instead of /system
LinkBoi00 Aug 13, 2021
c497b26
prebuilt: bash: Copy bash related files to /sbin instead of /system
LinkBoi00 Aug 13, 2021
168bc4c
action: Unmount vendor partition prior to switching slots
CaptainThrowback Aug 13, 2021
ee353e0
action: Only unmount /vendor if it actually exists
LinkBoi00 Nov 16, 2021
14aeca5
gui: theme: Remove the TWRP app button from the reboot menu
LinkBoi00 Nov 16, 2021
c6d463f
gui: theme: Switch to larger buttons in the reboot menu
LinkBoi00 Nov 16, 2021
5437732
repacker: update partition details after switching slot
nebrassy Nov 18, 2021
f940ba2
Adopted Storage: Add support for mixed mode sdcards
nkk71 Mar 24, 2017
7671140
event-log-tags: force copy to recovery out
CaptainThrowback Nov 18, 2021
f46463a
ext4crypt: only include if TARGET_USERIMAGES_USE_EXT4 is set
CaptainThrowback Nov 19, 2021
0c4e6b8
Fix build in 5.1 tree
CaptainThrowback Nov 20, 2021
7ae713a
One more path fix for partitionmanager
CaptainThrowback Nov 20, 2021
66c9fb4
twrpRepacker: override slot back after flashing
nebrassy Nov 21, 2021
60642f0
postinstall: fix logcat causing build to break
CaptainThrowback Nov 22, 2021
4ea0719
Update Russian language, sync with en.xml
Ctapchuk Nov 13, 2021
8d6dbd8
Russian language: fix spaces
kirillsvc Dec 3, 2021
a763dcd
vold_decrypt: don't update patch level if fastboot booting
CaptainThrowback Dec 7, 2021
2b4b6f0
vold_decrypt: only include patch_level functions with libresetprop
CaptainThrowback Dec 29, 2021
cd15a0b
Change TWRP nano TERM env variable from pcansi to bg1.25
theincognito-inc Dec 25, 2021
b1dab14
vold_decrypt: fix unused function build errors
CaptainThrowback Jan 7, 2022
593f531
Add TW_QCOM_ATS_OFFSET flag to manually set time/date offset
CaptainThrowback Jan 19, 2022
9cf5fe6
System_Property_Get: Allow specifying multiple prop file paths
CaptainThrowback Jan 1, 2022
acb6c5f
theme: move TW_THEME_VERSION to variables.h
CaptainThrowback Jan 29, 2022
4dee05a
theme: clean up TW_THEME_VERSION shell command
CaptainThrowback Jan 29, 2022
e427455
A9: 3.6.1 release
bigbiff Feb 26, 2022
8b6e804
Merge remote-tracking branch 'TeamWin/android-9.0' into amonet
chaosmaster Mar 2, 2022
36e2663
Create devcontainer.json
bialy69-git Dec 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.*.swp
*~
tags
.vscode
148 changes: 129 additions & 19 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,24 @@ LOCAL_SRC_FILES := \
twrpDigestDriver.cpp \
openrecoveryscript.cpp \
tarWrite.c \
twrpAdbBuFifo.cpp
twrpAdbBuFifo.cpp \
twrpRepacker.cpp

ifeq ($(TW_AMONET), true)
LOCAL_SRC_FILES += amonet.cpp
ifneq ($(TW_AMONET_MICROLOADER_SRC),)
LOCAL_SRC_FILES += ../../$(TW_AMONET_MICROLOADER_SRC)
LOCAL_CFLAGS += -DTW_MICROLOADER
endif
endif

ifeq ($(TW_IP_ADDRESS), true)
LOCAL_CFLAGS += -DTW_IP_ADDRESS
endif

ifeq ($(TW_IP_SIDELOAD), true)
LOCAL_CFLAGS += -DTW_IP_SIDELOAD
endif

ifneq ($(TARGET_RECOVERY_REBOOT_SRC),)
LOCAL_SRC_FILES += $(TARGET_RECOVERY_REBOOT_SRC)
Expand Down Expand Up @@ -143,6 +160,10 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libstlport
LOCAL_CFLAGS += -DTW_NO_SHA2_LIBRARY
endif
LOCAL_CFLAGS += -DSDK_VERSION=$(PLATFORM_SDK_VERSION)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 25; echo $$?),0)
LOCAL_CFLAGS += -DUSE_OLD_BASE_INCLUDE
endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libmincrypttwrp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes
Expand All @@ -151,7 +172,7 @@ else
LOCAL_SHARED_LIBRARIES += libcrypto
endif

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 23; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libbase
endif

Expand All @@ -172,12 +193,17 @@ ifeq ($(TW_OEM_BUILD),true)
BOARD_HAS_NO_REAL_SDCARD := true
TW_USE_TOOLBOX := true
TW_EXCLUDE_MTP := true
TW_EXCLUDE_TZDATA := true
TW_EXCLUDE_NANO := true
TW_EXCLUDE_BASH := true
endif

ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 28; echo $$?),0)
LOCAL_CFLAGS += -DUSE_EXT4
LOCAL_C_INCLUDES += system/extras/ext4_utils
LOCAL_C_INCLUDES += system/extras/ext4_utils \
system/extras/ext4_utils/include \
$(commands_TWRP_local_path)/crypto/ext4crypt
LOCAL_SHARED_LIBRARIES += libext4_utils
ifneq ($(wildcard external/lz4/Android.mk),)
#LOCAL_STATIC_LIBRARIES += liblz4
Expand All @@ -193,6 +219,10 @@ ifeq ($(AB_OTA_UPDATER),true)
TWRP_REQUIRED_MODULES += libhardware
endif

ifneq ($(TW_SYSTEM_BUILD_PROP_ADDITIONAL_PATHS),)
LOCAL_CFLAGS += -DTW_SYSTEM_BUILD_PROP_ADDITIONAL_PATHS='"$(TW_SYSTEM_BUILD_PROP_ADDITIONAL_PATHS)"'
endif

LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin

#ifeq ($(TARGET_RECOVERY_UI_LIB),)
Expand All @@ -206,15 +236,18 @@ else
LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_TWRP_LIB)
endif

LOCAL_C_INCLUDES += system/extras/ext4_utils

tw_git_revision := $(shell git -C $(LOCAL_PATH) rev-parse --short=8 HEAD 2>/dev/null)
ifeq ($(shell git -C $(LOCAL_PATH) diff --quiet; echo $$?),1)
tw_git_revision := $(tw_git_revision)-dirty
endif
LOCAL_CFLAGS += -DTW_GIT_REVISION='"$(tw_git_revision)"'

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
ifeq ($(TW_FORCE_USE_BUSYBOX), true)
TW_USE_TOOLBOX := false
else
TW_USE_TOOLBOX := true
endif
ifeq ($(TW_EXCLUDE_MTP),)
LOCAL_SHARED_LIBRARIES += libtwrpmtp-ffs
endif
Expand All @@ -225,13 +258,23 @@ ifeq ($(TW_EXCLUDE_MTP),)
endif
endif

ifeq ($(BOARD_USES_RECOVERY_AS_BOOT), true)
LOCAL_CFLAGS += -DBOARD_USES_RECOVERY_AS_BOOT
endif
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE), true)
LOCAL_CFLAGS += -DBOARD_BUILD_SYSTEM_ROOT_IMAGE
endif

#TWRP Build Flags
ifeq ($(TW_EXCLUDE_MTP),)
LOCAL_CFLAGS += -DTW_HAS_MTP
endif
ifneq ($(TW_NO_SCREEN_TIMEOUT),)
LOCAL_CFLAGS += -DTW_NO_SCREEN_TIMEOUT
endif
ifneq ($(TW_NO_SCREEN),)
LOCAL_CFLAGS += -DTW_NO_SCREEN
endif
ifeq ($(BOARD_HAS_NO_REAL_SDCARD), true)
LOCAL_CFLAGS += -DBOARD_HAS_NO_REAL_SDCARD
endif
Expand Down Expand Up @@ -259,6 +302,15 @@ endif
ifeq ($(TW_NO_REBOOT_BOOTLOADER), true)
LOCAL_CFLAGS += -DTW_NO_REBOOT_BOOTLOADER
endif
ifeq ($(TW_AMONET), true)
LOCAL_CFLAGS += -DTW_AMONET
endif
ifeq ($(TW_HACKED_BL_BUTTON), true)
LOCAL_CFLAGS += -DTW_HACKED_BL_BUTTON
endif
ifeq ($(TW_BOOT_MENU), true)
LOCAL_CFLAGS += -DTW_BOOT_MENU
endif
ifeq ($(TW_NO_REBOOT_RECOVERY), true)
LOCAL_CFLAGS += -DTW_NO_REBOOT_RECOVERY
endif
Expand Down Expand Up @@ -333,6 +385,9 @@ ifeq ($(TW_INCLUDE_CRYPTO), true)
endif
ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),)
ifneq ($(TW_CRYPTO_USE_SYSTEM_VOLD),false)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
TW_INCLUDE_LIBRESETPROP := true
endif
LOCAL_CFLAGS += -DTW_CRYPTO_USE_SYSTEM_VOLD
LOCAL_STATIC_LIBRARIES += libvolddecrypt
endif
Expand Down Expand Up @@ -395,9 +450,32 @@ ifneq ($(TW_DEFAULT_LANGUAGE),)
else
LOCAL_CFLAGS += -DTW_DEFAULT_LANGUAGE=en
endif
ifneq ($(TW_QCOM_ATS_OFFSET),)
LOCAL_CFLAGS += -DTW_QCOM_ATS_OFFSET=$(TW_QCOM_ATS_OFFSET)
endif
ifneq ($(TW_CLOCK_OFFSET),)
LOCAL_CFLAGS += -DTW_CLOCK_OFFSET=$(TW_CLOCK_OFFSET)
endif
ifneq ($(TW_OVERRIDE_SYSTEM_PROPS),)
TW_INCLUDE_LIBRESETPROP := true
LOCAL_CFLAGS += -DTW_OVERRIDE_SYSTEM_PROPS=$(TW_OVERRIDE_SYSTEM_PROPS)
endif
ifneq ($(TW_INCLUDE_LIBRESETPROP),)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
$(warning libresetprop is not available for android < 7)
else
LOCAL_SHARED_LIBRARIES += libresetprop
LOCAL_C_INCLUDES += external/magisk-prebuilt/include
LOCAL_CFLAGS += -DTW_INCLUDE_LIBRESETPROP
endif
endif
ifeq ($(TW_EXCLUDE_NANO), true)
LOCAL_CFLAGS += -DTW_EXCLUDE_NANO
endif
ifneq ($(TW_DEFAULT_BACKUP_LIST),)
LOCAL_CFLAGS += -DTW_DEFAULT_BACKUP_LIST=$(TW_DEFAULT_BACKUP_LIST)
endif

TWRP_REQUIRED_MODULES += \
dump_image \
erase_image \
Expand Down Expand Up @@ -427,9 +505,9 @@ else
endif
ifneq ($(TW_USE_TOOLBOX), true)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
LOCAL_POST_INSTALL_CMD := \
$(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin && \
ln -sf /sbin/busybox $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh
LOCAL_POST_INSTALL_CMD += \
$(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin; \
ln -sf /sbin/busybox $(TARGET_RECOVERY_ROOT_OUT)/sbin/sh;
endif
else
ifneq ($(wildcard external/toybox/Android.mk),)
Expand Down Expand Up @@ -483,6 +561,32 @@ ifeq ($(TWRP_INCLUDE_LOGCAT), true)
TWRP_REQUIRED_MODULES += logcat
ifeq ($(TARGET_USES_LOGD), true)
TWRP_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 28; echo $$?),0)
TWRP_REQUIRED_MODULES += event-log-tags
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
LOCAL_POST_INSTALL_CMD += \
mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system_root/system/etc; \
cp -f $(TARGET_OUT_ETC)/event-log-tags $(TARGET_RECOVERY_ROOT_OUT)/system_root/system/etc/;
else
LOCAL_POST_INSTALL_CMD += \
mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc; \
cp -f $(TARGET_OUT_ETC)/event-log-tags $(TARGET_RECOVERY_ROOT_OUT)/system/etc/;
endif
endif
endif
endif
ifneq ($(TW_EXCLUDE_TZDATA), true)
TWRP_REQUIRED_MODULES += tzdata_twrp
endif
ifneq ($(TW_EXCLUDE_NANO), true)
TWRP_REQUIRED_MODULES += \
nano_twrp \
init.recovery.nano.rc
endif
ifneq ($(TW_EXCLUDE_BASH), true)
ifneq ($(wildcard external/bash/.),)
TWRP_REQUIRED_MODULES += \
bash_twrp
endif
endif
# Allow devices to specify device-specific recovery dependencies
Expand Down Expand Up @@ -517,15 +621,10 @@ endif

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
TWRP_REQUIRED_MODULES += ld.config.txt
ifeq ($(BOARD_VNDK_RUNTIME_DISABLE),true)
LOCAL_POST_INSTALL_CMD += \
sed '0,/^namespace.default.search.paths\s\{1,\}/!b;//a\namespace.default.search.paths += \/sbin' \
$(TARGET_OUT_ETC)/ld.config.vndk_lite.txt > $(TARGET_RECOVERY_ROOT_OUT)/sbin/ld.config.txt;
else
LOCAL_POST_INSTALL_CMD += \
sed '0,/^namespace.default.search.paths\s\{1,\}/!b;//a\namespace.default.search.paths += \/sbin' \
$(TARGET_OUT_ETC)/ld.config.txt > $(TARGET_RECOVERY_ROOT_OUT)/sbin/ld.config.txt;
endif
TWRP_REQUIRED_MODULES += init.recovery.ldconfig.rc
LOCAL_POST_INSTALL_CMD += \
sed 's/\(namespace.default.search.paths\)\s\{1,\}=/namespace.default.search.paths = \/sbin\n\1 +=/' \
$(TARGET_OUT_ETC)/ld.config*.txt > $(TARGET_RECOVERY_ROOT_OUT)/sbin/ld.config.txt;
endif

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25; echo $$?),0)
Expand All @@ -544,6 +643,12 @@ else
LOCAL_ADDITIONAL_DEPENDENCIES += $(TWRP_REQUIRED_MODULES)
endif

TW_THEME_VERSION := $(shell grep TW_THEME_VERSION bootable/recovery/variables.h | cut -d ' ' -f 3)

LOCAL_POST_INSTALL_CMD += \
sed -i "s/{themeversion}/$(TW_THEME_VERSION)/" $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)splash.xml; \
sed -i "s/{themeversion}/$(TW_THEME_VERSION)/" $(TARGET_RECOVERY_ROOT_OUT)$(TWRES_PATH)ui.xml;

include $(BUILD_EXECUTABLE)

# Symlink for file_contexts
Expand All @@ -556,8 +661,8 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
else
LOCAL_ADDITIONAL_DEPENDENCIES := file_contexts.bin
endif
LOCAL_POST_INSTALL_CMD := \
$(hide) cp -f $(PRODUCT_OUT)/obj/ETC/file_contexts.bin_intermediates/file_contexts.concat.tmp $(TARGET_RECOVERY_ROOT_OUT)/file_contexts
LOCAL_POST_INSTALL_CMD += \
cp -f $(PRODUCT_OUT)/obj/ETC/file_contexts.bin_intermediates/file_contexts.concat.tmp $(TARGET_RECOVERY_ROOT_OUT)/file_contexts;

include $(BUILD_PHONY_PACKAGE)

Expand Down Expand Up @@ -875,6 +980,11 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
include $(commands_TWRP_local_path)/libmincrypt/Android.mk
endif

ifneq ($(TW_OZIP_DECRYPT_KEY),)
TWRP_REQUIRED_MODULES += ozip_decrypt
include $(commands_TWRP_local_path)/ozip_decrypt/Android.mk
endif

ifeq ($(TW_INCLUDE_CRYPTO), true)
include $(commands_TWRP_local_path)/crypto/fde/Android.mk
include $(commands_TWRP_local_path)/crypto/scrypt/Android.mk
Expand Down
Loading