Skip to content

Commit

Permalink
Simplify project file
Browse files Browse the repository at this point in the history
  • Loading branch information
d2dyno1 committed Oct 8, 2024
1 parent ca0b6b8 commit 7758845
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/Platforms/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<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" />
<PackageVersion Include="Uno.Resizetizer" Version="1.5.2" />
<PackageVersion Include="Uno.Resizetizer" Version="1.6.0" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.3.90" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.37" />
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="8.0.20" />
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/SecureFolderFS.Uno/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Properties>
<DisplayName>SecureFolderFS</DisplayName>
<PublisherDisplayName>d2dyno</PublisherDisplayName>
<Logo>Assets\PackageLogo.png</Logo>
<Logo>Assets\AppIcon\PackageLogo.png</Logo>
</Properties>

<Dependencies>
Expand Down
45 changes: 14 additions & 31 deletions src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<!-- Uncomment if you want to explicity set a TargetFramework -->
<!--<TargetFramework>net8.0-desktop</TargetFramework>-->
<!--<TargetFramework>net8.0-maccatalyst</TargetFramework>-->
<!--<TargetFramework>net8.0-windows10.0.19041</TargetFramework>-->
</PropertyGroup>

<PropertyGroup>

<PropertyGroup>
<!-- Build Properties -->
<OutputType>Exe</OutputType>
<UnoSingleProject>true</UnoSingleProject>
Expand All @@ -25,31 +25,6 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationId>com.securefolderfs.SecureFolderFS</ApplicationId>

</PropertyGroup>

<PropertyGroup>
<!--
UnoFeatures lets you quickly add and manage implicit package references based on the features you want to use.
https://aka.platform.uno/singleproject-features
-->
<UnoFeatures>
OpenSans;
</UnoFeatures>
</PropertyGroup>

<PropertyGroup>
<!--
If you encounter this error message:
error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll.
Please update to a newer .NET SDK in order to reference this assembly.
This means that the two packages below must be aligned with the "build" version number of
the "Microsoft.Windows.SDK.BuildTools" package above, and the "revision" version number
must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref.
-->
<!-- <WindowsSdkPackageVersion>10.0.22621.28</WindowsSdkPackageVersion> -->
</PropertyGroup>

<!-- Package References -->
Expand Down Expand Up @@ -128,14 +103,23 @@
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<TargetFramework>$(DotNetVersion)-windows10.0.19041.0</TargetFramework>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<!--<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>-->

<!-- Packaging -->
<AppxBundle>Never</AppxBundle>
<!--<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>-->
<AppxBundlePlatforms>x86|x64|arm64</AppxBundlePlatforms>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>False</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm64</AppxBundlePlatforms>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<!--<GenerateAppxPackageOnBuild>True</GenerateAppxPackageOnBuild>-->
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
<GenerateTestArtifacts>False</GenerateTestArtifacts>
<!--<UapAppxPackageBuildMode>Sideloading</UapAppxPackageBuildMode>-->

<!-- Temporary workaround for https://github.com/microsoft/WindowsAppSDK/issues/4480 -->
<WinAppSdkBuildToolsVersion Condition="$(TargetFramework.Contains('windows10'))">10.0.22621.3233</WinAppSdkBuildToolsVersion>
<UnoExtensionsVersion Condition="$(TargetFramework.Contains('windows10'))">4.2.2</UnoExtensionsVersion>

<!-- Languages -->
<AppxDefaultResourceQualifiers>Language=en-US;pl-PL;de-DE;es-ES;da-DK;uk-UA;pt-PT;ms-MY;id-ID;hi-IN</AppxDefaultResourceQualifiers>
Expand Down Expand Up @@ -222,7 +206,6 @@
<None Remove="Dialogs\RecoveryDialog.xaml" />
<None Remove="Dialogs\SettingsDialog.xaml" />
<None Remove="Dialogs\VaultWizardDialog.xaml" />
<None Remove="Package.appxmanifest" />
<None Remove="ResourceDictionaries\ColorResources.xaml" />
<None Remove="ResourceDictionaries\ImageResources.xaml" />
<None Remove="ResourceDictionaries\TextResources.xaml" />
Expand Down
13 changes: 13 additions & 0 deletions src/SecureFolderFS.Core.Migration/AppModels/V1_V2/MigratorV1_V2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public async Task MigrateAsync(IDisposable unlockContract, ProgressModel progres

// Create backup
await CreateConfigBackup(configStream, cancellationToken);
await CreateKeystoreBackup(cancellationToken);

await using var serializedStream = await _streamSerializer.SerializeAsync(v2ConfigDataModel, cancellationToken);
await serializedStream.CopyToAsync(configStream, cancellationToken);
Expand All @@ -117,6 +118,18 @@ private async Task CreateConfigBackup(Stream configStream, CancellationToken can
configStream.Position = 0L;
}

private async Task CreateKeystoreBackup(CancellationToken cancellationToken)
{
if (VaultFolder is not IModifiableFolder modifiableFolder)
return;

var keystoreFile = await VaultFolder.GetFileByNameAsync(Constants.Vault.Names.VAULT_KEYSTORE_FILENAME, cancellationToken);
var backupKeystoreName = $"{Constants.Vault.Names.VAULT_KEYSTORE_FILENAME}.bkup";
var backupKeystoreFile = await modifiableFolder.CreateFileAsync(backupKeystoreName, true, cancellationToken);

await keystoreFile.CopyContentsToAsync(backupKeystoreFile, cancellationToken);
}

private static string GetContentCipherId(int v1ContentCipherScheme)
{
return v1ContentCipherScheme switch
Expand Down

0 comments on commit 7758845

Please sign in to comment.