mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Add secure coding to SPUUserUpdateState
This commit is contained in:
1 parent
25b3d01efa
commit
1565db3fec
2 files changed
+26
-1
No files matched your search
Vendored
+25
@@ -12,6 +12,10 @@
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
#define SPUUserUpdateStateStageKey @"SPUUserUpdateStateStage"
|
||||
#define SPUUserUpdateStateUserInitiatedKey @"SPUUserUpdateStateUserInitiated"
|
||||
#define SPUUserUpdateStateMajorUpgradeKey @"SPUUserUpdateStateMajorUpgrade"
|
||||
|
||||
@implementation SPUUserUpdateState
|
||||
|
||||
@synthesize stage = _stage;
|
||||
@@ -29,4 +33,25 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)encoder
|
||||
{
|
||||
[encoder encodeInteger:self.stage forKey:SPUUserUpdateStateStageKey];
|
||||
[encoder encodeBool:self.userInitiated forKey:SPUUserUpdateStateUserInitiatedKey];
|
||||
[encoder encodeBool:self.majorUpgrade forKey:SPUUserUpdateStateMajorUpgradeKey];
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
SPUUserUpdateStage stage = [decoder decodeIntegerForKey:SPUUserUpdateStateStageKey];
|
||||
BOOL userInitiated = [decoder decodeBoolForKey:SPUUserUpdateStateUserInitiatedKey];
|
||||
BOOL majorUpgrade = [decoder decodeBoolForKey:SPUUserUpdateStateMajorUpgradeKey];
|
||||
|
||||
return [self initWithStage:stage userInitiated:userInitiated majorUpgrade:majorUpgrade];
|
||||
}
|
||||
|
||||
+ (BOOL)supportsSecureCoding
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+1
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SUAppcastItem (Private)
|
||||
@interface SUAppcastItem (Private) <NSSecureCoding>
|
||||
|
||||
// Initializes with data from a dictionary provided by the RSS class.
|
||||
- (nullable instancetype)initWithDictionary:(NSDictionary *)dict relativeToURL:(NSURL * _Nullable)appcastURL failureReason:(NSString * _Nullable __autoreleasing *_Nullable)error;
|
||||
|
||||
Reference in new issue
Block a user