mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-11-29 04:22:22 -05:00
Added serializer precompile to preload step for kdbp files
This commit is contained in:
parent
4cbc4542c2
commit
bb0827ea51
@ -15,6 +15,14 @@ namespace KeePassLib.Serialization
|
|||||||
{
|
{
|
||||||
public const string FileNameExtension = "kdbp";
|
public const string FileNameExtension = "kdbp";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Precompiles the serializer classes for faster first-run execution
|
||||||
|
/// </summary>
|
||||||
|
public static void PrepareSerializer()
|
||||||
|
{
|
||||||
|
RuntimeTypeModel.Default[typeof(PwDatabaseBuffer)].CompileInPlace();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the database pointed to by the specified ioc should be (de)serialised in default (xml) or protocol buffers format.
|
/// Determines whether the database pointed to by the specified ioc should be (de)serialised in default (xml) or protocol buffers format.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -375,6 +375,12 @@ namespace keepass2android
|
|||||||
|
|
||||||
private MemoryStream LoadDbFile()
|
private MemoryStream LoadDbFile()
|
||||||
{
|
{
|
||||||
|
if (KdbpFile.GetFormatToUse(_ioConnection) == KdbxFormat.ProtocolBuffers)
|
||||||
|
{
|
||||||
|
Kp2aLog.Log("Preparing kdbp serializer");
|
||||||
|
KdbpFile.PrepareSerializer();
|
||||||
|
}
|
||||||
|
|
||||||
Kp2aLog.Log("Pre-loading database file starting");
|
Kp2aLog.Log("Pre-loading database file starting");
|
||||||
var fileStorage = App.Kp2a.GetFileStorage(_ioConnection);
|
var fileStorage = App.Kp2a.GetFileStorage(_ioConnection);
|
||||||
var stream = fileStorage.OpenFileForRead(_ioConnection);
|
var stream = fileStorage.OpenFileForRead(_ioConnection);
|
||||||
|
Loading…
Reference in New Issue
Block a user