diff --git a/twrp.cpp b/twrp.cpp index 95e376b5..dac00932 100755 --- a/twrp.cpp +++ b/twrp.cpp @@ -127,7 +127,6 @@ int main(int argc, char **argv) { gui_loadResources(); bool Shutdown = false; - bool SkipDecryption = false; string Send_Intent = ""; { TWPartition* misc = PartitionManager.Find_Partition_By_Path("/misc"); @@ -162,9 +161,6 @@ int main(int argc, char **argv) { string ORSCommand = "install "; ORSCommand.append(ptr); - // If we have a map of blocks we don't need to mount data. - SkipDecryption = *ptr == '@'; - if (!OpenRecoveryScript::Insert_ORS_Command(ORSCommand)) break; } else @@ -232,17 +228,13 @@ int main(int argc, char **argv) { // Offer to decrypt if the device is encrypted if (DataManager::GetIntValue(TW_IS_ENCRYPTED) != 0) { - if (SkipDecryption) { - LOGINFO("Skipping decryption\n"); + LOGINFO("Is encrypted, do decrypt page first\n"); + if (gui_startPage("decrypt", 1, 1) != 0) { + LOGERR("Failed to start decrypt GUI page.\n"); } else { - LOGINFO("Is encrypted, do decrypt page first\n"); - if (gui_startPage("decrypt", 1, 1) != 0) { - LOGERR("Failed to start decrypt GUI page.\n"); - } else { - // Check for and load custom theme if present - TWFunc::check_selinux_support(); - gui_loadCustomResources(); - } + // Check for and load custom theme if present + TWFunc::check_selinux_support(); + gui_loadCustomResources(); } } else if (datamedia) { TWFunc::check_selinux_support(); @@ -266,7 +258,8 @@ int main(int argc, char **argv) { // Run any outstanding OpenRecoveryScript std::string cacheDir = TWFunc::get_cache_dir(); std::string orsFile = cacheDir + "/recovery/openrecoveryscript"; - if ((DataManager::GetIntValue(TW_IS_ENCRYPTED) == 0 || SkipDecryption) && (TWFunc::Path_Exists(SCRIPT_FILE_TMP) || TWFunc::Path_Exists(orsFile))) { + + if (TWFunc::Path_Exists(SCRIPT_FILE_TMP) || (DataManager::GetIntValue(TW_IS_ENCRYPTED) == 0 && TWFunc::Path_Exists(orsFile))) { OpenRecoveryScript::Run_OpenRecoveryScript(); }