Skip to content

Commit

Permalink
Fix #24
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelelz committed Aug 24, 2019
1 parent 1f3343b commit edf418a
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions WinHelloUnlock/UWPLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,20 +369,23 @@ internal static async Task UnlockDatabase(IOConnectionInfo ioInfo)
KeyList keyList = await RetrieveKeys(dbPath, retrievalResult);

CompositeKey compositeKey = Library.ConvertToComposite(keyList);
WinHelloUnlockExt.opened = true;
WinHelloUnlockExt.Host.MainWindow.OpenDatabase(ioInfo, compositeKey, true);
string oPath = Library.CharChange(WinHelloUnlockExt.Host.Database.IOConnectionInfo.Path);
if (oPath != dbPath)
++WinHelloUnlockExt.tries;
if (compositeKey != null)
{
string str = WinHelloUnlockExt.ProductName + " could not unlock this database." +
" MasterKey may have changed. Delete " + WinHelloUnlockExt.ProductName + " data?";
if (MessageService.AskYesNo(str, WinHelloUnlockExt.ShortProductName))
DeleteHelloData(dbPath);
WinHelloUnlockExt.Host.MainWindow.OpenDatabase(ioInfo, null, false);
}
compositeKey = null;

keyList = new KeyList(null, null);
WinHelloUnlockExt.Host.MainWindow.OpenDatabase(ioInfo, compositeKey, true);
string oPath = Library.CharChange(WinHelloUnlockExt.Host.Database.IOConnectionInfo.Path);
if (oPath != dbPath)
{
string str = WinHelloUnlockExt.ProductName + " could not unlock this database." +
" MasterKey may have changed. Delete " + WinHelloUnlockExt.ProductName + " data?";
if (MessageService.AskYesNo(str, WinHelloUnlockExt.ShortProductName))
DeleteHelloData(dbPath);
WinHelloUnlockExt.Host.MainWindow.OpenDatabase(ioInfo, null, false);
}
compositeKey = null;

keyList = new KeyList(null, null);
} else WinHelloUnlockExt.Host.MainWindow.OpenDatabase(ioInfo, null, false);
}
else
{
Expand Down

0 comments on commit edf418a

Please sign in to comment.