Emit edSignature in the appcast

This commit is contained in:
Kornel committed 2018-09-16 11:19:28 +01:00
1 parent d90529ccaa
commit 19be83b15f
2 files changed
+8 -2

No files matched your search

+2 -2
View File
@@ -83,8 +83,8 @@ class ArchiveItem: CustomStringConvertible {
throw makeError(code: .unarchivingError, "No Version \(kCFBundleVersionKey as String? ?? "missing kCFBundleVersionKey") \(appPath)");
}
let shortVersion = infoPlist["CFBundleShortVersionString"] as? String;
let publicEdKey = infoPlist["SUPublicEDKey"] as? String;
let supportsDSA = infoPlist["SUPublicDSAKey"] != nil || infoPlist["SUPublicDSAKeyFile"] != nil;
let publicEdKey = infoPlist[SUPublicEDKeyKey] as? String;
let supportsDSA = infoPlist[SUPublicDSAKeyKey] != nil || infoPlist[SUPublicDSAKeyFileKey] != nil;
var feedURL:URL? = nil;
if let feedURLStr = infoPlist["SUFeedURL"] as? String {
+6
View File
@@ -147,6 +147,9 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
XMLNode.attribute(withName: "length", stringValue: String(update.fileSize)) as! XMLNode,
XMLNode.attribute(withName: "type", stringValue: update.mimeType) as! XMLNode,
];
if let sig = update.edSignature {
attributes.append(XMLNode.attribute(withName: "sparkle:edSignature", uri: sparkleNS, stringValue: sig) as! XMLNode);
}
if let sig = update.dsaSignature {
attributes.append(XMLNode.attribute(withName: "sparkle:dsaSignature", uri: sparkleNS, stringValue: sig) as! XMLNode);
}
@@ -170,6 +173,9 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
XMLNode.attribute(withName: "length", stringValue: String(delta.fileSize)) as! XMLNode,
XMLNode.attribute(withName: "type", stringValue: "application/octet-stream") as! XMLNode,
];
if let sig = delta.edSignature {
attributes.append(XMLNode.attribute(withName: "sparkle:edSignature", uri: sparkleNS, stringValue: sig) as! XMLNode);
}
if let sig = delta.dsaSignature {
attributes.append(XMLNode.attribute(withName: "sparkle:dsaSignature", uri: sparkleNS, stringValue: sig) as! XMLNode);
}