Skip to content

Commit 2974765

Browse files
authored
Merge pull request #1637 from ychin/sparkle-2.9.1
Sparkle 2.9.1
2 parents 6d606b2 + 7b624f3 commit 2974765

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+324
-144
lines changed
14.3 KB
Binary file not shown.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// SPUAppcastSigningValidationStatus.h
3+
// Sparkle
4+
//
5+
// Created on 12/30/25.
6+
// Copyright © 2025 Sparkle Project. All rights reserved.
7+
//
8+
9+
#ifndef SPUAppcastSigningValidationStatus_h
10+
#define SPUAppcastSigningValidationStatus_h
11+
12+
typedef NS_ENUM(NSInteger, SPUAppcastSigningValidationStatus)
13+
{
14+
/**
15+
The bundle does not opt into requiring appcast signing and no validation of the appcast feed is done.
16+
*/
17+
SPUAppcastSigningValidationStatusSkipped = 0,
18+
19+
/**
20+
The appcast is signed and validation has passed succesfully.
21+
*/
22+
SPUAppcastSigningValidationStatusSucceeded,
23+
24+
/**
25+
The appcast is signed and validation has failed. In this case, appcast items operate in a 'safe' fallback mode
26+
meaning that they cannot be marked as a critical update, cannot be marked as informational update,
27+
and will not have any release note or link references.
28+
*/
29+
SPUAppcastSigningValidationStatusFailed,
30+
};
31+
32+
#endif /* SPUAppcastSigningValidationStatus_h */

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUDownloadData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
2323
/**
2424
* A class for containing downloaded data along with some information about it.
2525
*/
26-
SU_EXPORT @interface SPUDownloadData : NSObject <NSSecureCoding>
26+
SU_EXPORT NS_SWIFT_SENDABLE @interface SPUDownloadData : NSObject <NSSecureCoding>
2727

