Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
theofanis committed Nov 14, 2024
2 parents 232ce96 + cb6c8d2 commit 81d8993
Show file tree
Hide file tree
Showing 47 changed files with 309 additions and 149 deletions.
16 changes: 9 additions & 7 deletions src/BolWallet/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ namespace BolWallet;
public partial class App : Application, IRecipient<TargetNetworkChangedMessage>
{
private readonly INetworkPreferences _networkPreferences;
private ILogExtractor _logExtractor = null!;

public App(PreloadPage preloadPage, INetworkPreferences networkPreferences, IMessenger messenger)
public App(INetworkPreferences networkPreferences, IMessenger messenger)
{
_networkPreferences = networkPreferences;
InitializeComponent();
Expand Down Expand Up @@ -40,15 +41,16 @@ public App(PreloadPage preloadPage, INetworkPreferences networkPreferences, IMes
handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None;
#endif
});

MainPage = new NavigationPage(preloadPage);
}

protected override Window CreateWindow(IActivationState activationState)
{
Window window = base.CreateWindow(activationState);
window.Title = CreateWindowTitle();
return window;
// initialize singleton services which may not be used as dependencies but should exist.
// For example to listen to messages.
_logExtractor = activationState!.Context.Services.GetRequiredService<ILogExtractor>();

var preloadPage = activationState.Context.Services.GetRequiredService<PreloadPage>();
return new Window { Title = CreateWindowTitle(), Page = new NavigationPage(preloadPage) };
}

#if WINDOWS
Expand Down Expand Up @@ -77,7 +79,7 @@ private static void MapHorizontalOptions(IViewHandler handler, IView view)
#endif
public void Receive(TargetNetworkChangedMessage message)
{
MainThread.BeginInvokeOnMainThread(() => Current.MainPage.Window.Title = CreateWindowTitle());
MainThread.BeginInvokeOnMainThread(() => Current.Windows[0].Page.Window.Title = CreateWindowTitle());
}

private string CreateWindowTitle() => _networkPreferences.IsMainNet
Expand Down
36 changes: 18 additions & 18 deletions src/BolWallet/BolWallet.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net8.0-android;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('macos'))">$(TargetFrameworks);net8.0-maccatalyst;net8.0-ios</TargetFrameworks>
<TargetFrameworks>net9.0-android;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('macos'))">$(TargetFrameworks);net9.0-maccatalyst;net9.0-ios</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>BolWallet</RootNamespace>
<UseMaui>true</UseMaui>
<MauiVersion>8.0.92</MauiVersion>
<MauiVersion>9.0.0</MauiVersion>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

Expand All @@ -24,48 +24,49 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers> <DefaultLanguage>en-US</DefaultLanguage>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-android|AnyCPU'">
<WarningsAsErrors />
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-ios|AnyCPU'">
<WarningsAsErrors />
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<CreatePackage>false</CreatePackage>
<CodesignProvision>Automatic</CodesignProvision>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-maccatalyst|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-maccatalyst|AnyCPU'">
<WarningsAsErrors />
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-windows10.0.19041.0|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-windows10.0.19041.0|AnyCPU'">
<WarningsAsErrors />
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-android|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-android|AnyCPU'">
<WarningsAsErrors />
<AndroidLinkTool>r8</AndroidLinkTool>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-ios|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-ios|AnyCPU'">
<WarningsAsErrors />
<ArchiveOnBuild>true</ArchiveOnBuild>
<CodesignProvision>Automatic</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
<CodesignEntitlements>Platforms\iOS\Entitlements.plist</CodesignEntitlements>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-maccatalyst|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-maccatalyst|AnyCPU'">
<WarningsAsErrors />
<MtouchLink>SdkOnly</MtouchLink>
<CreatePackage>true</CreatePackage>
Expand All @@ -77,7 +78,7 @@
<CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-windows10.0.19041.0|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-windows10.0.19041.0|AnyCPU'">
<WarningsAsErrors />
</PropertyGroup>

Expand Down Expand Up @@ -213,15 +214,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="akavache" Version="9.1.20" />
<PackageReference Include="akavache" Version="10.1.6" />
<PackageReference Include="Blazing.Mvvm" Version="1.4.0" />
<PackageReference Include="BolChain.Core" Version="1.1.4" />
<PackageReference Include="CommunityToolkit.Maui" Version="8.0.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<!-- <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />-->
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)" />
<PackageReference Include="Plugin.Maui.Audio" Version="2.1.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
Expand Down
1 change: 1 addition & 0 deletions src/BolWallet/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal class Constants
public static readonly WalletClosedMessage WalletClosedMessage = new();
public static readonly WalletCreatedMessage WalletCreatedMessage = new();
public static readonly WalletCleanupCompletedMessage WalletCleanupCompletedMessage = new();
public static readonly SaveLogfileMessage SaveLogfileMessage = new();

