r720, r719を巻き戻し

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@724 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2013-02-22 06:30:37 +00:00
parent f84545d43b
commit bee874d4c2
3 changed files with 7 additions and 53 deletions

View File

@ -57,8 +57,6 @@ bool s_SkipNupMode = false;
bool s_DownloadPreinstallMode = false;
// 強制プリインストール書き込みモードかどうか
bool s_ForceDownloadPreinstall = false;
// シリアルNo.のチェックを無視するかどうか
bool s_IgnoreSerialNoCheck = false;
// 失敗サウンドを鳴らしたかどうか
bool s_PlayedFailSound = false;
@ -228,7 +226,6 @@ void CheckSdInserted(common::HardwareStateManager& manager, common::OperationMes
void CheckAcAdapter(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckSdWritable(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckApSetting(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckSerialNumber(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckNupExecuted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckDownloadIvs(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
void CheckAccountDeleted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep);
@ -289,9 +286,12 @@ void CheckSdWritable(common::HardwareStateManager& manager, common::OperationMes
// 設定ファイル書式チェック
void CheckApSetting(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{
NN_UNUSED_VAR(manager);
NN_UNUSED_VAR(goNextStep);
if (CheckAndReadAPSetting(message))
{
CheckSerialNumber(manager, message, goNextStep);
s_RestoreState = IMPORT_RTC;
}
else
{
@ -299,50 +299,6 @@ void CheckApSetting(common::HardwareStateManager& manager, common::OperationMess
}
}
// シリアルNo.が一致しているかどうかチェック
void CheckSerialNumber(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{
NN_UNUSED_VAR(message);
NN_UNUSED_VAR(goNextStep);
// SDカードにシリアルナンバーがあるか
if (!common::ExistsSerialNumberFile())
{
s_RestoreState = IMPORT_RTC;
return;
}
// シリアルNo.のチェックを無視するか?
if (s_IgnoreSerialNoCheck)
{
s_RestoreState = IMPORT_RTC;
return;
}
u8 serialInSd[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN];
nn::Result result = ReadSerialNumber(serialInSd);
if (result.IsFailure())
{
s_RestoreState = FAIL;
return;
}
u8* serial;
size_t size;
manager.GetSerialNumber(&serial, &size);
if(std::memcmp(serialInSd, serial, size) == 0)
{
s_RestoreState = IMPORT_RTC;
}
else
{
COMMON_LOGGER("Mismatched Serial Number!!");
s_RestoreState = FAIL;
}
}
// NUP済みかどうかチェック
void CheckNupExecuted(common::HardwareStateManager& manager, common::OperationMessage& message, bool& goNextStep)
{
@ -790,7 +746,7 @@ bool CheckAndReadAPSetting(common::OperationMessage& operationMessage)
if (!s_ReadSettingDone)
{
s_ReadSettingDone = true;
s_ReadSettingIsSuccess = ReadSetting(&s_NupOnlyMode, &s_GetIvsOnlyMode, &s_CheckSdOnlyMode, &s_SkipNupMode, &s_DownloadPreinstallMode, &s_IgnoreSerialNoCheck);
s_ReadSettingIsSuccess = ReadSetting(&s_NupOnlyMode, &s_GetIvsOnlyMode, &s_CheckSdOnlyMode, &s_SkipNupMode, &s_DownloadPreinstallMode);
}
if (s_NupOnlyMode && s_GetIvsOnlyMode
@ -2072,7 +2028,6 @@ void InitializeState()
s_GetIvsOnlyMode = false;
s_CheckSdOnlyMode = false;
s_SkipNupMode = false;
s_IgnoreSerialNoCheck = false;
s_ExecutePreparePreinstallTitleDownload = false;
s_ExecutePreinstallTitleDownload = false;
s_PreinstallTitleDownloadSuccess = false;

View File

@ -1149,7 +1149,7 @@ void ReadSettingFlag(common::ConfigFileLoader* loader, const wchar_t* paramName,
}
}
bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup, bool* dlPreinstall, bool* ignoreSerial)
bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup, bool* dlPreinstall)
{
nn::Result result;
bool retval = true;
@ -1456,7 +1456,6 @@ bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup, bool
ReadSettingFlag(&configfileLoader, L"CHECK_SD", checkSd, "CHECK SD Mode.\n");
ReadSettingFlag(&configfileLoader, L"SKIP_NUP", skipNup, "Skip NUP Mode.\n");
ReadSettingFlag(&configfileLoader, L"DL_PREINSTALL", dlPreinstall, "Download PreInstall Application Mode.\n");
ReadSettingFlag(&configfileLoader, L"IGNORE_SERIAL", ignoreSerial, "Ignore Serial No. mismatch.\n");
configfileLoader.Finalize();

View File

@ -111,7 +111,7 @@ struct TimeZone
};
// ネットワーク設定ファイルを読み込む
bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup, bool* dlPreinstall, bool* ignoreSerial);
bool ReadSetting(bool* nupOnly, bool* getIvs, bool* checkSd, bool* skipNup, bool* dlPreinstall);
// ネットワーク設定ファイルからNTPサーバの名前を取得する
// 先にReadSettingが成功している必要がある