From d620b70dac3a3562776f6ee4aa03226fd6b47b8d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 3 Jun 2019 15:06:05 -0400 Subject: [PATCH] migration cleanup --- src/App/Migration/MigrationHelpers.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/App/Migration/MigrationHelpers.cs b/src/App/Migration/MigrationHelpers.cs index bec5b2c36..cc3c00858 100644 --- a/src/App/Migration/MigrationHelpers.cs +++ b/src/App/Migration/MigrationHelpers.cs @@ -25,7 +25,6 @@ namespace Bit.App.Migration return false; } - Log("Start migrating."); Migrating = true; var settingsShim = ServiceContainer.Resolve("settingsShim"); var oldSecureStorageService = ServiceContainer.Resolve( @@ -99,10 +98,10 @@ namespace Bit.App.Migration settingsShim.GetValueOrDefault("push:currentToken", null)); await storageService.SaveAsync(Constants.PushRegisteredTokenKey, settingsShim.GetValueOrDefault("push:registeredToken", null)); - //Log("Migrating 6.9"); - // var lastReg = settingsShim.GetValueOrDefault("push:lastRegistrationDate", DateTime.MinValue); - //Log("Migrating 6.9.1 " + lastReg); - // await storageService.SaveAsync(Constants.PushLastRegistrationDateKey, lastReg); + Log("Migrating 6.9"); + var lastReg = settingsShim.GetValueOrDefault("push:lastRegistrationDate", DateTime.MinValue); + Log("Migrating 6.9.1 = " + lastReg); + await storageService.SaveAsync(Constants.PushLastRegistrationDateKey, lastReg); Log("Migrating 6.10"); await storageService.SaveAsync("rememberedEmail", settingsShim.GetValueOrDefault("other:lastLoginEmail", null)); @@ -166,9 +165,9 @@ namespace Bit.App.Migration if(oldFingerprint) { - await storageService.SaveAsync(Constants.FingerprintUnlockKey, oldFingerprint); + await storageService.SaveAsync(Constants.FingerprintUnlockKey, true); } - else if(!string.IsNullOrWhiteSpace(oldPin) && !oldFingerprint) + else if(!string.IsNullOrWhiteSpace(oldPin)) { var pinKey = await cryptoService.MakePinKeyAysnc(oldPin, oldEmail, oldKdf, oldKdfIterations); var pinProtectedKey = await cryptoService.EncryptAsync(oldKeyBytes, pinKey); @@ -182,7 +181,6 @@ namespace Bit.App.Migration Migrating = false; messagingService.Send("migrated"); var task = Task.Run(() => syncService.FullSyncAsync(true)); - Log("Done migrating."); return true; }