added tests for kdb writing, fixed issue with syncing (keep UUIDs when loading again)

This commit is contained in:
Philipp Crocoll
2015-02-07 20:54:13 +01:00
parent 3506e253db
commit bc235b3ba5
17 changed files with 253 additions and 100 deletions

View File

@@ -218,8 +218,10 @@ namespace keepass2android
pwImp.New(new IOConnectionInfo(), pwDatabase.MasterKey);
pwImp.MemoryProtection = pwDatabase.MemoryProtection.CloneDeep();
pwImp.MasterKey = pwDatabase.MasterKey;
KdbxFile kdbx = new KdbxFile(pwImp);
kdbx.Load(GetStreamForBaseFile(fileStorage, ioc), KdbpFile.GetFormatToUse(ioc), null);
var stream = GetStreamForBaseFile(fileStorage, ioc);
_app.GetDb().DatabaseFormat.PopulateDatabaseFromStream(pwImp, stream, null);
pwDatabase.MergeIn(pwImp, PwMergeMethod.Synchronize, null);