From 87d73d6620ea7a848ece78c1ede326f66efb8f2f Mon Sep 17 00:00:00 2001 From: Captain Throwback Date: Mon, 17 Feb 2020 16:44:50 -0500 Subject: [PATCH] FBE: set TW_IS_FBE based on whether key version path exists - Should not be determined by whether support exists in TWRP - Set to 0 by default if FBE is not detected This also prevents the wrappedkey check from running on FDE devices Change-Id: I85d1952facdfafdaa1571fc1b11d4b4b7d9ba48e (cherry picked from commit cf0dffce3413261f149a3565d8f27cb32490ae54) --- partition.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/partition.cpp b/partition.cpp index eec423a4..2d619642 100755 --- a/partition.cpp +++ b/partition.cpp @@ -730,6 +730,7 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) { bool TWPartition::Decrypt_FBE_DE() { if (TWFunc::Path_Exists("/data/unencrypted/key/version")) { + DataManager::SetValue(TW_IS_FBE, 1); LOGINFO("File Based Encryption is present\n"); #ifdef TW_INCLUDE_FBE ExcludeAll(Mount_Point + "/convert_fbe"); @@ -776,6 +777,7 @@ if (TWFunc::Path_Exists("/data/unencrypted/key/version")) { LOGERR("FBE found but FBE support not present in TWRP\n"); #endif } + DataManager::SetValue(TW_IS_FBE, 0); return false; }