mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
only set pin when needed. sync after migration
This commit is contained in:
parent
3a691977aa
commit
a78997771f
2 changed files with 9 additions and 5 deletions
|
@ -124,6 +124,7 @@ namespace Bit.App
|
||||||
else if(message.Command == "migrated")
|
else if(message.Command == "migrated")
|
||||||
{
|
{
|
||||||
await Task.Delay(1000);
|
await Task.Delay(1000);
|
||||||
|
SyncIfNeeded();
|
||||||
await SetMainPageAsync();
|
await SetMainPageAsync();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -118,8 +118,8 @@ namespace Bit.App.Migration
|
||||||
await storageService.SaveAsync("rememberedEmail",
|
await storageService.SaveAsync("rememberedEmail",
|
||||||
settingsShim.GetValueOrDefault("other:lastLoginEmail", null));
|
settingsShim.GetValueOrDefault("other:lastLoginEmail", null));
|
||||||
Log("Migrating 6.11");
|
Log("Migrating 6.11");
|
||||||
await storageService.SaveAsync(Constants.FingerprintUnlockKey,
|
var oldFingerprint = settingsShim.GetValueOrDefault("setting:fingerprintUnlockOn", false);
|
||||||
settingsShim.GetValueOrDefault("setting:fingerprintUnlockOn", false));
|
await storageService.SaveAsync(Constants.FingerprintUnlockKey, oldFingerprint);
|
||||||
|
|
||||||
Log("Migrating 7");
|
Log("Migrating 7");
|
||||||
await environmentService.SetUrlsAsync(new Core.Models.Data.EnvironmentUrlData
|
await environmentService.SetUrlsAsync(new Core.Models.Data.EnvironmentUrlData
|
||||||
|
@ -163,9 +163,12 @@ namespace Bit.App.Migration
|
||||||
|
|
||||||
// Save pin
|
// Save pin
|
||||||
|
|
||||||
var pinKey = await cryptoService.MakePinKeyAysnc(oldPin, oldEmail, oldKdf, oldKdfIterations);
|
if(!string.IsNullOrWhiteSpace(oldPin) && !oldFingerprint)
|
||||||
var pinProtectedKey = await cryptoService.EncryptAsync(oldKeyBytes, pinKey);
|
{
|
||||||
await storageService.SaveAsync(Constants.PinProtectedKey, pinProtectedKey.EncryptedString);
|
var pinKey = await cryptoService.MakePinKeyAysnc(oldPin, oldEmail, oldKdf, oldKdfIterations);
|
||||||
|
var pinProtectedKey = await cryptoService.EncryptAsync(oldKeyBytes, pinKey);
|
||||||
|
await storageService.SaveAsync(Constants.PinProtectedKey, pinProtectedKey.EncryptedString);
|
||||||
|
}
|
||||||
|
|
||||||
// Save new authed data
|
// Save new authed data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue