diff --git a/crypto/ext4crypt/Decrypt.cpp b/crypto/ext4crypt/Decrypt.cpp index d486aa4a..3f82aa17 100755 --- a/crypto/ext4crypt/Decrypt.cpp +++ b/crypto/ext4crypt/Decrypt.cpp @@ -1203,7 +1203,9 @@ int Get_Password_Type(const userid_t user_id, std::string& filename) { } if (pwd.password_type == 1) // In Android this means pattern return 2; // In TWRP this means pattern - else if (pwd.password_type == 2) // In Android this means PIN or password + // In Android <11 type 2 is PIN or password + // In Android 11 type 3 is PIN and type 4 is password + else if (pwd.password_type > 1) return 1; // In TWRP this means PIN or password return 0; // We'll try the default password #else diff --git a/crypto/fscrypt/Decrypt.cpp b/crypto/fscrypt/Decrypt.cpp index ef46535f..44eae081 100755 --- a/crypto/fscrypt/Decrypt.cpp +++ b/crypto/fscrypt/Decrypt.cpp @@ -1045,7 +1045,9 @@ int Get_Password_Type(const userid_t user_id, std::string& filename) { printf("password type: pattern\n"); return 2; // In TWRP this means pattern } - else if (pwd.password_type == 2) { // In Android this means PIN or password + // In Android <11 type 2 is PIN or password + // In Android 11 type 3 is PIN and type 4 is password + else if (pwd.password_type > 1) { printf("password type: pin\n"); return 1; // In TWRP this means PIN or password }