mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Don't expose sparkleBundle (#1917)
This commit is contained in:
1 parent
d719b92636
commit
306ea26df8
16 files changed
+23
-32
No files matched your search
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Sparkle.xcodeproj">
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
Vendored
+1
-1
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SPUAutomaticUpdateDriver : NSObject <SPUUpdateDriver>
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate;
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -39,7 +39,7 @@
|
||||
@synthesize updateItem = _updateItem;
|
||||
@synthesize willInstallSilently = _willInstallSilently;
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
@@ -47,7 +47,7 @@
|
||||
// The user driver is only used for a termination callback
|
||||
_userDriver = userDriver;
|
||||
_updaterDelegate = updaterDelegate;
|
||||
_coreDriver = [[SPUCoreBasedUpdateDriver alloc] initWithHost:host applicationBundle:applicationBundle sparkleBundle:sparkleBundle updater:updater updaterDelegate:updaterDelegate delegate:self];
|
||||
_coreDriver = [[SPUCoreBasedUpdateDriver alloc] initWithHost:host applicationBundle:applicationBundle updater:updater updaterDelegate:updaterDelegate delegate:self];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SPUCoreBasedUpdateDriver : NSObject
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate delegate:(id<SPUCoreBasedUpdateDriverDelegate>)delegate;
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate delegate:(id<SPUCoreBasedUpdateDriverDelegate>)delegate;
|
||||
|
||||
- (void)prepareCheckForUpdatesWithCompletion:(SPUUpdateDriverCompletion)completionBlock;
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -66,7 +66,7 @@
|
||||
@synthesize resumableUpdate = _resumableUpdate;
|
||||
@synthesize downloadedUpdateForRemoval = _downloadedUpdateForRemoval;
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate delegate:(id<SPUCoreBasedUpdateDriverDelegate>)delegate
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate delegate:(id<SPUCoreBasedUpdateDriverDelegate>)delegate
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
@@ -76,7 +76,7 @@
|
||||
assert(bundleIdentifier != nil);
|
||||
|
||||
_basicDriver = [[SPUBasicUpdateDriver alloc] initWithHost:host updater:updater updaterDelegate:updaterDelegate delegate:self];
|
||||
_installerDriver = [[SPUInstallerDriver alloc] initWithHost:host applicationBundle:applicationBundle sparkleBundle:sparkleBundle updater:updater updaterDelegate:updaterDelegate delegate:self];
|
||||
_installerDriver = [[SPUInstallerDriver alloc] initWithHost:host applicationBundle:applicationBundle updater:updater updaterDelegate:updaterDelegate delegate:self];
|
||||
|
||||
_host = host;
|
||||
_updater = updater;
|
||||
|
||||
Vendored
+1
-1
@@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SPUInstallerDriver : NSObject
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate delegate:(nullable id<SPUInstallerDriverDelegate>)delegate;
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater updaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate delegate:(nullable id<SPUInstallerDriverDelegate>)delegate;
|
||||
|
||||
- (void)resumeInstallingUpdateWithUpdateItem:(SUAppcastItem *)updateItem systemDomain:(BOOL)systemDomain;
|
||||
|
||||
|
||||
Vendored
+1
-4
@@ -41,7 +41,6 @@
|
||||
|
||||
@property (nonatomic, readonly) SUHost *host;
|
||||
@property (nonatomic, readonly) NSBundle *applicationBundle;
|
||||
@property (nonatomic, readonly) NSBundle *sparkleBundle;
|
||||
@property (nonatomic, weak, readonly) id<SPUInstallerDriverDelegate> delegate;
|
||||
@property (nonatomic) SPUInstallerMessageType currentStage;
|
||||
@property (nonatomic) BOOL startedInstalling;
|
||||
@@ -69,7 +68,6 @@
|
||||
|
||||
@synthesize host = _host;
|
||||
@synthesize applicationBundle = _applicationBundle;
|
||||
@synthesize sparkleBundle = _sparkleBundle;
|
||||
@synthesize delegate = _delegate;
|
||||
@synthesize currentStage = _currentStage;
|
||||
@synthesize startedInstalling = _startedInstalling;
|
||||
@@ -86,13 +84,12 @@
|
||||
@synthesize aborted = _aborted;
|
||||
@synthesize installerError = _installerError;
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(id<SPUUpdaterDelegate>)updaterDelegate delegate:(nullable id<SPUInstallerDriverDelegate>)delegate
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater updaterDelegate:(id<SPUUpdaterDelegate>)updaterDelegate delegate:(nullable id<SPUInstallerDriverDelegate>)delegate
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_host = host;
|
||||
_applicationBundle = applicationBundle;
|
||||
_sparkleBundle = sparkleBundle;
|
||||
_updater = updater;
|
||||
_updaterDelegate = updaterDelegate;
|
||||
_delegate = delegate;
|
||||
|
||||
Vendored
+1
-1
@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SPUScheduledUpdateDriver : NSObject <SPUUpdateDriver>
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate;
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -27,11 +27,11 @@
|
||||
@synthesize uiDriver = _uiDriver;
|
||||
@synthesize showedUpdate = _showedUpdate;
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_uiDriver = [[SPUUIBasedUpdateDriver alloc] initWithHost:host applicationBundle:applicationBundle sparkleBundle:sparkleBundle updater:updater userDriver:userDriver userInitiated:NO updaterDelegate:updaterDelegate delegate:self];
|
||||
_uiDriver = [[SPUUIBasedUpdateDriver alloc] initWithHost:host applicationBundle:applicationBundle updater:updater userDriver:userDriver userInitiated:NO updaterDelegate:updaterDelegate delegate:self];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SPUUIBasedUpdateDriver : NSObject
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver userInitiated:(BOOL)userInitiated updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate delegate:(id<SPUUIBasedUpdateDriverDelegate>)delegate;
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver userInitiated:(BOOL)userInitiated updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate delegate:(id<SPUUIBasedUpdateDriverDelegate>)delegate;
|
||||
|
||||
- (void)prepareCheckForUpdatesWithCompletion:(SPUUpdateDriverCompletion)completionBlock;
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -111,7 +111,7 @@
|
||||
@synthesize httpHeaders = _httpHeaders;
|
||||
@synthesize userAgent = _userAgent;
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver userInitiated:(BOOL)userInitiated updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate delegate:(id<SPUUIBasedUpdateDriverDelegate>)delegate
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver userInitiated:(BOOL)userInitiated updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate delegate:(id<SPUUIBasedUpdateDriverDelegate>)delegate
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
@@ -122,7 +122,7 @@
|
||||
_updaterDelegate = updaterDelegate;
|
||||
_host = host;
|
||||
|
||||
_coreDriver = [[SPUCoreBasedUpdateDriver alloc] initWithHost:host applicationBundle:applicationBundle sparkleBundle:sparkleBundle updater:updater updaterDelegate:updaterDelegate delegate:self];
|
||||
_coreDriver = [[SPUCoreBasedUpdateDriver alloc] initWithHost:host applicationBundle:applicationBundle updater:updater updaterDelegate:updaterDelegate delegate:self];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Vendored
-5
@@ -216,11 +216,6 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
*/
|
||||
@property (nonatomic, readonly) NSBundle *hostBundle;
|
||||
|
||||
/**
|
||||
The bundle this class (`SPUUpdater`) is loaded into
|
||||
*/
|
||||
@property (nonatomic, readonly) NSBundle *sparkleBundle;
|
||||
|
||||
/**
|
||||
The user agent used when checking for updates.
|
||||
|
||||
|
||||
Vendored
+3
-5
@@ -50,6 +50,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
@property (nonatomic) id <SPUUpdateDriver> driver;
|
||||
@property (nonatomic, readonly) SUHost *host;
|
||||
@property (nonatomic, readonly) NSBundle *applicationBundle;
|
||||
@property (nonatomic, readonly) NSBundle *sparkleBundle;
|
||||
@property (nonatomic, readonly) SPUUpdaterSettings *updaterSettings;
|
||||
@property (nonatomic, readonly) SPUUpdaterCycle *updaterCycle;
|
||||
@property (nonatomic, readonly) SPUUpdaterTimer *updaterTimer;
|
||||
@@ -290,9 +291,8 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
}
|
||||
|
||||
// Check XPC Services are functional
|
||||
NSBundle *sparkleBundle = [NSBundle bundleForClass:[self class]];
|
||||
for (NSString *xpcServiceID in @[@INSTALLER_LAUNCHER_BUNDLE_ID, @DOWNLOADER_BUNDLE_ID, @INSTALLER_CONNECTION_BUNDLE_ID, @INSTALLER_STATUS_BUNDLE_ID]) {
|
||||
if (!SPUXPCValidateServiceIfBundleExists(xpcServiceID, sparkleBundle, error)) {
|
||||
if (!SPUXPCValidateServiceIfBundleExists(xpcServiceID, self.sparkleBundle, error)) {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
@@ -475,7 +475,6 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
[[SPUAutomaticUpdateDriver alloc]
|
||||
initWithHost:strongSelf.host
|
||||
applicationBundle:strongSelf.applicationBundle
|
||||
sparkleBundle:strongSelf.sparkleBundle
|
||||
updater:strongSelf
|
||||
userDriver:strongSelf.userDriver
|
||||
updaterDelegate:strongSelf.delegate];
|
||||
@@ -484,7 +483,6 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
[[SPUScheduledUpdateDriver alloc]
|
||||
initWithHost:strongSelf.host
|
||||
applicationBundle:strongSelf.applicationBundle
|
||||
sparkleBundle:strongSelf.sparkleBundle
|
||||
updater:strongSelf
|
||||
userDriver:strongSelf.userDriver
|
||||
updaterDelegate:strongSelf.delegate];
|
||||
@@ -527,7 +525,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
|
||||
self.sessionInProgress = YES;
|
||||
|
||||
id <SPUUpdateDriver> theUpdateDriver = [[SPUUserInitiatedUpdateDriver alloc] initWithHost:self.host applicationBundle:self.applicationBundle sparkleBundle:self.sparkleBundle updater:self userDriver:self.userDriver updaterDelegate:self.delegate];
|
||||
id <SPUUpdateDriver> theUpdateDriver = [[SPUUserInitiatedUpdateDriver alloc] initWithHost:self.host applicationBundle:self.applicationBundle updater:self userDriver:self.userDriver updaterDelegate:self.delegate];
|
||||
|
||||
NSString *bundleIdentifier = self.host.bundle.bundleIdentifier;
|
||||
assert(bundleIdentifier != nil);
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SPUUserInitiatedUpdateDriver : NSObject <SPUUpdateDriver>
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate;
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
+2
-2
@@ -31,11 +31,11 @@
|
||||
@synthesize showingUpdate = _showingUpdate;
|
||||
@synthesize aborted = _aborted;
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate
|
||||
- (instancetype)initWithHost:(SUHost *)host applicationBundle:(NSBundle *)applicationBundle updater:(id)updater userDriver:(id <SPUUserDriver>)userDriver updaterDelegate:(nullable id <SPUUpdaterDelegate>)updaterDelegate
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_uiDriver = [[SPUUIBasedUpdateDriver alloc] initWithHost:host applicationBundle:applicationBundle sparkleBundle:sparkleBundle updater:updater userDriver:userDriver userInitiated:YES updaterDelegate:updaterDelegate delegate:self];
|
||||
_uiDriver = [[SPUUIBasedUpdateDriver alloc] initWithHost:host applicationBundle:applicationBundle updater:updater userDriver:userDriver userInitiated:YES updaterDelegate:updaterDelegate delegate:self];
|
||||
_userDriver = userDriver;
|
||||
}
|
||||
return self;
|
||||
|
||||
Vendored
+2
-1
@@ -109,7 +109,8 @@ static NSMutableDictionary *sharedUpdaters = nil;
|
||||
|
||||
- (NSBundle *)sparkleBundle
|
||||
{
|
||||
return self.updater.sparkleBundle;
|
||||
// Use explicit class to use the correct bundle even when subclassed
|
||||
return [NSBundle bundleForClass:[SUUpdater class]];
|
||||
}
|
||||
|
||||
- (BOOL)automaticallyChecksForUpdates
|
||||
|
||||
Reference in new issue
Block a user