Add NSSecureCoding to SUUpdatePermissionPromptResult

This commit is contained in:
Zorg committed 2016-02-15 00:18:01 -05:00
1 parent 480feff34f
commit 48e0febf1a
3 files changed
+20 -1

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ typedef NS_ENUM(NSInteger, SUCheckUpdatesChoice) {
SUDoNotAutomaticallyCheck
};
@interface SUUpdatePermissionPromptResult : NSObject
@interface SUUpdatePermissionPromptResult : NSObject<NSSecureCoding>
+ (instancetype)updatePermissionPromptResultWithChoice:(SUCheckUpdatesChoice)choice shouldSendProfile:(BOOL)shouldSendProfile;
+18
View File
@@ -13,6 +13,24 @@
@synthesize choice = _choice;
@synthesize shouldSendProfile = _shouldSendProfile;
+ (BOOL)supportsSecureCoding
{
return YES;
}
- (instancetype)initWithCoder:(NSCoder *)decoder
{
NSInteger choice = [decoder decodeIntegerForKey:@"choice"];
BOOL shouldSendProfile = [decoder decodeBoolForKey:@"shouldSendProfile"];
return [[self class] updatePermissionPromptResultWithChoice:choice shouldSendProfile:shouldSendProfile];
}
- (void)encodeWithCoder:(NSCoder *)encoder
{
[encoder encodeInteger:self.choice forKey:@"choice"];
[encoder encodeBool:self.shouldSendProfile forKey:@"shouldSendProfile"];
}
- (instancetype)initWithCheckUpdatesChoice:(SUCheckUpdatesChoice)choice shouldSendProfile:(BOOL)shouldSendProfile
{
self = [super init];
+1
View File
@@ -17,6 +17,7 @@
- (instancetype)initWithHost:(SUHost *)host;
#warning might need to whitelist class types for systemProfile.. need to test this
- (void)requestUpdatePermissionWithSystemProfile:(NSArray *)systemProfile reply:(void (^)(SUUpdatePermissionPromptResult *))reply;
- (void)openInfoURLForAppcastItem:(SUAppcastItem *)appcastItem;