From 154b7025529ca666ef8674ef2a5514ee039914bb Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 16 Jan 2021 20:14:52 -0800 Subject: [PATCH] Parse and serialize osString appcast item property --- Sparkle/SUAppcastItem.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index b8921817..33de60f8 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -79,6 +79,7 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT _releaseNotesURL = [decoder decodeObjectOfClass:[NSURL class] forKey:SUAppcastItemReleaseNotesURLKey]; _title = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemTitleKey] copy]; _versionString = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemVersionStringKey] copy]; + _osString = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastAttributeOsType] copy]; _propertiesDictionary = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class], [NSDate class], [NSArray class]]] forKey:SUAppcastItemPropertiesKey]; } @@ -133,6 +134,10 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT [encoder encodeObject:self.versionString forKey:SUAppcastItemVersionStringKey]; } + if (self.osString != nil) { + [encoder encodeObject:self.osString forKey:SUAppcastAttributeOsType]; + } + if (self.propertiesDictionary != nil) { [encoder encodeObject:self.propertiesDictionary forKey:SUAppcastItemPropertiesKey]; } @@ -257,6 +262,7 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT } if (enclosure) { _signatures = [[SUSignatures alloc] initWithDsa:[enclosure objectForKey:SUAppcastAttributeDSASignature] ed:[enclosure objectForKey:SUAppcastAttributeEDSignature]]; + _osString = [enclosure objectForKey:SUAppcastAttributeOsType]; } _versionString = [(NSString *)newVersion copy];