市场插件安装机制修复,然后修复了一大堆东西
This commit is contained in:
lincube
2026-03-11 15:14:08 +08:00
parent e7a03404ce
commit 87110f1d69
9 changed files with 344 additions and 68 deletions

View File

@@ -78,9 +78,13 @@ internal sealed class AirAppMarketInstallService : IDisposable
}
}
await using var hashStream = File.OpenRead(downloadPath);
var hashBytes = await SHA256.HashDataAsync(hashStream, cancellationToken);
var actualHash = Convert.ToHexString(hashBytes).ToLowerInvariant();
string actualHash;
await using (var hashStream = File.OpenRead(downloadPath))
{
var hashBytes = await SHA256.HashDataAsync(hashStream, cancellationToken);
actualHash = Convert.ToHexString(hashBytes).ToLowerInvariant();
}
if (!string.Equals(actualHash, plugin.Sha256, StringComparison.OrdinalIgnoreCase))
{
File.Delete(downloadPath);