解决元数据导致的问题

This commit is contained in:
fanbook-wangdage
2025-12-19 21:19:47 +08:00
parent 6d08f669e7
commit 6c68a55d81
6 changed files with 23 additions and 45 deletions

View File

@@ -2,7 +2,7 @@
<Package
Name="Snap.Hutao"
Manufacturer="Millennium Science Technology R-D Inst"
Version="1.0.0.0"
Version="1.17.4.0"
UpgradeCode="121203be-60cb-408f-92cc-7080f6598e68"
Scope="perMachine">

View File

@@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<HarvestDirectory Include="..\Snap.Hutao\bin\Release\net10.0-windows10.0.26100.0\win-x64">
<HarvestDirectory Include="..\Snap.Hutao\bin\x64\Release\net10.0-windows10.0.26100.0\win-x64">
<ComponentGroupName>MainAppComponents</ComponentGroupName>
<DirectoryRefId>INSTALLFOLDER</DirectoryRefId>
<SuppressCom>true</SuppressCom>

View File

@@ -13,7 +13,7 @@
<Identity
Name="60568DGPStudio.SnapHutao"
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
Version="1.17.1.0" />
Version="1.17.4.0" />
<Properties>
<DisplayName>Snap Hutao</DisplayName>

View File

@@ -24,14 +24,23 @@ internal static class AvatarViewBuilderExtension
{
if (detailedCharacter.Costumes is [{ Id: { } id }, ..])
{
MetadataCostume costume = avatar.Costumes.Single(c => c.Id == id);
MetadataCostume? costume = avatar.Costumes.SingleOrDefault(c => c.Id == id);
if (costume != null)
{
ArgumentNullException.ThrowIfNull(costume.FrontIcon);
ArgumentNullException.ThrowIfNull(costume.SideIcon);
ArgumentNullException.ThrowIfNull(costume.FrontIcon);
ArgumentNullException.ThrowIfNull(costume.SideIcon);
// Set to costume icon
builder.View.Icon = AvatarIconConverter.IconNameToUri(costume.FrontIcon);
builder.View.SideIcon = AvatarIconConverter.IconNameToUri(costume.SideIcon);
// Set to costume icon
builder.View.Icon = AvatarIconConverter.IconNameToUri(costume.FrontIcon);
builder.View.SideIcon = AvatarIconConverter.IconNameToUri(costume.SideIcon);
}
else
{
// Costume not found in metadata, fallback to default avatar icon
builder.View.Icon = AvatarIconConverter.IconNameToUri(avatar.Icon);
builder.View.SideIcon = AvatarIconConverter.IconNameToUri(avatar.SideIcon);
}
}
else
{

View File

@@ -10,6 +10,9 @@
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<UseWinUI>true</UseWinUI>
<UseWPF>False</UseWPF>
<!-- 配置版本号 -->
<Version>1.17.4.0</Version>
<UseWindowsForms>False</UseWindowsForms>
<ImplicitUsings>False</ImplicitUsings>
<Nullable>enable</Nullable>
@@ -288,7 +291,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Snap.Hutao.SourceGeneration" Version="1.3.14">
<PackageReference Include="Snap.Hutao.SourceGeneration" Version="1.3.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -1,34 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Web.Hoyolab.DataSigning;
/// <summary>
/// Salt constants for data signing
/// Values are obtained from https://github.com/UIGF-org/Hoyolab.Salt
/// This file should normally be generated by Snap.Hutao.SourceGeneration.Automation.SaltConstantGenerator
/// But is provided manually when the generator fails to fetch values from the network.
///
/// IMPORTANT: For local builds, you must manually obtain salt values from:
/// https://github.com/UIGF-org/Hoyolab.Salt
/// </summary>
internal static class SaltConstants
{
// Version numbers - Update these according to the current miHoYo app versions
public const string CNVersion = "2.95.1";
public const string OSVersion = "2.54.0";
// Salt keys for Chinese (CN) server
// These are placeholder values - MUST be replaced with actual values from UIGF-org/Hoyolab.Salt
public const string CNK2 = "sfYPEgpxkOe1I3XVMLdwp1Lyt9ORgZsq";
public const string CNLK2 = "sidQFEglajEz7FA0Aj7HQPV88zpf17SO";
// Salt keys for Overseas (OS) server
public const string OSK2 = "599uqkwc0dlqu3h6epzjzfhgyyrd44ae";
public const string OSLK2 = "rk4xg2hakoi26nljpr099fv9fck1ah10";
// Note: The actual salt values are security-sensitive and should not be committed
// to public repositories. For local builds, obtain them from the UIGF organization
// and replace the placeholders above.
}