Skip to content

(V3) Vault recycle bin #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 80 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
440a0bd
Added initial view models for recycle bin
d2dyno1 Jan 22, 2025
fa81470
Fixed settings page on Android
d2dyno1 Jan 23, 2025
cf91b02
Added restore method to service
d2dyno1 Jan 24, 2025
8b6fc2f
Moved methods to IRecycleBinService
d2dyno1 Jan 24, 2025
5a4fe6c
Upgraded dependencies
d2dyno1 Jan 26, 2025
4506334
Merge branch 'master' into f_recyclebin
d2dyno1 Jan 28, 2025
1e6425c
Upgraded to Uno 5.6
d2dyno1 Jan 29, 2025
1c62d31
Fixed implicit animations
d2dyno1 Jan 29, 2025
856fd63
Introduced KeyPair class
d2dyno1 Feb 8, 2025
0a4515d
Begin work on Recycle Bin tests
d2dyno1 Feb 17, 2025
9bf9363
Added more Recycle Bin tests
d2dyno1 Feb 17, 2025
ec1ae41
Fixed tests
d2dyno1 Feb 17, 2025
82abec0
Added "Lock" context menu option
d2dyno1 Feb 17, 2025
ec7e99e
Upgraded nuget packages
d2dyno1 Feb 17, 2025
4facf03
Update submodules
d2dyno1 Feb 17, 2025
f2c2b20
Begin work on logic for Android Recycle Bin
d2dyno1 Feb 21, 2025
8a8181f
More work on Recycle Bin for Android
d2dyno1 Feb 21, 2025
9d8c74b
Added IFilePicker and IFolderPicker
d2dyno1 Feb 22, 2025
46c8e06
Redesigned MAUI login page
d2dyno1 Feb 24, 2025
9e63098
Fixed some issues with iOS build
d2dyno1 Feb 25, 2025
bc1bf7b
Redesigned Wizard location page
d2dyno1 Feb 25, 2025
bcf5f91
Enabled edge-to-edge on Android
d2dyno1 Feb 26, 2025
d3c0806
Improved design of Wizard credentials page
d2dyno1 Feb 26, 2025
cccfe08
Added IsTransparent to ModernPicker
d2dyno1 Feb 27, 2025
ee9f02b
Removed empty spaces
d2dyno1 Feb 27, 2025
47b3825
Update nwebdav
d2dyno1 Feb 27, 2025
d799e54
Remove TableView in favor of OptionsControl
d2dyno1 Feb 28, 2025
f6039e7
Removed last TableView reference
d2dyno1 Feb 28, 2025
7b28664
Added MauiThemeHelper
d2dyno1 Mar 1, 2025
27d449d
Added rounded corners to popups
d2dyno1 Mar 3, 2025
9fdfdbd
Updated design of Key File login view
d2dyno1 Mar 3, 2025
9daead6
Fixed file browser background
d2dyno1 Mar 4, 2025
4d523be
Fix build
d2dyno1 Mar 4, 2025
51b7a68
Use CanContinue
d2dyno1 Mar 8, 2025
88f95f0
Fixed invisible icons
d2dyno1 Mar 16, 2025
871ce2d
Begin work on sorters
d2dyno1 Mar 17, 2025
5f1ca44
Added ViewOptionsViewModel
d2dyno1 Mar 17, 2025
a3abc18
Begin work on Sheet
d2dyno1 Mar 17, 2025
8ffa4f1
Removed InsertSorted method
d2dyno1 Mar 24, 2025
3669ad5
Begin work on view options implementation
d2dyno1 Mar 24, 2025
bf1a701
Implemented layout options
d2dyno1 Mar 24, 2025
c70060c
Fixed formatting
d2dyno1 Mar 24, 2025
471d655
Added properties popup
d2dyno1 Mar 25, 2025
201b123
Fixed layout options
d2dyno1 Mar 25, 2025
92a14db
Added image thumbnails
d2dyno1 Mar 26, 2025
8e725e0
Added video thumbnail generation
d2dyno1 Apr 2, 2025
9e7b760
Resize icon on Android
d2dyno1 Apr 4, 2025
751381f
Added TransferType.Select
d2dyno1 Apr 7, 2025
5966d1b
Added some missing localizations
d2dyno1 Apr 7, 2025
e5ae1ae
Update BrowserControl.xaml
d2dyno1 Apr 7, 2025
ba4e8d6
Implemented StreamedMediaSource
d2dyno1 Apr 8, 2025
11a8c6e
Added mock design to HealthPage
d2dyno1 Apr 8, 2025
12d2d5d
Fixed race condition in wizard location page
d2dyno1 Apr 10, 2025
4bb0022
Added new parameters for Argon2id
d2dyno1 Apr 10, 2025
ce251cd
Updated some dependencies
d2dyno1 Apr 10, 2025
97ca887
Added empty view to file browser
d2dyno1 Apr 10, 2025
b64ea00
Added missing IsCachingDirectoryIds
d2dyno1 Apr 10, 2025
ba32fe8
Try to upgrade MediaElement
d2dyno1 Apr 12, 2025
3e53cee
Improved thumbnail loading performance
d2dyno1 Apr 12, 2025
24a75f8
Dramatically improve item scrolling performance
d2dyno1 Apr 13, 2025
5ace02f
GridView improvements
d2dyno1 Apr 13, 2025
39d70e4
More work on the health page
d2dyno1 Apr 17, 2025
73c3510
Size-based Recycle Bin
d2dyno1 Apr 17, 2025
1ddabb6
Exception proofing
d2dyno1 Apr 17, 2025
3780ed9
Updated LiveCharts
d2dyno1 Apr 18, 2025
b9d2f9f
Implemented desktop.ini icons
d2dyno1 Apr 18, 2025
1a55271
Refactored health scanning view models
d2dyno1 Apr 19, 2025
a95ec32
Fixed formatting
d2dyno1 Apr 19, 2025
e0747f4
Removed Material.Components.Maui
d2dyno1 Apr 19, 2025
2a3ec54
Added password strength bar
d2dyno1 Apr 19, 2025
7713682
Fixed password strength bar on MAUI
d2dyno1 Apr 19, 2025
6ff8423
Partially fix cancelling folder picking
d2dyno1 Apr 20, 2025
0501165
Added a setting to disable file thumbnails
d2dyno1 Apr 21, 2025
6520aa8
Implemented recycle bin for Dokany
d2dyno1 Apr 21, 2025
ee379d3
Added issue resolving to MAUI
d2dyno1 Apr 22, 2025
eeb792f
Implement V3 vault format
d2dyno1 Apr 23, 2025
9dd36d8
Added FallbackPreviewer
d2dyno1 May 1, 2025
af97527
Added Android Biometrics authentication
d2dyno1 May 2, 2025
907fb33
Better reporting for transferred items
d2dyno1 May 2, 2025
d17e484
Adjust Argon2id parameters again
d2dyno1 May 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"msbuild-sdks": {
"Uno.Sdk": "5.4.10"
"Uno.Sdk": "5.6.20"
},
"sdk": {
"allowPrerelease": true
}
}
2 changes: 1 addition & 1 deletion lib/Tmds.Fuse
37 changes: 18 additions & 19 deletions src/Platforms/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,29 @@
<ItemGroup>
<PackageVersion Include="AathifMahir.Maui.MauiIcons.Cupertino" Version="4.0.0" />
<PackageVersion Include="AathifMahir.Maui.MauiIcons.Material" Version="4.0.0" />
<PackageVersion Include="CommunityToolkit.Maui" Version="9.1.1" />
<PackageVersion Include="CommunityToolkit.Maui.MediaElement" Version="4.1.2" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Animations" Version="7.1.2" />
<PackageVersion Include="CommunityToolkit.Maui" Version="11.2.0" />
<PackageVersion Include="CommunityToolkit.Maui.MediaElement" Version="6.0.2" />
<PackageVersion Include="CommunityToolkit.WinUI.Animations" Version="8.2.250402" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
<PackageVersion Include="ContextMenuContainer" Version="1.2.3" />
<PackageVersion Include="H.NotifyIcon.Uno.WinUI" Version="2.1.4" />
<PackageVersion Include="H.NotifyIcon.Uno.WinUI" Version="2.3.0" />
<PackageVersion Include="IconPacks.Material" Version="1.0.8940.2-build" />
<PackageVersion Include="LiveChartsCore.SkiaSharpView.Uno.WinUI" Version="2.0.0-rc4.5" />
<PackageVersion Include="Material.Components.Maui" Version="0.2.2-preview" />
<PackageVersion Include="LiveChartsCore.SkiaSharpView.Uno.WinUI" Version="2.0.0-rc5.3" />
<PackageVersion Include="Microsoft.AppCenter.Analytics" Version="5.0.3" />
<PackageVersion Include="Microsoft.AppCenter.Crashes" Version="5.0.3" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="9.0.10" />
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.10" />
<PackageVersion Include="Microsoft.Maui.Core" Version="9.0.10" />
<PackageVersion Include="Microsoft.Maui.Essentials" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="9.0.50" />
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.50" />
<PackageVersion Include="Microsoft.Maui.Core" Version="9.0.50" />
<PackageVersion Include="Microsoft.Maui.Essentials" Version="9.0.50" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.4" />
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="8.0.0" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageVersion Include="Octokit" Version="13.0.1" />
<PackageVersion Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.9-preview.2.2" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageVersion Include="The49.Maui.BottomSheet" Version="8.0.3" />
<PackageVersion Include="Octokit" Version="14.0.0" />
<PackageVersion Include="Plugin.Maui.BottomSheet" Version="9.1.4" />
<PackageVersion Include="SkiaSharp" Version="3.116.1" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.4" />
<PackageVersion Include="Uno.CommunityToolkit.WinUI" Version="7.1.200" />
<PackageVersion Include="Uno.CommunityToolkit.WinUI.UI.Animations" Version="7.1.200" />
<PackageVersion Include="Uno.CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.203" />
<PackageVersion Include="Uno.CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.204" />
<PackageVersion Include="Uno.Core.Extensions.Logging" Version="4.1.1" />
<PackageVersion Include="Uno.Core.Extensions.Logging.Singleton" Version="4.1.1" />
<PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.7.0" />
Expand All @@ -35,6 +33,7 @@
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.37" />
<PackageVersion Include="Uno.WinUI" Version="5.3.90" />
<PackageVersion Include="Uno.WinUI.Lottie" Version="5.3.90" />
<PackageVersion Include="Vanara.PInvoke.ComCtl32" Version="4.0.4" />
<PackageVersion Include="Vanara.PInvoke.ComCtl32" Version="4.1.2" />
<PackageVersion Include="Vanara.PInvoke.Shell32" Version="4.1.2" />
</ItemGroup>
</Project>
</Project>
9 changes: 3 additions & 6 deletions src/Platforms/SecureFolderFS.Maui/App.xaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<Application
x:Class="SecureFolderFS.Maui.App"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mds="clr-namespace:Material.Components.Maui.Styles;assembly=Material.Components.Maui">
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">

