diff --git a/Sparkle/SUUpdater.h b/Sparkle/SUUpdater.h index d05270f2..e016294c 100644 --- a/Sparkle/SUUpdater.h +++ b/Sparkle/SUUpdater.h @@ -169,6 +169,11 @@ SU_EXPORT @interface SUUpdater : NSObject */ @property BOOL sendsSystemProfile; +/*! + The user's system profile information that will be sent when checking for updates if sendsSystemProfile is true. + */ +@property (copy, nullable) NSArray *> *systemProfileInformationArray; + /*! A property indicating the decryption password used for extracting updates shipped as Apple Disk Images (dmg) */ diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 8e54905a..531a9bf1 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -64,6 +64,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification @synthesize shouldRescheduleOnWake; @synthesize userAgentString = customUserAgentString; @synthesize httpHeaders; +@synthesize systemProfileInformationArray; @synthesize driver; @synthesize host; @synthesize sparkleBundle; @@ -133,6 +134,15 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults [sharedUpdaters setObject:self forKey:[NSValue valueWithNonretainedObject:bundle]]; host = [[SUHost alloc] initWithBundle:bundle]; + if (self) { + NSArray *> *profileInfo = [SUSystemProfiler systemProfileArrayForHost:self.host]; + BOOL sendingSystemProfile = [self sendsSystemProfile]; + if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) { + profileInfo = [profileInfo arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile]]; + } + self.systemProfileInformationArray = profileInfo; + } + // This runs the permission prompt if needed, but never before the app has finished launching because the runloop won't run before that [self performSelector:@selector(startUpdateCycle) withObject:nil afterDelay:0]; } @@ -231,6 +241,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) { profileInfo = [profileInfo arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:YES]]; } + self.systemProfileInformationArray = profileInfo; [SUUpdatePermissionPrompt promptWithHost:self.host systemProfile:profileInfo reply:^(SUUpdatePermissionResponse *response) { [self updatePermissionRequestFinishedWithResponse:response]; // Schedule checks, but make sure we ignore the delayed call from KVO @@ -566,6 +577,7 @@ static NSString *escapeURLComponent(NSString *str) { parameters = [parameters arrayByAddingObjectsFromArray:[SUSystemProfiler systemProfileArrayForHost:self.host]]; [self.host setObject:[NSDate date] forUserDefaultsKey:SULastProfileSubmitDateKey]; } + self.systemProfileInformationArray = parameters; if ([parameters count] == 0) { return baseFeedURL; } // Build up the parameterized URL.