Skip to content

Commit c1135b9

Browse files
authored
Beta5 (#78)
1 parent ea8a464 commit c1135b9

File tree

623 files changed

+14714
-5440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

623 files changed

+14714
-5440
lines changed

.run/SecureFolderFS.run.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="SecureFolderFS (Desktop)" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
33
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj" />
4-
<option name="LAUNCH_PROFILE_TFM" value="net8.0-desktop" />
4+
<option name="LAUNCH_PROFILE_TFM" value="net9.0-desktop" />
55
<option name="LAUNCH_PROFILE_NAME" value="SecureFolderFS (Desktop)" />
66
<option name="USE_EXTERNAL_CONSOLE" value="0" />
77
<option name="USE_MONO" value="0" />
@@ -16,7 +16,7 @@
1616
</configuration>
1717
<configuration default="false" name="SecureFolderFS (WinAppSDK Unpackaged)" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
1818
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj" />
19-
<option name="LAUNCH_PROFILE_TFM" value="net8.0-windows10.0.19041.0" />
19+
<option name="LAUNCH_PROFILE_TFM" value="net9.0-windows10.0.19041.0" />
2020
<option name="LAUNCH_PROFILE_NAME" value="SecureFolderFS (WinAppSDK Unpackaged)" />
2121
<option name="USE_EXTERNAL_CONSOLE" value="0" />
2222
<option name="USE_MONO" value="0" />

global.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
32
"msbuild-sdks": {
4-
"Uno.Sdk": "5.3.112"
3+
"Uno.Sdk": "5.4.10"
54
}
6-
}
5+
}

lib/Tmds.Fuse

lib/nwebdav

Submodule nwebdav updated 54 files

src/Platforms/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<DotNetVersion>net8.0</DotNetVersion>
3+
<DotNetVersion>net9.0</DotNetVersion>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66

@@ -62,7 +62,7 @@
6262
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
6363
<PropertyGroup>
6464
<IsMacCatalyst>true</IsMacCatalyst>
65-
<SupportedOSPlatformVersion>14.0</SupportedOSPlatformVersion>
65+
<SupportedOSPlatformVersion>15.0</SupportedOSPlatformVersion>
6666
</PropertyGroup>
6767
</When>
6868
<When Condition="$(TargetFramework.Contains('windows10'))">
Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<Project ToolsVersion="15.0">
22
<ItemGroup>
3-
<PackageVersion Include="AathifMahir.Maui.MauiIcons.Cupertino" Version="3.0.0" />
4-
<PackageVersion Include="AathifMahir.Maui.MauiIcons.Material" Version="3.0.0" />
5-
<PackageVersion Include="CommunityToolkit.Maui" Version="9.0.2" />
3+
<PackageVersion Include="AathifMahir.Maui.MauiIcons.Cupertino" Version="4.0.0" />
4+
<PackageVersion Include="AathifMahir.Maui.MauiIcons.Material" Version="4.0.0" />
5+
<PackageVersion Include="CommunityToolkit.Maui" Version="9.1.1" />
6+
<PackageVersion Include="CommunityToolkit.Maui.MediaElement" Version="4.1.2" />
67
<PackageVersion Include="CommunityToolkit.WinUI.UI.Animations" Version="7.1.2" />
78
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
8-
<PackageVersion Include="IconPacks.Material" Version="1.0.8765.1-build" />
9-
<PackageVersion Include="LiveChartsCore.SkiaSharpView.Uno.WinUI" Version="2.0.0-rc3.3" />
10-
<PackageVersion Include="Material.Components.Maui" Version="0.2.1-preview" />
9+
<PackageVersion Include="ContextMenuContainer" Version="1.2.3" />
10+
<PackageVersion Include="H.NotifyIcon.Uno.WinUI" Version="2.1.4" />
11+
<PackageVersion Include="IconPacks.Material" Version="1.0.8940.2-build" />
12+
<PackageVersion Include="LiveChartsCore.SkiaSharpView.Uno.WinUI" Version="2.0.0-rc4.5" />
13+
<PackageVersion Include="Material.Components.Maui" Version="0.2.2-preview" />
1114
<PackageVersion Include="Microsoft.AppCenter.Analytics" Version="5.0.3" />
1215
<PackageVersion Include="Microsoft.AppCenter.Crashes" Version="5.0.3" />
13-
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
14-
<PackageVersion Include="Microsoft.Maui.Controls" Version="8.0.70" />
15-
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
16-
<PackageVersion Include="Microsoft.Maui.Core" Version="8.0.70" />
17-
<PackageVersion Include="Microsoft.Maui.Essentials" Version="8.0.70" />
18-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
16+
<PackageVersion Include="Microsoft.Maui.Controls" Version="9.0.10" />
17+
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.10" />
18+
<PackageVersion Include="Microsoft.Maui.Core" Version="9.0.10" />
19+
<PackageVersion Include="Microsoft.Maui.Essentials" Version="9.0.10" />
1920
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
20-
<PackageVersion Include="Microsoft.NET.ILLink.Analyzers" Version="7.0.100-1.23401.1" />
2121
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="8.0.0" />
2222
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
23-
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" />
2423
<PackageVersion Include="Octokit" Version="13.0.1" />
24+
<PackageVersion Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.9-preview.2.2" />
2525
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
2626
<PackageVersion Include="The49.Maui.BottomSheet" Version="8.0.3" />
2727
<PackageVersion Include="Uno.CommunityToolkit.WinUI" Version="7.1.200" />
@@ -33,14 +33,8 @@
3333
<PackageVersion Include="Uno.Resizetizer" Version="1.6.0" />
3434
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.3.90" />
3535
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.37" />
36-
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="8.0.20" />
37-
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="8.0.20" />
38-
<PackageVersion Include="Uno.Wasm.Bootstrap.Server" Version="8.0.20" />
3936
<PackageVersion Include="Uno.WinUI" Version="5.3.90" />
4037
<PackageVersion Include="Uno.WinUI.Lottie" Version="5.3.90" />
41-
<PackageVersion Include="Uno.WinUI.DevServer" Version="5.3.90" />
42-
<PackageVersion Include="Uno.WinUI.Skia.Gtk" Version="5.3.90" />
43-
<PackageVersion Include="Uno.WinUI.WebAssembly" Version="5.3.90" />
44-
<PackageVersion Include="Vanara.PInvoke.ComCtl32" Version="4.0.2" />
38+
<PackageVersion Include="Vanara.PInvoke.ComCtl32" Version="4.0.4" />
4539
</ItemGroup>
4640
</Project>

