mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Uses real app icon for AltBackup icon
This commit is contained in:
@@ -1056,6 +1056,26 @@ private extension AppManager
|
||||
exportedUTIs.append(installedAppUTI)
|
||||
infoDictionary[Bundle.Info.exportedUTIs] = exportedUTIs
|
||||
|
||||
if let cachedApp = ALTApplication(fileURL: app.fileURL), let icon = cachedApp.icon?.resizing(to: CGSize(width: 180, height: 180))
|
||||
{
|
||||
let iconFileURL = unzippedAppBundleURL.appendingPathComponent("AppIcon.png")
|
||||
|
||||
if let iconData = icon.pngData()
|
||||
{
|
||||
do
|
||||
{
|
||||
try iconData.write(to: iconFileURL, options: .atomic)
|
||||
|
||||
let bundleIcons = ["CFBundlePrimaryIcon": ["CFBundleIconFiles": [iconFileURL.lastPathComponent]]]
|
||||
infoDictionary["CFBundleIcons"] = bundleIcons
|
||||
}
|
||||
catch
|
||||
{
|
||||
print("Failed to write app icon data.", error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try (infoDictionary as NSDictionary).write(to: unzippedAppBundle.infoPlistURL)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user