From ce2b218dfa2596d43ffa624abae340c4d76c7b35 Mon Sep 17 00:00:00 2001 From: lincube Date: Thu, 12 Mar 2026 00:18:04 +0800 Subject: [PATCH] 0.5.17 --- LanMountainDesktop/plugins/PluginMarketInstallService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LanMountainDesktop/plugins/PluginMarketInstallService.cs b/LanMountainDesktop/plugins/PluginMarketInstallService.cs index e5ea4cb..6d0085d 100644 --- a/LanMountainDesktop/plugins/PluginMarketInstallService.cs +++ b/LanMountainDesktop/plugins/PluginMarketInstallService.cs @@ -78,6 +78,7 @@ internal sealed class AirAppMarketInstallService : IDisposable } } + var actualSize = new FileInfo(downloadPath).Length; string actualHash; await using (var hashStream = File.OpenRead(downloadPath)) { @@ -87,11 +88,14 @@ internal sealed class AirAppMarketInstallService : IDisposable if (!string.Equals(actualHash, plugin.Sha256, StringComparison.OrdinalIgnoreCase)) { + AppLogger.Error( + "PluginMarket", + $"SHA-256 verification failed. PluginId='{plugin.Id}'; Version='{plugin.Version}'; DownloadUrl='{resolvedDownloadUrl}'; DownloadPath='{downloadPath}'; ExpectedHash='{plugin.Sha256}'; ActualHash='{actualHash}'; ExpectedSize='{plugin.PackageSizeBytes}'; ActualSize='{actualSize}'."); File.Delete(downloadPath); return new AirAppMarketInstallResult( false, null, - $"SHA-256 mismatch. Expected {plugin.Sha256}, actual {actualHash}."); + $"SHA-256 mismatch. Expected {plugin.Sha256}, actual {actualHash}. Expected size {plugin.PackageSizeBytes}, actual size {actualSize}. Source {resolvedDownloadUrl}."); } PluginManifest manifest;