Skip to content

Commit 3c8f1e3

Browse files
authored
Merge pull request #12 from shugaoye/dev3
Build version 1.3.3
2 parents a7edaad + 2eefc72 commit 3c8f1e3

File tree

15 files changed

+198
-48
lines changed

15 files changed

+198
-48
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "PureOtp"]
2+
path = PureOtp
3+
url = https://github.com/shugaoye/PureOtp.git
4+
branch = passxyz

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Change log
22

3+
### Release 1.3.3
4+
- Improved property `IsUserExist` and Added `Delete` method in `User`
5+
- Support KeePass key file
6+
- Removed dependency on PureOtp
7+
38
### Release 1.3.2
49
- Removed dependencies
510

KPCLib.nuspec

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata>
44
<id>KPCLib</id>
5-
<version>1.3.2.0</version>
5+
<version>1.3.3.0</version>
66
<authors>Roger Ye</authors>
77
<owners>Roger Ye</owners>
88
<requireLicenseAcceptance>false</requireLicenseAcceptance>
99
<license type="expression">LGPL-3.0-or-later</license>
1010
<projectUrl>https://github.com/passxyz/KPCLib</projectUrl>
1111
<description>This is the build of KeePassLib in Xamarin Portable Class Library. Three platforms, UWP, Android and iOS, are supported and tested.</description>
1212
<releaseNotes>
13-
- Updated to KeePass 2.48.1
14-
- Fixed an issue in CryptoRandom.cs
15-
</releaseNotes>
13+
- Updated to KeePass 2.48.1
14+
- Fixed an issue in CryptoRandom.cs
15+
- Support KeePass key file
16+
- Removed dependency on PureOtp
17+
</releaseNotes>
1618
<copyright>Dominik Reichl is the author of the original KeePassLib on Windows platform. Roger Ye updated and enhanced this library for .NET Standard.</copyright>
1719
<repository url="https://github.com/passxyz/KPCLib" />
1820
<dependencies>
1921
<group targetFramework=".NETStandard2.0">
2022
<dependency id="SkiaSharp" version="2.80.2" exclude="Build,Analyzers" />
2123
<dependency id="Svg.Skia" version="0.5.3" exclude="Build,Analyzers" />
22-
<dependency id="PureOtp" version="1.0.0.8" exclude="Build,Analyzers" />
2324
</group>
2425
</dependencies>
2526
<summary>KeePassLib built as .NET Standard Library</summary>
2627
</metadata>
2728
<files>
28-
<file src="PassXYZLib/bin/Release/netstandard2.0/KPCLib.dll" target="lib/netstandard2.0/KPCLib.dll" />
29+
<file src="KPCLib/bin/Release/netstandard2.0/KPCLib.dll" target="lib/netstandard2.0/KPCLib.dll" />
30+
<file src="KPCLib/bin/Release/netstandard2.0/PureOtp.dll" target="lib/netstandard2.0/PureOtp.dll" />
2931
</files>
3032
</package>

KPCLib.sln

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1717
README.md = README.md
1818
EndProjectSection
1919
EndProject
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PureOtp", "PureOtp\PureOtp\PureOtp.csproj", "{6361E2B1-FAC9-4D2E-9876-90A37E516598}"
21+
EndProject
2022
Global
2123
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2224
Debug|Any CPU = Debug|Any CPU
@@ -77,6 +79,22 @@ Global
7779
{E6F6B65A-6474-4978-9F9C-F22194688240}.Release|x64.Build.0 = Release|Any CPU
7880
{E6F6B65A-6474-4978-9F9C-F22194688240}.Release|x86.ActiveCfg = Release|Any CPU
7981
{E6F6B65A-6474-4978-9F9C-F22194688240}.Release|x86.Build.0 = Release|Any CPU
82+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
83+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Debug|Any CPU.Build.0 = Debug|Any CPU
84+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Debug|ARM.ActiveCfg = Debug|Any CPU
85+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Debug|ARM.Build.0 = Debug|Any CPU
86+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Debug|x64.ActiveCfg = Debug|Any CPU
87+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Debug|x64.Build.0 = Debug|Any CPU
88+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Debug|x86.ActiveCfg = Debug|Any CPU
89+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Debug|x86.Build.0 = Debug|Any CPU
90+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Release|Any CPU.ActiveCfg = Release|Any CPU
91+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Release|Any CPU.Build.0 = Release|Any CPU
92+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Release|ARM.ActiveCfg = Release|Any CPU
93+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Release|ARM.Build.0 = Release|Any CPU
94+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Release|x64.ActiveCfg = Release|Any CPU
95+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Release|x64.Build.0 = Release|Any CPU
96+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Release|x86.ActiveCfg = Release|Any CPU
97+
{6361E2B1-FAC9-4D2E-9876-90A37E516598}.Release|x86.Build.0 = Release|Any CPU
8098
EndGlobalSection
8199
GlobalSection(SolutionProperties) = preSolution
82100
HideSolutionNode = FALSE

KPCLib.xunit/KPCLib.xunit.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
<DataFiles Include="$(ProjectDir)\pass_d_E8f4pEk.xyz" />
3434
<DataFiles Include="$(ProjectDir)\pass_e_JyHzpRxcopt.xyz" />
3535
<DataFiles Include="$(ProjectDir)\pass_k_JyHzpRxcopt.k4xyz" />
36+
<DataFiles Include="$(ProjectDir)\pass_e_EFZGmRz.xyz" />
37+
<DataFiles Include="$(ProjectDir)\pass_k_EFZGmRz.k4xyz" />
3638
</ItemGroup>
3739