<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/ColorStyles.xaml" />
<ResourceDictionary Source="Resources/Styles/ButtonStyles.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />

<!-- Platform styles for Android -->
<mds:MaterialStyles Dark="#1791ff" Light="#158de0" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
26 changes: 18 additions & 8 deletions src/Platforms/SecureFolderFS.Maui/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
using CommunityToolkit.Mvvm.DependencyInjection;
using APES.UI.XF;
using SecureFolderFS.Maui.Extensions.Mappers;
using SecureFolderFS.Maui.Helpers;
using SecureFolderFS.Shared;
using SecureFolderFS.UI.Helpers;

namespace SecureFolderFS.Maui
{
public partial class App : Application
{
public static App Instance => (App)Application.Current!;
public static App Instance => (App)Current!;

public IServiceProvider? ServiceProvider { get; private set; }

public BaseLifecycleHelper ApplicationLifecycle { get; } =
Expand All @@ -18,23 +20,28 @@ public partial class App : Application
#else
null;
#endif

public event EventHandler? AppResumed;
public event EventHandler? AppPutToForeground;

public App()
{
InitializeComponent();

// Configure mappers
CustomMappers.AddEntryMappers();
CustomMappers.AddLabelMappers();
CustomMappers.AddPickerMappers();

// Configure exception handlers
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
}

protected override Window CreateWindow(IActivationState? activationState)
{
APES.UI.XF.ContextMenuContainer.Init();
ContextMenuContainer.Init();

var appShell = Task.Run(GetAppShellAsync).ConfigureAwait(false).GetAwaiter().GetResult();
return new Window(appShell);
}
Expand All @@ -49,10 +56,13 @@ private async Task<Page> GetAppShellAsync()

// Register IoC
DI.Default.SetServiceProvider(ServiceProvider);

// Create and initialize AppShell
var appShell = new AppShell();
await appShell.MainViewModel.InitAsync();
await appShell.MainViewModel.InitAsync().ConfigureAwait(false);

// Initialize ThemeHelper
await MauiThemeHelper.Instance.InitAsync().ConfigureAwait(false);

return appShell;
}
Expand Down
24 changes: 18 additions & 6 deletions src/Platforms/SecureFolderFS.Maui/AppModels/ImageStream.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
using SecureFolderFS.Shared.ComponentModel;
using IImage = SecureFolderFS.Shared.ComponentModel.IImage;

namespace SecureFolderFS.Maui.AppModels
{
/// <inheritdoc cref="IImage"/>
internal sealed class ImageStream : IImage
internal sealed class ImageStream : IImageStream
{
private readonly Stream _stream;
public Stream Stream { get; }

public StreamImageSource Source { get; }

public ImageStream(Stream stream)
{
_stream = stream;
Stream = stream;
Source = new();
Source.Stream = (cancellationToken) => Task.FromResult(stream);
Source.Stream = (ct) => Task.FromResult(stream);
}

/// <inheritdoc/>
public async Task CopyToAsync(Stream destination, CancellationToken cancellationToken = default)
{
var savedPosition = Stream.Position;
await Stream.CopyToAsync(destination, cancellationToken);
Stream.Position = savedPosition;
}

/// <inheritdoc/>
public void Dispose()
{
_stream.Dispose();
if (Stream is OnDemandDisposableStream onDemandDisposableStream)
onDemandDisposableStream.ForceClose();
else
Stream.Dispose();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace SecureFolderFS.Maui.AppModels
{
internal sealed class OnDemandDisposableStream : MemoryStream
{
public void ForceClose()
{
base.Dispose(true);
}

/// <inheritdoc/>
protected override void Dispose(bool disposing)
{
_ = disposing;
}
}
}
29 changes: 17 additions & 12 deletions src/Platforms/SecureFolderFS.Maui/AppModels/VideoStreamServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Task InitAsync(CancellationToken cancellationToken = default)
{
_httpListener.Start();
_ = BeginListeningAsync();

return Task.CompletedTask;

async Task BeginListeningAsync()
Expand All @@ -41,24 +41,29 @@ async Task BeginListeningAsync()
{
try
{
var response = context.Response;
if (context.Request.RawUrl != "/video")
{
context.Response.StatusCode = (int)HttpStatusCode.NotFound;
context.Response.Close();
response.StatusCode = (int)HttpStatusCode.NotFound;
response.Close();
continue;
}

context.Response.StatusCode = (int)HttpStatusCode.OK;
context.Response.ContentType = _mimeType;
context.Response.ContentLength64 = _videoStream.Length;
context.Response.Headers["Accept-Ranges"] = "bytes";

await _videoStream.CopyToAsync(context.Response.OutputStream, 64 * 1024, cancellationToken);
response.ContentType = _mimeType;
response.ContentLength64 = _videoStream.Length;
response.Headers["Accept-Ranges"] = "bytes";

await _videoStream.CopyToAsync(response.OutputStream, 64 * 1024, cancellationToken);
await _videoStream.FlushAsync(cancellationToken);
_videoStream.Position = 0L;
break;

response.StatusCode = (int)HttpStatusCode.OK;
response.StatusDescription = "OK";
response.Close();
}
catch (Exception)
catch (Exception ex)
{
_ = ex;
break;
}
}
Expand All @@ -72,7 +77,7 @@ public void Dispose()
_videoStream.Dispose();
_httpListener.Abort();
}

private static int GetAvailablePort()
{
using var listener = new TcpListener(IPAddress.Loopback, 0);
Expand Down
1 change: 1 addition & 0 deletions src/Platforms/SecureFolderFS.Maui/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public AppShell()
Routing.RegisterRoute("LoginPage", typeof(LoginPage));
Routing.RegisterRoute("OverviewPage", typeof(OverviewPage));
Routing.RegisterRoute("BrowserPage", typeof(BrowserPage));
Routing.RegisterRoute("HealthPage", typeof(HealthPage));
}
}
}
9 changes: 7 additions & 2 deletions src/Platforms/SecureFolderFS.Maui/Extensions/IocExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using OwlCore.Storage;
using Plugin.Maui.BottomSheet.Hosting;
using Plugin.Maui.BottomSheet.Navigation;
using SecureFolderFS.Maui.ServiceImplementation;
using SecureFolderFS.Maui.ServiceImplementation.Settings;
using SecureFolderFS.Maui.Sheets;
using SecureFolderFS.Sdk.Services;
using SecureFolderFS.UI.ServiceImplementation;
using SecureFolderFS.UI.ServiceImplementation.Settings;
Expand All @@ -14,10 +17,12 @@ public static IServiceCollection WithMauiServices(this IServiceCollection servic
return serviceCollection
.AddSingleton<ISettingsService, SettingsService>(_ => new(new MauiAppSettings(settingsFolder), new UserSettings(settingsFolder)))
.AddSingleton<IMediaService, MauiMediaService>()
.AddSingleton<IShareService, MauiShareService>()
.AddSingleton<IOverlayService, MauiOverlayService>()
.AddTransient<INavigationService, MauiNavigationService>()
.AddSingleton<IClipboardService, MauiClipboardService>()
//.AddSingleton<IThreadingService, ThreadingService>()
.AddSingleton<IBottomSheetNavigationService, BottomSheetNavigationService>()
.AddTransient<INavigationService, MauiNavigationService>()
.AddBottomSheet<ViewOptionsSheet>(nameof(ViewOptionsSheet))
;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;
using SecureFolderFS.Maui.UserControls.Common;

#if ANDROID
using Android.Graphics.Drawables.Shapes;
using Paint = Android.Graphics.Paint;
using ShapeDrawable = Android.Graphics.Drawables.ShapeDrawable;
#endif

namespace SecureFolderFS.Maui.Extensions.Mappers
{
public static partial class CustomMappers
{
public static void AddEntryMappers()
{
EntryHandler.Mapper.AppendToMapping($"{nameof(CustomMappers)}.{nameof(Entry)}", (handler, view) =>
{
if (view is not ModernEntry)
return;
#if ANDROID
var outerRadii = Enumerable.Range(1, 8).Select(_ => 24f).ToArray();
var roundRectShape = new RoundRectShape(outerRadii, null, null);
var shape = new ShapeDrawable(roundRectShape);

shape.Paint!.Color = (App.Instance.Resources["BorderLightColor"] as Color)!.ToPlatform();
shape.Paint.StrokeWidth = 4;
shape.Paint.SetStyle(Paint.Style.Stroke);
handler.PlatformView.Background = shape;
handler.PlatformView.SetPadding(40, 32,40, 32);
#elif IOS
handler.PlatformView.Layer.BorderColor = (App.Current.Resources["BorderLightColor"] as Color).ToPlatform().CGColor;
handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.RoundedRect;
#endif
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Microsoft.Maui.Handlers;
using SecureFolderFS.Maui.UserControls.Common;

namespace SecureFolderFS.Maui.Extensions.Mappers
{
public static partial class CustomMappers
{
public static void AddLabelMappers()
{
LabelHandler.Mapper.AppendToMapping($"{nameof(CustomMappers)}.{nameof(Label)}", (handler, view) =>
{
if (view is not SelectableLabel)
return;

#if ANDROID
handler.PlatformView.SetTextIsSelectable(true);
#endif
});
}
}
}
Loading