mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
Restoreも同一本体下記戻しの場合エージングできるように
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@368 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
c238fa7459
commit
34407ba9a2
@ -339,7 +339,18 @@ void CheckAccountTransfered(common::HardwareStateManager& manager, ::std::vector
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s_RestoreState = WAIT_START_TRANSFER_ACCOUNT;
|
// エージングのため同一本体下記書き戻しの場合は本体初期化からはじめる
|
||||||
|
if(EqualsDeviceIdFileandDeviceId(manager).IsSuccess())
|
||||||
|
{
|
||||||
|
CreateTransferAccountFinishedFile();
|
||||||
|
CreateDownloadIvsFinishedFile();
|
||||||
|
CheckWriteFinished(manager, message, goNextStep);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s_RestoreState = WAIT_START_TRANSFER_ACCOUNT;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -838,10 +849,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
|
|||||||
s_PlayedStartCursor = true;
|
s_PlayedStartCursor = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextStep)
|
s_RestoreState = READ_FILELIST;
|
||||||
{
|
|
||||||
s_RestoreState = READ_FILELIST;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -912,10 +920,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
|
|||||||
PlaySound(SOUND_ANNOTATION);
|
PlaySound(SOUND_ANNOTATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextStep)
|
s_RestoreState = READ_FILELIST;
|
||||||
{
|
|
||||||
s_RestoreState = READ_FILELIST;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1313,10 +1318,10 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
|
|||||||
s_PlayedRebootCursor = true;
|
s_PlayedRebootCursor = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextStep)
|
// リストア状態チェックファイルをすべて削除
|
||||||
{
|
DeleteAllCheckFiles();
|
||||||
s_RestoreState = REBOOTING;
|
|
||||||
}
|
s_RestoreState = REBOOTING;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -129,30 +129,27 @@ void Util::Initialize()
|
|||||||
|
|
||||||
// エージング回数の変更
|
// エージング回数の変更
|
||||||
SdMountManager::Mount();
|
SdMountManager::Mount();
|
||||||
size_t bufSize = GetAllocatableSize();
|
const size_t BUF_SIZE = 1024;
|
||||||
common::HeapManager heap(bufSize);
|
u8* buf[BUF_SIZE];
|
||||||
void* buf = heap.GetAddr();
|
common::SdReaderWriter sdReaderWriter;
|
||||||
if (buf != NULL)
|
size_t readSize;
|
||||||
|
result = sdReaderWriter.ReadBufWithCmac(common::AGING_COUNTER_PATHNAME, buf, BUF_SIZE, &readSize);
|
||||||
|
if (result.IsSuccess())
|
||||||
{
|
{
|
||||||
common::SdReaderWriter sdReaderWriter;
|
// SDから読み出し成功
|
||||||
|
std::memcpy(&m_AgingCounter, buf, readSize);
|
||||||
size_t readSize;
|
m_AgingCounter++;
|
||||||
result = sdReaderWriter.ReadBufWithCmac(common::AGING_COUNTER_PATHNAME, buf, bufSize, &readSize);
|
result = sdReaderWriter.WriteBufWithCmac(common::AGING_COUNTER_PATHNAME, &m_AgingCounter,
|
||||||
if(result.IsSuccess())
|
sizeof(m_AgingCounter));
|
||||||
{
|
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
||||||
// SDから読み出し成功
|
}
|
||||||
std::memcpy(&m_AgingCounter, buf, readSize);
|
else
|
||||||
m_AgingCounter++;
|
{
|
||||||
result = sdReaderWriter.WriteBufWithCmac(common::AGING_COUNTER_PATHNAME, &m_AgingCounter, sizeof(m_AgingCounter));
|
// 初期値
|
||||||
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
m_AgingCounter = 1;
|
||||||
}
|
result = sdReaderWriter.WriteBufWithCmac(common::AGING_COUNTER_PATHNAME, &m_AgingCounter,
|
||||||
else
|
sizeof(m_AgingCounter));
|
||||||
{
|
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
||||||
// 初期値
|
|
||||||
m_AgingCounter = 1;
|
|
||||||
result = sdReaderWriter.WriteBufWithCmac(common::AGING_COUNTER_PATHNAME, &m_AgingCounter, sizeof(m_AgingCounter));
|
|
||||||
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SdMountManager::Unmount();
|
SdMountManager::Unmount();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user