src/Platforms/SecureFolderFS.Maui/App.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public App()
3333

3434
protected override Window CreateWindow(IActivationState? activationState)
3535
{
36+
APES.UI.XF.ContextMenuContainer.Init();
37+
3638
var appShell = Task.Run(GetAppShellAsync).ConfigureAwait(false).GetAwaiter().GetResult();
3739
return new Window(appShell);
3840
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using IImage = SecureFolderFS.Shared.ComponentModel.IImage;
2+
3+
namespace SecureFolderFS.Maui.AppModels
4+
{
5+
/// <inheritdoc cref="IImage"/>
6+
internal sealed class ImageStream : IImage
7+
{
8+
private readonly Stream _stream;
9+
10+
public StreamImageSource Source { get; }
11+
12+
public ImageStream(Stream stream)
13+
{
14+
_stream = stream;
15+
Source = new();
16+
Source.Stream = (cancellationToken) => Task.FromResult(stream);
17+
}
18+
19+
/// <inheritdoc/>
20+
public void Dispose()
21+
{
22+
_stream.Dispose();
23+
}
24+
}
25+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
using System.Net;
2+
using System.Net.Sockets;
3+
using SecureFolderFS.Shared.ComponentModel;
4+
5+
namespace SecureFolderFS.Maui.AppModels
6+
{
7+
internal sealed class VideoStreamServer : IAsyncInitialize, IDisposable
8+
{
9+
private readonly HttpListener _httpListener;
10+
private readonly Stream _videoStream;
11+
private readonly string _mimeType;
12+
private readonly int _port;
13+
private bool _disposed;
14+
15+
public string BaseAddress => $"http://localhost:{_port}/video";
16+
17+
public VideoStreamServer(Stream videoStream, string mimeType)
18+
{
19+
_videoStream = videoStream;
20+
_mimeType = mimeType;
21+
22+
// Automatically find a free port
23+
_port = GetAvailablePort();
24+
25+
// Initialize the HttpListener with the free port
26+
_httpListener = new HttpListener();
27+
_httpListener.Prefixes.Add($"http://localhost:{_port}/");
28+
}
29+
30+
/// <inheritdoc/>
31+
public Task InitAsync(CancellationToken cancellationToken = default)
32+
{
33+
_httpListener.Start();
34+
_ = BeginListeningAsync();
35+
36+
return Task.CompletedTask;
37+
38+
async Task BeginListeningAsync()
39+
{
40+
while (!_disposed && _httpListener.IsListening && await _httpListener.GetContextAsync() is var context)
41+
{
42+
try
43+
{
44+
if (context.Request.RawUrl != "/video")
45+
{
46+
context.Response.StatusCode = (int)HttpStatusCode.NotFound;
47+
context.Response.Close();
48+
continue;
49+
}
50+
51+
context.Response.StatusCode = (int)HttpStatusCode.OK;
52+
context.Response.ContentType = _mimeType;
53+
context.Response.ContentLength64 = _videoStream.Length;
54+
context.Response.Headers["Accept-Ranges"] = "bytes";
55+
56+
await _videoStream.CopyToAsync(context.Response.OutputStream, 64 * 1024, cancellationToken);
57+
_videoStream.Position = 0L;
58+
break;
59+
}
60+
catch (Exception)
61+
{
62+
break;
63+
}
64+
}
65+
}
66+
}
67+
68+
/// <inheritdoc/>
69+
public void Dispose()
70+
{
71+
_disposed = true;
72+
_videoStream.Dispose();
73+
_httpListener.Abort();
74+
}
75+
76+
private static int GetAvailablePort()
77+
{
78+
using var listener = new TcpListener(IPAddress.Loopback, 0);
79+
listener.Start();
80+
81+
var port = ((IPEndPoint)listener.LocalEndpoint).Port;
82+
listener.Stop();
83+
84+
return port;
85+
}
86+
}
87+
}

src/Platforms/SecureFolderFS.Maui/AppShell.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public AppShell()
1414
// Register routes
1515
Routing.RegisterRoute("LoginPage", typeof(LoginPage));
1616
Routing.RegisterRoute("OverviewPage", typeof(OverviewPage));
17+
Routing.RegisterRoute("BrowserPage", typeof(BrowserPage));
1718
}
1819
}
1920
}

