客户端rsa,冗余清理,bug修复,安卓build问题
This commit is contained in:
@@ -11,6 +11,7 @@ public static class StoreOwnershipStorage
|
||||
private const string MainFileName = ".own.dat";
|
||||
private const string BackupFileName = ".own.bak";
|
||||
private const string TempFileName = ".own.tmp";
|
||||
private const string RecoverySlotKey = "store_ownership_storage";
|
||||
|
||||
private static string VaultDirectoryPath
|
||||
{
|
||||
@@ -53,9 +54,23 @@ public static class StoreOwnershipStorage
|
||||
return true;
|
||||
}
|
||||
|
||||
if (LocalRecoveryMirror.TryLoadJson(RecoverySlotKey, out payload) && payload != null)
|
||||
{
|
||||
TrySave(payload);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool HasAnyRecoverableState()
|
||||
{
|
||||
return HasAnyVaultFile(MainFileName)
|
||||
|| HasAnyVaultFile(BackupFileName)
|
||||
|| PlayerProgressBackupService.HasStoreOwnershipBackup()
|
||||
|| LocalRecoveryMirror.HasSlotData(RecoverySlotKey);
|
||||
}
|
||||
|
||||
public static bool TrySave(StoreOwnershipPayload payload)
|
||||
{
|
||||
try
|
||||
@@ -77,6 +92,7 @@ public static class StoreOwnershipStorage
|
||||
TryHidePath(MainFilePath);
|
||||
File.Delete(TempFilePath);
|
||||
PlayerProgressBackupService.SaveStoreOwnership(payload);
|
||||
LocalRecoveryMirror.SaveJson(RecoverySlotKey, payload);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -169,6 +185,20 @@ public static class StoreOwnershipStorage
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool HasAnyVaultFile(string fileName)
|
||||
{
|
||||
var candidates = SaveIdentityUtility.GetVaultFilePathVariants(fileName);
|
||||
for (int i = 0; i < candidates.Count; i++)
|
||||
{
|
||||
if (File.Exists(candidates[i]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string BuildEnvelopeJson(StoreOwnershipPayload payload)
|
||||
{
|
||||
payload.lastUpdatedUtcTicks = DateTime.UtcNow.Ticks;
|
||||
|
||||
Reference in New Issue
Block a user