Skip to content

Commit 7a0e514

Browse files
author
kev21
authored
Merge pull request #82 from nventive/feature/net7
Migrate to NET7
2 parents e036c80 + f5a1b07 commit 7a0e514

14 files changed

Lines changed: 133 additions & 131 deletions

BREAKING_CHANGES.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
# Breaking Changes
1+
# Breaking Changes
2+
3+
## 2.0.0
4+
5+
* Added support for .NET 7.
6+
* Dropped support for .NET 6.
7+
* Renamed method parameters of `IBiometryService` from `keyName` to `key` and from `keyValue` to `value`.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ await biometryService.ScanBiometry(CancellationToken.None);
169169
This method encrypts a value and stores it into the platform secure storage with the given key name.
170170

171171
``` cs
172-
await biometryService.Encrypt(CancellationToken.None, "KeyName", "KeyValue");
172+
await biometryService.Encrypt(CancellationToken.None, "Key", "Value");
173173
```
174174

175175
On Android, a new `CryptoObject` from `AndroidX.Biometric` is created with a key as a parameter. Then the data is encrypted and presented to the `BiometricPrompt` manager.
@@ -182,7 +182,7 @@ On iOS, the `SecKeyChain` is used to store a string linked to a key. The OS is i
182182
This method decrypts and gets the data associated to the given key.
183183

184184
``` cs
185-
await biometryService.Decrypt(CancellationToken.None, "KeyName");
185+
await biometryService.Decrypt(CancellationToken.None, "Key");
186186
```
187187

188188
On Android, the method retrieves the shared preference encrypted data, then decrypts it with the secret as a parameter by presenting it to the `BiometricPrompt` manager.
@@ -194,7 +194,7 @@ On iOS, the method retrieves the encrypted data from the `SecKeyChain` with the
194194
This method removes the ecrypted value from the platform secure storage.
195195

196196
``` cs
197-
biometryService.Remove("KeyName");
197+
biometryService.Remove("Key");
198198
```
199199

200200
On Android, the method removes the encrypted data from the shared preferences.

build/azure-pipelines.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ trigger:
33
include:
44
- main
55

6-
resources:
7-
containers:
8-
- container: windows
9-
image: nventive/vs_build-tools:17.2.5
10-
116
variables:
127
- name: NUGET_VERSION
138
value: 6.2.0
@@ -29,8 +24,8 @@ variables:
2924
value: nventive.internal.p12 # This is the certificate from the entreprise account used to sign internal builds.
3025
- name: InternalKeystore
3126
value: com.nventive.internal.applicationtemplate.jks
32-
- name: windowsPoolName
33-
value: 'windows 2022'
27+
- name: windowsHostedAgentImage
28+
value: 'windows-2022'
3429

3530
stages:
3631
- stage: Build
@@ -45,7 +40,7 @@ stages:
4540
GeneratePackageOnBuild: true
4641

4742
pool:
48-
name: $(windowsPoolName)
43+
vmImage: $(windowsHostedAgentImage)
4944

5045
variables:
5146
- name: PackageOutputPath # Path where nuget packages will be copied to.
@@ -54,8 +49,6 @@ stages:
5449
workspace:
5550
clean: all # Cleanup the workspace before starting
5651

57-
container: windows
58-
5952
steps:
6053
- template: stage-build.yml
6154
parameters:
@@ -73,7 +66,7 @@ stages:
7366
- job: Publish_NuGet_External
7467

7568
pool:
76-
name: $(windowsPoolName)
69+
vmImage: $(windowsHostedAgentImage)
7770

7871
workspace:
7972
clean: all # Cleanup the workspace before starting

build/stage-build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
configFilePath: $(Build.SourcesDirectory)/build/gitversion.yml
1111
displayName: 'Calculate version'
1212

13-
- task: DotNetCoreCLI@2
14-
displayName: 'Install dotnet 6 workloads'
13+
- script: dotnet workload install android ios macos maccatalyst"
14+
displayName: 'Install .NET workloads'
15+
16+
- task: JavaToolInstaller@0
17+
displayName: "Install Java SDK 11"
1518
inputs:
16-
command: 'custom'
17-
custom: 'workload'
18-
arguments: 'install android ios macos maccatalyst'
19+
versionSpec: '11'
20+
jdkArchitectureOption: 'x64'
21+
jdkSourceOption: 'PreInstalled'
1922

2023
- task: MSBuild@1
2124
displayName: 'Restore solution packages'

samples/BiometryService.SampleApp.Uno.Mobile/BiometryService.SampleApp.Uno.Mobile.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0-android;net6.0-ios</TargetFrameworks>
3+
<TargetFrameworks>net7.0-android;net7.0-ios</TargetFrameworks>
44
<SingleProject>true</SingleProject>
55
<OutputType>Exe</OutputType>
66
<IsUnoHead>true</IsUnoHead>
7-
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
8-
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
7+
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-ios'">14.2</SupportedOSPlatformVersion>
8+
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-android'">21.0</SupportedOSPlatformVersion>
99
<DefineConstants>$(DefineConstants);WINUI</DefineConstants>
1010
</PropertyGroup>
1111