public static readonly JsonSerializerOptions WalletJsonSerializerDefaultOptions = new()
{
Expand Down
2 changes: 1 addition & 1 deletion src/BolWallet/Extensions/LoggingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static IServiceCollection ConfigureSerilog(this IServiceCollection servic
Log.Logger.Information("App Info: {@AppInfo}", appInfo);

services.AddLogging(configure => configure.AddSerilog(dispose: true));

services.AddTransient<ILogExtractor, LogExtractor>();
return services;
}
}
9 changes: 9 additions & 0 deletions src/BolWallet/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static MauiApp CreateMauiApp()
fonts.AddFont("MaterialIcons-Regular.ttf", "MaterialIconsRegular");
});

builder.Services.AddSingleton<IAppVersion, AppVersion>();
builder.Services.AddMauiBlazorWebView();

builder.Services.AddMudServices();
Expand All @@ -45,10 +46,18 @@ public static MauiApp CreateMauiApp()
#else
builder.AddConfiguration("BolWallet.appsettings.json");
#endif

#if IOS || MACCATALYST
builder.ConfigureMauiHandlers(handlers =>
{
handlers.AddHandler<Microsoft.Maui.Controls.CollectionView, Microsoft.Maui.Controls.Handlers.Items2.CollectionViewHandler2>();
});
#endif

var services = builder.Services;

// Register Services
services.AddSingleton<TimeProvider>(TimeProvider.System);
services.AddScoped<IRepository>(_ => new Repository(BlobCache.UserAccount));
services.AddScoped<ISecureRepository, AkavacheRepository>();
services.AddSingleton<INavigationService, NavigationService>();
Expand Down
3 changes: 3 additions & 0 deletions src/BolWallet/Models/Messages/SaveLogfileMessage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace BolWallet.Models.Messages;

public record SaveLogfileMessage;
2 changes: 1 addition & 1 deletion src/BolWallet/Pages/CitizenshipPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@
return;
}

await App.Current.MainPage.Navigation.PushAsync(new Views.EcryptedCitizenshipPage());
await Application.Current.Windows[0].Page.Navigation.PushAsync(new Views.EcryptedCitizenshipPage());
}
}
17 changes: 12 additions & 5 deletions src/BolWallet/Pages/MenuPanel.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@using Bol.Core.Model
@using CommunityToolkit.Mvvm.Messaging
@inject INavigationService NavigationService
@inject IBolService bolService;
@inject ICloseWalletService closeWalletService;
@inject IAppVersion AppVersion;
@inject IMessenger Messenger;

