Skip to content

Commit

Permalink
FBE: set TW_IS_FBE based on whether key version path exists
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
CaptainThrowback authored and bigbiff committed Jun 10, 2020
1 parent 2702094 commit cf0dffc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,10 +723,10 @@ 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
Is_FBE = true;
DataManager::SetValue(TW_IS_FBE, 1);
ExcludeAll(Mount_Point + "/convert_fbe");
ExcludeAll(Mount_Point + "/unencrypted");
ExcludeAll(Mount_Point + "/misc/vold/user_keys");
Expand Down Expand Up @@ -777,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;
}

Expand Down

0 comments on commit cf0dffc

Please sign in to comment.