客户端rsa,冗余清理,bug修复,安卓build问题

This commit is contained in:
FloatGaming
2026-07-14 01:43:49 +08:00
parent fd22501f71
commit f8985d91d2
682 changed files with 4595 additions and 11216 deletions
@@ -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}");
}
}
}
@@ -333,6 +333,21 @@ public sealed class DailyTaskService : MonoBehaviour
return claimedCount;
}
public void ClearPersistentState()
{
InitializeStorageIfNeeded();
pendingEvents.Clear();
pendingOnlineDurationSeconds = 0f;
isGameplayDurationTracking = false;
gameplayDurationRealtimeStart = 0f;
saveData = new DailyTaskSaveData();
EnsureRuntimeCollections();
DailyTaskSaveService.ClearPersistentState();
NotifyTasksChanged();
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (string.Equals(scene.name, MainUiSceneName, StringComparison.OrdinalIgnoreCase))