diff --git a/src/Snap.Hutao/Snap.Hutao.Installer/Package.wxs b/src/Snap.Hutao/Snap.Hutao.Installer/Package.wxs index 6567b23..ac0ec61 100644 --- a/src/Snap.Hutao/Snap.Hutao.Installer/Package.wxs +++ b/src/Snap.Hutao/Snap.Hutao.Installer/Package.wxs @@ -2,7 +2,7 @@ diff --git a/src/Snap.Hutao/Snap.Hutao.Installer/Snap.Hutao.Installer.wixproj b/src/Snap.Hutao/Snap.Hutao.Installer/Snap.Hutao.Installer.wixproj index ee8d9b2..cb6c0e2 100644 --- a/src/Snap.Hutao/Snap.Hutao.Installer/Snap.Hutao.Installer.wixproj +++ b/src/Snap.Hutao/Snap.Hutao.Installer/Snap.Hutao.Installer.wixproj @@ -11,7 +11,7 @@ - + MainAppComponents INSTALLFOLDER true diff --git a/src/Snap.Hutao/Snap.Hutao/Package.appxmanifest b/src/Snap.Hutao/Snap.Hutao/Package.appxmanifest index 9eaebe9..43f146d 100644 --- a/src/Snap.Hutao/Snap.Hutao/Package.appxmanifest +++ b/src/Snap.Hutao/Snap.Hutao/Package.appxmanifest @@ -13,7 +13,7 @@ + Version="1.17.4.0" /> Snap Hutao diff --git a/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/Builder/AvatarViewBuilderExtension.cs b/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/Builder/AvatarViewBuilderExtension.cs index 7471fbb..db4577a 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/Builder/AvatarViewBuilderExtension.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/Builder/AvatarViewBuilderExtension.cs @@ -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 { diff --git a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj index f112dea..8cbe51d 100644 --- a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj +++ b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj @@ -10,6 +10,9 @@ win-x64 true False + + 1.17.4.0 + False False enable @@ -288,7 +291,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/DataSigning/SaltConstants.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/DataSigning/SaltConstants.cs deleted file mode 100644 index c34a6fd..0000000 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/DataSigning/SaltConstants.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) DGP Studio. All rights reserved. -// Licensed under the MIT license. - -namespace Snap.Hutao.Web.Hoyolab.DataSigning; - -/// -/// 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 -/// - -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. -}