From 9a4ef26299c920b8b7d5108b910d1dfd1732cece Mon Sep 17 00:00:00 2001 From: Mohd Faraz Date: Sun, 18 Oct 2020 23:58:21 +0530 Subject: [PATCH] Unmount vendor after apex BUG: prebuilt vendor blobs are being overriden by vendor partition, which causes failed to decrypt the device TEST: after this patch vendor is no more overriding and decryption working as expected. * Devices using the stock or the rom based libs then it needed to add the TW_USES_VENDOR_LIBS := true in the BoardConfig Change-Id: I3cbc7fe6df2289081e9198941cfb65a1a7e0e6a3 Signed-off-by: Mohd Faraz --- Android.mk | 4 ++++ partitionmanager.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/Android.mk b/Android.mk index bfd5797c..ef067cc1 100755 --- a/Android.mk +++ b/Android.mk @@ -153,6 +153,10 @@ ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) LOCAL_CFLAGS += -DPRODUCT_USE_DYNAMIC_PARTITIONS=1 endif +ifeq ($(TW_USES_VENDOR_LIBS),true) + LOCAL_CFLAGS += -DUSE_VENDOR_LIBS=1 +endif + ifneq ($(BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST),) BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST := $(BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST) else ifneq ($(BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST),) diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 5c279ab2..d85ae2a8 100755 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -295,6 +295,12 @@ int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error) } } } +#ifndef USE_VENDOR_LIBS + if (ven) + ven->UnMount(true); + if (sys) + sys->UnMount(true); +#endif if (!datamedia && !settings_partition && Find_Partition_By_Path("/sdcard") == NULL && Find_Partition_By_Path("/internal_sd") == NULL && Find_Partition_By_Path("/internal_sdcard") == NULL && Find_Partition_By_Path("/emmc") == NULL) { // Attempt to automatically identify /data/media emulated storage devices