<MudLayout>
<MudAppBar Style="background-color:#0050FF">
Expand All @@ -12,7 +15,10 @@
</MudAppBar>
<MudDrawer @bind-Open="@open" Variant="@DrawerVariant.Responsive" PreserveOpenState="true">
<MudDrawerHeader>
<MudText Typo="Typo.h6">Bol Menu</MudText>
<MudList>
<MudText Typo="Typo.h6">BOL Wallet</MudText>
<MudText Typo="Typo.caption">@(AppVersion.GetVersion())</MudText>
</MudList>
</MudDrawerHeader>
<MudNavMenu Bordered="true">
<MudNavGroup Title="Transactions" Expanded="true">
Expand All @@ -29,19 +35,20 @@
<MudNavGroup Title="Certifier">
@if (!BolAccount.IsCertifier)
{
<MudNavLink Icon="@Icons.Material.Rounded.SupervisorAccount" OnClick="() => App.Current.MainPage.Navigation.PushAsync(new Views.RegisterAsCertifierPage())">Become a Certifier</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.SupervisorAccount" OnClick="() => App.Current.Windows[0].Page.Navigation.PushAsync(new Views.RegisterAsCertifierPage())">Become a Certifier</MudNavLink>
}
else
{
<MudNavLink Icon="@Icons.Material.Rounded.PersonAdd" OnClick="() => NavigationService.NavigateTo<CertifyViewModel>(true)">Certify a CodeName</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.AddModerator" OnClick="() => NavigationService.NavigateTo<WhitelistViewModel>(true)">Whitelist a Main Address</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.LockPerson" OnClick="() => App.Current.MainPage.Navigation.PushAsync(new Views.AddMultiCitizenship())">Submit a Multiple Citizenship</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.AttachMoney" OnClick="() => App.Current.MainPage.Navigation.PushAsync(new Views.SetCertifierFeePage())">Set Your Fee</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.LockPerson" OnClick="() => App.Current.Windows[0].Page.Navigation.PushAsync(new Views.AddMultiCitizenship())">Submit a Multiple Citizenship</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.AttachMoney" OnClick="() => App.Current.Windows[0].Page.Navigation.PushAsync(new Views.SetCertifierFeePage())">Set Your Fee</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.RemoveModerator" OnClick="() => ShowUnregisterConfirmation()">Unregister as Certifier</MudNavLink>
}
</MudNavGroup>
<MudNavGroup Title="Tools">
<MudNavLink Icon="@Icons.Material.Rounded.History" OnClick="() => NavigationService.NavigateTo<TransactionsViewModel>(true)">History</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.FolderZip" OnClick="() => Messenger.Send(Constants.SaveLogfileMessage)">Save Logfile</MudNavLink>
@* <MudNavLink Icon="@Icons.Material.Rounded.Explore" Href="https://explorer.mainnet.bolchain.net">Explore Blockchain</MudNavLink>
<MudNavLink Icon="@Icons.Material.Rounded.Monitor" Href="https://monitor.mainnet.bolchain.net">Monitor Seeds</MudNavLink> *@
@* <MudNavLink Icon="@Icons.Material.Rounded.Logout" Href="https://monitor.mainnet.bolchain.net">Unload Wallet</MudNavLink> *@
Expand Down Expand Up @@ -83,7 +90,7 @@
{
try
{
bool confirmed = await App.Current.MainPage.DisplayAlert("Confirm", "Are you sure you want to unregister as a certifier?", "Yes", "No");
bool confirmed = await App.Current.Windows[0].Page.DisplayAlert("Confirm", "Are you sure you want to unregister as a certifier?", "Yes", "No");
if (confirmed)
{
await bolService.UnRegisterAsCertifier();
Expand Down
2 changes: 1 addition & 1 deletion src/BolWallet/Pages/WalletCreationInfo.razor
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
{
if (!IsNavigationDisabled)
{
await App.Current.MainPage.Navigation.PushAsync(new Views.CitizenshipPage());
await App.Current.Windows[0].Page.Navigation.PushAsync(new Views.CitizenshipPage());
}
}
}
3 changes: 1 addition & 2 deletions src/BolWallet/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.bol.bolwallet" android:versionCode="6" android:versionName="2.3.3">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.bol.bolwallet" android:versionCode="9" android:versionName="3.0.0">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true" android:label="BoL Wallet"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Expand Down
6 changes: 4 additions & 2 deletions src/BolWallet/Platforms/MacCatalyst/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
<string>processing</string>
</array>
<key>CFBundleVersion</key>
<string>2024.1105.2230</string>
<string>2024.1113.0540</string>
<key>CFBundleShortVersionString</key>
<string>2.3.3</string>
<string>3.0.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>NSHumanReadableCopyright</key>
Expand All @@ -44,5 +44,7 @@
<string>The app can use the microphone to record your voice and use it when creating a new wallet.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>The app can use the photo library to select photos from your library and use them when creating a new wallet.</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion src/BolWallet/Platforms/Windows/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="3.0.0.0" />

<mp:PhoneIdentity PhoneProductId="91ADD539-7E17-4B6C-9E6D-310A654419CD" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Expand Down
28 changes: 15 additions & 13 deletions src/BolWallet/Platforms/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
Expand All @@ -29,18 +29,20 @@
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
<key>NSCameraUsageDescription</key>
<string>The app can use the camera to take a photo of a document and use it when creating a new wallet.</string>
<string>The app can use the camera to take a photo of a document and use it when creating a new wallet.</string>
<key>NSMicrophoneUsageDescription</key>
<string>The app can use the microphone to record your voice and use it when creating a new wallet.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>The app can use the photo library to select photos from your library and use them when creating a new wallet.</string>
<key>CFBundleVersion</key>
<string>2024.1105.2230</string>
<key>CFBundleShortVersionString</key>
<string>2.3.3</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>NSHumanReadableCopyright</key>
<string>1bol.org © 2024</string>
<string>The app can use the microphone to record your voice and use it when creating a new wallet.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>The app can use the photo library to select photos from your library and use them when creating a new wallet.</string>
<key>CFBundleVersion</key>
<string>2024.1113.0540</string>
<key>CFBundleShortVersionString</key>
<string>3.0.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>NSHumanReadableCopyright</key>
<string>1bol.org © 2024</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>
1 change: 1 addition & 0 deletions src/BolWallet/Resources/Images/zip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 81d8993

Please sign in to comment.