2828
/**
2929
* The raw data that was downloaded.

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUStandardUpdaterController.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
4040
4141
This class must be used on the main thread.
4242
*/
43-
SU_EXPORT @interface SPUStandardUpdaterController : NSObject
43+
SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUStandardUpdaterController : NSObject
4444
{
4545
#pragma clang diagnostic push
4646
#pragma clang diagnostic ignored "-Wobjc-interface-ivars"
@@ -81,6 +81,8 @@ SU_EXPORT @interface SPUStandardUpdaterController : NSObject
8181
Create a new `SPUStandardUpdaterController` programmatically.
8282
8383
The updater is started automatically. See `-startUpdater` for more information.
84+
85+
Note the `updaterDelegate` and `userDriverDelegate` are weakly referenced, so you are responsible for keeping them alive.
8486
*/
8587
- (instancetype)initWithUpdaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate userDriverDelegate:(nullable id<SPUStandardUserDriverDelegate>)userDriverDelegate;
8688

@@ -89,6 +91,8 @@ SU_EXPORT @interface SPUStandardUpdaterController : NSObject
8991
9092
You can specify whether or not you want to start the updater immediately.
9193
If you do not start the updater, you must invoke `-startUpdater` at a later time to start it.
94+
95+
Note the `updaterDelegate` and `userDriverDelegate` are weakly referenced, so you are responsible for keeping them alive.
9296
*/
9397
- (instancetype)initWithStartingUpdater:(BOOL)startUpdater updaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate userDriverDelegate:(nullable id<SPUStandardUserDriverDelegate>)userDriverDelegate;
9498

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUStandardUserDriver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ NS_ASSUME_NONNULL_BEGIN
2727
/**
2828
Sparkle's standard built-in user driver for updater interactions
2929
*/
30-
SU_EXPORT @interface SPUStandardUserDriver : NSObject <SPUUserDriver>
30+
SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUStandardUserDriver : NSObject <SPUUserDriver>
3131

3232
/**
3333
Initializes a Sparkle's standard user driver for user update interactions
3434
3535
@param hostBundle The target bundle of the host that is being updated.
36-
@param delegate The optional delegate to this user driver.
36+
@param delegate The optional delegate to this user driver. Note the standard user driver weakly references the delegate, so you are responsible for keeping it alive.
3737
*/
3838
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(nullable id<SPUStandardUserDriverDelegate>)delegate;
3939

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUStandardUserDriverDelegate.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
188188
*/
189189
- (void)standardUserDriverWillFinishUpdateSession;
190190

191+
/**
192+
Called before the standard user driver shows plain-text or markdown release notes text to the user.
193+
194+
The delegate has the opportunity to return a new attributed string for the release notes text that will be shown to the user.
195+
The `bundleDisplayVersion` and `bundleVersion` are supplied in case they're useful for creating a new attributed string.
196+
197+
This method will not be invoked for HTML release notes. It is only applicable to plain-text and markdown release notes.
198+
199+
@param releaseNotesAttributedString The release notes text that the standard user driver wants to show to the user.
200+
@param update The new update the release notes will be shown for.
201+
@param bundleDisplayVersion The current display version (or `CFBundleShortVersionString`) of the bundle that is being updated.
202+
@param bundleVersion The current version (or `CFBundleVersion`) of the bundle that is being updated.
203+
@return A new attributed string for the release notes text to show, or @c nil if the `releaseNotesAttributedString` should still be used.
204+
*/
205+
- (NSAttributedString * _Nullable)standardUserDriverWillShowReleaseNotesText:(NSAttributedString *)releaseNotesAttributedString forUpdate:(SUAppcastItem *)update withBundleDisplayVersion:(NSString *)bundleDisplayVersion bundleVersion:(NSString *)bundleVersion;
206+
191207
@end
192208

193209
NS_ASSUME_NONNULL_END

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdatePermissionRequest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
2323
/**
2424
This class represents information needed to make a permission request for checking updates.
2525
*/
26-
SU_EXPORT @interface SPUUpdatePermissionRequest : NSObject<NSSecureCoding>
26+
SU_EXPORT NS_SWIFT_SENDABLE @interface SPUUpdatePermissionRequest : NSObject<NSSecureCoding>
2727

2828
/**
2929
Initializes a new update permission request instance.

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdater.h

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
4545
4646
This class must be used on the main thread.
4747
*/
48-
SU_EXPORT @interface SPUUpdater : NSObject
48+
SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUUpdater : NSObject
4949

5050
/**
5151
Initializes a new `SPUUpdater` instance
@@ -57,7 +57,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
5757
@param hostBundle The bundle that should be targeted for updating.
5858
@param applicationBundle The application bundle that should be waited for termination and relaunched (unless overridden). Usually this can be the same as hostBundle. This may differ when updating a plug-in or other non-application bundle.
5959
@param userDriver The user driver that Sparkle uses for user update interaction.
60-
@param delegate The delegate for `SPUUpdater`.
60+
@param delegate The delegate for `SPUUpdater`. Note the updater weakly references the delegate, so you are responsible for keeping it alive.
6161
*/
6262
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle applicationBundle:(NSBundle *)applicationBundle userDriver:(id <SPUUserDriver>)userDriver delegate:(nullable id<SPUUpdaterDelegate>)delegate;
6363

@@ -92,7 +92,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
9292
- (BOOL)startUpdater:(NSError * __autoreleasing *)error;
9393

9494
/**
95-
Checks for updates, and displays progress while doing so if needed.
95+
Checks for new updates, and displays progress while doing so if needed.
9696
9797
This is meant for users initiating a new update check or checking the current update progress.
9898
@@ -109,25 +109,23 @@ SU_EXPORT @interface SPUUpdater : NSObject
109109
- (void)checkForUpdates;
110110

111111
/**
112-
Checks for updates, but does not show any UI unless an update is found.
112+
Checks for new updates in the background.
113113
114-
You usually do not need to call this method directly. If `automaticallyChecksForUpdates` is @c YES,
115-
Sparkle calls this method automatically according to its update schedule using the `updateCheckInterval`
116-
and the `lastUpdateCheckDate`. Therefore, you should typically only consider calling this method directly if you
117-
opt out of automatic update checks. Calling this method when updating your own bundle is invalid if Sparkle is configured
118-
to ask the user's permission to check for updates automatically and `automaticallyChecksForUpdates` is `NO`.
119-
If you want to reset the updater's cycle after an updater setting change, see `resetUpdateCycle` or `resetUpdateCycleAfterShortDelay` instead.
114+
You usually should not call this method directly. By default Sparkle calls this method automatically
115+
on a scheduled basis if automatic update checks are enabled. This is done by checking the current state of
116+
`automaticallyChecksForUpdates`, `updateCheckInterval`, `lastUpdateCheckDate`, and
117+
`SUScheduledImpatientCheckInterval`.
120118
121-
This is meant for programmatically initiating a check for updates in the background without the user initiating it.
122-
This check will not show UI if no new updates are found.
119+
If you want to additionally force an update check on every app launch though, it's recommended to only call this method immediately after starting the updater,
120+
and only when automatic update checks are enabled (by checking `automaticallyChecksForUpdates` is `YES`). Calling this method at later points
121+
could interfere with Sparkle's scheduler in unexpected ways.
123122
124-
If a new update is found, the updater's user driver may handle showing it at an appropriate (but not necessarily immediate) time.
125-
If you want control over when and how a new update is shown, please see https://sparkle-project.org/documentation/gentle-reminders/
123+
If you want to reset the updater's cycle after an updater setting change, please use `resetUpdateCycle` or `resetUpdateCycleAfterShortDelay` instead.
126124
127-
Note if automated downloading/installing is turned on, either a new update may be downloaded in the background to be installed silently,
128-
or an already downloaded update may be shown.
125+
Updates that are found may not be presented immediately to the user, either due to automatic downloading/installing of updates being on or
126+
due to gentle reminders https://sparkle-project.org/documentation/gentle-reminders/ for example.
129127
130-
This will not find updates that the user has opted into skipping.
128+
Updates that have been skipped by the user will not be found.
131129
132130
This method does not do anything if there is a `sessionInProgress`.
133131
@@ -251,6 +249,18 @@ SU_EXPORT @interface SPUUpdater : NSObject
251249
*/
252250
@property (nonatomic) BOOL automaticallyDownloadsUpdates;
253251

252+
/**
253+
A property indicating whether or not the *option* to automatically download updates in the background can be turned on.
254+
255+
This property can be used to determine whether an option to automatically download/install updates should be enabled.
256+
257+
Its value depends on `automaticallyChecksForUpdates`, or the `SUAllowsAutomaticUpdates`in the host bundle's Info.plist if specified.
258+
Don't set `SUAllowsAutomaticUpdates` in the Info.plist unless you need custom behavior.
259+
260+
This property is KVO compliant. This property must be called on the main thread.
261+
*/
262+
@property (nonatomic, readonly) BOOL allowsAutomaticUpdates;
263+
254264
/**
255265
The URL of the appcast used to download update information.
256266

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdaterDelegate.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey;
6666
/**
6767
Provides delegation methods to control the behavior of an `SPUUpdater` object.
6868
*/
69-
@protocol SPUUpdaterDelegate <NSObject>
69+
NS_SWIFT_UI_ACTOR @protocol SPUUpdaterDelegate <NSObject>
7070
@optional
7171

7272
/**
@@ -421,16 +421,21 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey;
421421
/**
422422
Called when an update is scheduled to be silently installed on quit after downloading the update automatically.
423423
424-
If the updater is given responsibility, it can later remind the user an update is available if they have not terminated the application for a long time.
424+
If you want to intercept this method without taking control of installing the update, return @c NO.
425+
This will let future update cycles to run and allow Sparkle to present the update to the user later if certain conditions are met.
426+
For example, critical updates will be presented to the user right away. Other updates may be presented later if the user hasn't terminated the application
427+
for a long time (defined by `SUScheduledImpatientCheckInterval`).
425428
426-
Also if the updater is given responsibility and the update item is marked critical, the new update will be presented to the user immediately after.
429+
If you want to take control of installing the update, return @c YES.
430+
This stalls the current update cycle and prevents future update cycles from running. When the opportunity arrives, you can invoke `immediateInstallHandler` to
431+
install the update and relaunch the application without any UI interaction shown.
427432
428-
Even if the @c immediateInstallHandler is not invoked, the installer will attempt to install the update on termination.
433+
In either case Sparkle will always attempt to install the update when the app terminates.
429434
430435
@param updater The updater instance.
431436
@param item The appcast item corresponding to the update that is proposed to be installed.
432-
@param immediateInstallHandler The install handler for the delegate to immediately install the update. No UI interaction will be shown and the application will be relaunched after installation. This handler can only be used if @c YES is returned and the delegate handles installing the update. For Sparkle 2.3 onwards, this handler can be invoked multiple times in case the application cancels the termination request.
433-
@return @c YES if the delegate will handle installing the update or @c NO if the updater should be given responsibility.
437+
@param immediateInstallHandler The install handler to immediately install the update and relaunch the application. This handler can only be used if @c YES is returned. For Sparkle 2.3 onwards, this handler can be invoked multiple times in case the application cancels the termination request.
438+
@return @c YES if you will handle installing the update using `immediateInstallHandler` or @c NO to allow Sparkle's update scheduler to continue running.
434439
*/
435440
- (BOOL)updater:(SPUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)(void))immediateInstallHandler;
436441

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdaterSettings.h

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ NS_ASSUME_NONNULL_BEGIN
2828
2929
For updating updater settings, changes are made in the host's user defaults.
3030
*/
31-
SU_EXPORT @interface SPUUpdaterSettings : NSObject
31+
SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUUpdaterSettings : NSObject
32+
33+
- (instancetype)init NS_UNAVAILABLE;
3234

