mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
NIMのシステムセーブデータは吸出し後削除するように
ログ出力の整理 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@41 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
8e1461f24d
commit
cf30075a41
@ -34,6 +34,7 @@ typedef enum BackupState
|
||||
EXPORT_TWL_SOUND, // TWLサウンド領域の吸出し中
|
||||
EXPORT_TWL_PHOTO, // TWL写真領域の吸出し中
|
||||
EXPORT_CTR_NAND, // 吸出し中
|
||||
DELETE_NIM, // nimのシステムセーブデータ削除
|
||||
DONE, // 吸出し完了
|
||||
FINISHED, // SDカード抜き完了
|
||||
FAIL // 失敗
|
||||
@ -203,7 +204,7 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
||||
|
||||
if(GetProgress() > 99)
|
||||
{
|
||||
s_BackupState = DONE;
|
||||
s_BackupState = DELETE_NIM;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -212,6 +213,14 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// nimのシステムセーブデータ削除
|
||||
case DELETE_NIM:
|
||||
{
|
||||
DeleteNimSaveData();
|
||||
s_BackupState = DONE;
|
||||
}
|
||||
break;
|
||||
|
||||
// 吸出し完了
|
||||
|
||||
@ -60,13 +60,12 @@ wchar_t s_RootName[256];
|
||||
|
||||
}
|
||||
|
||||
void DeleteTrash()
|
||||
void DeleteTrash(std::wstring currentDirectory)
|
||||
{
|
||||
// TODO: リードオンリーのファイルが消去できない
|
||||
|
||||
COMMON_LOGGER("Delete Trash.\n");
|
||||
|
||||
std::wstring currentDirectory = common::SDMC_ROOT_DIRECTORY_PATH;
|
||||
nn::fs::FileInputStream fis;
|
||||
nn::fs::Directory dir;
|
||||
nn::Result result;
|
||||
@ -353,7 +352,7 @@ void ExportTwlPhotoData()
|
||||
void ExportTwlSoundData()
|
||||
{
|
||||
// 不要なデータを削除する
|
||||
DeleteTrash();
|
||||
DeleteTrash(common::SDMC_ROOT_DIRECTORY_PATH);
|
||||
|
||||
s_ExportThread.Start(WriteTwlSoundData, s_ExportThreadStack);
|
||||
}
|
||||
@ -465,6 +464,26 @@ void WritePlayHistory()
|
||||
historyManager.Export();
|
||||
}
|
||||
|
||||
void DeleteNimSaveData()
|
||||
{
|
||||
nn::Result result;
|
||||
::std::wstring nimSaveDataPath =
|
||||
::std::wstring(common::SDMC_ROOT_DIRECTORY_PATH) +
|
||||
::std::wstring(common::SD_SAVEDATA_ROOT_NAME) +
|
||||
::std::wstring(s_RootName) +
|
||||
::std::wstring(L"/") +
|
||||
std::wstring(common::NIM_SAVEDATA_DIRECTORY_NAME);
|
||||
|
||||
common::SdMountManager::Mount();
|
||||
|
||||
NN_LOG("%ls\n", nimSaveDataPath.c_str());
|
||||
result = nn::fs::TryDeleteDirectoryRecursively(nimSaveDataPath.c_str());
|
||||
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
||||
|
||||
common::SdMountManager::Unmount();
|
||||
}
|
||||
|
||||
|
||||
void ExportData()
|
||||
{
|
||||
static bool init = true;
|
||||
|
||||
@ -24,6 +24,7 @@ namespace ConsoleBackup
|
||||
void ExportTwlPhotoData();
|
||||
void ExportTwlSoundData();
|
||||
void ExportData();
|
||||
void DeleteNimSaveData();
|
||||
|
||||
u32 GetProgress();
|
||||
bool IsExportFinished();
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
|
||||
|
||||
#define COMMON_LOGGER_RESULT_WITH_LINE(result, line, func) \
|
||||
(void)nn::dbg::detail::Printf("%s\n", func); \
|
||||
(void)nn::dbg::detail::Printf("%d\n", line); \
|
||||
(void)nn::dbg::PrintResult(result); \
|
||||
(void)common::Logger::GetLoggerInstance()->PrintResult("Func = %s\n", func); \
|
||||
|
||||
@ -30,6 +30,7 @@ const wchar_t* const LOG_ROOT_DIRECTORY_PATH = L"sdmc:/CTR_Console_Repair";
|
||||
const wchar_t* const SD_SAVEDATA_ROOT_NAME = L"CTR_Console_Repair/CTRBackup/";
|
||||
const wchar_t* const SD_SAVEDATA_TWL_PHOTO_ROOT_NAME = L"CTR_Console_Repair/TWLPhotoBackup/";
|
||||
const wchar_t* const SD_SAVEDATA_TWL_SOUND_ROOT_NAME = L"CTR_Console_Repair/TWLSoundBackup/";
|
||||
const wchar_t* const NIM_SAVEDATA_DIRECTORY_NAME = L"sysdata/0001002c";
|
||||
const wchar_t* const LOG_PATHNAME = L"CTR_Console_Repair/Migration_Log.txt";
|
||||
const wchar_t* const LOG_FILENAME = L"Migration_Log.txt";
|
||||
const wchar_t* const COUNTRY_SETTING_PATHNAME = L"sdmc:/CTR_Console_Repair/CountrySetting.bin";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user