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)
This commit is contained in:
Captain Throwback
2020-02-17 16:44:50 -05:00
committed by bigbiff
parent 38ed6a7e82
commit 87d73d6620
+2
View File
@@ -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;
}