mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
プリインストールアプリダウンロードモードでインターネット設定を元に戻すように
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:
parent
487b92c8f2
commit
14d6ed5209
@ -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");
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -118,6 +118,9 @@ char* GetNtpServerName();
|
||||
// 先にReadSettingが成功している必要がある
|
||||
TimeZone GetTimeZone();
|
||||
|
||||
// インターネット設定をユーザの設定に戻す
|
||||
void RestoreCurrentInternetSetting();
|
||||
|
||||
struct CheckedNetworkSetting
|
||||
{
|
||||
nn::ac::CTR::NetworkSetting setting;
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user