プリインストールアプリダウンロードモードでインターネット設定を元に戻すように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@608 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2012-01-26 06:20:58 +00:00
parent 487b92c8f2
commit 14d6ed5209
4 changed files with 38 additions and 26 deletions

View File

@ -1530,6 +1530,9 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
{
s_RestoreState = WAIT_SD_EJECT;
// インターネット設定を元に戻す
RestoreCurrentInternetSetting();
// リストア状態チェックファイルをすべて削除
DeleteAllCheckFiles();
}
@ -1770,6 +1773,10 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
{
NN_LOG("AP Setting Exists. OK\n");
COMMON_LOGGER("Download PreInstalled Application failed\n");
// インターネット設定を元に戻す
RestoreCurrentInternetSetting();
ChangeState(saved, s_RestoreState, FAIL);
}
else
@ -1858,6 +1865,9 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
if (ExistsAPSetting())
{
NN_LOG("AP Setting Exists. OK\n");
// インターネット設定を元に戻す
RestoreCurrentInternetSetting();
if(s_PreinstallTitleDownloadSuccess)
{
COMMON_LOGGER("Download PreInstalled Application done\n");

View File

@ -1988,6 +1988,31 @@ void RepairSimpleAddress()
}
}
void RestoreCurrentInternetSetting()
{
COMMON_LOGGER("Restore Current Internet Setting\n");
nn::Result result;
if (GetTempNetworkSetting()->isValid)
{
result = nn::ac::CTR::UpdateNetworkSetting(0, GetTempNetworkSetting()->setting);
COMMON_LOGGER_RESULT_IF_FAILED(result);
}
else
{
// 無効の場合は消去しておく
result = nn::ac::CTR::RemoveNetworkSetting(0);
COMMON_LOGGER_RESULT_IF_FAILED(result);
}
result = nn::ac::FlushNetworkSetting();
COMMON_LOGGER_RESULT_IF_FAILED(result);
result = nn::ac::FinalizeInternal();
COMMON_LOGGER_RESULT_IF_FAILED(result);
}
nn::Result ImportData()
{
static nn::Result result = nn::ResultSuccess();

View File

@ -118,6 +118,9 @@ char* GetNtpServerName();
// 先にReadSettingが成功している必要がある
TimeZone GetTimeZone();
// インターネット設定をユーザの設定に戻す
void RestoreCurrentInternetSetting();
struct CheckedNetworkSetting
{
nn::ac::CTR::NetworkSetting setting;

View File

@ -238,29 +238,6 @@ bool GetNtpTime(u32* ntpTime)
return retval;
}
void RestoreCurrentInternetSetting()
{
COMMON_LOGGER("Restore Current Internet Setting\n");
nn::Result result;
if (GetTempNetworkSetting()->isValid)
{
result = nn::ac::CTR::UpdateNetworkSetting(0, GetTempNetworkSetting()->setting);
COMMON_LOGGER_RESULT_IF_FAILED(result);
}
else
{
// 無効の場合は消去しておく
result = nn::ac::CTR::RemoveNetworkSetting(0);
COMMON_LOGGER_RESULT_IF_FAILED(result);
}
result = nn::ac::FlushNetworkSetting();
COMMON_LOGGER_RESULT_IF_FAILED(result);
result = nn::ac::FinalizeInternal();
COMMON_LOGGER_RESULT_IF_FAILED(result);
}
}
void NtpThreadFunc()
@ -298,9 +275,6 @@ void NtpThreadFunc()
COMMON_LOGGER("Failed Get Ntp Time\n");
s_NtpSyncSuccessed = false;
}
// インターネット設定を元に戻す
RestoreCurrentInternetSetting();
}
bool IsTimeAdjustFinished()