From 901683d837b5f8d99e2aefa5b3877f5e616185c5 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 30 Jan 2021 11:08:46 -0800 Subject: [PATCH] Revert "Exposed systemProfileInformationArray, e.g. for use by the app preferences GUI" This reverts commit 1c32cc7fcb417c4124311b2489258a98971ae685. * We cannot make it look like applications are collecting system profile information all the time. * The method collects non-system profile information too (feed parameters from delegate). Presumably users only cares about system profile information. Otherwise the name is incorrect. * Adding a mutable property to SUUpdater is heavyweight; perhaps an API to ask and compute for the systemProfileArray is better idea. Or a delegate API when system profile array will be sent. * This change introduced nullability warnings in SUUpdater.h due to other things not being null annotated there. --- Sparkle/SUUpdater.h | 5 ----- Sparkle/SUUpdater.m | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/Sparkle/SUUpdater.h b/Sparkle/SUUpdater.h index e016294c..d05270f2 100644 --- a/Sparkle/SUUpdater.h +++ b/Sparkle/SUUpdater.h @@ -169,11 +169,6 @@ 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 531a9bf1..8e54905a 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -64,7 +64,6 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification @synthesize shouldRescheduleOnWake; @synthesize userAgentString = customUserAgentString; @synthesize httpHeaders; -@synthesize systemProfileInformationArray; @synthesize driver; @synthesize host; @synthesize sparkleBundle; @@ -134,15 +133,6 @@ 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]; } @@ -241,7 +231,6 @@ 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 @@ -577,7 +566,6 @@ 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.