Skip to content

Commit f771db5

Browse files
committed
v8.1.26791.0-Beta2
1 parent 4cbd863 commit f771db5

37 files changed

+505
-282
lines changed

Common/Common.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Platforms>AnyCPU;x64</Platforms>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26727.0-Beta2" />
14-
<PackageReference Include="ITHit.FileSystem" Version="8.1.26727.0-Beta2" />
13+
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26791.0-Beta2" />
14+
<PackageReference Include="ITHit.FileSystem" Version="8.1.26791.0-Beta2" />
1515
</ItemGroup>
1616
</Project>

Windows/Common/Core/Common.Windows.Core.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
2222
</ItemGroup>
2323
<ItemGroup>
24-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26727.0-Beta2" />
25-
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26727.0-Beta2" />
24+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26791.0-Beta2" />
25+
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26791.0-Beta2" />
2626
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2727
</ItemGroup>
2828
</Project>

Windows/Common/VirtualDrive/Common.Windows.VirtualDrive.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<Compile Remove="IVirtualFolder.cs" />
1414
</ItemGroup>
1515
<ItemGroup>
16-
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="8.1.26727.0-Beta2" />
17-
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26727.0-Beta2" />
16+
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="8.1.26791.0-Beta2" />
17+
<PackageReference Include="ITHit.FileSystem.Windows" Version="8.1.26791.0-Beta2" />
1818
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1919
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
2020
</ItemGroup>

Windows/VirtualDrive/VirtualDrive.ShellExtension/VirtualDrive.ShellExtension.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
2020
</ItemGroup>
2121
<ItemGroup>
22-
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="8.1.26727.0-Beta2" />
22+
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="8.1.26791.0-Beta2" />
2323
</ItemGroup>
2424
<ItemGroup>
2525
<None Update="log4net.config">

Windows/VirtualDrive/VirtualDrive/VirtualDrive.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This is an advanced project with ETags support, Microsoft Office documents editi
4040
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
4141
</ItemGroup>
4242
<ItemGroup>
43-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26727.0-Beta2" />
43+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26791.0-Beta2" />
4444
<ProjectReference Include="..\..\..\Common\Common.csproj" />
4545
<ProjectReference Include="..\..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
4646
</ItemGroup>

Windows/VirtualFileSystem/VirtualFileSystem.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This project does not support ETags, locking, Microsoft Office documents editing
3535
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.7" />
3636
</ItemGroup>
3737
<ItemGroup>
38-
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="8.1.26727.0-Beta2" />
38+
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="8.1.26791.0-Beta2" />
3939
<ProjectReference Include="..\Common\Core\Common.Windows.Core.csproj" />
4040
</ItemGroup>
4141
<ItemGroup>

Windows/WebDAVDrive/WebDAVDrive.ShellExtension/WebDAVDrive.ShellExtension.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Copyright>IT HIT LTD.</Copyright>
1313
</PropertyGroup>
1414
<ItemGroup>
15-
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="8.1.26727.0-Beta2" />
15+
<PackageReference Include="ITHit.FileSystem.Windows.ShellExtension" Version="8.1.26791.0-Beta2" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<None Update="log4net.config">

Windows/WebDAVDrive/WebDAVDrive/WebDAVDrive.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
4040
</ItemGroup>
4141
<ItemGroup>
42-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26727.0-Beta2" />
42+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="8.1.26791.0-Beta2" />
4343
<ProjectReference Include="..\..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
4444
<ProjectReference Include="..\WebDAVDrive.ShellExtension\WebDAVDrive.ShellExtension.csproj" />
4545
<ProjectReference Include="..\WebDAVDrive.UI\WebDAVDrive.UI.csproj" />

macOS/Common/Core/Common.Core.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<LinkMode>None</LinkMode>
2020
</PropertyGroup>
2121
<ItemGroup>
22-
<PackageReference Include="ITHit.FileSystem" Version="8.1.26727-Beta2" />
22+
<PackageReference Include="ITHit.FileSystem" Version="8.1.26791-Beta2" />
2323
</ItemGroup>
2424
</Project>

macOS/Common/Core/NotificationAnotherDomainIsRegistered.cs

-9
This file was deleted.

macOS/Common/Core/NotificationItemSettings.cs

-18
This file was deleted.

macOS/Common/Core/SecureStorageBase.cs