3335
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle;
3436

@@ -48,12 +50,10 @@ SU_EXPORT @interface SPUUpdaterSettings : NSObject
4850

4951
/**
5052
* Indicates whether or not automatically downloading updates is allowed to be turned on by the user.
51-
* If this value is nil, the developer has not explicitly specified this option.
52-
*/
53-
@property (readonly, nonatomic, nullable) NSNumber *allowsAutomaticUpdatesOption;
54-
55-
/**
56-
* Indicates whether or not automatically downloading updates is allowed to be turned on by the user.
53+
*
54+
* This property is determined by checking `automaticallyChecksForUpdates` and `allowsAutomaticUpdatesOption`.
55+
*
56+
* This property is KVO compliant. This property must be called on the main thread.
5757
*/
5858
@property (readonly, nonatomic) BOOL allowsAutomaticUpdates;
5959

@@ -67,6 +67,25 @@ SU_EXPORT @interface SPUUpdaterSettings : NSObject
6767
*/
6868
@property (nonatomic) BOOL automaticallyDownloadsUpdates;
6969

70+
/**
71+
* Indicates whether or not the developer allows turning on updates being automatically downloaded and installed.
72+
* If this value is nil, the developer has not explicitly specified this option (which is the default).
73+
*
74+
* Please prefer to use `allowsAutomaticUpdates` instead.
75+
*/
76+
@property (readonly, nonatomic, nullable) NSNumber *allowsAutomaticUpdatesOption;
77+
78+
/**
79+
* The impatient update check interval.
80+
*
81+
* If an update has already been downloaded automatically in the background, Sparkle may not notify users of the update immediately,
82+
* and tries to install the update siliently on quit without notifying the user.
83+
*
84+
* Sparkle uses this long impatient update check interval to decide when to notify the user of the update if they haven't quit the app for a long time.
85+
* By default this check interval is set to 604800 seconds (which is 1 week). This interval must be bigger than the `updateCheckInterval`.
86+
*/
87+
@property (nonatomic, readonly) NSTimeInterval impatientUpdateCheckInterval;
88+
7089
/**
7190
* Indicates whether or not anonymous system profile information is sent when checking for updates.
7291
*

0 commit comments

Comments
 (0)