apex: unmount flattened apex directory before installing zips

Change-Id: Idd1cadedcab94e81e30a487bd09f9173e5fe577e
This commit is contained in:
bigbiff
2021-06-26 19:00:30 +00:00
parent d8a0ef78b7
commit ab036619a4
3 changed files with 7 additions and 0 deletions
+5
View File
@@ -400,6 +400,11 @@ int GUIAction::flash_zip(std::string filename, int* wipe_cache)
if (simulate) {
simulate_progress_bar();
} else {
char apex_enabled[PROPERTY_VALUE_MAX];
property_get("twrp.apex.flattened", apex_enabled, "");
if (strcmp(apex_enabled, "true") == 0) {
umount("/apex");
}
ret_val = TWinstall_zip(filename.c_str(), wipe_cache, (bool) !DataManager::GetIntValue(TW_SKIP_DIGEST_CHECK_ZIP_VAR));
PartitionManager.Unlock_Block_Partitions();
// Now, check if we need to ensure TWRP remains installed...
+1
View File
@@ -45,6 +45,7 @@ bool twrpApex::loadApexImages() {
LOGERR("Unable to bind mount flattened apex directory\n");
return false;
}
android::base::SetProperty("twrp.apex.flattened", "true");
return true;
}
if (!mountApexOnLoopbackDevices(apexFiles)) {
+1
View File
@@ -15,6 +15,7 @@
#include <sys/sysmacros.h>
#include <fcntl.h>
#include <unistd.h>
#include <android-base/properties.h>
#include <ziparchive/zip_archive.h>
#include "twcommon.h"