From 91393700ff99224aa8b347bb4ff89b88721b6ab0 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Fri, 28 Jul 2023 04:07:43 +0300 Subject: [PATCH] nyx: use restore/emummc folder for restoring In order to avoid mistakes, emuMMC can now only be restored from `backup/{emmc_sn}/restore/emummc`. --- nyx/nyx_gui/frontend/fe_emmc_tools.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/nyx/nyx_gui/frontend/fe_emmc_tools.c b/nyx/nyx_gui/frontend/fe_emmc_tools.c index dcbf1e6..4bd498f 100644 --- a/nyx/nyx_gui/frontend/fe_emmc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emmc_tools.c @@ -778,6 +778,7 @@ void dump_emmc_selected(emmcPartType_t dumpType, emmc_tool_gui_t *gui) char sdPath[OUT_FILENAME_SZ]; // Create Restore folders, if they do not exist. emmcsn_path_impl(sdPath, "/restore", "", &emmc_storage); + emmcsn_path_impl(sdPath, "/restore/emummc", "", &emmc_storage); emmcsn_path_impl(sdPath, "/restore/partitions", "", &emmc_storage); // Set folder to backup/{emmc_sn}. @@ -1431,8 +1432,10 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui) int i = 0; char sdPath[OUT_FILENAME_SZ]; - - emmcsn_path_impl(sdPath, "/restore", "", &emmc_storage); + if (!gui->raw_emummc) + emmcsn_path_impl(sdPath, "/restore", "", &emmc_storage); + else + emmcsn_path_impl(sdPath, "/restore/emummc", "", &emmc_storage); gui->base_path = (char *)malloc(strlen(sdPath) + 1); strcpy(gui->base_path, sdPath); @@ -1464,7 +1467,10 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui) emmc_set_partition(i + 1); - emmcsn_path_impl(sdPath, "/restore", bootPart.name, &emmc_storage); + if (!gui->raw_emummc) + emmcsn_path_impl(sdPath, "/restore", bootPart.name, &emmc_storage); + else + emmcsn_path_impl(sdPath, "/restore/emummc", bootPart.name, &emmc_storage); res = _restore_emmc_part(gui, sdPath, i, &emmc_storage, &bootPart, false); if (!res) @@ -1530,7 +1536,10 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui) manual_system_maintenance(true); i++; - emmcsn_path_impl(sdPath, "/restore", rawPart.name, &emmc_storage); + if (!gui->raw_emummc) + emmcsn_path_impl(sdPath, "/restore", rawPart.name, &emmc_storage); + else + emmcsn_path_impl(sdPath, "/restore/emummc", rawPart.name, &emmc_storage); res = _restore_emmc_part(gui, sdPath, 2, &emmc_storage, &rawPart, true); if (!res)