mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
ModernKeePassLib custom PCL version
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Windows.Storage;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ModernKeePass.ViewModels;
|
||||
using ModernKeePassLib;
|
||||
using ModernKeePassLib.Interfaces;
|
||||
@@ -23,13 +22,14 @@ namespace ModernKeePass.Common
|
||||
{
|
||||
this.databaseFile = databaseFile;
|
||||
}
|
||||
public async Task<string> Open(string password)
|
||||
public string Open(string password)
|
||||
{
|
||||
var key = new CompositeKey();
|
||||
try
|
||||
{
|
||||
key.AddUserKey(new KcpPassword(password));
|
||||
await _pwDatabase.Open(IOConnectionInfo.FromFile(databaseFile), key, new NullStatusLogger());
|
||||
_pwDatabase.Open(IOConnectionInfo.FromFile(databaseFile), key, new NullStatusLogger());
|
||||
//_pwDatabase.Open(IOConnectionInfo.FromPath(databaseFile.Path), key, new NullStatusLogger());
|
||||
IsOpen = _pwDatabase.IsOpen;
|
||||
Name = databaseFile.DisplayName;
|
||||
RootGroup = new GroupVm(_pwDatabase.RootGroup);
|
||||
@@ -42,6 +42,10 @@ namespace ModernKeePass.Common
|
||||
{
|
||||
return "Wrong password";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ex.Message;
|
||||
}
|
||||
/*finally
|
||||
{
|
||||
// TODO: move this when implementing write mode
|
||||
|
@@ -39,7 +39,7 @@ namespace ModernKeePass
|
||||
}
|
||||
}
|
||||
|
||||
private async void openBbutton_Click(object sender, RoutedEventArgs e)
|
||||
private void openBbutton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
/*var database = DataContext as DatabaseVm;
|
||||
database.Open();
|
||||
@@ -47,7 +47,7 @@ namespace ModernKeePass
|
||||
Frame.Navigate(typeof(GroupDetailPage), database.RootGroup);*/
|
||||
var homeVm = DataContext as HomeVm;
|
||||
var app = ((App)Application.Current);
|
||||
homeVm.ErrorMessage = await app.Database.Open(homeVm.Password);
|
||||
homeVm.ErrorMessage = app.Database.Open(homeVm.Password);
|
||||
if (!app.Database.IsOpen) homeVm.NotifyPropertyChanged("ErrorMessage");
|
||||
else Frame.Navigate(typeof(GroupDetailPage), app.Database.RootGroup);
|
||||
}
|
||||
|
@@ -159,8 +159,8 @@
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ModernKeePassLib, Version=2.19.0.26255, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ModernKeePassLib.2.19.0.26255\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
|
||||
<Reference Include="ModernKeePassLib, Version=2.36.0.27373, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ModernKeePassLib.2.36.0.27373\lib\netstandard1.2\ModernKeePassLib.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
@@ -221,7 +221,9 @@
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.0\build\NETStandard.Library.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
@@ -1,12 +1,5 @@
|
||||
using System.ComponentModel;
|
||||
using Windows.Storage;
|
||||
|
||||
using ModernKeePassLib;
|
||||
using ModernKeePassLib.Keys;
|
||||
using ModernKeePassLib.Serialization;
|
||||
using ModernKeePassLib.Interfaces;
|
||||
using Windows.UI.Xaml;
|
||||
using System;
|
||||
|
||||
namespace ModernKeePass.ViewModels
|
||||
{
|
||||
|
@@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="win81" />
|
||||
<package id="Microsoft.Bcl.Compression" version="3.9.85" targetFramework="win81" />
|
||||
<package id="Microsoft.NETCore.Platforms" version="2.0.0" targetFramework="win81" />
|
||||
<package id="Microsoft.NETCore.Portable.Compatibility" version="1.0.2" targetFramework="win81" />
|
||||
<package id="ModernKeePassLib" version="2.19.0.26255" targetFramework="win81" />
|
||||
<package id="ModernKeePassLib" version="2.36.0.27373" targetFramework="win81" />
|
||||
<package id="NETStandard.Library" version="2.0.0" targetFramework="win81" />
|
||||
<package id="System.Net.Requests" version="4.3.0" targetFramework="win81" />
|
||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="win81" />
|
||||
|
Reference in New Issue
Block a user