客户端rsa,冗余清理,bug修复,安卓build问题
This commit is contained in:
@@ -6,12 +6,19 @@ public static class DailyTaskSaveService
|
||||
{
|
||||
private const string SaveCategory = "daily_task";
|
||||
private const string SaveKey = "runtime";
|
||||
private const string RecoverySlotKey = "daily_task_runtime";
|
||||
|
||||
private static string LegacySaveFilePath
|
||||
{
|
||||
get { return Path.Combine(Application.persistentDataPath, "daily_tasks.json"); }
|
||||
}
|
||||
|
||||
public static bool HasAnyRecoverableState()
|
||||
{
|
||||
return SecureSaveVault.HasAnyRecoverableState(SaveCategory, SaveKey, LegacySaveFilePath)
|
||||
|| LocalRecoveryMirror.HasSlotData(RecoverySlotKey);
|
||||
}
|
||||
|
||||
public static DailyTaskSaveData Load()
|
||||
{
|
||||
try
|
||||
@@ -22,6 +29,12 @@ public static class DailyTaskSaveService
|
||||
return data ?? new DailyTaskSaveData();
|
||||
}
|
||||
|
||||
if (LocalRecoveryMirror.TryLoadJson(RecoverySlotKey, out data) && data != null)
|
||||
{
|
||||
SecureSaveVault.SaveJson(SaveCategory, SaveKey, data, LegacySaveFilePath);
|
||||
return data;
|
||||
}
|
||||
|
||||
return new DailyTaskSaveData();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -41,10 +54,24 @@ public static class DailyTaskSaveService
|
||||
try
|
||||
{
|
||||
SecureSaveVault.SaveJson(SaveCategory, SaveKey, data, LegacySaveFilePath);
|
||||
LocalRecoveryMirror.SaveJson(RecoverySlotKey, data);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"[DailyTaskSaveService] Save failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearPersistentState()
|
||||
{
|
||||
try
|
||||
{
|
||||
SecureSaveVault.Delete(SaveCategory, SaveKey, LegacySaveFilePath);
|
||||
LocalRecoveryMirror.DeleteSlot(RecoverySlotKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"[DailyTaskSaveService] Clear failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user