Revert "Add support for multi-user decryption"
This reverts commit 0b25b1d79b79bc4d45dfff2aaf575e10bd24ef2d.
Reason for revert: Changes need to be made to libtwrpfscrypt to include this patchset. Will cherry-pick this patch later and make necessary modifications.
Change-Id: I7601d7b820129709b05d9b4368573b6f1048de02
diff --git a/twrp.cpp b/twrp.cpp
index 22a6b8d..2b84cbb 100755
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -307,11 +307,8 @@
// Offer to decrypt if the device is encrypted
if (DataManager::GetIntValue(TW_IS_ENCRYPTED) != 0) {
- LOGINFO("Is encrypted, do decrypt page first\n");
- if (DataManager::GetIntValue(TW_IS_FBE))
- DataManager::SetValue("tw_crypto_user_id", "0");
- if (gui_startPage("decrypt", 1, 1) != 0) {
- LOGERR("Failed to start decrypt GUI page.\n");
+ if (SkipDecryption) {
+ LOGINFO("Skipping decryption\n");
} else {
LOGINFO("Is encrypted, do decrypt page first\n");
if (gui_startPage("decrypt", 1, 1) != 0) {
@@ -332,7 +329,8 @@
}
// Fixup the RTC clock on devices which require it
- if (crash_counter == 0) TWFunc::Fixup_Time_On_Boot();
+ if (crash_counter == 0)
+ TWFunc::Fixup_Time_On_Boot();
// Read the settings file
TWFunc::Update_Log_File();
@@ -343,9 +341,7 @@
// Run any outstanding OpenRecoveryScript
std::string cacheDir = TWFunc::get_cache_dir();
std::string orsFile = cacheDir + "/recovery/openrecoveryscript";
-
- if (TWFunc::Path_Exists(SCRIPT_FILE_TMP) ||
- (DataManager::GetIntValue(TW_IS_ENCRYPTED) == 0 && TWFunc::Path_Exists(orsFile))) {
+ if ((DataManager::GetIntValue(TW_IS_ENCRYPTED) == 0 || SkipDecryption) && (TWFunc::Path_Exists(SCRIPT_FILE_TMP) || TWFunc::Path_Exists(orsFile))) {
OpenRecoveryScript::Run_OpenRecoveryScript();
}