Skip to content

Commit c495c79

Browse files
committed
Add missing properties to plist
1 parent 3891c0b commit c495c79

14 files changed

Lines changed: 60 additions & 130 deletions

File tree

src/Core/SecureFolderFS.Core.FileSystem/Streams/PlaintextStream.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,14 @@ private bool TryWriteHeader()
316316

317317
lock (_writeLock)
318318
{
319+
// Re-check after lock
320+
if (_headerBuffer.IsHeaderReady)
321+
return true;
322+
319323
// Check if there is data already written only when we can seek
320324
if (Inner.Length > 0L)
321325
return false;
322326

323-
// Make sure we save the header state
324-
_headerBuffer.IsHeaderReady = true;
325-
326327
// Allocate ciphertext header
327328
Span<byte> ciphertextHeader = stackalloc byte[_security.HeaderCrypt.HeaderCiphertextSize];
328329

@@ -343,6 +344,9 @@ private bool TryWriteHeader()
343344
Inner.Write(ciphertextHeader);
344345
}
345346

347+
// Make sure we save the header state
348+
_headerBuffer.IsHeaderReady = true;
349+
346350
return true;
347351
}
348352
}

src/Core/SecureFolderFS.Core.WebDav/EncryptingStorage2/EncryptingDiskStoreFile.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,8 @@ public async Task<HttpStatusCode> UploadFromStreamAsync(Stream inputStream, Canc
133133
try
134134
{
135135
// Copy the information to the destination stream
136-
using (var outputStream = await GetWritableStreamAsync(cancellationToken).ConfigureAwait(false))
137-
{
138-
await inputStream.CopyToAsync(outputStream).ConfigureAwait(false);
139-
}
140-
136+
await using var outputStream = await GetWritableStreamAsync(cancellationToken).ConfigureAwait(false);
137+
await inputStream.CopyToAsync(outputStream, cancellationToken).ConfigureAwait(false);
141138
return HttpStatusCode.OK;
142139
}
143140
catch (IOException ioException) when (ioException.IsDiskFull())

src/Platforms/SecureFolderFS.Maui/Platforms/iOS/Info.plist

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@
33
<plist version="1.0">
44
<dict>
55
<key>NSFaceIDUsageDescription</key>
6-
<string>Use Face ID to authenticate vaults</string>
6+
<string>Allows Face ID authentication to unlock vaults.</string>
77
<key>LSRequiresIPhoneOS</key>
88
<true/>
9+
<key>NSAppTransportSecurity</key>
10+
<dict>
11+
<key>NSAllowsArbitraryLoads</key>
12+
<true/>
13+
</dict>
14+
<key>NSLocalNetworkUsageDescription</key>
15+
<string>This app needs local network access to connect to user-specified FTP servers.</string>
16+
<key>NSBonjourServices</key>
17+
<array>
18+
<string>_ftp._tcp</string>
19+
<string>_ftps._tcp</string>
20+
</array>
921
<key>UIDeviceFamily</key>
1022
<array>
1123
<integer>1</integer>

src/Platforms/SecureFolderFS.Maui/Popups/CredentialsPopup.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
Clicked="ResetViewButton_Click"
3333
HorizontalOptions="Fill"
3434
IsEnabled="{Binding ViewModel.CanContinue, Mode=OneWay, Source={x:Reference ThisPopup}}"
35-
Style="{OnPlatform Android={StaticResource AccentButtonStyle},
36-
iOS={StaticResource NoBackgroundButtonStyle}}"
35+
Style="{StaticResource AccentButtonStyle}"
3736
Text="{Binding ViewModel.PrimaryText, Mode=OneWay, Source={x:Reference ThisPopup}}" />
3837
</VerticalStackLayout>
3938
</DataTemplate>
@@ -44,7 +43,8 @@
4443
<uc:LoginControl CurrentViewModel="{Binding CurrentViewModel, Mode=OneWay}" ProvideContinuationButton="True" />
4544
<Button
4645
Command="{Binding RecoverAccessCommand}"
47-
Style="{StaticResource TransparentButtonStyle}"
46+
Style="{OnPlatform Android={StaticResource TransparentButtonStyle},
47+
iOS={StaticResource NoBackgroundButtonStyle}}"
4848
Text="{l:ResourceString Rid=RecoverAccess}" />
4949
</VerticalStackLayout>
5050
</DataTemplate>

src/Platforms/SecureFolderFS.Maui/Popups/PropertiesPopup.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@
4949
CommandParameter="ItemType"
5050
Subtitle="{Binding ViewModel.FileTypeText, Mode=OneWay}" />
5151

52+
<!-- Size -->
53+
<uc:ItemProperty
54+
Title="{l:ResourceString Rid=Size}"
55+
Command="{Binding ViewModel.CopyPropertyCommand, Mode=OneWay}"
56+
CommandParameter="Size"
57+
IsVisible="{Binding ViewModel.SizeText, Mode=OneWay, Converter={StaticResource NullToBoolConverter}}"
58+
Subtitle="{Binding ViewModel.SizeText, Mode=OneWay}" />
59+
5260
<!-- Date Created -->
5361
<OnPlatform x:TypeArguments="View">
5462
<On Platform="iOS">
@@ -66,14 +74,6 @@
6674
Command="{Binding ViewModel.CopyPropertyCommand, Mode=OneWay}"
6775
CommandParameter="DateModified"
6876
Subtitle="{Binding ViewModel.DateModifiedText, Mode=OneWay}" />
69-
70-
<!-- Size -->
71-
<uc:ItemProperty
72-
Title="{l:ResourceString Rid=Size}"
73-
Command="{Binding ViewModel.CopyPropertyCommand, Mode=OneWay}"
74-
CommandParameter="Size"
75-
IsVisible="{Binding ViewModel.SizeText, Mode=OneWay, Converter={StaticResource NullToBoolConverter}}"
76-
Subtitle="{Binding ViewModel.SizeText, Mode=OneWay}" />
7777
</VerticalStackLayout>
7878
</Border>
7979
</tv:Popup>

