summaryrefslogtreecommitdiffstats
path: root/openrecoveryscript.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-01-17 02:39:28 +0100
committerDees_Troy <dees_troy@teamw.in>2013-01-17 16:53:49 +0100
commitdc8bc1b28a78fb7371a7aee9ceabf4743b976e10 (patch)
tree6f520c772d9eb96e8a09425a388d94ecf5ea7f6d /openrecoveryscript.cpp
parentFix problems with thread creation on some devices (diff)
downloadandroid_bootable_recovery-dc8bc1b28a78fb7371a7aee9ceabf4743b976e10.tar
android_bootable_recovery-dc8bc1b28a78fb7371a7aee9ceabf4743b976e10.tar.gz
android_bootable_recovery-dc8bc1b28a78fb7371a7aee9ceabf4743b976e10.tar.bz2
android_bootable_recovery-dc8bc1b28a78fb7371a7aee9ceabf4743b976e10.tar.lz
android_bootable_recovery-dc8bc1b28a78fb7371a7aee9ceabf4743b976e10.tar.xz
android_bootable_recovery-dc8bc1b28a78fb7371a7aee9ceabf4743b976e10.tar.zst
android_bootable_recovery-dc8bc1b28a78fb7371a7aee9ceabf4743b976e10.zip
Diffstat (limited to 'openrecoveryscript.cpp')
-rw-r--r--openrecoveryscript.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index 147214931..4fbb6784e 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -103,6 +103,7 @@ int OpenRecoveryScript::run_script_file(void) {
}
if (strcmp(command, "install") == 0) {
// Install Zip
+ PartitionManager.Mount_All_Storage();
ret_val = Install_Command(value);
install_cmd = -1;
} else if (strcmp(command, "wipe") == 0) {
@@ -156,19 +157,19 @@ int OpenRecoveryScript::run_script_file(void) {
// Restore
PartitionManager.Mount_All_Storage();
DataManager_SetIntValue(TW_SKIP_MD5_CHECK_VAR, 0);
+ char folder_path[512], partitions[512];
string val = value, restore_folder, restore_partitions;
size_t pos = val.find_last_of(" ");
if (pos == string::npos) {
- ui_print("Malformed restore parameter: '%s'\n", value1);
- ret_val = 1;
- continue;
+ restore_folder = value;
+ partitions[0] = '\0';
+ } else {
+ restore_folder = val.substr(0, pos);
+ restore_partitions = val.substr(pos + 1, val.size() - pos - 1);
+ strcpy(partitions, restore_partitions.c_str());
}
- restore_folder = val.substr(0, pos);
- char folder_path[512], partitions[512];
strcpy(folder_path, restore_folder.c_str());
- restore_partitions = val.substr(pos + 1, val.size() - pos - 1);
- strcpy(partitions, restore_partitions.c_str());
LOGI("Restore folder is: '%s' and partitions: '%s'\n", folder_path, partitions);
ui_print("Restoring '%s'\n", folder_path);
@@ -277,10 +278,6 @@ int OpenRecoveryScript::run_script_file(void) {
DataManager_SetIntValue(TW_RESTORE_SP2_VAR, 0);
if (DataManager_GetIntValue(TW_RESTORE_SP3_VAR) && !tw_restore_sp3)
DataManager_SetIntValue(TW_RESTORE_SP3_VAR, 0);
- } else {
- ui_print("No restore options set.\n");
- ret_val = 1;
- continue;
}
PartitionManager.Run_Restore(folder_path);
ui_print("Restore complete!\n");