+19-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ namespace Common.Core
66
public class SecureStorageBase
77
{
88
private string appGroupId;
9+
private string domainIdentifier;
910
private const string InternalSettingFile = "userdata.out";
1011

12+
public SecureStorageBase(string appGroupId, string domainIdentifier)
13+
{
14+
this.appGroupId = appGroupId;
15+
this.domainIdentifier = domainIdentifier;
16+
}
17+
1118
public SecureStorageBase(string appGroupId)
1219
{
1320
this.appGroupId = appGroupId;
@@ -31,6 +38,11 @@ public async Task SetAsync(string key, string value)
3138
throw new ArgumentNullException(nameof(value));
3239
}
3340

41+
if(!string.IsNullOrEmpty(domainIdentifier))
42+
{
43+
key = $"{domainIdentifier}-{key}";
44+
}
45+
3446
// Because secure storage requires provisioning profile, in case of the development mode, we store credentials in external file.
3547
string userDataPath = Path.Combine(GetSharedContainerPath(), InternalSettingFile);
3648
Dictionary<string, string> userData = File.Exists(userDataPath) ? JsonSerializer.Deserialize<Dictionary<string, string>>(await File.ReadAllTextAsync(userDataPath)) : new Dictionary<string, string>();
@@ -61,15 +73,21 @@ public async Task SetAsync(string key, string value)
6173
/// Returns value by key.
6274
/// </summary>
6375
/// <param name="key">Key.</param>
76+
/// <param name="useDomainIdentifier">true if include domain identifier in, otherwise false. default is true.</param>
6477
/// <returns></returns>
65-
public async Task<string> GetAsync(string key)
78+
public async Task<string> GetAsync(string key, bool useDomainIdentifier = true)
6679
{
6780
string userDataPath = Path.Combine(GetSharedContainerPath(), InternalSettingFile);
6881
if (File.Exists(userDataPath))
6982
{
7083
string settingsContent = await File.ReadAllTextAsync(userDataPath);
7184
Dictionary<string, string> userData = JsonSerializer.Deserialize<Dictionary<string, string>>(settingsContent);
7285

86+
if (!string.IsNullOrEmpty(domainIdentifier) && useDomainIdentifier)
87+
{
88+
key = $"{domainIdentifier}-{key}";
89+
}
90+
7391
if (userData.ContainsKey(key))
7492
{
7593
return userData[key];

macOS/VirtualFileSystem/FileProviderExtension/FileProviderExtension.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<ItemGroup>
7777
<PackageReference Include="System.Security.Permissions" Version="8.0.0" />
7878
<PackageReference Include="System.Threading.AccessControl" Version="8.0.0" />
79-
<PackageReference Include="ITHit.FileSystem.Mac" Version="8.1.26727-Beta2" />
79+
<PackageReference Include="ITHit.FileSystem.Mac" Version="8.1.26791-Beta2" />
8080
</ItemGroup>
8181
<ItemGroup>
8282
<Content Include="..\VirtualFileSystemMacApp\Resources\appsettings.json" Link="Resources\appsettings.json" />

macOS/VirtualFileSystem/FileProviderExtension/VirtualEngine.cs

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
using System.Text;
1313
using VirtualFileSystemCommon;
1414

15+
// workaround for NSFileProvider Extension crash on MacOS 14.4 https://github.com/xamarin/xamarin-macios/issues/20034
16+
[assembly: ObjCRuntime.LinkWith(LinkerFlags = "-Wl,-unexported_symbol -Wl,_main")]
17+
1518
namespace FileProviderExtension
1619
{
1720
[Register(nameof(VirtualEngine))]

macOS/VirtualFileSystem/VirtualFileSystemMacApp/AppDelegate.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public override void DidFinishLaunching(NSNotification notification)
3030
if (isExtensionRegistered)
3131
{
3232
UninstallMenuItem.Activated += Uninstall;
33-
RemoteStorageMonitor.ServerNotifications = new ServerNotifications(
33+
RemoteStorageMonitor.ServerNotifications = new ServerNotifications(SecureStorage.BaseExtensionIdentifier,
3434
NSFileProviderManager.FromDomain(new NSFileProviderDomain(SecureStorage.BaseExtensionIdentifier, SecureStorage.BaseExtensionDisplayName)),
3535
RemoteStorageMonitor.Logger);
3636
RemoteStorageMonitor.Start();
@@ -66,7 +66,7 @@ private void Install(object? sender, EventArgs e)
6666
Task.Run(async () =>
6767
{
6868
NSFileProviderDomain domain = await Common.Core.Registrar.RegisterAsync(SecureStorage.BaseExtensionIdentifier, SecureStorage.BaseExtensionDisplayName, Logger);
69-
RemoteStorageMonitor.ServerNotifications = new ServerNotifications(NSFileProviderManager.FromDomain(domain), RemoteStorageMonitor.Logger);
69+
RemoteStorageMonitor.ServerNotifications = new ServerNotifications(domain.Identifier, NSFileProviderManager.FromDomain(domain), RemoteStorageMonitor.Logger);
7070
RemoteStorageMonitor.Start();
7171
}).Wait();
7272

macOS/WebDAVDrive/WebDAVCommon/SecureStorage.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ namespace WebDAVCommon
99
{
1010
public class SecureStorage: SecureStorageBase
1111
{
12-
public SecureStorage(): base("65S3A9JQ35.group.com.webdav.vfs")
12+
public SecureStorage(string domainIdentifier) : base("H9B9JEKY3W.group.com.webdav.vfs", domainIdentifier)
13+
{
14+
15+
}
16+
17+
public SecureStorage() : base("H9B9JEKY3W.group.com.webdav.vfs")
1318
{
1419

1520
}

macOS/WebDAVDrive/WebDAVCommon/WebDavSessionUtils.cs

+29-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using System.Net;
3+
using Common.Core;
4+
using ITHit.FileSystem;
35
using ITHit.WebDAV.Client;
46

57
namespace WebDAVCommon
@@ -9,12 +11,22 @@ public class WebDavSessionUtils
911
/// <summary>
1012
/// Initializes WebDAV session.
1113
/// </summary>
12-
public static async Task<WebDavSession> GetWebDavSessionAsync()
14+
public static async Task<WebDavSession> GetWebDavSessionAsync(SecureStorage secureStorage)
1315
{
14-
SecureStorage secureStorage = new SecureStorage();
1516
WebDavSession webDavSession = new WebDavSession(AppGroupSettings.Settings.Value.WebDAVClientLicense);
1617
webDavSession.CustomHeaders.Add("InstanceId", Environment.MachineName);
1718

19+
await UpdateAuthenticationAsync(webDavSession, secureStorage);
20+
return webDavSession;
21+
}
22+
23+
/// <summary>
24+
/// Updates authentication settings.
25+
/// </summary>
26+
/// <param name="webDavSession">WebDav session.</param>
27+
/// <returns></returns>
28+
public static async Task UpdateAuthenticationAsync(WebDavSession webDavSession, SecureStorage secureStorage)
29+
{
1830
string loginType = await secureStorage.GetAsync("LoginType");
1931
if (!string.IsNullOrEmpty(loginType) && loginType.Equals("UserNamePassword"))
2032
{
@@ -25,14 +37,26 @@ public static async Task<WebDavSession> GetWebDavSessionAsync()
2537
List<Cookie> cookies = await secureStorage.GetAsync<List<Cookie>>("Cookies");
2638
if (cookies != null)
2739
{
40+
CookieCollection currentCookies = webDavSession.CookieContainer.GetAllCookies();
2841
foreach (Cookie cookie in cookies)
2942
{
30-
webDavSession.CookieContainer.Add(cookie);
43+
Cookie? currentCookie = webDavSession.CookieContainer.GetAllCookies().Where(p => p.Name == cookie.Name && p.Domain == cookie.Domain).FirstOrDefault();
44+
if (currentCookie == null)
45+
{
46+
webDavSession.CookieContainer.Add(new Cookie(cookie.Name, cookie.Value)
47+
{
48+
Domain = cookie.Domain,
49+
Secure = cookie.Secure,
50+
HttpOnly = cookie.HttpOnly
51+
});
52+
}
53+
else
54+
{
55+
currentCookie.Value = cookie.Value;
56+
}
3157
}
3258
}
3359
}
34-
35-
return webDavSession;
3660
}
3761
}
3862
}

macOS/WebDAVDrive/WebDAVFileProviderExtension/Entitlements.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<true/>
77
<key>com.apple.security.application-groups</key>
88
<array>
9-
<string>65S3A9JQ35.group.com.webdav.vfs</string>
9+
<string>H9B9JEKY3W.group.com.webdav.vfs</string>
1010
</array>
1111
<key>com.apple.security.files.downloads.read-write</key>
1212
<true/>

macOS/WebDAVDrive/WebDAVFileProviderExtension/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</dict>
5555
</array>
5656
<key>NSExtensionFileProviderDocumentGroup</key>
57-
<string>65S3A9JQ35.group.com.webdav.vfs</string>
57+
<string>H9B9JEKY3W.group.com.webdav.vfs</string>
5858
<key>NSFileProviderDecorations</key>
5959
<array>
6060
<dict>

0 commit comments

Comments
 (0)