ORS engine fixes
Fix backup to not error when a non-existant partition is given.
Fix restore to run when no partition parameters are given.
Ensure that ORS runs after decryption and that zips install.
Fix a problem with the fake internal sdcard not mounting to
/sdcard on data media devices.
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index 1472149..4fbb678 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -103,6 +103,7 @@
}
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 @@
// 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 @@
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");