src/Platforms/SecureFolderFS.Maui/Extensions/IocExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public static IServiceCollection WithMauiServices(this IServiceCollection servic
1313
{
1414
return serviceCollection
1515
.AddSingleton<ISettingsService, SettingsService>(_ => new(new MauiAppSettings(settingsFolder), new UserSettings(settingsFolder)))
16+
.AddSingleton<IMediaService, MauiMediaService>()
1617
.AddSingleton<IOverlayService, MauiOverlayService>()
1718
.AddTransient<INavigationService, MauiNavigationService>()
1819
.AddSingleton<IClipboardService, MauiClipboardService>()

src/Platforms/SecureFolderFS.Maui/Localization/ResourceString.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ internal sealed class ResourceString : IMarkupExtension
1212
/// <summary>
1313
/// Gets or sets the name identifier that is associated with a resource.
1414
/// </summary>
15-
public string? Name { get; set; }
15+
public string? Rid { get; set; }
1616

1717
/// <inheritdoc/>
1818
public object ProvideValue(IServiceProvider serviceProvider)
1919
{
2020
LocalizationService ??= DI.OptionalService<ILocalizationService>();
2121
if (LocalizationService is null)
22-
return $"{{{Name}}}";
22+
return $"{{{Rid}}}";
2323

24-
return LocalizationService.TryGetString(Name ?? string.Empty) ?? $"{{{Name}}}";
24+
return LocalizationService.TryGetString(Rid ?? string.Empty) ?? $"{{{Rid}}}";
2525
}
2626
}
2727
}

src/Platforms/SecureFolderFS.Maui/MauiProgram.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using APES.UI.XF;
12
using CommunityToolkit.Maui;
23
using Microsoft.Extensions.Logging;
34
using The49.Maui.BottomSheet;
@@ -25,12 +26,14 @@ public static MauiApp CreateMauiApp()
2526
})
2627

