mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
中途半端なNAND書き込み状態で起動しないように、やっぱりIVSの書き込みはNAND書き込み完了後にする
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@350 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
06778aee07
commit
82ee9cbffa
@ -1260,10 +1260,19 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
|
|||||||
case POST_RESTORE:
|
case POST_RESTORE:
|
||||||
{
|
{
|
||||||
operationMessage.push_back(::std::string("Post Process..."));
|
operationMessage.push_back(::std::string("Post Process..."));
|
||||||
// 書き込み完了ファイルを作成
|
|
||||||
CreateWriteFinishedFile();
|
|
||||||
|
|
||||||
s_RestoreState = RESTORE_DONE;
|
// SDカードのIVSファイルを書き込む
|
||||||
|
if(ImportIvsData())
|
||||||
|
{
|
||||||
|
// 書き込み完了ファイルを作成
|
||||||
|
CreateWriteFinishedFile();
|
||||||
|
|
||||||
|
s_RestoreState = RESTORE_DONE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s_RestoreState = FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -690,6 +690,11 @@ nn::Result ImportIvs()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ImportIvsData()
|
||||||
|
{
|
||||||
|
return ImportIvs().IsSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
void ImportThreadFunc()
|
void ImportThreadFunc()
|
||||||
{
|
{
|
||||||
nn::Result result;
|
nn::Result result;
|
||||||
@ -1856,10 +1861,6 @@ nn::Result ImportData()
|
|||||||
// NANDのごみを削除する
|
// NANDのごみを削除する
|
||||||
Cleanup();
|
Cleanup();
|
||||||
|
|
||||||
// SDカードのIVSファイルを書き込む
|
|
||||||
result = ImportIvs();
|
|
||||||
NN_UTIL_RETURN_IF_FAILED(result);
|
|
||||||
|
|
||||||
// NORデータを書き込む
|
// NORデータを書き込む
|
||||||
result = ImportNorData();
|
result = ImportNorData();
|
||||||
NN_UTIL_RETURN_IF_FAILED(result);
|
NN_UTIL_RETURN_IF_FAILED(result);
|
||||||
|
|||||||
@ -154,6 +154,9 @@ nn::Result ReadVersionData();
|
|||||||
// SDカードのNintendo 3DS以下ににIVSと一致するディレクトリがあるかどうか
|
// SDカードのNintendo 3DS以下ににIVSと一致するディレクトリがあるかどうか
|
||||||
bool ExistsIvsDirectory(std::string& ivsRoot);
|
bool ExistsIvsDirectory(std::string& ivsRoot);
|
||||||
|
|
||||||
|
// SDカードのIVSデータを書き込む
|
||||||
|
bool ImportIvsData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* IMPORTER_H_ */
|
#endif /* IMPORTER_H_ */
|
||||||
|
|||||||
@ -806,15 +806,12 @@ bool ConfirmFile(nn::fs::FileInputStream* from_file, nn::fs::FileStream* to_file
|
|||||||
NN_LOG("Verification Success %s, Rename\n", GetCharStr(sdPath));
|
NN_LOG("Verification Success %s, Rename\n", GetCharStr(sdPath));
|
||||||
// 書き込み先を削除する
|
// 書き込み先を削除する
|
||||||
result = nn::fs::TryDeleteFile(truePath);
|
result = nn::fs::TryDeleteFile(truePath);
|
||||||
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
|
||||||
// 正しいファイル名にリネームする
|
// 正しいファイル名にリネームする
|
||||||
|
|
||||||
|
|
||||||
result = nn::fs::TryRenameFile(tmpPath, truePath);
|
result = nn::fs::TryRenameFile(tmpPath, truePath);
|
||||||
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
||||||
if (result.IsFailure())
|
if (result.IsFailure())
|
||||||
{
|
{
|
||||||
COMMON_LOGGER_RESULT_IF_FAILED(result);
|
|
||||||
s_FinishedFileSize -= nandFileSize;
|
s_FinishedFileSize -= nandFileSize;
|
||||||
ret_value = false;
|
ret_value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user