From aa8d517d9b36ef64f06e975f1eae6164be3b3d65 Mon Sep 17 00:00:00 2001 From: bigbiff Date: Fri, 5 Nov 2021 18:58:37 +0000 Subject: [PATCH 01/19] Revert "checkpoint: check checkpoint instead of assuming" This reverts commit c0228607f340461e2e0448fabbba32756d1c2807. Reason for revert: It seems necessary to force checkpoint. Change-Id: I6889027538c0656b3689e008b03c1812317b22e6 --- crypto/fscrypt/MetadataCrypt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/fscrypt/MetadataCrypt.cpp b/crypto/fscrypt/MetadataCrypt.cpp index e9b19672..853e81eb 100755 --- a/crypto/fscrypt/MetadataCrypt.cpp +++ b/crypto/fscrypt/MetadataCrypt.cpp @@ -174,7 +174,7 @@ static bool read_key(const std::string& metadata_key_dir, const KeyGeneration& g unlink(newKeyPath.c_str()); } bool needs_cp = cp_needsCheckpoint(); - if (!retrieveOrGenerateKey(dir, temp, kEmptyAuthentication, gen, key, needs_cp)) return false; + if (!retrieveOrGenerateKey(dir, temp, kEmptyAuthentication, gen, key, true)) return false; if (needs_cp && pathExists(newKeyPath)) std::thread(commit_key, dir).detach(); return true; } From f386d472d82505963f2285b09ebaf97f47ff0fd8 Mon Sep 17 00:00:00 2001 From: Captain Throwback Date: Thu, 4 Nov 2021 15:23:04 -0400 Subject: [PATCH 02/19] crypto: differentiate type for PIN Change-Id: Ic3c384fcc5dc3c71b868a1b45040e74d729c63f0 --- crypto/fscrypt/Decrypt.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/crypto/fscrypt/Decrypt.cpp b/crypto/fscrypt/Decrypt.cpp index 00554715..02173588 100755 --- a/crypto/fscrypt/Decrypt.cpp +++ b/crypto/fscrypt/Decrypt.cpp @@ -1080,15 +1080,21 @@ int Get_Password_Type(const userid_t user_id, std::string& filename) { printf("Failed to Get_Password_Data\n"); return 0; } - if (pwd.password_type == 1) { // In Android this means pattern + // In Android type 1 is pattern + // In Android <11 type 2 is PIN or password + // In Android 11+ type 3 is PIN and type 4 is password + if (pwd.password_type == 2) { + printf("password type: password/PIN\n"); + return 1; // In TWRP this means password or PIN (Android <11) + } else if (pwd.password_type == 4) { + printf("password type: password\n"); + return 1; // In TWRP this means password + } else if (pwd.password_type == 1) { printf("password type: pattern\n"); return 2; // In TWRP this means pattern - } - // 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 + } else if (pwd.password_type == 3) { + printf("password type: PIN\n"); + return 3; // In TWRP this means PIN } printf("using default password\n"); return 0; // We'll try the default password From fec0c3bf53ef16cc3dbca2797dfe4f6abd0cf7a3 Mon Sep 17 00:00:00 2001 From: Captain Throwback Date: Thu, 4 Nov 2021 15:50:36 -0400 Subject: [PATCH 03/19] keyboard: add num template for PIN input Credit for the xml updates: fordownloads (vnukov.d03@gmail.com) MrYacha (yacha@orangefox.tech) Change-Id: Ie776b7de206dbeda122184052d474ebf5fbd7d68 --- gui/theme/common/landscape.xml | 68 +++++++++++++++++++++++++++++++++ gui/theme/common/portrait.xml | 68 +++++++++++++++++++++++++++++++++ gui/theme/common/watch.xml | 65 +++++++++++++++++++++++++++++++ gui/theme/landscape_hdpi/ui.xml | 23 +++++++++++ gui/theme/landscape_mdpi/ui.xml | 23 +++++++++++ gui/theme/portrait_hdpi/ui.xml | 24 ++++++++++++ gui/theme/portrait_mdpi/ui.xml | 24 ++++++++++++ gui/theme/watch_mdpi/ui.xml | 24 ++++++++++++ 8 files changed, 319 insertions(+) diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index da3e3217..f9e3a77e 100755 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -4771,6 +4771,11 @@ edi decrypt_pattern + + + decrypt_pin + + {@mount_hdr=Mount} @@ -4900,6 +4905,69 @@ edi + +