Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions framework.maui.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

<Project>
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.50,)" />
<!--<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />-->
</ItemGroup>
<PropertyGroup>
<TargetFrameworks>net10.0;net10.0-android</TargetFrameworks>
<!-- Needed for GitHub action, iOS and MacOS is not workig on Linux -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.30,)" />
<!--<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.50,)" />-->
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
<PackageReference Include="RestSharp" Version="114.0.0" />
</ItemGroup>
Expand Down
21 changes: 12 additions & 9 deletions src/SharedMauiCoreLibrary.Test/CoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ public void GenerateHexStringTest()
byte[] salt = EncryptionManager.CreateRandomSalt(saltSize);
string hex = EncryptionManager.GetHexStringFromSalt(salt);

Assert.That(!string.IsNullOrEmpty(hex));
Assert.That(hex.Length, Is.EqualTo(saltSize * 2));
using (Assert.EnterMultipleScope())
{
Assert.That(!string.IsNullOrEmpty(hex));
Assert.That(hex, Has.Length.EqualTo(saltSize * 2));
}
}
catch (Exception ex)
{
Expand All @@ -49,27 +52,27 @@ public void EncryptionTests()
Assert.That(!string.IsNullOrEmpty(encryptedWithKey));

string decrytpedTextWithKey = EncryptionManager.DecryptStringFromBase64String(encryptedWithKey, base64Key, 256);
Assert.That(plainText == decrytpedTextWithKey);
Assert.That(plainText, Is.EqualTo(decrytpedTextWithKey));

int saltSize = 16;
string saltHexString = EncryptionManager.GetHexStringFromSalt(EncryptionManager.CreateRandomSalt(saltSize));
Assert.That(saltHexString.Length == saltSize * 2);
Assert.That(saltHexString, Has.Length.EqualTo(saltSize * 2));
byte[] salt = EncryptionManager.GetSaltFromHexString(saltHexString);

string userpassword = "This is a secret text";
byte[] hashedPassword = EncryptionManager.SaltWithPasswordString(userpassword, salt, 32);
Assert.That(hashedPassword.Length, Is.EqualTo(32));
Assert.That(hashedPassword, Has.Length.EqualTo(32));

string encryptedText = EncryptionManager.EncryptStringToBase64String(plainText, hashedPassword, 256);

string decrytpedText = EncryptionManager.DecryptStringFromBase64String(encryptedText, hashedPassword, 256);
Assert.That(plainText == decrytpedText);
Assert.That(plainText, Is.EqualTo(decrytpedText));

// Recreate hash from user password
salt = EncryptionManager.GetSaltFromHexString(saltHexString);
hashedPassword = EncryptionManager.SaltWithPasswordString(userpassword, salt, 32);
decrytpedText = EncryptionManager.DecryptStringFromBase64String(encryptedText, hashedPassword, 256);
Assert.That(plainText == decrytpedText);
Assert.That(plainText, Is.EqualTo(decrytpedText));
}
catch (Exception ex)
{
Expand All @@ -93,12 +96,12 @@ public void UsePasswordDoubleEncryptionTest()
string encryptedPassphrase = EncryptionManager.EncryptStringToBase64String(passphrase, hashedPassword);

string decryptedPassphrase = EncryptionManager.DecryptStringFromBase64String(encryptedPassphrase, hashedPassword);
Assert.That(passphrase == decryptedPassphrase);
Assert.That(passphrase, Is.EqualTo(decryptedPassphrase));

var t = EncryptionManager.EncryptStringToBase64String(plainText, decryptedPassphrase);
var t2 = EncryptionManager.DecryptStringFromBase64String(t, decryptedPassphrase);

Assert.That(plainText == t2);
Assert.That(plainText, Is.EqualTo(t2));
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,7 @@ public void SubscribeNavigated()
}
public void UnsubscribeNavigated()
{
if (Shell.Current is not null)
{
Shell.Current.Navigated -= OnNavigated;
}
Shell.Current?.Navigated -= OnNavigated;
}

private void OnNavigated(object? sender, ShellNavigatedEventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions src/SharedMauiCoreLibrary/SharedMauiCoreLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.30,)" />
<PackageReference Include="CommunityToolkit.Maui" Version="14.0.0" />
<!--<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.50,)" />-->
<PackageReference Include="CommunityToolkit.Maui" Version="14.1.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
</ItemGroup>

Expand Down
3 changes: 1 addition & 2 deletions src/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"sdk": {
//"version": "9.0.308",
"version": "10.0.100"
"version": "10.0.201"
}
}
Loading