diff --git a/CollapseLauncher/Classes/CachesManagement/Honkai/Check.cs b/CollapseLauncher/Classes/CachesManagement/Honkai/Check.cs index 52851e3ea..f465a5e6e 100644 --- a/CollapseLauncher/Classes/CachesManagement/Honkai/Check.cs +++ b/CollapseLauncher/Classes/CachesManagement/Honkai/Check.cs @@ -1,6 +1,8 @@ using CollapseLauncher.Helper; using CollapseLauncher.Helper.StreamUtility; using CollapseLauncher.Interfaces; +using Hi3Helper.Data; +using Hi3Helper.EncTool.Parser.AssetMetadata; using Hi3Helper.Log; using System; using System.Buffers; @@ -35,8 +37,7 @@ private async Task> Check(List assetIndex, Cancella Directory.CreateDirectory(GamePath!); } - // Check for unused files - CheckUnusedAssets(assetIndex, returnAsset); + HashSet exceptionFromUnusedCategory = []; // Do check in parallelization. await Parallel.ForEachAsync(assetIndex!, new ParallelOptions @@ -45,8 +46,11 @@ private async Task> Check(List assetIndex, Cancella CancellationToken = token }, async (asset, localToken) => { - await CheckAsset(asset, returnAsset, localToken); + await CheckAsset(asset, returnAsset, exceptionFromUnusedCategory, localToken); }); + + // Check for unused files + CheckUnusedAssets(assetIndex, returnAsset, exceptionFromUnusedCategory); } catch (AggregateException ex) { @@ -57,10 +61,10 @@ private async Task> Check(List assetIndex, Cancella return returnAsset; } - private void CheckUnusedAssets(List assetIndex, List returnAsset) + private void CheckUnusedAssets(List assetIndex, List returnAsset, HashSet exceptionFromUnusedCategory) { // Directory info and if the directory doesn't exist, return - DirectoryInfo directoryInfo = new DirectoryInfo(GamePath); + DirectoryInfo directoryInfo = new(GamePath); if (!directoryInfo.Exists) { return; @@ -82,10 +86,10 @@ private void CheckUnusedAssets(List assetIndex, List ret foreach (FileInfo fileInfo in directoryInfo.EnumerateFiles("*", SearchOption.AllDirectories) .EnumerateNoReadOnly()) { - ReadOnlySpan filePath = fileInfo.FullName; - - if (filePath.ContainsAny(unusedSearchValues) - || assetIndex.Exists(x => x.ConcatPath == fileInfo.FullName)) + bool excludedFromList = exceptionFromUnusedCategory.Contains(fileInfo.FullName); + if (excludedFromList || + fileInfo.FullName.AsSpan().ContainsAny(unusedSearchValues) || + assetIndex.Exists(x => x.ConcatPath == fileInfo.FullName)) { continue; } @@ -94,7 +98,7 @@ private void CheckUnusedAssets(List assetIndex, List ret ProgressAllCountFound++; // Add asset to the returnAsset - CacheAsset asset = new CacheAsset + CacheAsset asset = new() { BasePath = Path.GetDirectoryName(fileInfo.FullName), N = Path.GetFileName(fileInfo.FullName), @@ -121,13 +125,19 @@ private void CheckUnusedAssets(List assetIndex, List ret } } - private async ValueTask CheckAsset(CacheAsset asset, List returnAsset, CancellationToken token) + private async ValueTask CheckAsset(CacheAsset asset, List returnAsset, HashSet exceptionFromUnusedCategory, CancellationToken token) { // Increment the count and update the status Interlocked.Add(ref ProgressAllCountCurrent, 1); Status.ActivityStatus = string.Format(Locale.Current.Lang?._CachesPage?.CachesStatusChecking ?? "", asset!.DataType, asset.N); Status.ActivityAll = string.Format(Locale.Current.Lang?._CachesPage?.CachesTotalStatusChecking ?? "", ProgressAllCountCurrent, ProgressAllCountTotal); + // Check for patch ifnormation first. + if (!UseFastMethod && await IsPatchExist(asset, returnAsset, exceptionFromUnusedCategory, token)) + { + return; + } + // Assign the file info. FileInfo fileInfo = new FileInfo(asset.ConcatPath).EnsureNoReadOnly(out bool isExist); @@ -163,15 +173,85 @@ private async ValueTask CheckAsset(CacheAsset asset, List returnAsse } } + private async ValueTask IsPatchExist( + CacheAsset asset, + List returnAsset, + HashSet exceptionFromUnusedCategory, + CancellationToken token) + { + if (asset.PatchInfo is not { } patchInfoDict) + return false; + + string assetDir = Path.Combine(GetAssetBasePathByType(asset.DataType), asset.DataType.ToString().ToLowerInvariant()); + byte[] hashArrayBuffer = ArrayPool.Shared.Rent(20); + + try + { + foreach ((string oldFileName, CachePatchInfo patchInfo) in patchInfoDict) + { + string combinedOldPath = Path.Combine(assetDir, $"{oldFileName}.unity3d"); + string combinedPatchPath = Path.Combine(assetDir, patchInfo.PatchName); + ConverterTool.NormalizePathInplaceNoTrim(combinedOldPath); + + FileInfo fileInfo = new(combinedOldPath); + + if (!fileInfo.Exists) + continue; + + // If above passes, then run the CRC check + await using FileStream oldFileStream = await NaivelyOpenFileStreamAsync(fileInfo, FileMode.Open, FileAccess.Read, FileShare.Read); + // Calculate the asset CRC (SHA1) + byte[] hashArray = await GetCryptoHashAsync(oldFileStream, GameSalt, true, true, token); + + // If the asset CRC doesn't match, then add the file to asset index. + ReadOnlySpan hashSpan = GetHashFromName(hashArrayBuffer, oldFileName); + if (!IsArrayMatch(hashSpan, hashArray)) + { + continue; + } + + // Clear patch info and re-add single patch info. + patchInfoDict.Clear(); + patchInfoDict.Add(oldFileName, patchInfo); + exceptionFromUnusedCategory.Add(combinedOldPath); + exceptionFromUnusedCategory.Add(combinedPatchPath); + + AddGenericCheckAsset(asset, CacheAssetStatus.Patch, returnAsset, hashArray, asset.CRCArray); + return true; + } + } + finally + { + ArrayPool.Shared.Return(hashArrayBuffer); + } + + // Unassign patch info if none is found. + asset.PatchInfo = null; + return false; + + static ReadOnlySpan GetHashFromName(Span buffer, ReadOnlySpan name) + { + ReadOnlySpan hexString = name.GetSplit(1, '_'); + if (hexString.IsEmpty || HexTool.TryHexToBytesUnsafe(hexString, buffer, out _, out int length) != OperationStatus.Done) + return ReadOnlySpan.Empty; + + return buffer[..length]; + } + } + private void AddGenericCheckAsset(CacheAsset asset, CacheAssetStatus assetStatus, List returnAsset, byte[] localCrc, byte[] remoteCrc) { + long size = asset.PatchInfo?.Values.FirstOrDefault() is { } patchInfo + ? patchInfo.PatchFileSize + : asset.CS; + // Increment the count and total size lock (this) { // Set Indetermined status as false Status.IsProgressAllIndetermined = false; ProgressAllCountFound++; - ProgressAllSizeFound += asset!.CS; + ProgressAllSizeFound += size; } // Add file into asset index @@ -188,7 +268,7 @@ private void AddGenericCheckAsset(CacheAsset asset, CacheAssetStatus assetStatus Path.GetFileName(asset.N) ?? "", asset.DataType, Path.GetDirectoryName(asset.N), - asset.CS, + size, localCrc, remoteCrc )) diff --git a/CollapseLauncher/Classes/CachesManagement/Honkai/Fetch.cs b/CollapseLauncher/Classes/CachesManagement/Honkai/Fetch.cs index 519432dc2..d02ebfeb0 100644 --- a/CollapseLauncher/Classes/CachesManagement/Honkai/Fetch.cs +++ b/CollapseLauncher/Classes/CachesManagement/Honkai/Fetch.cs @@ -4,6 +4,7 @@ using CollapseLauncher.RepairManagement; using Hi3Helper.EncTool; using Hi3Helper.EncTool.Enc; +using Hi3Helper.EncTool.Parser.AssetMetadata; using Hi3Helper.EncTool.Parser.KianaDispatch; using Hi3Helper.Log; using Hi3Helper.UABT; @@ -22,6 +23,7 @@ // ReSharper disable StringLiteralTypo #pragma warning disable IDE0130 +#nullable enable namespace CollapseLauncher { internal partial class HonkaiCache @@ -46,6 +48,9 @@ private async Task> Fetch(CancellationToken token) // Build _gameRepoURL from loading Dispatcher and Gateway await BuildGameRepoURL(httpClientNew, token); + // Iterate patch for "Data" type + CachePatchManifest dataTypePatch = await FetchPatchByType(httpClientNew, CacheAssetType.Data, token); + // Iterate type and do fetch await Parallel.ForEachAsync( Enum.GetValues(), @@ -81,16 +86,19 @@ await Parallel.ForEachAsync( } }); + // Merge patch info + MergeAssetPatchInfo(dataTypePatch, returnAsset); + // Return asset index return returnAsset; } private async Task BuildGameRepoURL(HttpClient client, CancellationToken token) { - KianaDispatch dispatch = null; - Exception lastException = null; + KianaDispatch? dispatch = null; + Exception? lastException = null; - PresetConfig presetConfig = GameVersionManager!.GamePreset!; + PresetConfig presetConfig = GameVersionManager.GamePreset; int[] version = GameVersion.VersionArray; string key = presetConfig.DispatcherKey ?? ""; @@ -127,7 +135,7 @@ private async Task BuildGameRepoURL(HttpClient client, CancellationToken token) // Get gatewayURl and fetch the gateway GameGateway = await KianaDispatch.GetGameServerAsync(client, - dispatch!, + dispatch, presetConfig.GameGatewayDefault!, key, version, @@ -164,6 +172,45 @@ private async Task BuildGameRepoURL(HttpClient client, CancellationToken token) return returnValue; } + private async Task FetchPatchByType(HttpClient client, CacheAssetType type, CancellationToken token) + { + Status.ActivityStatus = string.Format(Locale.Current.Lang?._CachesPage?.CachesStatusFetchingType ?? "", $"{type}Patch"); + Status.IsProgressAllIndetermined = true; + Status.IsIncludePerFileIndicator = false; + UpdateStatus(); + + // Get the asset index properties + string baseUrl = string.Format(BuildAssetBundleURL(GameGateway), type.ToString().ToLowerInvariant()); + string fileUrl = string.Format(baseUrl.CombineURLFromString("patch/patchconfig.xmf?t={0}"), DateTime.Now.Ticks); + + CDNCacheResult result = await client.TryGetCachedStreamFrom(fileUrl, token: token); + if (!result.IsSuccessStatusCode) + { + Logger.WriteLine($"Cache Patch information file is unavailable due to error: {result.StatusCode} ({(int)result.StatusCode}). URL: {fileUrl}", + LogType.Warning, + true); + return CachePatchManifest.Empty; + } + + await using Stream resultStream = result.Stream; + return new CachePatchManifest(resultStream); + } + + private static void MergeAssetPatchInfo(CachePatchManifest manifest, List assets) + { + Dictionary>.AlternateLookup> lookup = manifest.GetAlternateLookup>(); + foreach (CacheAsset asset in assets.Where(x => x.DataType == CacheAssetType.Data)) + { + ReadOnlySpan fileNameNew = Path.GetFileNameWithoutExtension(asset.ConcatNRemote); + if (!lookup.TryGetValue(fileNameNew, out Dictionary? cachePatchInfoDict)) + { + continue; + } + + asset.PatchInfo = cachePatchInfoDict; + } + } + private IEnumerable EnumerateCacheTextAsset(CacheAssetType type, IEnumerable enumerator, string baseUrl) { // Set isFirst flag as true if type is Data and @@ -199,7 +246,7 @@ private IEnumerable EnumerateCacheTextAsset(CacheAssetType type, IEn continue; } - CacheAsset content; + CacheAsset? content; try { // Deserialize the line and set the type @@ -231,18 +278,13 @@ private IEnumerable EnumerateCacheTextAsset(CacheAssetType type, IEn } } - private async ValueTask> BuildAssetIndex(CacheAssetType type, string baseURL, Stream stream, - List assetIndex, CancellationToken token) + private async ValueTask> BuildAssetIndex(CacheAssetType type, string baseURL, Stream stream, List assetIndex, CancellationToken token) { int count = 0; long size = 0; // Set isFirst flag as true if type is Data and // also convert type as lowered string. - - // Unused as of Aug 4th 2024, bonk @bagusnl if not true - // bool isFirst = type == CacheAssetType.Data; - // bool isNeedReadLuckyNumber = type == CacheAssetType.Data; // Parse asset index file from UABT BundleFile bundleFile = new(stream); @@ -306,7 +348,7 @@ await Parallel.ForEachAsync(EnumerateCacheTextAsset(type, dataTextAsset.GetStrin private static byte[] GetAssetIndexSalt(string data) { // Get the salt from the string and return as byte[] - byte[] key; + byte[]? key; if (DataCooker.IsServeV3Data(MetadataHelper.CurrentMasterKey?.Key)) { DataCooker.GetServeV3DataSize(MetadataHelper.CurrentMasterKey?.Key, out long keyCompSize, @@ -325,13 +367,13 @@ private static byte[] GetAssetIndexSalt(string data) key, saltBytes, out _, - out Exception exception)) + out Exception? exception)) throw exception; return saltBytes; } - private string GetAssetBasePathByType(CacheAssetType type) => Path.Combine(GamePath!, type == CacheAssetType.Data ? "Data" : "Resources"); + private string GetAssetBasePathByType(CacheAssetType type) => Path.Combine(GamePath, type == CacheAssetType.Data ? "Data" : "Resources"); private static bool IsValidRegionFile(string input, string lang) { diff --git a/CollapseLauncher/Classes/CachesManagement/Honkai/Update.cs b/CollapseLauncher/Classes/CachesManagement/Honkai/Update.cs index 5d7d4f84d..ab99f78fe 100644 --- a/CollapseLauncher/Classes/CachesManagement/Honkai/Update.cs +++ b/CollapseLauncher/Classes/CachesManagement/Honkai/Update.cs @@ -1,6 +1,7 @@ using CollapseLauncher.Helper; using CollapseLauncher.Helper.StreamUtility; using CollapseLauncher.Interfaces; +using Hi3Helper.Data; using Hi3Helper.Http; using Hi3Helper.Log; using System; @@ -8,6 +9,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; +using System.Linq; using System.Net; using System.Net.Http; using System.Threading; @@ -119,39 +121,87 @@ private void UpdateCacheVerifyList(List assetIndex) private async Task UpdateCacheAsset((CacheAsset AssetIndex, IAssetProperty AssetProperty) asset, DownloadClient downloadClient, DownloadProgressDelegate downloadProgress, CancellationToken token) { - // Increment total count and update the status + // Increment total count ProgressAllCountCurrent++; - Status.ActivityStatus = string.Format(Locale.Current.Lang?._Misc?.Downloading + " {0}: {1}", asset!.AssetIndex.DataType, asset.AssetIndex.N); - UpdateAll(); - FileInfo fileInfo = new FileInfo(asset.AssetIndex.ConcatPath!) .EnsureCreationOfDirectory() .EnsureNoReadOnly(out bool isExist); - // This is a action for Unused asset. - if (asset.AssetIndex.DataType == CacheAssetType.Unused) + try { - if (isExist) - fileInfo.Delete(); + // This is a action for Unused asset. + if (asset.AssetIndex.DataType == CacheAssetType.Unused) + { + if (isExist) + fileInfo.Delete(); + + Logger.WriteLine($"Deleted unused file: {fileInfo.FullName}", LogType.Default, true); + return; + } + + // Update the status + Status.ActivityStatus = string.Format(Locale.Current.Lang?._Misc?.Downloading + " {0}: {1}", asset!.AssetIndex.DataType, asset.AssetIndex.N); + UpdateAll(); + + // If asset is patchable, perform the patch routine. + if (asset.AssetIndex.PatchInfo?.FirstOrDefault() is { } patchInfo) + { + string basePath = Path.Combine(GetAssetBasePathByType(asset.AssetIndex.DataType), asset.AssetIndex.DataType.ToString().ToLowerInvariant()); + string oldFilePath = Path.Combine(basePath, $"{patchInfo.Value.OldFileName}.unity3d"); + string newFilePath = asset.AssetIndex.ConcatPath; + + + long patchFileSize = patchInfo.Value.PatchFileSize; + string patchFilePath = Path.Combine(basePath, patchInfo.Value.PatchName); + string patchFileUrl = string.Format(BuildAssetBundleURL(GameGateway), asset.AssetIndex.DataType.ToString().ToLowerInvariant()) + .CombineURLFromString("patch", patchInfo.Value.PatchName); + + FileInfo patchFileInfo = new(patchFilePath); + - Logger.WriteLine($"Deleted unused file: {fileInfo.FullName}", LogType.Default, true); - } - // Other than unused file, do this action - else - { +#if DEBUG + Logger.WriteLine($"Patching cache [T: {asset.AssetIndex.DataType}]: {asset.AssetIndex.N} at URL: {patchFileUrl}", LogType.Debug, true); +#endif + await RunDownloadTask(patchFileSize, patchFileInfo, patchFileUrl, downloadClient, downloadProgress, token); + patchFileInfo.Refresh(); + + await Task.Run(() => + { + BinaryPatchUtility patchUtil = new(); + using FileStream oldFileStream = File.Open(oldFilePath, FileMode.Open, FileAccess.Read, FileShare.Read); + using FileStream newFileStream = File.Open(newFilePath, FileMode.Create, FileAccess.Write, FileShare.Write); + + patchUtil.Initialize(oldFileStream, + () => patchFileInfo.Open(FileMode.Open, FileAccess.Read, FileShare.Read), + newFileStream, + false); + patchUtil.Apply(token); + }, token); + +#if !DEBUG + Logger.WriteLine($"Patched cache [T: {asset.AssetIndex.DataType}]: {asset.AssetIndex.N}", LogType.Default, true); +#endif + patchFileInfo.Delete(); + File.Delete(oldFilePath); + return; + } + + + // Other than unused file, do this action #if DEBUG Logger.WriteLine($"Downloading cache [T: {asset.AssetIndex.DataType}]: {asset.AssetIndex.N} at URL: {asset.AssetIndex.ConcatURL}", LogType.Debug, true); #endif await RunDownloadTask(asset.AssetIndex.CS, fileInfo, asset.AssetIndex.ConcatURL, downloadClient, downloadProgress, token); - - #if !DEBUG +#if !DEBUG Logger.WriteLine($"Downloaded cache [T: {asset.AssetIndex.DataType}]: {asset.AssetIndex.N}", LogType.Default, true); - #endif +#endif + } + finally + { + // Remove Asset Entry display + PopRepairAssetEntry(asset.AssetProperty); } - - // Remove Asset Entry display - PopRepairAssetEntry(asset.AssetProperty); } } } diff --git a/CollapseLauncher/Classes/Helper/Background/ColorPaletteUtility.cs b/CollapseLauncher/Classes/Helper/Background/ColorPaletteUtility.cs index b6b407038..193ae0376 100644 --- a/CollapseLauncher/Classes/Helper/Background/ColorPaletteUtility.cs +++ b/CollapseLauncher/Classes/Helper/Background/ColorPaletteUtility.cs @@ -319,17 +319,17 @@ static unsafe FileStream CreateSvgTempStream(int width, int height, Span b header.Init(); ref BITMAPV5HEADER dibV5Header = ref header.TryReadAs(); - dibV5Header.V5Width = width; - dibV5Header.V5Height = height; - dibV5Header.V5Planes = 1; - dibV5Header.V5BitCount = 32; - dibV5Header.V5SizeImage = (uint)stride; - dibV5Header.V5RedMask = 0x00FF0000; - dibV5Header.V5GreenMask = 0x0000FF00; - dibV5Header.V5BlueMask = 0x000000FF; - dibV5Header.V5AlphaMask = 0xFF000000; - dibV5Header.V5CSType = 0x73524742; // 'sRGB' - header.File.Size = (uint)(sizeof(BITMAPHEADER) + buffer.Length); + dibV5Header.V5Width = width; + dibV5Header.V5Height = height; + dibV5Header.V5Planes = 1; + dibV5Header.V5BitCount = 32; + dibV5Header.V5SizeImage = (uint)stride; + dibV5Header.V5RedMask = 0x00FF0000; + dibV5Header.V5GreenMask = 0x0000FF00; + dibV5Header.V5BlueMask = 0x000000FF; + dibV5Header.V5AlphaMask = 0xFF000000; + dibV5Header.V5CSType = 0x73524742; // 'sRGB' + header.File.Size = (uint)(sizeof(BITMAPHEADER) + buffer.Length); FileStream stream = File.Open(tempPath, new FileStreamOptions { @@ -337,7 +337,7 @@ static unsafe FileStream CreateSvgTempStream(int width, int height, Span b Access = FileAccess.ReadWrite, Share = FileShare.ReadWrite }); - stream.Write(in dibV5Header); + stream.Write(dibV5Header); stream.Write(buffer); stream.Position = 0; diff --git a/CollapseLauncher/Classes/Helper/DaftarPustaka/DaftarPustakaUtil.Decompressor.cs b/CollapseLauncher/Classes/Helper/DaftarPustaka/DaftarPustakaUtil.Decompressor.cs index ce20c8d42..4b27c33e8 100644 --- a/CollapseLauncher/Classes/Helper/DaftarPustaka/DaftarPustakaUtil.Decompressor.cs +++ b/CollapseLauncher/Classes/Helper/DaftarPustaka/DaftarPustakaUtil.Decompressor.cs @@ -1,5 +1,4 @@ -// ReSharper disable IdentifierTypo -using System; +using System; using System.IO; using System.IO.Compression; using System.Runtime.CompilerServices; @@ -21,6 +20,7 @@ using ZstandardManagedStream = ZstdSharp.DecompressionStream; #endif #pragma warning disable IDE0130 +// ReSharper disable IdentifierTypo #nullable enable namespace CollapseLauncher.Helper.DaftarPustaka; @@ -111,7 +111,7 @@ internal unsafe T Read() T result = default; Span buffer = MemoryMarshal.AsBytes(new Span(ref result)); - int read = stream.Read(buffer); + int read = stream.ReadAtLeast(buffer, buffer.Length); return read != sizeof(T) ? throw new EndOfStreamException("Stream has been reaching end-of-data") : result; @@ -138,7 +138,7 @@ internal unsafe T[] ReadArray(int elementCount) while (!arrayAsBytes.IsEmpty) { - int read = stream.Read(arrayAsBytes); + int read = stream.ReadAtLeast(arrayAsBytes, arrayAsBytes.Length, false); arrayAsBytes = arrayAsBytes[read..]; if (read == 0) diff --git a/CollapseLauncher/Classes/Helper/DaftarPustaka/ServeV3FileContext.cs b/CollapseLauncher/Classes/Helper/DaftarPustaka/ServeV3FileContext.cs index fcec6a95a..a9c5e560e 100644 --- a/CollapseLauncher/Classes/Helper/DaftarPustaka/ServeV3FileContext.cs +++ b/CollapseLauncher/Classes/Helper/DaftarPustaka/ServeV3FileContext.cs @@ -48,8 +48,7 @@ public void GetKeyAndIvFromLength(int keyLength, int ivLength, out byte[] key, o key = new byte[keyLength]; iv = new byte[ivLength]; - DateTimeOffset fileTime = FileTime; - long dateTimeAsLong = MemoryMarshal.Read(MemoryMarshal.AsBytes(new ReadOnlySpan(ref fileTime))); + long dateTimeAsLong = FileTime.Ticks; int saltLow = unchecked((int)Salt); int saltHigh = unchecked((int)(Salt >> 32)); @@ -57,8 +56,9 @@ public void GetKeyAndIvFromLength(int keyLength, int ivLength, out byte[] key, o int dateTimeLow = unchecked((int)dateTimeAsLong); int dateTimeHigh = unchecked((int)(dateTimeAsLong >> 32)); - Random random = new(((saltLow | saltHigh) - (dateTimeLow | dateTimeHigh)) | (keyLength * ivLength)); + int seed = ((saltLow | saltHigh) - (dateTimeLow | dateTimeHigh)) | (keyLength * ivLength); + Random random = new(seed); if (key.Length != 0) { Array.Copy(ContentFileHash, diff --git a/CollapseLauncher/Classes/Helper/HttpClientBuilder.Dns.cs b/CollapseLauncher/Classes/Helper/HttpClientBuilder.Dns.cs index 27155905c..86f28ef61 100644 --- a/CollapseLauncher/Classes/Helper/HttpClientBuilder.Dns.cs +++ b/CollapseLauncher/Classes/Helper/HttpClientBuilder.Dns.cs @@ -160,7 +160,7 @@ static void GetDefault(out string[] innerHosts) throw new NullReferenceException("[HttpClientBuilder::ParseDnsSettings] No DnsServerTemplate is available!"); } - innerHosts = [$"${valueTemplate.Value.Key.ToLower()}"]; + innerHosts = [$"${valueTemplate.Value.Key.ToLowerInvariant()}"]; } } @@ -275,7 +275,7 @@ public static bool TryParseDnsConnectionType(ReadOnlySpan inputAsSpan, out hostRangeList.Add(currentRange); } - return hostRangeList.Count != 0 ? hostRangeList.ToArray() : null; + return hostRangeList.Count != 0 ? [.. hostRangeList] : null; static string GetStringFromRange(ReadOnlySpan span, Range range) => span[range].ToString(); @@ -310,7 +310,7 @@ static string GetStringFromRange(ReadOnlySpan span, Range range) return null; } - IPAddress[] recordAddress = addressedHosts.ToArray(); + IPAddress[] recordAddress = [.. addressedHosts]; if (bypassCache) { return recordAddress; @@ -347,7 +347,7 @@ internal static void UseExternalDns(string[]? servers = null, DnsConnectionType if (nameServerList.Count != 0) { - UseExternalDns(nameServerList.ToArray()); + UseExternalDns([.. nameServerList]); return; } @@ -417,14 +417,18 @@ internal static async Task ResolveHostToIpAsync(string host, NameSe (ResourceRecordCollection recordsIpv4, ResourceRecordCollection recordsIpv6) = await GetFallbackQuery(host, dnsNameServers, token); - (ResourceRecord record, uint timeToLive)[] recordInfo = recordsIpv4 - .MergeWithZigZag(recordsIpv6) - .EnumerateAOrAAAARecordOnly() - .ToArray(); + (ResourceRecord record, uint timeToLive)[] recordInfo = + [ + .. recordsIpv4 + .MergeWithZigZag(recordsIpv6) + .EnumerateAOrAAAARecordOnly() + ]; - cachedIpAddress = recordInfo - .Select(x => new IPAddress(x.record.Data.Span)) - .ToArray(); + cachedIpAddress = + [ + .. recordInfo + .Select(x => new IPAddress(x.record.Data.Span)) + ]; double avgTtl = recordInfo .Select(x => x.timeToLive) @@ -556,9 +560,8 @@ bool IsLoopbackOrIPAddr(string hostLocal, out (ResourceRecordCollection, Resourc return true; } - ResourceRecordCollection CreateFromSingle(string hostInner, byte[] addressByte) - => new( - [new ResourceRecord(hostInner, + static ResourceRecordCollection CreateFromSingle(string hostInner, byte[] addressByte) + => new([new ResourceRecord(hostInner, addressByte.Length > 4 ? DnsType.AAAA : DnsType.A, DnsClass.IN, uint.MaxValue, @@ -566,7 +569,7 @@ [new ResourceRecord(hostInner, addressByte)] ); - ResourceRecordCollection CreateEmpty() => new(); + static ResourceRecordCollection CreateEmpty() => new(); } private static bool TryGetCachedIp(ReadOnlySpan host, out IPAddress[]? cachedIpAddress) diff --git a/CollapseLauncher/Classes/Helper/StreamUtility/StreamExtension.cs b/CollapseLauncher/Classes/Helper/StreamUtility/StreamExtension.cs index bbc2baaea..76043e3a0 100644 --- a/CollapseLauncher/Classes/Helper/StreamUtility/StreamExtension.cs +++ b/CollapseLauncher/Classes/Helper/StreamUtility/StreamExtension.cs @@ -399,7 +399,7 @@ public static bool IsPathLocal(this ReadOnlySpan path) extension(Stream stream) { [SkipLocalsInit] - internal void Write(ref readonly T source) + internal void Write(T source) where T : unmanaged { ReadOnlySpan asSpan = MemoryMarshal.AsBytes(new ReadOnlySpan(in source)); diff --git a/CollapseLauncher/Classes/Interfaces/Class/CacheAsset.cs b/CollapseLauncher/Classes/Interfaces/Class/CacheAsset.cs index e46acde48..0fa1c57cb 100644 --- a/CollapseLauncher/Classes/Interfaces/Class/CacheAsset.cs +++ b/CollapseLauncher/Classes/Interfaces/Class/CacheAsset.cs @@ -1,6 +1,7 @@ using Hi3Helper.Data; using Hi3Helper.EncTool.Parser.AssetMetadata; using Hi3Helper.Preset; +using System.Collections.Generic; using System.IO; using System.Text.Json.Serialization; // ReSharper disable InconsistentNaming @@ -32,19 +33,25 @@ internal sealed class CacheAsset : IAssetIndexSummary // For more information: // https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.hmacsha1 public string CRC { get; set; } - public byte[] CRCArray => HexTool.HexToBytesUnsafe(CRC.ToLower()); - public string CRCLower { get => CRC.ToLower(); } + public byte[] CRCArray => HexTool.HexToBytesUnsafe(CRC.ToLowerInvariant()); + public string CRCLower { get => CRC.ToLowerInvariant(); } // File size of the cache file. [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] public long CS { get; set; } + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] public long DLM { get; set; } - public CacheAssetType DataType { get; set; } - public CacheAssetStatus Status { get; set; } - public CachePatchInfo? PatchInfo { get; set; } - public bool IsUseLocalPath { get; set; } = false; - public bool IsHasPatch { get => PatchInfo.HasValue; } + + public CacheAssetType DataType { get; set; } + public CacheAssetStatus Status { get; set; } + +#nullable enable + public Dictionary? PatchInfo { get; set; } +#nullable restore + + public bool IsUseLocalPath { get; set; } + public bool IsHasPatch { get => PatchInfo != null; } public string PrintSummary() => $"File [T: {DataType}]: {N}\t{ConverterTool.SummarizeSizeSimple(CS)} ({CS} bytes)"; public long GetAssetSize() => Status == CacheAssetStatus.Unused ? 0 : CS; diff --git a/CollapseLauncher/Classes/Interfaces/Class/Enums.cs b/CollapseLauncher/Classes/Interfaces/Class/Enums.cs index 3a2e515f8..c0733657c 100644 --- a/CollapseLauncher/Classes/Interfaces/Class/Enums.cs +++ b/CollapseLauncher/Classes/Interfaces/Class/Enums.cs @@ -37,6 +37,7 @@ internal enum CacheAssetStatus { New, Obsolete, + Patch, Unused } diff --git a/CollapseLauncher/CollapseLauncher.csproj b/CollapseLauncher/CollapseLauncher.csproj index a157e6da7..aed6df54f 100644 --- a/CollapseLauncher/CollapseLauncher.csproj +++ b/CollapseLauncher/CollapseLauncher.csproj @@ -20,7 +20,7 @@ preview x64 - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 10.0.26100.87 10.0.17763.0 win-x64 @@ -51,10 +51,9 @@ true - - + + runtime-async=on - true @@ -88,8 +87,6 @@ - SIMULATEGIHDR : Force enable Genshin Impact HDR settings panel for non-HDR panels (Note: this wont force GI to use HDR) - GSPBYPASSGAMERUNNING : Bypass checks for Game Settings Pages for currently running game - MHYPLUGINSUPPORT : Enable miHoYo's patching system through launcher (EXPERIMENTAL) - - USEFFMPEGFORVIDEOBG : Use FFmpeg to decode video background content. - This decoder supports lots of newest format, including AV1, HEVC and MPEG-DASH Contained video. - USENEWZIPDECOMPRESS : Use sharpcompress for decompressing .zip game package files - ENABLEUSERFEEDBACK : Enable user feedback feature --> @@ -268,17 +265,13 @@ - - + + - - - - all build; analyzers @@ -303,7 +296,7 @@ - + @@ -315,9 +308,9 @@ - - - + + + diff --git a/CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIRelease.pubxml b/CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIRelease.pubxml index ab999d5a8..c2671614c 100644 --- a/CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIRelease.pubxml +++ b/CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIRelease.pubxml @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 win-x64 diff --git a/CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIReleaseAOT.pubxml b/CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIReleaseAOT.pubxml index 540b4ab74..0cedeff3f 100644 --- a/CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIReleaseAOT.pubxml +++ b/CollapseLauncher/Properties/PublishProfiles/Publish-DebugCIReleaseAOT.pubxml @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 win-x64 diff --git a/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewLocalDevAOT.pubxml b/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewLocalDevAOT.pubxml index d24e95606..ceb4514cd 100644 --- a/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewLocalDevAOT.pubxml +++ b/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewLocalDevAOT.pubxml @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 win-x64 diff --git a/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewRelease.pubxml b/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewRelease.pubxml index 206c80180..a5592fd16 100644 --- a/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewRelease.pubxml +++ b/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewRelease.pubxml @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 win-x64 diff --git a/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewReleaseAOT.pubxml b/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewReleaseAOT.pubxml index ffb13a1bd..a573a221a 100644 --- a/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewReleaseAOT.pubxml +++ b/CollapseLauncher/Properties/PublishProfiles/Publish-PreviewReleaseAOT.pubxml @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 win-x64 diff --git a/CollapseLauncher/Properties/PublishProfiles/Publish-StableRelease.pubxml b/CollapseLauncher/Properties/PublishProfiles/Publish-StableRelease.pubxml index 8e6bf2e4a..bc74c3786 100644 --- a/CollapseLauncher/Properties/PublishProfiles/Publish-StableRelease.pubxml +++ b/CollapseLauncher/Properties/PublishProfiles/Publish-StableRelease.pubxml @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 win-x64 diff --git a/CollapseLauncher/Properties/PublishProfiles/Publish-StableReleaseAOT.pubxml b/CollapseLauncher/Properties/PublishProfiles/Publish-StableReleaseAOT.pubxml index 797b1034c..154620cb2 100644 --- a/CollapseLauncher/Properties/PublishProfiles/Publish-StableReleaseAOT.pubxml +++ b/CollapseLauncher/Properties/PublishProfiles/Publish-StableReleaseAOT.pubxml @@ -13,7 +13,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 win-x64 diff --git a/CollapseLauncher/StaticLib/StaticLib.7z.001 b/CollapseLauncher/StaticLib/StaticLib.7z.001 index aaf96931c..264a3c570 100644 Binary files a/CollapseLauncher/StaticLib/StaticLib.7z.001 and b/CollapseLauncher/StaticLib/StaticLib.7z.001 differ diff --git a/CollapseLauncher/StaticLib/StaticLib.7z.002 b/CollapseLauncher/StaticLib/StaticLib.7z.002 index ed621275d..086f46822 100644 Binary files a/CollapseLauncher/StaticLib/StaticLib.7z.002 and b/CollapseLauncher/StaticLib/StaticLib.7z.002 differ diff --git a/CollapseLauncher/StaticLib/StaticLib.7z.003 b/CollapseLauncher/StaticLib/StaticLib.7z.003 index 2cd313347..ce10a2fe2 100644 Binary files a/CollapseLauncher/StaticLib/StaticLib.7z.003 and b/CollapseLauncher/StaticLib/StaticLib.7z.003 differ diff --git a/CollapseLauncher/StaticLib/StaticLib.7z.004 b/CollapseLauncher/StaticLib/StaticLib.7z.004 index 878dd71b7..71019e7e5 100644 Binary files a/CollapseLauncher/StaticLib/StaticLib.7z.004 and b/CollapseLauncher/StaticLib/StaticLib.7z.004 differ diff --git a/CollapseLauncher/StaticLib/StaticLib.7z.005 b/CollapseLauncher/StaticLib/StaticLib.7z.005 index 59dff4aa7..d754e0f36 100644 Binary files a/CollapseLauncher/StaticLib/StaticLib.7z.005 and b/CollapseLauncher/StaticLib/StaticLib.7z.005 differ diff --git a/CollapseLauncher/StaticLib/buildScript/build_staticlib.bat b/CollapseLauncher/StaticLib/buildScript/build_staticlib.bat index cac6edf88..83602b35c 100644 --- a/CollapseLauncher/StaticLib/buildScript/build_staticlib.bat +++ b/CollapseLauncher/StaticLib/buildScript/build_staticlib.bat @@ -283,19 +283,54 @@ goto :COMPLETE call :ERR ". Make sure you have installed any Python 3 interpreter" && goto :EOF ) - (>NUL meson --version) || call :ERR ". Make sure you have meson installed by using 'pip install meson' system-wide" && goto :EOF - (>NUL ninja --version) || call :ERR ". Make sure you have ninja installed by using 'pip install ninja' system-wide" && goto :EOF + :TryTestNasm + (2>NUL 1>NUL where nasm) || if /I exist "C:\Program Files\NASM\nasm.exe" ( + set "PATH=%PATH%;C:\Program Files\NASM" + ) else if /I exist "%appdata%\..\Local\bin\NASM\nasm.exe" ( + set "PATH=%PATH%;%appdata%\..\Local\bin\NASM" + ) + (2>NUL 1>NUL nasm --version) || (call :TryInstallNasm && goto :TryTestNasm) || call :ERR ". Make sure you have installed NASM 3.x or above and installed in either 'C:\Program Files\NASM' or '%appdata%\..\Local\bin' directory" && goto :EOF + + :TryTestMeson + (2>NUL 1>NUL meson --version) || (call :TryInstallPipDeps "meson" && goto :TryTestMeson) || call :ERR ". Make sure you have meson installed by using 'pip install meson' system-wide" && goto :EOF + + :TryTestNinja + (2>NUL 1>NUL ninja --version) || call :ERR ". Make sure you have ninja installed by using 'pip install ninja' system-wide" && goto :EOF + + :TryTestVulkan + :: Check for Vulkan SDK dependencies (for Waifu2X) + if /I not exist "%VULKAN_SDK%\Lib\vulkan-1.lib" ( + ( + set /p CONFIRM=Vulkan SDK isn't installed. Would you like to install the SDK first ^(Y/N^)? + if /I "%CONFIRM%" == "Y" ( + (call :TryInstallVulkanSDK && echo "Vulkan SDK has been installed. Please restart this console instance to refresh the PATH variable.") || call :ERR ". Vulkan SDK failed to install due to unknown error." && goto :EOF + ) + ) + set errorlevel=67 + call :ERR ". Make sure you have Vulkan SDK installed and VULKAN_SDK variable defined." && goto :EOF + ) + goto :EOF - (2>NUL 1>NUL where nasm) || if /I exist "C:\Program Files\NASM\nasm.exe" ( - set "PATH=%PATH%;C:\Program Files\NASM" - ) else if /I exist "%appdata%\..\Local\bin\NASM\nasm.exe" ( - set "PATH=%PATH%;%appdata%\..\Local\bin\NASM" - ) +:TryInstallPipDeps + echo Installing %1 from pip... + pip install %1 + goto :EOF - (>NUL nasm --version) || call :ERR ". Make sure you have installed NASM 3.x or above and installed in either 'C:\Program Files\NASM' or '%appdata%\..\Local\bin' directory" && goto :EOF - - :: Check for Vulkan SDK dependencies (for Waifu2X) - if /I not exist "%VULKAN_SDK%\Lib\vulkan-1.lib" ( - set errorlevel=67 - call :ERR ". Make sure you have Vulkan SDK installed and ^%VULKAN_SDK^% variable defined." && goto :EOF - ) \ No newline at end of file +:TryInstallNasm + set NASM_VERSION=3.02 + set NASM_PLATFORM=win64 + set NASM_ARCH=x64 + set NASM_INSTALLER_NAME=nasm-%NASM_VERSION%-installer-%NASM_ARCH%.exe + echo Installing NASM (Please follow the instruction once the download is completed)... + curl -o "%temp%\%NASM_INSTALLER_NAME%" https://www.nasm.us/pub/nasm/releasebuilds/%NASM_VERSION%/%NASM_PLATFORM%/%NASM_INSTALLER_NAME% + "%temp%\%NASM_INSTALLER_NAME%" && del /Y /Q "%temp%\%NASM_INSTALLER_NAME%" && set errorlevel=0 + goto :EOF + +:TryInstallVulkanSDK + set VULKANSDK_VERSION=1.4.363.1 + set VULKANSDK_ARCH=X64 + set VULKANSDK_INSTALLER_NAME=vulkansdk-windows-%VULKANSDK_ARCH%-%VULKANSDK_VERSION%.exe + echo Installing Vulkan SDK (Please follow the instruction once the download is completed)... + curl -o "%temp%\%VULKANSDK_INSTALLER_NAME%" https://sdk.lunarg.com/sdk/download/%VULKANSDK_VERSION%/windows/%VULKANSDK_INSTALLER_NAME% + "%temp%\%VULKANSDK_INSTALLER_NAME%" && del /Y /Q "%temp%\%VULKANSDK_INSTALLER_NAME%" && set errorlevel=0 + goto :EOF \ No newline at end of file diff --git a/CollapseLauncher/XAMLs/Theme/CustomControls/VideoPresenter/CompositionSurfaceAcrylicBrush.cs b/CollapseLauncher/XAMLs/Theme/CustomControls/VideoPresenter/CompositionSurfaceAcrylicBrush.cs new file mode 100644 index 000000000..edabf256f --- /dev/null +++ b/CollapseLauncher/XAMLs/Theme/CustomControls/VideoPresenter/CompositionSurfaceAcrylicBrush.cs @@ -0,0 +1,221 @@ +using Microsoft.Graphics.Canvas; +using Microsoft.Graphics.Canvas.Effects; +using Microsoft.UI; +using Microsoft.UI.Composition; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Media; +using System; +using Windows.UI; + +#nullable enable +namespace CollapseLauncher.XAMLs.Theme.CustomControls.VideoPresenter; + +/// +/// An acrylic-like XAML brush that samples an explicit composition surface +/// instead of the compositor backdrop. +/// +public sealed partial class CompositionSurfaceAcrylicBrush : XamlCompositionBrushBase +{ + private ICompositionSurface? _source; + private CompositionSurfaceBrush? _surfaceBrush; + private bool _isConnected; + + public static readonly DependencyProperty BlurAmountProperty = DependencyProperty.Register( + nameof(BlurAmount), + typeof(double), + typeof(CompositionSurfaceAcrylicBrush), + new PropertyMetadata(16d, OnEffectPropertyChanged)); + + public static readonly DependencyProperty SaturationProperty = DependencyProperty.Register( + nameof(Saturation), + typeof(double), + typeof(CompositionSurfaceAcrylicBrush), + new PropertyMetadata(1d, OnEffectPropertyChanged)); + + public static readonly DependencyProperty TintColorProperty = DependencyProperty.Register( + nameof(TintColor), + typeof(Color), + typeof(CompositionSurfaceAcrylicBrush), + new PropertyMetadata(Colors.Black, OnEffectPropertyChanged)); + + public static readonly DependencyProperty TintOpacityProperty = DependencyProperty.Register( + nameof(TintOpacity), + typeof(double), + typeof(CompositionSurfaceAcrylicBrush), + new PropertyMetadata(0.15d, OnEffectPropertyChanged)); + + public static readonly DependencyProperty StretchProperty = DependencyProperty.Register( + nameof(Stretch), + typeof(CompositionStretch), + typeof(CompositionSurfaceAcrylicBrush), + new PropertyMetadata(CompositionStretch.UniformToFill, OnStretchChanged)); + + public CompositionSurfaceAcrylicBrush() + { + FallbackColor = Colors.Black; + RegisterPropertyChangedCallback(FallbackColorProperty, OnFallbackColorChanged); + } + + /// + /// Gets or sets the surface sampled by this brush. Set this from the UI thread. + /// The brush does not own or dispose the surface. + /// + public ICompositionSurface? Source + { + get => _source; + set + { + if (ReferenceEquals(_source, value)) + return; + + _source = value; + if (_isConnected) + RebuildCompositionBrush(); + } + } + + /// The blur radius, in DIPs. + public double BlurAmount + { + get => (double)GetValue(BlurAmountProperty); + set => SetValue(BlurAmountProperty, value); + } + + /// The saturation multiplier applied after the blur. + public double Saturation + { + get => (double)GetValue(SaturationProperty); + set => SetValue(SaturationProperty, value); + } + + /// The color composited over the blurred surface. + public Color TintColor + { + get => (Color)GetValue(TintColorProperty); + set => SetValue(TintColorProperty, value); + } + + /// The opacity of . + public double TintOpacity + { + get => (double)GetValue(TintOpacityProperty); + set => SetValue(TintOpacityProperty, value); + } + + /// How the source surface is mapped into the painted element. + public CompositionStretch Stretch + { + get => (CompositionStretch)GetValue(StretchProperty); + set => SetValue(StretchProperty, value); + } + + protected override void OnConnected() + { + if (_isConnected) + return; + + _isConnected = true; + RebuildCompositionBrush(); + } + + protected override void OnDisconnected() + { + if (!_isConnected) + return; + + _isConnected = false; + DisposeCompositionResources(); + } + + private static void OnEffectPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) + { + CompositionSurfaceAcrylicBrush brush = (CompositionSurfaceAcrylicBrush)sender; + if (brush._isConnected) + brush.RebuildCompositionBrush(); + } + + private static void OnStretchChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) + { + CompositionSurfaceAcrylicBrush brush = (CompositionSurfaceAcrylicBrush)sender; + if (brush._surfaceBrush != null) + brush._surfaceBrush.Stretch = (CompositionStretch)args.NewValue; + } + + private static void OnFallbackColorChanged(DependencyObject sender, DependencyProperty property) + { + CompositionSurfaceAcrylicBrush brush = (CompositionSurfaceAcrylicBrush)sender; + if (brush._isConnected && brush._source == null) + brush.RebuildCompositionBrush(); + } + + private void RebuildCompositionBrush() + { + DisposeCompositionResources(); + if (!_isConnected) + return; + + Compositor compositor = CompositionTarget.GetCompositorForCurrentThread(); + if (_source == null) + { + CompositionBrush = compositor.CreateColorBrush(FallbackColor); + return; + } + + _surfaceBrush = compositor.CreateSurfaceBrush(_source); + _surfaceBrush.Stretch = Stretch; + _surfaceBrush.HorizontalAlignmentRatio = 0.5f; + _surfaceBrush.VerticalAlignmentRatio = 0.5f; + + CompositionCapabilities capabilities = new(); + if (!capabilities.AreEffectsSupported()) + { + CompositionBrush = _surfaceBrush; + return; + } + + GaussianBlurEffect blurEffect = new() + { + BlurAmount = (float)Math.Clamp(BlurAmount, 0d, 250d), + BorderMode = EffectBorderMode.Hard, + Optimization = EffectOptimization.Balanced, + Source = new CompositionEffectSourceParameter("Surface") + }; + + SaturationEffect saturationEffect = new() + { + Saturation = (float)Math.Clamp(Saturation, 0d, 2d), + Source = blurEffect + }; + + Color tintColor = TintColor; + tintColor.A = (byte)Math.Round(255d * Math.Clamp(TintOpacity, 0d, 1d)); + ColorSourceEffect tintEffect = new() + { + Color = tintColor + }; + + CompositeEffect acrylicEffect = new() + { + Mode = CanvasComposite.SourceOver + }; + acrylicEffect.Sources.Add(saturationEffect); + acrylicEffect.Sources.Add(tintEffect); + + using CompositionEffectFactory effectFactory = compositor.CreateEffectFactory(acrylicEffect); + CompositionEffectBrush effectBrush = effectFactory.CreateBrush(); + effectBrush.SetSourceParameter("Surface", _surfaceBrush); + CompositionBrush = effectBrush; + } + + private void DisposeCompositionResources() + { + CompositionBrush? compositionBrush = CompositionBrush; + CompositionBrush = null; + + if (compositionBrush != null && !ReferenceEquals(compositionBrush, _surfaceBrush)) + compositionBrush.Dispose(); + + _surfaceBrush?.Dispose(); + _surfaceBrush = null; + } +} diff --git a/CollapseLauncher/packages.lock.json b/CollapseLauncher/packages.lock.json index 9ceb503ab..413d463f5 100644 --- a/CollapseLauncher/packages.lock.json +++ b/CollapseLauncher/packages.lock.json @@ -1,7 +1,7 @@ { "version": 1, "dependencies": { - "net10.0-windows10.0.26100": { + "net11.0-windows10.0.26100": { "CommunityToolkit.Common": { "type": "Direct", "requested": "[8.4.2, )", @@ -111,24 +111,15 @@ }, "Markdig.Signed": { "type": "Direct", - "requested": "[1.5.1, )", - "resolved": "1.5.1", - "contentHash": "udNE1saI/bKSqSO6thS+rDfNgCNL88DOm0mftT/w4/eF8J6TbV4/qs1lDVcYA7xS0RBBu+/sjOOiLHNWtQdRnw==" + "requested": "[1.6.0, )", + "resolved": "1.6.0", + "contentHash": "RA5Veyb+KV5x59fxeMzTvW0B6bfFa6td1arF9p7p67qhGlh+/Vk13SugarkqVSUwX7gD7oCPa2jtLszi8YuSHw==" }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { + "Microsoft.DotNet.ILCompiler": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw==" - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14" - } + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "lw6gUL92db6XPwYsQwaGwrJxgRM0X0qQKl0QkwuZIACMtgH0eFu6jmq6W+/L8qTxQZwggfV/dGjICyMqVHdehg==" }, "Microsoft.Graphics.Win2D": { "type": "Direct", @@ -141,9 +132,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "YlTamXppEQls6DYWt7RdUuwWDb0lyw/vXCaGeQpLCpsLmfwGuCkOz/vIGgMTV7ECsJcavkCOkxZXv9s8rdAHkQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "gK2aq4XvChj5kvozpPHrkfKkr7zc5Z4xoTrJb4GPZzDEPMlCk0TX632bwY3LsWcX2UVcVRQBBGzsBGC2lq6YhA==" }, "Microsoft.Web.WebView2": { "type": "Direct", @@ -231,26 +222,24 @@ }, "SharpHPatchZ": { "type": "Direct", - "requested": "[3.1.1, )", - "resolved": "3.1.1", - "contentHash": "pOeTAjQCc+DvNfXkwPeY0K33jh1xHAyyVHkMhm1oVsBnP3viMr4Lu8GSjJ38ZOd9YvLCHHA0KWFMTDPvit0WXg==", + "requested": "[3.1.2, )", + "resolved": "3.1.2", + "contentHash": "R93fOtmwH46c9reo/Owf/YqS+NG4MXcGr9tLafMAaNUPEcL3by2hjuyLQlfFdyCXmKOhQ9Ikr8SOFp2m5y+4dw==", "dependencies": { - "Hi3Helper.ZstdNet": "1.6.7", - "System.IO.Hashing": "10.0.13", - "ZstdSharp.Port": "0.8.8" + "System.IO.Hashing": "11.0.0" } }, "System.CommandLine": { "type": "Direct", - "requested": "[2.0.14, )", - "resolved": "2.0.14", - "contentHash": "15fyVO4aG6poR6IKmhM74zf7PUzaU6FZAGm2d3SQSO9yIyGAeo44e6t9qeKjjaqyMEqYdqcb2G1B0gpLoDU2cA==" + "requested": "[3.0.0, )", + "resolved": "3.0.0", + "contentHash": "swNpSTl0iYJeBuvYYfaY+VxzZ5YC8wklwkqDCNOq2aTQqJzjauJfh/O3Zw93nwxspWrxvZTjT45f8VPR0ParEA==" }, "System.Security.Cryptography.ProtectedData": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "UuaBUHgmtc9h6CMxaQqFDDJxkS5JVy7XEB+DbtCvD68GFcVM9/AccuNwFpARx8nwCnvjaxzoOBjG3gPz32P1Eg==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "iS9iyAMwLDPFBzTdcREDkzRBYmwy7aENYl7EXxAvnNJNCbl7+UVRgJfWaVLtVjSeDmT3JIItgGODmuAPljXFww==" }, "ThisAssembly.Constants": { "type": "Direct", @@ -320,47 +309,23 @@ "resolved": "0.0.3", "contentHash": "XbK/Qd5vsFuytKxoyfaGbyLQJleev0hFKVzUiFYkl+roGr8pW3RRniXsow7LOOipvL53MsQ7EVaKM+dk+PrtrQ==" }, - "Hi3Helper.ZstdNet": { - "type": "Transitive", - "resolved": "1.7.1", - "contentHash": "UMTpQOSOuWdW9AI7Grz7vRtSVYoHICQnAFbo6X24hSe/4Rgd2daKY4QCgAbUfYDpP0T+evp/ElV9JHVPziZDIw==" - }, "Microsoft.Extensions.DependencyInjection": { "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "2LzcuVjemeXR+WdY9wGIr8iGb7fYsDAit+IScxXX2XJnX0b++mWcE/WO6fEGIqhdMfSQM2ZS5JGMHYZix7YXZg==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14" - } + "resolved": "11.0.0", + "contentHash": "KygQMITBDDPXw7+AAgdwQvVAaTXuDsc1iCAuvhO73ERxKX+d92cdbgZmpoYF7DIUq2hfs/yO2KD87uIreRy3MA==" }, "Microsoft.Extensions.Logging": { "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "O2fXL6JmtkFwkigxS8fPTQpLXxGDjgZco5D+h88s++Cl0bDCs023PVkpNoifciJ+f30I82jnp8tpwF0wCLdFtA==", + "resolved": "11.0.0", + "contentHash": "zsse8MOgo0bj2KAEsSkg9WtNAfZbHbTlGeqfhy5PGozomM3zQM0XzumSQzQ0451IWNSJWLqYaSIQEpCi2j1sCA==", "dependencies": { - "Microsoft.Extensions.DependencyInjection": "10.0.14", - "Microsoft.Extensions.Logging.Abstractions": "10.0.14", - "Microsoft.Extensions.Options": "10.0.14" + "Microsoft.Extensions.DependencyInjection": "11.0.0" } }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "EeN/33S418m9oWEaZY4N5T+BNxtOqNTIFoFbIgBKwylh4OJPKIWFAzbIhpTdNbwUs26MhkmbLCAbdY+YCJ1dIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14", - "Microsoft.Extensions.Primitives": "10.0.14" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "1bbZqqCJTPba3inTADExbp/9PsGVyvGOX3zr6tFr7ySCgVkX9Lpw7BV0TizktNItd3SsbUu1sQfSAYm1GZMoNw==" - }, "Microsoft.Win32.SystemEvents": { "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "axfieK5mj+uS/wLYl0dhlRFWdNP1iKHhx/M6DZNXPCSve7q4TCogw//W6BWGsYhnWuSw55aqheHE0a8l8s1oTw==" + "resolved": "11.0.0", + "contentHash": "cI7p6SRuPcNTsgoryUpb367r1DhE+69l5XZeAS1UmyU293gwkguh2LPMiCg0YlZUZxBx0CPfXqI59Q/20Dlnvg==" }, "Microsoft.Windows.AI.MachineLearning": { "type": "Transitive", @@ -467,55 +432,50 @@ }, "Sentry": { "type": "Transitive", - "resolved": "6.12.1", - "contentHash": "yCHz3cLGZ3TVik3rLV6rp6SaqJ0Ai7PyIi2KdoHNGpZYWEkcX7kx13IV46mufAzPW7pqZZoKNoru0w0RpmkmrA==" + "resolved": "6.13.0", + "contentHash": "TwgXw4BwBa6gYKJxTEBJWZ0y+MyBDTMzCq8ywYWUEzG9srNmKui4AMcz6vZ9BEsaZYVJxni0EIDHGho+PQXDVA==" }, "System.Drawing.Common": { "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "kBe75KgVcm8soY0BPd5vTSLfC5vjd0O1YN6ApsL4qWnQiLUsOQ2k+PjWwraOI7JEp36mksavW/qz/r0NoSzYuQ==", + "resolved": "11.0.0", + "contentHash": "oF5GQr2bzXFe3urMHTPRykuS+OcW2AJOZ2YGBcAqsctQ+2JE7l7Kxqup33ZpM3C2Yfdjurts2fNZL2qnHfY4JA==", "dependencies": { - "Microsoft.Win32.SystemEvents": "10.0.14" + "Microsoft.Win32.SystemEvents": "11.0.0" } }, "System.IO.Hashing": { "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "lVqovhCt3HlZe7ONG5ydaj6BYwYI004gldVfMMkJl/lR5ueeCtWNpW4nejOX75sPmzm8vXCxB69GqwHaYCnyUQ==" + "resolved": "11.0.0", + "contentHash": "U+Bv2qCYt6eONi+arSP0QIp4uTO6os6uceBsqiAwruZ+Wo2HrRhO/0tj38M9URJtS+4DhAtT3ka2TGNFYsnhyQ==" }, "System.Numerics.Tensors": { "type": "Transitive", "resolved": "9.0.0", "contentHash": "hyJB4UlpAi19Xr9AXzu2NuagKC4lPfHObNMEAA0HmqFz2rX7wKgzeYzO/jM/eBHDhnUGFFEjk5cOoJaxqg5J4A==" }, - "ZstdSharp.Port": { - "type": "Transitive", - "resolved": "0.8.8", - "contentHash": "UIDFkA5DC3en3tOJ3Mof11yBx9kUQLsaeo/oFdvN6Bbkr9E9+VCqfIadHci8cu+I51K2Sl7XYWVl2R/mA75NBQ==" - }, "colorthief": { "type": "Project", "dependencies": { - "System.Drawing.Common": "[10.0.14, )" + "System.Drawing.Common": "[11.0.0, )" } }, "discordrpc": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging": "[10.0.14, )" + "Microsoft.Extensions.Logging": "[11.0.0, )" } }, "h.generatedicons.system.drawing": { "type": "Project", "dependencies": { - "System.Drawing.Common": "[10.0.14, )" + "System.Drawing.Common": "[11.0.0, )" } }, "h.notifyicon": { "type": "Project", "dependencies": { "H.GeneratedIcons.System.Drawing": "[1.0.0, )", - "Microsoft.Extensions.Logging": "[10.0.14, )" + "Microsoft.Extensions.Logging": "[11.0.0, )" } }, "h.notifyicon.winui": { @@ -532,16 +492,16 @@ "Hi3Helper.Log": "[1.0.0, )", "Hi3Helper.Win32": "[1.0.0, )", "Microsoft.Windows.CsWinRT": "[2.3.1, )", - "Sentry": "[6.12.1, )" + "Sentry": "[6.13.0, )" } }, "hi3helper.enctool": { "type": "Project", "dependencies": { "Google.Protobuf": "[3.36.2, )", - "Hi3Helper.Http": "[2.0.1, )", + "Hi3Helper.Http": "[2.0.2, )", "Hi3Helper.Win32": "[1.0.0, )", - "System.IO.Hashing": "[10.0.14, )" + "System.IO.Hashing": "[11.0.0, )" } }, "hi3helper.http": { @@ -555,10 +515,7 @@ } }, "hi3helper.log": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )" - } + "type": "Project" }, "hi3helper.magicscaler.libheifcl": { "type": "Project", @@ -568,10 +525,7 @@ } }, "hi3helper.plugin.core": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )" - } + "type": "Project" }, "hi3helper.simpleziparchivereader": { "type": "Project" @@ -580,9 +534,8 @@ "type": "Project", "dependencies": { "Google.Protobuf": "[3.36.2, )", - "Hi3Helper.ZstdNet": "[1.7.1, )", - "SharpHPatchZ": "[3.1.1, )", - "System.IO.Hashing": "[10.0.14, )" + "SharpHPatchZ": "[3.1.2, )", + "System.IO.Hashing": "[11.0.0, )" } }, "hi3helper.taskscheduler": { @@ -592,16 +545,12 @@ } }, "hi3helper.win32": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )" - } + "type": "Project" }, "hi3helper.win32.winrt": { "type": "Project", "dependencies": { "Hi3Helper.Win32": "[1.0.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )", "Microsoft.Windows.CsWinRT": "[2.3.1, )" } }, @@ -629,7 +578,7 @@ "innosetuphelper": { "type": "Project", "dependencies": { - "System.IO.Hashing": "[10.0.14, )" + "System.IO.Hashing": "[11.0.0, )" } }, "SettingsControls": { @@ -646,13 +595,22 @@ "type": "Project" } }, - "net10.0-windows10.0.26100/win-x64": { + "net11.0-windows10.0.26100/win-x64": { "Libsql.Client": { "type": "Direct", "requested": "[0.5.1, )", "resolved": "0.5.1", "contentHash": "5fJusmhN7snIZzlsZ0xpQOoNvWZkJKS2/hhljLz8qvEPIJZgYxpkWWCROrSDpjMxQpixqI/nUhfhrQR67jVVoA==" }, + "Microsoft.DotNet.ILCompiler": { + "type": "Direct", + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "lw6gUL92db6XPwYsQwaGwrJxgRM0X0qQKl0QkwuZIACMtgH0eFu6jmq6W+/L8qTxQZwggfV/dGjICyMqVHdehg==", + "dependencies": { + "runtime.win-x64.Microsoft.DotNet.ILCompiler": "11.0.0" + } + }, "Microsoft.Graphics.Win2D": { "type": "Direct", "requested": "[1.4.0, )", @@ -710,8 +668,8 @@ }, "Microsoft.Win32.SystemEvents": { "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "axfieK5mj+uS/wLYl0dhlRFWdNP1iKHhx/M6DZNXPCSve7q4TCogw//W6BWGsYhnWuSw55aqheHE0a8l8s1oTw==" + "resolved": "11.0.0", + "contentHash": "cI7p6SRuPcNTsgoryUpb367r1DhE+69l5XZeAS1UmyU293gwkguh2LPMiCg0YlZUZxBx0CPfXqI59Q/20Dlnvg==" }, "Microsoft.Windows.AI.MachineLearning": { "type": "Transitive", @@ -729,6 +687,11 @@ "Microsoft.WindowsAppSDK.Base": "[2.6.5, 3.0.0)", "Microsoft.WindowsAppSDK.InteractiveExperiences": "[2.6.5, 3.0.0)" } + }, + "runtime.win-x64.Microsoft.DotNet.ILCompiler": { + "type": "Transitive", + "resolved": "11.0.0", + "contentHash": "GhYzDaU4IbNnTgyFgxT2URnUogx+xuphFHscUx8v1H8ZRKiIlYa/8Lkpd0SXJZ+pEWHJFJXLvEPpWLEcwyNkmQ==" } } } diff --git a/ColorThief b/ColorThief index b6f042305..6a1cfbe5d 160000 --- a/ColorThief +++ b/ColorThief @@ -1 +1 @@ -Subproject commit b6f04230524f8e64a2410281ea5d1b600c6ba3e7 +Subproject commit 6a1cfbe5d57496eb239850023850cfab00f42ac6 diff --git a/H.NotifyIcon b/H.NotifyIcon index 6bd53b39f..57109ebee 160000 --- a/H.NotifyIcon +++ b/H.NotifyIcon @@ -1 +1 @@ -Subproject commit 6bd53b39ff4a40a8a8322b8474c294adeafb9f53 +Subproject commit 57109ebee381cbaf7957bece61301b5337c181fd diff --git a/Hi3Helper.CommunityToolkit/ImageCropper/Hi3Helper.CommunityToolkit.WinUI.Controls.ImageCropper.csproj b/Hi3Helper.CommunityToolkit/ImageCropper/Hi3Helper.CommunityToolkit.WinUI.Controls.ImageCropper.csproj index 5fc89d108..7408e9eb1 100644 --- a/Hi3Helper.CommunityToolkit/ImageCropper/Hi3Helper.CommunityToolkit.WinUI.Controls.ImageCropper.csproj +++ b/Hi3Helper.CommunityToolkit/ImageCropper/Hi3Helper.CommunityToolkit.WinUI.Controls.ImageCropper.csproj @@ -3,7 +3,7 @@ x64 - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 10.0.26100.87 10.0.17763.0 win-x64 diff --git a/Hi3Helper.CommunityToolkit/ImageCropper/packages.lock.json b/Hi3Helper.CommunityToolkit/ImageCropper/packages.lock.json index 01302e105..52c51e10f 100644 --- a/Hi3Helper.CommunityToolkit/ImageCropper/packages.lock.json +++ b/Hi3Helper.CommunityToolkit/ImageCropper/packages.lock.json @@ -1,7 +1,7 @@ { "version": 1, "dependencies": { - "net10.0-windows10.0.26100": { + "net11.0-windows10.0.26100": { "CommunityToolkit.Common": { "type": "Direct", "requested": "[8.4.2, )", @@ -41,9 +41,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "YlTamXppEQls6DYWt7RdUuwWDb0lyw/vXCaGeQpLCpsLmfwGuCkOz/vIGgMTV7ECsJcavkCOkxZXv9s8rdAHkQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "gK2aq4XvChj5kvozpPHrkfKkr7zc5Z4xoTrJb4GPZzDEPMlCk0TX632bwY3LsWcX2UVcVRQBBGzsBGC2lq6YhA==" }, "Microsoft.Windows.CsWinRT": { "type": "Direct", @@ -198,7 +198,7 @@ "contentHash": "hyJB4UlpAi19Xr9AXzu2NuagKC4lPfHObNMEAA0HmqFz2rX7wKgzeYzO/jM/eBHDhnUGFFEjk5cOoJaxqg5J4A==" } }, - "net10.0-windows10.0.26100/win-x64": { + "net11.0-windows10.0.26100/win-x64": { "Microsoft.Graphics.Win2D": { "type": "Direct", "requested": "[1.4.0, )", diff --git a/Hi3Helper.CommunityToolkit/SettingsControls/Hi3Helper.CommunityToolkit.WinUI.Controls.SettingsControls.csproj b/Hi3Helper.CommunityToolkit/SettingsControls/Hi3Helper.CommunityToolkit.WinUI.Controls.SettingsControls.csproj index 46a2ea7cf..bf5f51e96 100644 --- a/Hi3Helper.CommunityToolkit/SettingsControls/Hi3Helper.CommunityToolkit.WinUI.Controls.SettingsControls.csproj +++ b/Hi3Helper.CommunityToolkit/SettingsControls/Hi3Helper.CommunityToolkit.WinUI.Controls.SettingsControls.csproj @@ -3,7 +3,7 @@ x64 - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 10.0.26100.87 10.0.17763.0 win-x64 diff --git a/Hi3Helper.CommunityToolkit/SettingsControls/packages.lock.json b/Hi3Helper.CommunityToolkit/SettingsControls/packages.lock.json index 69d715bbe..c7098845d 100644 --- a/Hi3Helper.CommunityToolkit/SettingsControls/packages.lock.json +++ b/Hi3Helper.CommunityToolkit/SettingsControls/packages.lock.json @@ -1,7 +1,7 @@ { "version": 1, "dependencies": { - "net10.0-windows10.0.26100": { + "net11.0-windows10.0.26100": { "CommunityToolkit.Common": { "type": "Direct", "requested": "[8.4.2, )", @@ -20,9 +20,9 @@ }, "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "YlTamXppEQls6DYWt7RdUuwWDb0lyw/vXCaGeQpLCpsLmfwGuCkOz/vIGgMTV7ECsJcavkCOkxZXv9s8rdAHkQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "gK2aq4XvChj5kvozpPHrkfKkr7zc5Z4xoTrJb4GPZzDEPMlCk0TX632bwY3LsWcX2UVcVRQBBGzsBGC2lq6YhA==" }, "Microsoft.Windows.CsWinRT": { "type": "Direct", @@ -186,7 +186,7 @@ "contentHash": "hyJB4UlpAi19Xr9AXzu2NuagKC4lPfHObNMEAA0HmqFz2rX7wKgzeYzO/jM/eBHDhnUGFFEjk5cOoJaxqg5J4A==" } }, - "net10.0-windows10.0.26100/win-x64": { + "net11.0-windows10.0.26100/win-x64": { "Microsoft.Web.WebView2": { "type": "Transitive", "resolved": "1.0.3719.77", diff --git a/Hi3Helper.Core/Hi3Helper.Core.csproj b/Hi3Helper.Core/Hi3Helper.Core.csproj index f603d38e5..208678281 100644 --- a/Hi3Helper.Core/Hi3Helper.Core.csproj +++ b/Hi3Helper.Core/Hi3Helper.Core.csproj @@ -1,7 +1,7 @@  - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 10.0.26100.87 10.0.17763.0 x64 @@ -23,6 +23,11 @@ true + + + runtime-async=on + + True @@ -45,7 +50,7 @@ - + diff --git a/Hi3Helper.Core/packages.lock.json b/Hi3Helper.Core/packages.lock.json index 46cd3dd6f..fce9a4a13 100644 --- a/Hi3Helper.Core/packages.lock.json +++ b/Hi3Helper.Core/packages.lock.json @@ -1,12 +1,12 @@ { "version": 1, "dependencies": { - "net10.0-windows10.0.26100": { + "net11.0-windows10.0.26100": { "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "YlTamXppEQls6DYWt7RdUuwWDb0lyw/vXCaGeQpLCpsLmfwGuCkOz/vIGgMTV7ECsJcavkCOkxZXv9s8rdAHkQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "gK2aq4XvChj5kvozpPHrkfKkr7zc5Z4xoTrJb4GPZzDEPMlCk0TX632bwY3LsWcX2UVcVRQBBGzsBGC2lq6YhA==" }, "Microsoft.Windows.CsWinRT": { "type": "Direct", @@ -16,56 +16,37 @@ }, "Sentry": { "type": "Direct", - "requested": "[6.12.1, )", - "resolved": "6.12.1", - "contentHash": "yCHz3cLGZ3TVik3rLV6rp6SaqJ0Ai7PyIi2KdoHNGpZYWEkcX7kx13IV46mufAzPW7pqZZoKNoru0w0RpmkmrA==" + "requested": "[6.13.0, )", + "resolved": "6.13.0", + "contentHash": "TwgXw4BwBa6gYKJxTEBJWZ0y+MyBDTMzCq8ywYWUEzG9srNmKui4AMcz6vZ9BEsaZYVJxni0EIDHGho+PQXDVA==" }, "Google.Protobuf": { "type": "Transitive", "resolved": "3.36.2", "contentHash": "Ci1q1iJg74qAE5riTA2FbMS0wPbpruPQI/JQ9DrAsRo2VsSxgt1e/pmxGxgrci+pXJEgrSYg2vPl8rrStZkclQ==" }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw==" - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14" - } - }, "System.IO.Hashing": { "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "lVqovhCt3HlZe7ONG5ydaj6BYwYI004gldVfMMkJl/lR5ueeCtWNpW4nejOX75sPmzm8vXCxB69GqwHaYCnyUQ==" + "resolved": "11.0.0", + "contentHash": "U+Bv2qCYt6eONi+arSP0QIp4uTO6os6uceBsqiAwruZ+Wo2HrRhO/0tj38M9URJtS+4DhAtT3ka2TGNFYsnhyQ==" }, "hi3helper.enctool": { "type": "Project", "dependencies": { "Google.Protobuf": "[3.36.2, )", - "Hi3Helper.Http": "[2.0.1, )", + "Hi3Helper.Http": "[2.0.2, )", "Hi3Helper.Win32": "[1.0.0, )", - "System.IO.Hashing": "[10.0.14, )" + "System.IO.Hashing": "[11.0.0, )" } }, "hi3helper.http": { "type": "Project" }, "hi3helper.log": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )" - } + "type": "Project" }, "hi3helper.win32": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )" - } + "type": "Project" } } } diff --git a/Hi3Helper.EncTool b/Hi3Helper.EncTool index c3a7bf0e9..09ac3b8b4 160000 --- a/Hi3Helper.EncTool +++ b/Hi3Helper.EncTool @@ -1 +1 @@ -Subproject commit c3a7bf0e937b7503895012e589d3d753ae22d237 +Subproject commit 09ac3b8b448805773e6fdd6995eaef07455725d0 diff --git a/Hi3Helper.EncTool.Test/Hi3Helper.EncTool.Test.csproj b/Hi3Helper.EncTool.Test/Hi3Helper.EncTool.Test.csproj index b0fb08e5c..f803d9645 100644 --- a/Hi3Helper.EncTool.Test/Hi3Helper.EncTool.Test.csproj +++ b/Hi3Helper.EncTool.Test/Hi3Helper.EncTool.Test.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 enable enable x64 diff --git a/Hi3Helper.EncTool.Test/packages.lock.json b/Hi3Helper.EncTool.Test/packages.lock.json index 3aaf70078..904d28e78 100644 --- a/Hi3Helper.EncTool.Test/packages.lock.json +++ b/Hi3Helper.EncTool.Test/packages.lock.json @@ -1,12 +1,12 @@ { "version": 1, "dependencies": { - "net10.0": { + "net11.0": { "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "YlTamXppEQls6DYWt7RdUuwWDb0lyw/vXCaGeQpLCpsLmfwGuCkOz/vIGgMTV7ECsJcavkCOkxZXv9s8rdAHkQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "gK2aq4XvChj5kvozpPHrkfKkr7zc5Z4xoTrJb4GPZzDEPMlCk0TX632bwY3LsWcX2UVcVRQBBGzsBGC2lq6YhA==" } } } diff --git a/Hi3Helper.Http b/Hi3Helper.Http index ccacb8b46..b0980bdbd 160000 --- a/Hi3Helper.Http +++ b/Hi3Helper.Http @@ -1 +1 @@ -Subproject commit ccacb8b46ce5d855974700462ecf43f12a269652 +Subproject commit b0980bdbde699b76e786159c93a6de0a83bc2c6d diff --git a/Hi3Helper.LocaleSourceGen/Hi3Helper.LocaleSourceGen.csproj b/Hi3Helper.LocaleSourceGen/Hi3Helper.LocaleSourceGen.csproj index 0312411e7..eda0a7b48 100644 --- a/Hi3Helper.LocaleSourceGen/Hi3Helper.LocaleSourceGen.csproj +++ b/Hi3Helper.LocaleSourceGen/Hi3Helper.LocaleSourceGen.csproj @@ -1,7 +1,7 @@  - net10.0-windows10.0.26100.0 + net11.0-windows10.0.26100.0 10.0.26100.87 10.0.17763.0 x64 diff --git a/Hi3Helper.Log/Hi3Helper.Log.csproj b/Hi3Helper.Log/Hi3Helper.Log.csproj index f6314fd70..7b6bc05b2 100644 --- a/Hi3Helper.Log/Hi3Helper.Log.csproj +++ b/Hi3Helper.Log/Hi3Helper.Log.csproj @@ -1,15 +1,21 @@  - net10.0 + net11.0 14.0 enable true Debug;Release + true + + + + + runtime-async=on - + diff --git a/Hi3Helper.MagicScaler.LibheifCL/Hi3Helper.MagicScaler.LibheifCL.csproj b/Hi3Helper.MagicScaler.LibheifCL/Hi3Helper.MagicScaler.LibheifCL.csproj index 1a028d834..b4fb855db 100644 --- a/Hi3Helper.MagicScaler.LibheifCL/Hi3Helper.MagicScaler.LibheifCL.csproj +++ b/Hi3Helper.MagicScaler.LibheifCL/Hi3Helper.MagicScaler.LibheifCL.csproj @@ -1,7 +1,7 @@  - net10.0 + net11.0 x64 Debug;Release preview diff --git a/Hi3Helper.MagicScaler.LibheifCL/packages.lock.json b/Hi3Helper.MagicScaler.LibheifCL/packages.lock.json index 74ec65855..b77a060ae 100644 --- a/Hi3Helper.MagicScaler.LibheifCL/packages.lock.json +++ b/Hi3Helper.MagicScaler.LibheifCL/packages.lock.json @@ -1,12 +1,12 @@ { "version": 1, "dependencies": { - "net10.0": { + "net11.0": { "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "YlTamXppEQls6DYWt7RdUuwWDb0lyw/vXCaGeQpLCpsLmfwGuCkOz/vIGgMTV7ECsJcavkCOkxZXv9s8rdAHkQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "gK2aq4XvChj5kvozpPHrkfKkr7zc5Z4xoTrJb4GPZzDEPMlCk0TX632bwY3LsWcX2UVcVRQBBGzsBGC2lq6YhA==" }, "PhotoSauce.MagicScaler": { "type": "Direct", diff --git a/Hi3Helper.Plugin.Core b/Hi3Helper.Plugin.Core index fd424b7a2..be7a3fc94 160000 --- a/Hi3Helper.Plugin.Core +++ b/Hi3Helper.Plugin.Core @@ -1 +1 @@ -Subproject commit fd424b7a2c9e0502d7617984557d9c3e1c6c01e6 +Subproject commit be7a3fc94399612a84b73db3c4bf6b478db733f4 diff --git a/Hi3Helper.SharpDiscordRPC b/Hi3Helper.SharpDiscordRPC index 3a8db56fd..14b65593e 160000 --- a/Hi3Helper.SharpDiscordRPC +++ b/Hi3Helper.SharpDiscordRPC @@ -1 +1 @@ -Subproject commit 3a8db56fd652f414b9aa93f52439673c13adcb6d +Subproject commit 14b65593e7cc7b5c3522e4c7a0c6f65bf74b9985 diff --git a/Hi3Helper.SimpleZipArchiveReader b/Hi3Helper.SimpleZipArchiveReader index 345d80576..22cf3a43e 160000 --- a/Hi3Helper.SimpleZipArchiveReader +++ b/Hi3Helper.SimpleZipArchiveReader @@ -1 +1 @@ -Subproject commit 345d8057652890010e7e3600849d91c0acddfcf0 +Subproject commit 22cf3a43e31cc7187ab35b0e067a524f8a59de5c diff --git a/Hi3Helper.Sophon b/Hi3Helper.Sophon index 4c6001e85..4518394d0 160000 --- a/Hi3Helper.Sophon +++ b/Hi3Helper.Sophon @@ -1 +1 @@ -Subproject commit 4c6001e8585ffa2fda78805db0ab960e3245c049 +Subproject commit 4518394d08ae4dd1f279a02331c09baf8dfee41b diff --git a/Hi3Helper.TaskScheduler/Hi3Helper.TaskScheduler.csproj b/Hi3Helper.TaskScheduler/Hi3Helper.TaskScheduler.csproj index e4aba6a51..3d33525dc 100644 --- a/Hi3Helper.TaskScheduler/Hi3Helper.TaskScheduler.csproj +++ b/Hi3Helper.TaskScheduler/Hi3Helper.TaskScheduler.csproj @@ -1,7 +1,7 @@  - net10.0 + net11.0 disable x64 x64 diff --git a/Hi3Helper.TaskScheduler/packages.lock.json b/Hi3Helper.TaskScheduler/packages.lock.json index ce8929c76..8e3459720 100644 --- a/Hi3Helper.TaskScheduler/packages.lock.json +++ b/Hi3Helper.TaskScheduler/packages.lock.json @@ -1,25 +1,9 @@ { "version": 1, "dependencies": { - "net10.0": { - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "QtpQzuSZVyTPCuHW058yCs9Nj0394uUkNyFHS813nOmK9UgUdBdaprJ5PPsBgsQIpxADTsTkbaMMonykem6qdw==" - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "10.0.14", - "contentHash": "SwcbEBtkECq3D2oywvHkm46fyrX9Dd2JPWphDnHUc2+cUWR1Mdo41atAjh/9iZjgQxuvbKfZKXqostT/LZfefA==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.14" - } - }, + "net11.0": { "hi3helper.win32": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[10.0.14, )" - } + "type": "Project" } } } diff --git a/Hi3Helper.Win32 b/Hi3Helper.Win32 index c509505cb..9dcf492d7 160000 --- a/Hi3Helper.Win32 +++ b/Hi3Helper.Win32 @@ -1 +1 @@ -Subproject commit c509505cb5fac9e932c95778efbf14bd99ab8a68 +Subproject commit 9dcf492d7cb37cbb1148f3d39148499bb752be35 diff --git a/ImageEx b/ImageEx index 2be4c993e..6685ca1cd 160000 --- a/ImageEx +++ b/ImageEx @@ -1 +1 @@ -Subproject commit 2be4c993e887929c31ca50fa06cc263366d37dcc +Subproject commit 6685ca1cd9ef18f765b70c2bab09047dda8969c8 diff --git a/InnoSetupHelper/InnoSetupHelper.csproj b/InnoSetupHelper/InnoSetupHelper.csproj index d009f4214..327f7104b 100644 --- a/InnoSetupHelper/InnoSetupHelper.csproj +++ b/InnoSetupHelper/InnoSetupHelper.csproj @@ -1,7 +1,7 @@ - net10.0 + net11.0 disable enable true @@ -19,7 +19,7 @@ - + \ No newline at end of file diff --git a/InnoSetupHelper/packages.lock.json b/InnoSetupHelper/packages.lock.json index cbd40d71b..3e6ed929e 100644 --- a/InnoSetupHelper/packages.lock.json +++ b/InnoSetupHelper/packages.lock.json @@ -1,18 +1,18 @@ { "version": 1, "dependencies": { - "net10.0": { + "net11.0": { "Microsoft.NET.ILLink.Tasks": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "YlTamXppEQls6DYWt7RdUuwWDb0lyw/vXCaGeQpLCpsLmfwGuCkOz/vIGgMTV7ECsJcavkCOkxZXv9s8rdAHkQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "gK2aq4XvChj5kvozpPHrkfKkr7zc5Z4xoTrJb4GPZzDEPMlCk0TX632bwY3LsWcX2UVcVRQBBGzsBGC2lq6YhA==" }, "System.IO.Hashing": { "type": "Direct", - "requested": "[10.0.14, )", - "resolved": "10.0.14", - "contentHash": "lVqovhCt3HlZe7ONG5ydaj6BYwYI004gldVfMMkJl/lR5ueeCtWNpW4nejOX75sPmzm8vXCxB69GqwHaYCnyUQ==" + "requested": "[11.0.0, )", + "resolved": "11.0.0", + "contentHash": "U+Bv2qCYt6eONi+arSP0QIp4uTO6os6uceBsqiAwruZ+Wo2HrRhO/0tj38M9URJtS+4DhAtT3ka2TGNFYsnhyQ==" } } } diff --git a/SevenZipExtractor b/SevenZipExtractor index 370c1c2d8..ecf7f6be6 160000 --- a/SevenZipExtractor +++ b/SevenZipExtractor @@ -1 +1 @@ -Subproject commit 370c1c2d8c4c88cb7a788085ebf70b72932c4843 +Subproject commit ecf7f6be6ffe8359d0eee01575af7b0df71487e2 diff --git a/env.json b/env.json index 3dab5e897..2a0d219be 100644 --- a/env.json +++ b/env.json @@ -1,5 +1,5 @@ { "DOTNET_INSTALL_DIR": ".\\.dotnet", - "DOTNET_VERSION": "10.0.4xx", + "DOTNET_VERSION": "11.0.1xx", "DOTNET_QUALITY": "ga" } \ No newline at end of file diff --git a/global.json b/global.json index 9d0a59174..34656e29d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.403", + "version": "11.0.100", "rollForward": "latestPatch", "allowPrerelease": true }