From 812660fd1d49bec7129d4c32a8493038a48385d7 Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Thu, 20 Sep 2012 09:55:17 -0400 Subject: Add and improve OpenRecoveryScript support Improve zip finding in ORS engine Add support for restoring with just a backup name --- recovery.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'recovery.cpp') diff --git a/recovery.cpp b/recovery.cpp index 2d89014c1..8cf31069e 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -56,6 +56,7 @@ extern "C" { } #include "partitions.hpp" #include "variables.h" +#include "openrecoveryscript.hpp" TWPartitionManager PartitionManager; @@ -924,8 +925,19 @@ main(int argc, char **argv) { //if (status != INSTALL_SUCCESS) ui->SetBackground(RecoveryUI::ERROR); if (status != INSTALL_SUCCESS /*|| ui->IsTextVisible()*/) { + finish_recovery(NULL); DataManager_ReadSettingsFile(); - gui_start(); + if (DataManager_GetIntValue(TW_IS_ENCRYPTED) == 0 && OpenRecoveryScript::check_for_script_file()) { + gui_console_only(); + OpenRecoveryScript::run_script_file(); + if (1 || OpenRecoveryScript::run_script_file() != 0) { + // There was an error, boot the recovery + gui_start(); + } else { + usleep(2000000); // Sleep for 2 seconds before rebooting + } + } else + gui_start(); //prompt_and_wait(device); } -- cgit v1.2.3