From 063d211c62a800738103afb6bfb8bb40641bfe7b Mon Sep 17 00:00:00 2001 From: Fernando Oliveira Date: Thu, 12 Jan 2023 16:12:55 -0300 Subject: [PATCH 1/5] gui: permanence of custom theme after changing TWRP folder After changing the TWRP folder the custom theme was not being found because it was set in the code to the folder "TWRP/theme..." This patch aims to fix that. Signed-off-by: Fernando Oliveira Change-Id: I41e6e1378c74c9ee579b7b23beb37e0c2cd8761a (cherry picked from commit ddaccbe7d411e707307ce0a9c95a36571be38ad7) --- gui/gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/gui.cpp b/gui/gui.cpp index 00aab7ff..5c7d27e1 100755 --- a/gui/gui.cpp +++ b/gui/gui.cpp @@ -816,7 +816,7 @@ extern "C" int gui_loadResources(void) } } - theme_path += "/TWRP/theme/ui.zip"; + theme_path += TWFunc::Check_For_TwrpFolder() + "/theme/ui.zip"; if (check || PageManager::LoadPackage("TWRP", theme_path, "main")) { #endif // ifndef TW_OEM_BUILD @@ -850,7 +850,7 @@ extern "C" int gui_loadCustomResources(void) } std::string theme_path = DataManager::GetSettingsStoragePath(); - theme_path += "/TWRP/theme/ui.zip"; + theme_path += TWFunc::Check_For_TwrpFolder() + "/theme/ui.zip"; // Check for a custom theme if (TWFunc::Path_Exists(theme_path)) { // There is a custom theme, try to load it From 8bc9da5e10d2a2848c6184e17cfe58742641ee95 Mon Sep 17 00:00:00 2001 From: Darth9 Date: Sun, 5 Feb 2023 23:41:03 +0000 Subject: [PATCH 2/5] decryption: solve specific decryption problems on some devices Change-Id: I832c16da3d45888299fd9f96888ed8a85e5d48c9 --- Android.mk | 4 ++++ partition.cpp | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index a0603515..7bbd66ef 100755 --- a/Android.mk +++ b/Android.mk @@ -176,6 +176,10 @@ ifeq ($(TW_NO_BIND_SYSTEM),true) LOCAL_CFLAGS += -DTW_NO_BIND_SYSTEM endif +ifeq ($(TW_PREPARE_DATA_MEDIA_EARLY),true) + LOCAL_CFLAGS += -DTW_PREPARE_DATA_MEDIA_EARLY +endif + LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin ifeq ($(TARGET_RECOVERY_TWRP_LIB),) diff --git a/partition.cpp b/partition.cpp index 294046b5..99f4949e 100755 --- a/partition.cpp +++ b/partition.cpp @@ -665,6 +665,10 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) { UnMount(false); #ifdef TW_INCLUDE_CRYPTO + #ifdef TW_PREPARE_DATA_MEDIA_EARLY + if (datamedia) + Setup_Data_Media(); + #endif Can_Be_Encrypted = true; char crypto_blkdev[255]; property_get("ro.crypto.fs_crypto_blkdev", crypto_blkdev, "error"); @@ -672,8 +676,10 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) { Set_FBE_Status(); Decrypted_Block_Device = crypto_blkdev; LOGINFO("Data already decrypted, new block device: '%s'\n", crypto_blkdev); + #ifndef TW_PREPARE_DATA_MEDIA_EARLY if (datamedia) Setup_Data_Media(); + #endif DataManager::SetValue(TW_IS_ENCRYPTED, 0); } else if (!Mount(false)) { if (Is_Present) { @@ -716,9 +722,10 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) { LOGERR("Unable to decrypt FBE device\n"); } else { DataManager::SetValue(TW_IS_ENCRYPTED, 0); + #ifndef TW_PREPARE_DATA_MEDIA_EARLY if (datamedia) Setup_Data_Media(); - + #endif } } if (datamedia && (!Is_Encrypted || (Is_Encrypted && Is_Decrypted))) { @@ -1231,8 +1238,12 @@ void TWPartition::Setup_Data_Media() { Make_Dir("/sdcard", false); Symlink_Mount_Point = "/sdcard"; } + #ifdef TW_PREPARE_DATA_MEDIA_EARLY + if (Mount(false) && TWFunc::Path_Exists(Mount_Point + "/media/0")) { + #else Mount(false); if (TWFunc::Path_Exists(Mount_Point + "/media/0")) { + #endif Storage_Path = Mount_Point + "/media/0"; Symlink_Path = Storage_Path; DataManager::SetValue(TW_INTERNAL_PATH, Mount_Point + "/media/0"); From e5c5cd40660a63130edd288510427bd4f76b743c Mon Sep 17 00:00:00 2001 From: me-cafebabe Date: Mon, 31 Jul 2023 21:35:01 +0800 Subject: [PATCH 3/5] crypto: fde: Update cryptfs_hw path Change-Id: Ida281721ca4cb94243f4b7f893566754c1cc8f0a --- crypto/fde/Android.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/fde/Android.mk b/crypto/fde/Android.mk index faf7da8d..03f1c5fc 100755 --- a/crypto/fde/Android.mk +++ b/crypto/fde/Android.mk @@ -51,7 +51,7 @@ else endif ifeq ($(TARGET_HW_DISK_ENCRYPTION),true) ifeq ($(TARGET_CRYPTFS_HW_PATH),) - LOCAL_C_INCLUDES += device/qcom/common/cryptfs_hw + LOCAL_C_INCLUDES += vendor/qcom/opensource/cryptfs_hw else LOCAL_C_INCLUDES += $(TARGET_CRYPTFS_HW_PATH) endif @@ -112,7 +112,7 @@ else endif ifeq ($(TARGET_HW_DISK_ENCRYPTION),true) ifeq ($(TARGET_CRYPTFS_HW_PATH),) - LOCAL_C_INCLUDES += device/qcom/common/cryptfs_hw + LOCAL_C_INCLUDES += vendor/qcom/opensource/cryptfs_hw else LOCAL_C_INCLUDES += $(TARGET_CRYPTFS_HW_PATH) endif From 793313176792d0d452c5e7520800ff72f831f8cd Mon Sep 17 00:00:00 2001 From: Captain Throwback Date: Thu, 24 Aug 2023 11:53:24 -0400 Subject: [PATCH 4/5] libxml2: add flag to exclude lib It has been reported that this file causes bootloops on some device(s) Usage: TW_EXCLUDE_LIBXML2 := true Change-Id: I426536cc143b758f6821e5d2fc10ce942c3b1c79 --- prebuilt/Android.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prebuilt/Android.mk b/prebuilt/Android.mk index bb7f89ab..aed16e21 100755 --- a/prebuilt/Android.mk +++ b/prebuilt/Android.mk @@ -197,7 +197,9 @@ ifeq ($(TW_INCLUDE_CRYPTO), true) RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.vibrator-V1-cpp.so RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstatslog.so RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsoft_attestation_cert.so - RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libxml2.so + ifneq ($(TW_EXCLUDE_LIBXML2), true) + RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libxml2.so + endif ifneq ($(wildcard system/keymaster/keymaster_stl.cpp),) RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster_portable.so From 8bd48201c3ed825a0acecc0e6dcf125449ab1ec2 Mon Sep 17 00:00:00 2001 From: Captain Throwback Date: Thu, 24 Aug 2023 11:57:15 -0400 Subject: [PATCH 5/5] lpdump and lptools: make opt-in instead of opt-out These binaries (or dependencies related to them) cause bootloops on some devices Change-Id: I876eea8fc0cbd54fa0e20465ee8e4f699d6b3eaa --- prebuilt/Android.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prebuilt/Android.mk b/prebuilt/Android.mk index aed16e21..6b5490ab 100755 --- a/prebuilt/Android.mk +++ b/prebuilt/Android.mk @@ -241,7 +241,7 @@ ifeq ($(AB_OTA_UPDATER), true) RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.boot@1.1.so endif ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) - ifeq ($(TW_EXCLUDE_LPDUMP),) + ifneq ($(TW_INCLUDE_LPDUMP),) RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/bootctl RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lpdump RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lpdumpd @@ -249,7 +249,7 @@ ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblpdump_interface-V1-cpp.so RECOVERY_LIBRARY_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so endif - ifeq ($(TW_EXCLUDE_LPTOOLS),) + ifneq ($(TW_INCLUDE_LPTOOLS),) RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/lptools endif endif