2728
// Plugins
28-
.UseMauiCommunityToolkit() // https://github.com/CommunityToolkit/Maui
29-
.UseBottomSheet() // https://github.com/the49ltd/The49.Maui.BottomSheet
29+
.UseMauiCommunityToolkitMediaElement() // https://github.com/CommunityToolkit/Maui
30+
.UseMauiCommunityToolkit() // https://github.com/CommunityToolkit/Maui
31+
.UseBottomSheet() // https://github.com/the49ltd/The49.Maui.BottomSheet
32+
.ConfigureContextMenuContainer() // https://github.com/anpin/ContextMenuContainer
3033

3134
#if ANDROID
32-
.UseMaterialMauiIcons() // https://github.com/AathifMahir/MauiIcons
33-
.UseMaterialComponents() // https://github.com/mdc-maui/mdc-maui
35+
.UseMaterialMauiIcons() // https://github.com/AathifMahir/MauiIcons
36+
.UseMaterialComponents() // https://github.com/mdc-maui/mdc-maui
3437
#elif IOS
3538
.UseCupertinoMauiIcons()
3639
#endif
@@ -42,11 +45,8 @@ public static MauiApp CreateMauiApp()
4245
handlers.AddHandler<ContentPageExtended, Handlers.ContentPageExHandler>();
4346
#endif
4447
})
45-
;
46-
47-
#if DEBUG
48-
builder.Logging.AddDebug();
49-
#endif
48+
49+
; // Finish initialization
5050

5151
return builder.Build();
5252
}
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3-
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true"></application>
3+
<application android:usesCleartextTraffic="true" android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true">
4+
<service android:name="communityToolkit.maui.media.services" android:exported="false" android:enabled="true" android:foregroundServiceType="mediaPlayback">
5+
<intent-filter>
6+
<action android:name="android.intent.action.MEDIA_BUTTON" />
7+
</intent-filter>
8+
<intent-filter>
9+
<action android:name="androidx.media3.session.MediaSessionService"/>
10+
</intent-filter>
11+
</service>
12+
</application>
413
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
514
<uses-permission android:name="android.permission.INTERNET" />
15+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
16+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
17+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
18+
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
619
<uses-sdk />
7-
</manifest>
20+
</manifest>

src/Platforms/SecureFolderFS.Maui/Platforms/Android/AppModels/AndroidFileSystemDescriptor.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Platforms/SecureFolderFS.Maui/Platforms/Android/Helpers/AndroidLifecycleHelper.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ internal sealed class AndroidLifecycleHelper : BaseLifecycleHelper
1717
protected override string AppDirectory { get; } = Microsoft.Maui.Storage.FileSystem.Current.AppDataDirectory;
1818

1919
/// <inheritdoc/>
20-
public override async Task InitAsync(CancellationToken cancellationToken = default)
20+
public override Task InitAsync(CancellationToken cancellationToken = default)
2121
{
22-
// Request permissions
23-
//await RequestPermissionsAsync<Permissions.StorageWrite>();
24-
2522
// Initialize settings
2623
var settingsFolderPath = Path.Combine(AppDirectory, SecureFolderFS.UI.Constants.FileNames.SETTINGS_FOLDER_NAME);
2724
var settingsFolder = new SystemFolder(Directory.CreateDirectory(settingsFolderPath));
2825
ConfigureServices(settingsFolder);
26+
27+
return Task.CompletedTask;
2928
}
3029

3130
/// <inheritdoc/>
@@ -40,8 +39,9 @@ protected override IServiceCollection ConfigureServices(IModifiableFolder settin
4039
return base.ConfigureServices(settingsFolder)
4140
//.AddSingleton<IPrinterService, WindowsPrinterService>()
4241
.AddSingleton<IApplicationService, AndroidApplicationService>()
43-
.AddSingleton<IVaultService, AndroidVaultService>()
44-
.AddSingleton<IVaultManagerService, AndroidVaultManagerService>()
42+
.AddSingleton<ISystemService, AndroidSystemService>()
43+
.AddSingleton<IVaultCredentialsService, AndroidVaultCredentialsService>()
44+
.AddSingleton<IVaultFileSystemService, AndroidVaultFileSystemService>()
4545
.AddSingleton<IStorageService, AndroidStorageService>()
4646
.AddSingleton<IFileExplorerService, AndroidFileExplorerService>()
4747
.AddSingleton<ITelemetryService, DebugTelemetryService>()

0 commit comments

Comments
 (0)