src/Platforms/SecureFolderFS.Maui/ServiceImplementation/MauiAccountService.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public async IAsyncEnumerable<AccountViewModel> GetAccountsAsync(string dataSour
4141
yield return accountData.DataSourceType switch
4242
{
4343
DATA_SOURCE_FTP => new FtpAccountViewModel(accountData, propertyStore),
44-
45-
// TODO: Maybe move AccountViewModel to shared project and implement the AccountViewModel
46-
// in separate projects (SecureFolderFS.Sdk.Ftp, SecureFolderFS.Sdk.GoogleDrive)
4744
_ => throw new ArgumentOutOfRangeException(nameof(AccountDataModel.DataSourceType))
4845
};
4946
}

src/Platforms/SecureFolderFS.Maui/Views/Modals/Vault/FilePreviewModalPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected override async void OnDisappearing()
9898
};
9999

100100
#if IOS
101-
await Task.Delay(800);
101+
await Task.Delay(600);
102102
#endif
103103
var result = await overlayService.ShowAsync(messageOverlay);
104104
if (result.Positive())
@@ -161,7 +161,7 @@ private void GalleryView_Loaded(object? sender, EventArgs e)
161161
if (sender is not GalleryView { BindingContext: CarouselPreviewerViewModel carouselViewModel } galleryView)
162162
return;
163163

164-
GalleryView.Current = galleryView;
164+
GalleryView = galleryView;
165165
galleryView.FitToParent();
166166

167167
galleryView.PreviousRequested += Gallery_PreviousRequested;

src/Platforms/SecureFolderFS.Uno/Extensions/OnPlatform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class OnPlatform : MarkupExtension
2828
if (OperatingSystem.IsLinux())
2929
return Linux;
3030

31-
throw new System.PlatformNotSupportedException();
31+
throw new PlatformNotSupportedException();
3232
#endif
3333
}
3434
}

src/Platforms/SecureFolderFS.Uno/ValueConverters/SeverityHealthIconConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ internal sealed class SeverityHealthIconConverter : BaseSeverityHealthIconConver
1313
#if WINDOWS && !HAS_UNO
1414
new SvgImageSource(new("ms-appx://SecureFolderFS.UI/Assets/AppAssets/Shields/success_shield.svg"));
1515
#else
16-
new BitmapImage(new("ms-appx://SecureFolderFS.UI/Assets/AppAssets/Shields/success_shield.png"));
16+
new BitmapImage(new("/Assets/AppAssets/Shields/success_shield.png"));
1717
#endif
1818

1919
/// <inheritdoc/>
2020
protected override object? WarningIcon { get; } =
2121
#if WINDOWS && !HAS_UNO
2222
new SvgImageSource(new("ms-appx://SecureFolderFS.UI/Assets/AppAssets/Shields/warning_shield.svg"));
2323
#else
24-
new BitmapImage(new("ms-appx://SecureFolderFS.UI/Assets/AppAssets/Shields/warning_shield.png"));
24+
new BitmapImage(new("/Assets/AppAssets/Shields/warning_shield.png"));
2525
#endif
2626

2727
/// <inheritdoc/>
2828
protected override object? CriticalIcon { get; } =
2929
#if WINDOWS && !HAS_UNO
3030
new SvgImageSource(new("ms-appx://SecureFolderFS.UI/Assets/AppAssets/Shields/error_shield.svg"));
3131
#else
32-
new BitmapImage(new("ms-appx://SecureFolderFS.UI/Assets/AppAssets/Shields/error_shield.png"));
32+
new BitmapImage(new("/Assets/AppAssets/Shields/error_shield.png"));
3333
#endif
3434

3535
/// <inheritdoc/>

src/Sdk/SecureFolderFS.Sdk.Ftp/ViewModels/FtpAccountViewModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,12 @@ private async Task<IFolder> ConnectAsync(string? address, string? username, stri
116116
try
117117
{
118118
var uri = new Uri(address);
119-
_ftpClient = new AsyncFtpClient(uri.Host, username, password ?? string.Empty, uri.Port);
119+
var config = new FtpConfig();
120+
// Sandbox may block automatic detection of PASV, so it's necessary to be set manually
121+
if (OperatingSystem.IsIOS())
122+
config.DataConnectionType = FtpDataConnectionType.PASV;
123+
124+
_ftpClient = new AsyncFtpClient(uri.Host, username, password ?? string.Empty, uri.Port, config);
120125
using var timeoutCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
121126
timeoutCts.CancelAfter(TimeSpan.FromMilliseconds(3000));
122127
await _ftpClient.Connect(timeoutCts.Token);

0 commit comments

Comments
 (0)