3840
<Copy SourceFiles="@(DataFiles)" DestinationFolder="$(TargetDir)\" SkipUnchangedFiles="true" />

KPCLib.xunit/PxDatabaseTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public class PxLibInfoTests
379379
public void PxLibVersion()
380380
{
381381
Debug.WriteLine($"{PxLibInfo.Version}");
382-
Assert.Equal(PxLibInfo.Version, new System.Version("1.3.2.0"));
382+
Assert.Equal(PxLibInfo.Version, new System.Version("1.3.3.0"));
383383
}
384384

385385
[Fact]

KPCLib.xunit/UserTests.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ public UserFixture()
1717
{
1818
Username = "test1"
1919
};
20+
PxDb = new PxDatabase();
2021
}
2122

2223
public void Dispose()
2324
{
25+
PxDb.Close();
2426
}
27+
public PxDatabase PxDb { get; private set; }
2528
}
2629

2730
[CollectionDefinition("User collection")]
@@ -47,7 +50,7 @@ public void DataPathTest()
4750
{
4851
userFixture.user.Username = "test1";
4952
Debug.Print($"DataFilePath={PxDataFile.DataFilePath}");
50-
Debug.Print($"FileName={userFixture.user.FileName}");
53+
Debug.Print($"FileName={userFixture.user.FileName}, LastAccessTime: {userFixture.user.LastAccessTime}");
5154
Assert.NotNull(PxDataFile.DataFilePath);
5255
Assert.True(!userFixture.user.IsDeviceLockEnabled);
5356
}
@@ -70,12 +73,27 @@ public void GetUserNameTest()
7073
public void FileNameTest()
7174
{
7275
userFixture.user.Username = "kpclibpy";
76+
PxDataFile.DataFilePath = System.IO.Directory.GetCurrentDirectory();
7377
Debug.Print($"FileName={userFixture.user.FileName}");
7478
if(userFixture.user.IsKeyFileExist)
7579
{
7680
Debug.WriteLine($"FileNameTest: Found key file {userFixture.user.KeyFileName}");
7781
}
7882
Assert.NotNull(userFixture.user.FileName);
7983
}
84+
85+
/// <summary>
86+
/// Testing a KeePass database with key file.
87+
/// </summary>
88+
[Fact]
89+
public void KeePassKeyFileTest()
90+
{
91+
PxDataFile.DataFilePath = System.IO.Directory.GetCurrentDirectory();
92+
userFixture.user.Username = "user1";
93+
userFixture.user.Password = "123123";
94+
userFixture.PxDb.Open(userFixture.user);
95+
Debug.WriteLine($"Database: {userFixture.PxDb.Name}");
96+
Assert.True(userFixture.PxDb.IsOpen);
97+
}
8098
}
8199
}

KPCLib.xunit/pass_e_EFZGmRz.xyz

286 KB
Binary file not shown.

KPCLib.xunit/pass_k_EFZGmRz.k4xyz

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<KeyFile>
3+
<Meta>
4+
<Version>2.0</Version>
5+
</Meta>
6+
<Key>
7+
<Data Hash="4D5DDE72">
8+
57DCEADA E967B73F E95D01EB E6AB9B38
9+
EF15BA80 6363CB33 B4455D5D B1A22AAA
10+
</Data>
11+
</Key>
12+
</KeyFile>

KPCLib/KPCLib.csproj

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<OutputType>Library</OutputType>
77
<StartupObject />
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9-
<Version>1.3.2</Version>
9+
<Version>1.3.3</Version>
1010
<PackageProjectUrl>https://github.com/passxyz/KPCLib</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/passxyz/KPCLib</RepositoryUrl>
1212
<Description>This is the build of KeePassLib in Xamarin Portable Class Library. Three platforms, UWP, Android and iOS, are supported and tested.</Description>
@@ -15,10 +15,12 @@
1515
<Company>PassXYZ Inc.</Company>
1616
<PackageReleaseNotes>- Moved PassXYZLib to a separate package
1717
- Updated to KeePass 2.48.1
18-
- Fixed an issue in CryptoRandom.cs</PackageReleaseNotes>
18+
- Fixed an issue in CryptoRandom.cs
19+
- Removed dependency on PureOtp
20+
- Support KeePass key file</PackageReleaseNotes>
1921
<NeutralLanguage>en-US</NeutralLanguage>
20-
<AssemblyVersion>1.3.2.0</AssemblyVersion>
21-
<FileVersion>1.3.2.0</FileVersion>
22+
<AssemblyVersion>1.3.3.0</AssemblyVersion>
23+
<FileVersion>1.3.3.0</FileVersion>
2224
</PropertyGroup>
2325

2426
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -30,9 +32,12 @@
3032
</PropertyGroup>
3133

3234
<ItemGroup>
33-
<PackageReference Include="PureOtp" Version="1.0.0.8" />
3435
<PackageReference Include="SkiaSharp" Version="2.80.2" />
3536
<PackageReference Include="Svg.Skia" Version="0.5.3" />
3637
</ItemGroup>
3738

39+
<ItemGroup>
40+
<ProjectReference Include="..\PureOtp\PureOtp\PureOtp.csproj" />
41+
</ItemGroup>
42+
3843
</Project>

0 commit comments

Comments
 (0)