diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp index 6d762986..903bc6c8 100755 --- a/openrecoveryscript.cpp +++ b/openrecoveryscript.cpp @@ -148,8 +148,8 @@ int OpenRecoveryScript::run_script_file(void) { // Wipe if (strcmp(value, "cache") == 0 || strcmp(value, "/cache") == 0) { PartitionManager.Wipe_By_Path("/cache"); - } else if (strcmp(value, PartitionManager.Get_Android_Root_Path().c_str()) == 0 || strcmp(value, PartitionManager.Get_Android_Root_Path().c_str()) == 0) { - PartitionManager.Wipe_By_Path(PartitionManager.Get_Android_Root_Path()); + } else if (strcmp(value, "system") == 0 || strcmp(value, "/system") == 0 || strcmp(value, PartitionManager.Get_Android_Root_Path().c_str()) == 0) { + PartitionManager.Wipe_By_Path("/system"); } else if (strcmp(value, "dalvik") == 0 || strcmp(value, "dalvick") == 0 || strcmp(value, "dalvikcache") == 0 || strcmp(value, "dalvickcache") == 0) { PartitionManager.Wipe_Dalvik_Cache(); } else if (strcmp(value, "data") == 0 || strcmp(value, "/data") == 0 || strcmp(value, "factory") == 0 || strcmp(value, "factoryreset") == 0) { @@ -253,8 +253,8 @@ int OpenRecoveryScript::run_script_file(void) { gui_msg(Msg("set_restore_opt=Setting restore options: '{1}':")(value2)); line_len = strlen(value2); for (i=0; i::iterator iter; string Local_Path = TWFunc::Get_Root_Path(Path); + if (Local_Path == "/system") + Local_Path = Get_Android_Root_Path(); for (iter = Partitions.begin(); iter != Partitions.end(); iter++) { if ((*iter)->Mount_Point == Local_Path || (!(*iter)->Symlink_Mount_Point.empty() && (*iter)->Symlink_Mount_Point == Local_Path)) return (*iter); @@ -1273,8 +1275,12 @@ void TWPartitionManager::Set_Restore_Files(string Restore_Name) { Part->Backup_FileName.resize(Part->Backup_FileName.size() - strlen(extn) + 3); } - if (!Part->Is_SubPartition) - Restore_List += Part->Backup_Path + ";"; + if (!Part->Is_SubPartition) { + if (Part->Backup_Path == Get_Android_Root_Path()) + Restore_List += "/system;"; + else + Restore_List += Part->Backup_Path + ";"; + } } closedir(d); } @@ -1297,6 +1303,8 @@ int TWPartitionManager::Wipe_By_Path(string Path) { bool found = false; string Local_Path = TWFunc::Get_Root_Path(Path); + if (Local_Path == "/system") + Local_Path = Get_Android_Root_Path(); // Iterate through all partitions for (iter = Partitions.begin(); iter != Partitions.end(); iter++) { if ((*iter)->Mount_Point == Local_Path || (!(*iter)->Symlink_Mount_Point.empty() && (*iter)->Symlink_Mount_Point == Local_Path)) {