From fefe5915b06a1121d885fba3680dd1b90027fd5d Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Sat, 30 Sep 2017 22:22:13 -0500 Subject: FBE for Pixel 2 Includes various minor fixes for building in Android 8 trees with r23+ tag Update FBE extended header in libtar to version 2 and include the entire ext4_encryption_policy structure now after translating the policy. See this post for more details: https://plus.google.com/u/1/+DeesTroy/posts/i33ygUi7tiu Change-Id: I2af981e51f459b17fcd895fb8c2d3f6c8200e24b --- partition.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'partition.cpp') diff --git a/partition.cpp b/partition.cpp index 8b73f646b..3957c6542 100644 --- a/partition.cpp +++ b/partition.cpp @@ -656,7 +656,9 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) { //ExcludeAll(Mount_Point + "/user_de"); //ExcludeAll(Mount_Point + "/misc/profiles/cur/0"); // might be important later ExcludeAll(Mount_Point + "/misc/gatekeeper"); + ExcludeAll(Mount_Point + "/misc/keystore"); ExcludeAll(Mount_Point + "/drm/kek.dat"); + ExcludeAll(Mount_Point + "/system_de/0/spblob"); // contains data needed to decrypt pixel 2 int retry_count = 3; while (!Decrypt_DE() && --retry_count) usleep(2000); @@ -668,7 +670,12 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) { DataManager::SetValue(TW_IS_FBE, 1); DataManager::SetValue(TW_IS_ENCRYPTED, 1); string filename; - DataManager::SetValue(TW_CRYPTO_PWTYPE, Get_Password_Type(0, filename)); + int pwd_type = Get_Password_Type(0, filename); + if (pwd_type < 0) { + LOGERR("This TWRP does not have synthetic password decrypt support\n"); + pwd_type = 0; // default password + } + DataManager::SetValue(TW_CRYPTO_PWTYPE, pwd_type); DataManager::SetValue(TW_CRYPTO_PASSWORD, ""); DataManager::SetValue("tw_crypto_display", ""); } -- cgit v1.2.3