Treat /vendor like /system for read only
The vendor partition is verity checked just like system so we
should treat vendor as read only same as system.
Change-Id: Ida65c9f44d8610e52fcdcef0b4a50faf5c7110d2
diff --git a/twrp.cpp b/twrp.cpp
index 50db725..ff7d55f 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -345,6 +345,7 @@
#ifndef TW_OEM_BUILD
// Check if system has never been changed
TWPartition* sys = PartitionManager.Find_Partition_By_Path("/system");
+ TWPartition* ven = PartitionManager.Find_Partition_By_Path("/vendor");
if (sys) {
if ((DataManager::GetIntValue("tw_mount_system_ro") == 0 && sys->Check_Lifetime_Writes() == 0) || DataManager::GetIntValue("tw_mount_system_ro") == 2) {
if (DataManager::GetIntValue("tw_never_show_system_ro_page") == 0) {
@@ -354,11 +355,15 @@
}
} else if (DataManager::GetIntValue("tw_mount_system_ro") == 0) {
sys->Change_Mount_Read_Only(false);
+ if (ven)
+ ven->Change_Mount_Read_Only(false);
}
} else if (DataManager::GetIntValue("tw_mount_system_ro") == 1) {
// Do nothing, user selected to leave system read only
} else {
sys->Change_Mount_Read_Only(false);
+ if (ven)
+ ven->Change_Mount_Read_Only(false);
}
}
#endif