mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-28 05:14:34 +00:00
Add NSSecureCoding to SUUpdatePermissionPromptResult
This commit is contained in:
1 parent
480feff34f
commit
48e0febf1a
3 files changed
+20
-1
No files matched your search
+1
-1
@@ -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
@@ -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];
|
||||
|
||||
Vendored
+1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user