@@ -19,7 +19,7 @@
1919
</ItemGroup>
2020

2121
<Choose>
22-
<When Condition="'$(TargetFramework)'=='net6.0-android'">
22+
<When Condition="'$(TargetFramework)'=='net7.0-android'">
2323
<ItemGroup>
2424
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.6.1.1" />
2525
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.36" />
@@ -28,8 +28,8 @@
2828
<AndroidEnvironment Include="Android/environment.conf" />
2929
</ItemGroup>
3030
</When>
31-
<When Condition="'$(TargetFramework)'=='net6.0-ios'">
32-
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-ios'">
31+
<When Condition="'$(TargetFramework)'=='net7.0-ios'">
32+
<PropertyGroup Condition="'$(TargetFramework)'=='net7.0-ios'">
3333
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
3434
<!-- See https://github.com/unoplatform/uno/issues/9430 for more details. -->
3535
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>

samples/BiometryService.SampleApp.Uno.WinUI/BiometryService.SampleApp.Uno.WinUI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
5-
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
4+
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
5+
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
66
<RootNamespace>BiometryService.SampleApp.Uno.WinUI</RootNamespace>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Platforms>x86;x64;arm64</Platforms>

src/BiometryService.Abstractions/BiometryService.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<LangVersion>10.0</LangVersion>
3+
<LangVersion>11.0</LangVersion>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>BiometryService</RootNamespace>
66
<Authors>nventive</Authors>

src/BiometryService.Abstractions/IBiometryService.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,32 @@ public interface IBiometryService
3434
Task ScanBiometry(CancellationToken ct);
3535

3636
/// <summary>
37-
/// Encrypts the value and stores it into the platform secure storage with the given <paramref name="keyName"/>.
37+
/// Encrypts the value and stores it into the platform secure storage with the given <paramref name="key"/>.
3838
/// </summary>
3939
/// <remarks>
4040
/// Catch and throw <see cref="BiometryException"/> for general biometry errors.
4141
/// </remarks>
4242
/// <param name="ct"><see cref="CancellationToken" />.</param>
43-
/// <param name="keyName">The name of the key.</param>
44-
/// <param name="keyValue">The value to be encrypt.</param>
45-
Task Encrypt(CancellationToken ct, string keyName, string keyValue);
43+
/// <param name="key">The name of the key.</param>
44+
/// <param name="value">The value to be encrypted.</param>
45+
Task Encrypt(CancellationToken ct, string key, string value);
4646

4747
/// <summary>
48-
/// Decrypts and gets the data associated to the given <paramref name="keyName"/>.
48+
/// Decrypts and gets the data associated to the given <paramref name="key"/>.
4949
/// </summary>
5050
/// <remarks>
5151
/// Catch and throw <see cref="BiometryException"/> for general biometry errors.
5252
/// Catch and throw <see cref="OperationCanceledException"/> if the user cancelled the operation.
5353
/// </remarks>
5454
/// <param name="ct"><see cref="CancellationToken" />.</param>
55-
/// <param name="keyName">The name of the Key.</param>
55+
/// <param name="key">The name of the Key.</param>
5656
/// <returns>The decrypted data associated to the key.</returns>
57-
Task<string> Decrypt(CancellationToken ct, string keyName);
57+
Task<string> Decrypt(CancellationToken ct, string key);
5858

5959
/// <summary>
6060
/// Removes the ecrypted value in the platform secure storage.
6161
/// </summary>
62-
/// <param name="keyName">The name of the Key.</param>
62+
/// <param name="key">The name of the Key.</param>
6363
/// <exception cref="BiometryException">Thrown for general biometry errors.</exception>
64-
void Remove(string keyName);
64+
void Remove(string key);
6565
}

src/BiometryService/BaseBiometryService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ public BaseBiometryService(ILoggerFactory loggerFactory = null)
2525
}
2626

2727
/// <inheritdoc/>
28-
public abstract Task<string> Decrypt(CancellationToken ct, string keyName);
28+
public abstract Task<string> Decrypt(CancellationToken ct, string key);
2929

3030
/// <inheritdoc/>
31-
public abstract Task Encrypt(CancellationToken ct, string keyName, string keyValue);
31+
public abstract Task Encrypt(CancellationToken ct, string key, string value);
3232

3333
/// <inheritdoc/>
3434
public abstract Task<BiometryCapabilities> GetCapabilities(CancellationToken ct);
3535

3636
/// <inheritdoc/>
37-
public abstract void Remove(string keyName);
37+
public abstract void Remove(string key);
3838

3939
/// <inheritdoc/>
4040
public abstract Task ScanBiometry(CancellationToken ct);

0 commit comments

Comments
 (0)