feat: show xcarchive developer notes

This commit is contained in:
relikd
2025-11-06 01:06:53 +01:00
parent 1a6d98a4b2
commit 2d16cb666b
4 changed files with 40 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
import Foundation
extension MetaInfo {
/// Read `Info.plist` if type `.Archive`
func readPlistXCArchive() -> PlistDict? {
switch self.type {
case .Archive:
// not `readPayloadFile` because plist is in root dir
return try? Data(contentsOf: self.url.appendingPathComponent("Info.plist", isDirectory: false)).asPlistOrNil()
case .IPA, .Extension:
return nil
}
}
}
extension PreviewGenerator {
/// Process info of `.xcarchive` stored in root `Info.plist`
mutating func procArchiveInfo(_ archivePlist: PlistDict?) {
guard let archivePlist, let comment = archivePlist["Comment"] as? String else {
self.apply(["ArchiveHidden": CLASS_HIDDEN])
return
}
self.apply([
"ArchiveHidden": CLASS_VISIBLE,
"ArchiveComment": comment,
])
}
}

View File

@@ -10,13 +10,13 @@ struct PreviewGenerator {
init(_ meta: MetaInfo) {
self.meta = meta
let plistApp = meta.readPlistApp()
let plistItunes = meta.readPlistItunes()
let plistProvision = meta.readPlistProvision()
data["QuickLookTitle"] = stringForFileType(meta)
procAppInfo(plistApp, isOSX: meta.isOSX)
procItunesMeta(plistItunes)
procArchiveInfo(meta.readPlistXCArchive())
procItunesMeta(meta.readPlistItunes())
procTransportSecurity(plistApp)
procEntitlements(meta, plistApp, plistProvision)
procProvision(plistProvision, isOSX: meta.isOSX)