Fix apk icon can not be found from resource id

This commit is contained in:
ema
2025-06-27 02:12:49 +08:00
parent 2bf6387b8f
commit aef35d748e
2 changed files with 4 additions and 2 deletions

View File

@@ -53,7 +53,9 @@ public static class ApkParser
if (baseInfo.HasIcon)
{
ZipEntry entry = zip.GetEntry(baseInfo.Icons.Values.LastOrDefault());
ZipEntry entry = zip.GetEntry(baseInfo.Icons.Values
.Where(icon => icon.EndsWith(".png", StringComparison.OrdinalIgnoreCase))
.LastOrDefault());
using var s = new BinaryReader(zip.GetInputStream(entry));
info.Logo = s.ReadBytes((int)entry.Size);
}

View File

@@ -75,8 +75,8 @@
<PackageReference Include="WixToolset.Dtf.WindowsInstaller" Version="6.0.0" />
<PackageReference Include="SharpZipLib" Version="1.4.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="ApkReader" Version="2.0.1.1" />
<PackageReference Include="PureSharpCompress" Version="0.39.0" />
<PackageReference Include="QuickLook.ApkReader" Version="2.0.2" />
<PackageReference Include="QuickLook.DiscUtils" Version="1.0.0" />
<PackageReference Include="QuickLook.RpmReader" Version="1.0.0" />
</ItemGroup>