mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Create DB works correctly
Sample data moved to application Tests updated (still not working - splat) WIP
This commit is contained in:
@@ -34,6 +34,25 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .NET Framework is automatically included -->
|
||||
<None Include="Libs\Windows.winmd" />
|
||||
|
@@ -31,6 +31,8 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
public bool IsOpen => (_pwDatabase?.IsOpen).GetValueOrDefault();
|
||||
public string Name => _pwDatabase?.Name;
|
||||
public string RootGroupId => _pwDatabase?.RootGroup.Uuid.ToHexString();
|
||||
|
||||
// TODO: find a correct place for this
|
||||
public string FileAccessToken { get; set; }
|
||||
|
||||
// Settings
|
||||
@@ -111,16 +113,18 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
await Open(file, _credentials);
|
||||
}
|
||||
|
||||
public async Task Create(byte[] file, Credentials credentials, DatabaseVersion version = DatabaseVersion.V2)
|
||||
public async Task Create(Credentials credentials, string name, DatabaseVersion version = DatabaseVersion.V2)
|
||||
{
|
||||
try
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
var compositeKey = CreateCompositeKey(credentials);
|
||||
var ioConnection = IOConnectionInfo.FromByteArray(file);
|
||||
var ioConnection = IOConnectionInfo.FromByteArray(new byte[] {});
|
||||
|
||||
_pwDatabase.New(ioConnection, compositeKey);
|
||||
_pwDatabase.Name = name;
|
||||
_pwDatabase.RootGroup.Name = name;
|
||||
|
||||
switch (version)
|
||||
{
|
||||
|
@@ -14,10 +14,9 @@ namespace ModernKeePass.Infrastructure.UWP
|
||||
|
||||
public int EntryCount => _mru.Entries.Count;
|
||||
|
||||
public async Task<FileInfo> Get(string token)
|
||||
public async Task<FileInfo> Get(string token, bool updateAccessTime = false)
|
||||
{
|
||||
var recentEntry = _mru.Entries.FirstOrDefault(e => e.Token == token);
|
||||
var file = await _mru.GetFileAsync(token);
|
||||
var file = await _mru.GetFileAsync(token, updateAccessTime ? AccessCacheOptions.None : AccessCacheOptions.SuppressAccessTimeUpdate);
|
||||
StorageApplicationPermissions.FutureAccessList.AddOrReplace(token, file);
|
||||
return new FileInfo
|
||||
{
|
||||
|
Reference in New Issue
Block a user