Compare commits

..
102 Commits
Author SHA1 Message Date
Sparkle-Bot 2a98381dfe Update Package management files for version 2.3.0 2022-10-01 16:01:44 +00:00
Zorg 9b4c91bc58 Update CHANGELOG 2022-10-01 08:27:56 -07:00
Zorg a7855eabe6 Update secondary CI runner from Xcode 14.0 -> 14.1 beta (#2272) 2022-09-24 10:32:56 -07:00
Chiahong f86907c13c Update zh_TW localization (#2271) 2022-09-23 22:31:07 -07:00
Sparkle-Bot 028e4c2bec Update Package management files for version 2.3.0-beta.2 2022-09-19 05:53:23 +00:00
Zorg 891cd38eba Update CHANGELOG for 2.3.0-beta.2 2022-09-18 22:44:16 -07:00
Zorg a208bd5cf9 Add -p option to sign_update to only print the signed signature (#2268) 2022-09-18 07:18:39 -07:00
Zorg 005392963f Allow developer to always force allowing automatic updates (#2266)
By default, if the SUAllowsAutomaticUpdates Info.plist key is not specified, the update alert option to allow automatic downloading/installing of updates will only be shown if automatic checking of updates is enabled. However, the developer can now override this by setting SUAllowsAutomaticUpdates to true in Info.plist which indicates the option should be available even if automatic checking of updates is not enabled.
2022-09-16 20:41:08 -07:00
Sparkle-Bot 83cc66b988 Update Package management files for version 2.3.0-beta.1 2022-09-06 02:35:22 +00:00
Zorg a93317fb08 Update CHANGELOG for 2.3 2022-09-05 19:27:15 -07:00
Zorg 1b1a7db1ac Expose maximum-versions option to preserve in feed per branch (#2259) 2022-09-05 16:20:35 -07:00
Zorg d9c0cc7f53 Add delegate method for when user makes an update choice (#2257)
Also add gentle reminder support in legacy SUUpdater 1.x methods
2022-09-04 15:58:09 -07:00
Zorg 7d68f8f7ae Improve clarification on documentation for SPUUpdater properties (#2256) 2022-09-03 14:18:57 -07:00
Zorg 03f2452379 Expose -[SPUStandardUserDriver activeUpdateAlert] as private API (#2255) 2022-09-03 07:25:31 -07:00
Zorg fc8000471b Pick branch runner is running on when drafting releases (#2254) 2022-09-02 13:34:31 -07:00
kakaiikaka 6c0e685063 added zh_CN l10n for "Version History" (#2247) 2022-08-30 22:18:53 -07:00
Sparkle-Bot c7c8b719cb Update Package management files for version 2.2.2 2022-08-28 23:28:16 -07:00
Zorg 4fa7b23f09 Update CHANGELOG for 2.2.2 2022-08-28 23:26:07 -07:00
Zorg f1fe9e45f6 Revert "Add 2.2.2 to test on CI"
This reverts commit 679cbc8652.
2022-08-28 22:04:05 -07:00
Zorg 679cbc8652 Add 2.2.2 to test on CI 2022-08-28 15:54:09 -07:00
Chiahong 6ef1f7fc7f Update zh_TW localization (#2246) 2022-08-28 15:17:25 -07:00
Zorg 6831a35e28 Update Package.resolved (#2245) 2022-08-27 17:26:35 -07:00
Zorg 1c560652e7 Remove ed25519 git submodule (#2244)
Also allow release scripts to work without git repository and bump the Sparkle versions.
2022-08-27 10:46:29 -07:00
Eitot 863f85b5f5 Clean up left-over code (#2243) 2022-08-27 06:17:28 -07:00
Zorg f46ea87380 Ensure install handlers are invoked on main queue (#2235) 2022-08-22 18:23:23 -07:00
Zorg f5d4ad52ca Allow user to re-try installing/relaunching application (#2234)
If the app termination request is delayed or canceled, the user can check for updates again with the standard user driver and try installing/relaunching again, which will trigger the installer to send another quit event to the running application.

Before the install/relaunch window would close but the check for updates option would still be present but not functional.
2022-08-21 08:54:03 -07:00
Zorg 926c47d48e Find potential matching translocated running apps in updater agent (#2233)
In the installer progress agent, when we find all potential running applications for a host bundle, we should also consider any translocated running apps that look-alike the host bundle.

This matters when updating external bundles. For example if sparkle-cli tries to update an app on disk in ~/Downloads/ but a running instance of the app is translocated, sparkle-cli should terminate the translocated instance of the app before installing the update.

It's possible this could generate a false positive but we err on the side of safety here. We only use running translocated apps if we find no regular matching apps.
2022-08-20 10:30:00 -07:00
Zorg fbfcec3453 Fix recently introduced bugs in generate_appcast with multiple feeds (#2232)
We fix the validation check for using the output option when multiple feeds are present, fix not generating new feeds when no prior feed is available, and fix incorrect logic with cleaning up delta files when multiple feeds are present.
2022-08-19 21:36:50 -07:00
Zorg 8f77f066c1 Add delta update attributes for validating an app hasn't been stripped (#2231) 2022-08-19 20:48:52 -07:00
Zorg 47f335614a Wait for a threshold amount of time before replying with status info data (#2230)
This also reverts 6a69f26dcc and 4cb6719c6b
2022-08-19 10:40:25 -07:00
Zorg 80a5b80ade Move old updates to old_updates in generate_appcast (#2228)
Document --versions in generate_appcast better and add comments to explain why certain policies were made.

Add separate option to automatically pruned old update files. Now we only automatically move old update files aside. If the user passes --auto-prune-update-files we will also remove the old update files automatically.

Move old release notes files too.

Don't make old-updates directory hidden.
2022-08-14 19:07:48 -07:00
Zorg e81ccbd891 Upgrade Xcode builds in CI to 13.4.1 and 14.0 beta (#2226) 2022-08-12 18:49:40 -07:00
Kent Sutherland dc2e1ff534 Update Portuguese localization (#2224) 2022-08-08 19:24:56 -07:00
Zorg 37ef179284 Prune and preserve necessary updates in generate_appcast (#2218)
We preserve a batch of updates for each branch point (defined by an update's {majorVersion, minSystemVersion, maxSystemVersion, channel}). The latest for each branch point is used for generating delta updates.

We prune older update items that are no longer needed in the feed or needed for generating delta updates from newer items. We move pruned update files into a separate hidden directory, which is later garbage collected after a couple weeks based on each file's last modification date.

To insert new update items that are older than the latest update in the feed, --version flag needs to be used.

The overall goal is to have the feed only keep a small window of updates to serve to the user. This will also ease future processing generate_appcast needs to do and ensure the cache's directory doesn't blow up by pruning old updates.
2022-08-07 19:13:20 -07:00
Zorg 6a69f26dcc Clean up handling appcast item registration message (#2223) 2022-08-07 17:08:33 -07:00
Zorg 4cb6719c6b Critical update alerts may not show up as promptly as they should when automatically installing them (#2221)
Wait for appcast item registration before finishing automatic update driver.

This fixes a potential race issue where sometimes the automatic update driver on completion would sometimes not trigger to prompt an update alert immediately for critical updates. Note in this case, the update would still be installed on app termination and would still be scheduled to alert the user on the regular update check interval, so this issue is not severe.
2022-08-06 11:28:47 -07:00
Zorg 2c81393ec2 Remove module imports from framework headers (#2217)
Framework headers should not be using them. The warning these aim to suppress (-Wauto-import) is also going away.
2022-07-29 22:01:04 -07:00
Zorg 983d19580b Fix handle applying patches when files aren't writeable (#2216) 2022-07-23 10:37:29 -07:00
Zorg 6cbe8444a0 Refine update alert when no release notes are shown (#2206)
* Set layout constraint constant between buttons and description to 20

* Disable update alert resizing when no release notes are available

* Fix layout constraint warning

* Set alert autosave frame name only when release notes are shown
2022-07-17 20:56:17 -07:00
Zorg 45a9099082 Reject DSA only configurations for setting up the updater (#2207)
The one exception is an updater that is targeted to update another / non-main bundle.

Note we still allow configuration of not using DSA or EdDSA with the deprecation warning in tact.
2022-07-17 20:55:31 -07:00
Jie aa72b3f639 Hide automatic install check box when allowsAutomaticUpdates is disabled (#2202) 2022-07-17 16:45:02 -07:00
Zorg 372f0504a5 Bump minimum deployment target to macOS 10.13 (#2196) 2022-07-17 16:43:24 -07:00
Zorg 470296a90e Remove outdated model translation plist (#2195) 2022-07-17 15:57:43 -07:00
Zorg 242ae2c392 Disable implicit dependencies for runnable schemes (#2171)
Also add missing explicit dependencies from targets
2022-07-17 15:52:16 -07:00
Sparkle-Bot 059ce91287 Update Package management files for version 2.2.1 2022-07-16 13:34:05 +00:00
Zorg cc0007de3a Update CHANGELOG 2022-07-16 06:25:46 -07:00
VinBoiSoft fe69cab530 Update Italian localization (#2192) 2022-07-09 12:43:10 -07:00
Zorg 14e511f901 Fix memory leaks when using generate_appcast (#2193)
We fix one memory leak when calculating sha's, one memory leak in the xar delta applying path, and avoid creating Bundles for reading the Sparkle framework version.

There are some other small leaks with the xar delta creation/applying code but since it's a legacy implementation and the APIs are undocumented I don't want to touch it too much.

The biggest culprit here is the leak when calculating sha's I believe, if you have many archive items.
2022-07-09 12:22:36 -07:00
Pavel Moiseenko 80e60279ee Make dark scroll bar in dark theme (#2187) 2022-07-04 09:40:44 -07:00
Sparkle-Bot c1bf68f91f Update Package management files for version 2.2.0 2022-07-02 18:55:40 +00:00
Zorg 4622061d8f Add deprecation of -s flag in CHANGELOG 2022-07-02 09:45:00 -07:00
Zorg a7e5320d6a Update CHANGELOG 2022-07-01 21:58:58 -07:00
basilTandaONe 90221e7a0f Update Greek localizations (#2185)
Co-authored-by: aONe
2022-07-01 21:47:16 -07:00
aONe 7c1cc5627b Updated Greek translation (#2184)
Fixes #2175, from @seitsme
2022-07-01 19:08:13 -07:00
Zorg bececc3738 Reset opportune time for showing new updates after preference changes (#2183)
Reset opportune time for showing update notice when updater starts as well.

Also update updater header API documentation and add private protocol for gentle scheduled reminder APIs that the updater uses.
2022-07-01 19:06:27 -07:00
1024jp a6984d3c02 Update Japanese localization (#2182)
* Add unlocalized strings to Japanese localization

* Remove unwanted spaces in Japanese localization
2022-06-30 21:54:01 -07:00
Zorg 102c4a4009 Fix Greek translation in "You are currently running version" string (#2181) 2022-06-28 22:26:20 -07:00
Zorg d2fd9a50e0 Use recovery suggestion key for update permission error (#2180) 2022-06-26 18:41:55 -07:00
Zorg d544d456e0 Synchronize usage of XPC connections to main queue (#2178) 2022-06-25 21:29:44 -07:00
Zorg b1f6c161d1 Use snprintf instead of sprintf to fix compile warning (#2179) 2022-06-25 16:41:32 -07:00
Zorg 06daa03196 Fix installer status xpc service bundle ID (#2177)
The bundle ID name broke after I was renaming the XPC Services for 2.2.
2022-06-25 15:00:33 -07:00
Zorg e64b7649f2 Deprecate -s flag and add --ed-key-file option to generate_appcast (#2170) 2022-06-24 21:19:10 -07:00
Sparkle-Bot 220c1edac1 Update Package management files for version 2.2.0-beta.2 2022-06-20 02:54:54 +00:00
Zorg e866f8d786 Update changelog for Sparkle 2.2 2022-06-19 18:18:31 -07:00
Zorg 2b6664cd8a Fix incorrect references in gentle reminder header documentation (#2165) 2022-06-19 17:39:52 -07:00
Zorg a913fe1355 Update external licenses text and add ed25519 (#2164) 2022-06-18 20:54:46 -07:00
Zorg 24b072c661 Update gentle reminder API documentation (#2163) 2022-06-18 12:59:13 -07:00
Zorg 2ddef5179e Bump initial installer message timeouts and declare daemon/agents as Interactive (#2162) 2022-06-18 11:40:45 -07:00
Sparkle-Bot 308ba94373 Update Package management files for version 2.2.0-beta.1 2022-06-13 02:31:58 +00:00
Zorg 9a1142a5b1 Fix pull request number in changelog 2022-06-12 19:23:40 -07:00
Zorg 4cb4974107 Update changelog to incorporate #2119 2022-06-12 18:59:27 -07:00
Zorg 5343305e3f Report friendly error if installation fails with no write permission (#2157)
On macOS 13 (Ventura) and later, installation could fail if Gatekeeper blocks app modifications. Note this is only applicable for external updaters like sparkle-cli where the updater and target bundle to update have different team identifiers.
2022-06-12 18:50:40 -07:00
Zorg 72c866f964 Update changelog with stage manager fix 2022-06-12 15:23:23 -07:00
Zorg 6808a94dbb Don't let status window make other active windows exit in stage manager (#2153)
We set the status window's collection behavior to full screen auxiliary. This is how the collection behavior for the update alerts and permission prompts are set up, but we never applied it to the status window.

With this change, bringing the status window up front (e.g, for downloading an update) does not push the other app's windows back into the stage manager tiles.
2022-06-12 15:19:55 -07:00
Zorg 38ed86dad0 Update Changelog for Sparkle 2.2 2022-06-11 19:33:13 -07:00
Zorg 15e8270291 Silence deprecation warnings when bumping deployment target (#2152) 2022-06-11 13:09:23 -07:00
Zorg d7942768b8 Validate permission bits of Sparkle executable for delta updates (#2151) 2022-06-11 11:21:52 -07:00
Zorg f126876d35 Show checking window back in focus and activate app if needed (#2150) 2022-06-10 21:53:58 -07:00
Zorg 9080bebc88 Fix Xcode 14 warnings (#2149)
* Upgrade project version

* Use +initialize instead of +load for debug warning
2022-06-10 21:30:42 -07:00
Zorg bf6dc6210f Update issue templates to reflect new discussions 2022-06-05 18:01:17 -07:00
Zorg 04d3c13043 Make displayVersionString non-null and update fallback documentation (#2139) 2022-06-05 16:35:04 -07:00
samschott a33bae7bad Use displayVersionString instead of versionString for OS version mismatch error message (#2138) 2022-06-05 16:34:37 -07:00
Zorg b3d31d254e Update create-draft-release CI action 2022-06-05 07:13:20 -07:00
Zorg 024eec0b09 Update Xcode in CI to 13.3.1 (#2137) 2022-06-04 23:16:33 -07:00
Zorg 9ba73525b0 Update last update check time when choosing to install update (#2136)
In the UI driver, this is when the user chooses to Install & Relaunch.

In the automatic download based driver, this is when Sparkle hands off responsibility to its delegate to install the update and they trigger the callback to relaunch the app.
2022-06-04 18:43:59 -07:00
Zorg 7ced6efba0 Remove SPUURLRequest class (#2134)
This class was only introduced because older OS versions we no longer support didn't have NSURLRequest implement NSSecureCoding.
2022-06-04 18:22:44 -07:00
Zorg fabd3e6c7b Schedule next update check if we're firing immediately (#2133)
Even if the updater is set to not automatically check for updates.

This fixes a bug where an update cycle may not complete if the automatic update driver first started, and the update should have been resumed but automatic update checks were disabled by the developer.

The developer would have had to disable automatic update checks, check updates in the background themselves, have updates set to download automatically/silently, and be in a situation where the update would be deferred to non-silent update (for example, user requiring authorization to install, critical update being presented, info-only update being presented).
2022-06-04 14:03:03 -07:00
Zorg 58fa11ce04 Add standard user driver APIs for gentle scheduled update reminders (#2122)
* Log warning if gentle reminders aren't implemented for background app
* Don't let background running app steal focus from other apps except at launch
* Don't set update alert window level to floating for background apps
* Show update alert in back for currently active background apps
* Disable warnings for direct ivar access
* Center update status window to last update alert window shown
* Activate app from user initiated checks if it's not active
* Set systemHasBeenIdle to YES only if the app isn't preventing display sleep
* Don't make status window key if update alert wasn't key window
2022-06-04 13:14:01 -07:00
Zorg 503830bf24 Refine minimizing state for download/extraction/installation status (#2121)
Don't allow status window to be minimizable for non-app bundle updates due to atomicity concerns.

Add delegate method to allow developer to configure if they want the status window to be minimizable.
2022-05-08 11:12:12 -04:00
Zorg 2bc9471ed1 Delay showing scheduled update alert if application is active (#2120)
We wait until a more opportune time when the app becomes re-activated, but if too much time 
has passed we will show the update anyway. A few exceptions are:

* App just launched
* User has been idle on their machine
* User initiates update check themselves
2022-05-08 10:32:14 -04:00
Zorg 339e26984e Add support for running framework and CLI as root (#2119)
When the framework or sparkle-cli is run as root, we always launch the installer (Autoupdate) in the system domain.

For the progress tool agent, we chown() the copied Updater.app so the Updater app has proper ownership of it (and clean it up later). The progress tool app may not be able to clean up the parent directory, but that's okay and will be garbage collected on a later run.

To get the username and home directory for the user session when running the framework as root, we use the SecurityConfiguration framework. Sparkle needs and depends on an active GUI user login session. If a user ssh's in to install an update, that user must be the same as the active logged in user.

Installing interactive based package updates as root is not supported. For sparkle-cli, we disallow using --interactive when running as root.

An additional error exit code is added for sparkle-cli when ran as root and trying to install a interactive based package update, which is unsupported.
2022-05-07 09:33:27 -04:00
Zorg 9042c8dbd9 Fall back to regular update if delta update fails to download (#2118)
Also log out the download failure when a delta update fails to download (such as a 404 error for example).

Additionally, add a check to make sure that top-level appcast items cannot be delta update items.
2022-05-01 22:58:29 -07:00
Eitot 180f8975cf Replace deprecated code with newer APIs (#2112)
* Use UniformTypeIdentifiers framework to replace deprecated types

kUTType* constants are deprecated since macOS 12. The UniformTypeIdentifiers framework is available since the macOS 11 SDK.

* Replace renamed constants

* Use API_AVAILABLE macro instead of __OSX_AVAILABLE
2022-04-24 16:51:48 -07:00
Zorg d5b650bae7 Skip delta updates on exFAT and FAT32 file systems (#2115)
We don't support applying delta updates on these systems (due to lack of permission support), so we shouldn't even try downloading delta updates in this case.
2022-04-24 00:39:40 -07:00
Zorg 94719edeb3 Ignore custom icons set via resource forks in delta updates (#2114)
For creation, we will disallow creating delta updates if a custom resource fork icon data is found in either the old or app bundles.

For applying, we will just ignore the icon data when performing hash verification and continue applying the patch.
2022-04-24 00:38:42 -07:00
Eitot c33a416b53 Update localisations (#2113)
* Remove duplicate localization identifiers

Some localizations have multiple identifiers, e.g. Canadian French has "fr-CA", "fr_ca" and "fr_CA" and Norwegian Bokmål has "nb" and "no" (though "no" can include Norwegian Nynorsk, Xcode seems to treat it as Bokmål and therefore a duplicate of "nb"). This commit removes superfluous identifiers and keeps the identifier that Xcode uses by default.

This also removes the no.lproj/ directory which contains either obsolete localized strings or strings that are present in nb.lproj/ too.

Furthermore, this renames the .lproj/ directories for "pt_PT"/"pt_BR" to "pt-PT"/"pt-BR" since the latter identifiers are the default in Xcode.

* Update localizable strings to match the current localizations

Replaces the following characters in the localizable strings:
- ellipses (... → …)
- curly apostrophe (' → ’)
- em dashes (-- → —)
- non-breaking spaces

These were already used in the .strings files.

* Regenerate Sparkle.strings

This applies the changes in the previous commit to the strings files of the base localization.

This also removes the following strings, which are no longer present in the source:
- "%1$@ wants permission to update %2$@."	
- "%1$@ wants permission to update."
- "An error occurred while downloading the update feed."
- "An error occurred while installing the update. Please try again later."
- "An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@."
- "Are you sure you want to skip this upgrade?"
- "Don't Skip"
- "Skip Upgrade"
- "The update is improperly signed."
- "You already have the newest version of %@."
- "B", "GB", "KB" and "MB"

* Update localized Sparkle.strings

This applies the changes in the previous commits to the strings files of the localizations.

* Re-import localizations

This updates the .strings files using xcodebuild to:
- remove obsolete localizable strings,
- incorporate (changed) localization comments and
- replace UTF-16 encoded .strings files with UTF-8.

* Update Dutch localization

* Update French localization

This replaces single quotes and spaces with apostrophes and non-breaking spaces.
2022-04-24 00:36:29 -07:00
Eitot b0116ef31b Remove obsolete SDK checks (#2111)
Sparkle currently requires at least Xcode 12 (or the macOS 11 SDK), therefore fallbacks for older versions are no longer needed.

* Remove +isOperatingSystemAtLeastVersion: method

* Remove +operatingSystemVersion accessor method

* Remove SUTouchBarForwardDeclarations header
2022-04-23 23:34:20 -07:00
Eitot c0cf32c2b7 Remove obsolete fallbacks folder older OS versions (#2110)
* Remove fallback for NSByteCountFormatter

* Remove fallback for NSFont -monospacedDigitSystemFontOfSize:weight:
2022-04-21 20:00:33 -07:00
Zorg f250bead4b Update alert activation improvements (#2100)
* Don't activate app when bringing up update alert errors
* Don't set status window level to floating
* Make status window minimize-able after checking for updates
* Allow install button to have focus when app has just launched
* Reset install button focus when app becomes active again
2022-03-06 22:39:32 -08:00
Zorg 640e988a39 Change XPC Service product names to be more human readable (#2096)
They should not be bundle IDs because they may surface up in the UI.

Particularly, the Installer XPC Service may show up in the authorization prompt when authorization is required to install an update.
2022-03-06 21:26:56 -08:00
Zorg 183a930797 Ignore -Wobjc-interface-ivars warning (#2099) 2022-03-05 13:03:08 -08:00
BR Lingo 2f86c4f5fe Translation of new strings (#2094)
Adaptation of previously translated strings to use a more inclusive language
Translation consistency amendments
2022-02-26 19:52:28 -08:00
268 changed files with 10297 additions and 3449 deletions

No files matched your search

@@ -1,11 +1,24 @@
---
name: Enhancements and Bug Fixes
about: Found a bug? Want to implement a new feature?
about: Found a bug? Want to implement a new feature? Something else?
title: ''
assignees: ''
---
<!--
If this is a question or an idea, please consider posting in Discussions first:
https://github.com/sparkle-project/Sparkle/discussions
Otherwise the answer to your issue may already be in Console.app on your computer.
Please use Console.app and search for Sparkle.
Please try troubleshooting steps:
https://github.com/sparkle-project/Sparkle#troubleshooting
-->
## Summary
[provide general summary to the issue or enhancement and its rationale]
@@ -1,6 +1,6 @@
---
name: Sparkle 2.x doesn't work in my app
about: Problems with using the beta version of Sparkle 2
about: Problems with integration, unexpected errors using Sparkle 2
title: ''
labels: '2.x'
assignees: ''
@@ -1,6 +1,6 @@
---
name: Sparkle 1.x doesn't work in my app
about: Problems with integration, unexpected errors
about: Problems with integration, unexpected errors using Sparkle 1
title: ''
labels: '1.x'
assignees: ''
+1 -1
View File
@@ -2,7 +2,7 @@
Fixes # (issue)
## Misc Checklist:
## Misc Checklist
- [ ] My change requires a documentation update on [Sparkle's website repository](https://github.com/sparkle-project/sparkle-project.github.io)
- [ ] My change requires changes to generate_appcast, generate_keys, or sign_update
+10 -8
View File
@@ -10,19 +10,21 @@ jobs:
build:
strategy:
matrix:
xcode: ['xcode12.5.1', 'xcode13.2.1']
xcode: ['xcode14.1', 'xcode13.4.1']
include:
- xcode: 'xcode12.5.1'
xcode-path: '/Applications/Xcode_12.5.1.app/Contents/Developer'
upload-dist: false
run-analyzer: false
- xcode: 'xcode13.2.1'
xcode-path: '/Applications/Xcode_13.2.1.app/Contents/Developer'
- xcode: 'xcode13.4.1'
xcode-path: '/Applications/Xcode_13.4.1.app/Contents/Developer'
upload-dist: true
run-analyzer: true
macos: 'macos-12'
- xcode: 'xcode14.1'
xcode-path: '/Applications/Xcode_14.1.app/Contents/Developer'
upload-dist: false
run-analyzer: false
macos: 'macos-12'
name: Build and Test Sparkle
runs-on: macos-11
runs-on: ${{ matrix.macos }}
steps:
- name: Checkout
+5 -4
View File
@@ -2,7 +2,7 @@ name: "Create Draft Release"
env:
BUILDDIR: "build"
DEVELOPER_DIR: "/Applications/Xcode_13.2.1.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode_13.4.1.app/Contents/Developer"
on:
workflow_dispatch:
@@ -29,11 +29,11 @@ concurrency:
jobs:
release:
name: "Publish binaries for release"
runs-on: macos-11
runs-on: macos-12
steps:
- name: "Checkout sources"
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
submodules: true
@@ -90,7 +90,8 @@ jobs:
with:
draft: true
prerelease: ${{ env.PRERELEASE_VERSION }}
name: "Sparkle ${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
target_commitish: ${{ github.ref_name }}
name: "${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
tag_name: "${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
fail_on_unmatched_files: true
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
-3
View File
@@ -1,3 +0,0 @@
[submodule "Vendor/ed25519"]
path = Vendor/ed25519
url = https://github.com/orlp/ed25519
+3 -1
View File
@@ -78,7 +78,9 @@
__weak AgentConnection *weakSelf = self;
newConnection.interruptionHandler = ^{
[weakSelf.activeConnection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.activeConnection invalidate];
});
};
newConnection.invalidationHandler = ^{
+21 -12
View File
@@ -32,8 +32,8 @@
#include "AppKitPrevention.h"
#define FIRST_UPDATER_MESSAGE_TIMEOUT 7ull
#define RETRIEVE_PROCESS_IDENTIFIER_TIMEOUT 5ull
#define FIRST_UPDATER_MESSAGE_TIMEOUT 18ull
#define RETRIEVE_PROCESS_IDENTIFIER_TIMEOUT 8ull
/**
* Show display progress UI after a delay from starting the final part of the installation.
@@ -147,7 +147,9 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
__weak AppInstaller *weakSelf = self;
newConnection.interruptionHandler = ^{
[weakSelf.activeConnection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.activeConnection invalidate];
});
};
newConnection.invalidationHandler = ^{
@@ -440,7 +442,16 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
if (self.performedStage1Installation) {
// Resume the installation if we aren't done with stage 2 yet, and remind the client we are prepared to relaunch
dispatch_async(self.installerQueue, ^{
[self performStage2InstallationIfNeeded];
if (!self.performedStage2Installation) {
[self performStage2Installation];
} else if (!self.performedStage3Installation) {
// If we already performed the 2nd stage, re-purpose this request to re-try sending another termination signal
dispatch_async(dispatch_get_main_queue(), ^{
// Don't check if the target is already terminated, leave that to the progress agent
// We could be slightly off if there were multiple instances running
[self.agentConnection.agent sendTerminationSignal];
});
}
});
}
});
@@ -502,14 +513,10 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
});
}
- (void)performStage2InstallationIfNeeded
- (void)performStage2Installation
{
if (self.performedStage2Installation) {
return;
}
BOOL performedSecondStage = self.shouldShowUI || [self.installer canInstallSilently];
if (performedSecondStage) {
BOOL canPerformSecondStage = self.shouldShowUI || [self.installer canInstallSilently];
if (canPerformSecondStage) {
self.performedStage2Installation = YES;
dispatch_async(dispatch_get_main_queue(), ^{
@@ -561,7 +568,9 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
}
dispatch_async(self.installerQueue, ^{
[self performStage2InstallationIfNeeded];
if (!self.performedStage2Installation) {
[self performStage2Installation];
}
if (!self.performedStage2Installation) {
// We failed and we're going to exit shortly
+2
View File
@@ -559,6 +559,8 @@ static compression_algorithm _compressionAlgorithmForMode(SPUDeltaCompressionMod
if ((commands & SPUDeltaItemCommandBinaryDiff) != 0 || S_ISREG(mode)) {
// Regular files
[fileManager removeItemAtPath:itemFilePath error:NULL];
char itemFilePathString[PATH_MAX + 1] = {0};
if (![itemFilePath getFileSystemRepresentation:itemFilePathString maxLength:sizeof(itemFilePathString) - 1]) {
self.error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadInvalidFileNameError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Path to extract cannot be decoded and expressed as a file system representation: %@", itemFilePath] }];
+5 -1
View File
@@ -348,7 +348,11 @@ static xar_file_t _xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTa
continue;
}
NSString *relativePath = @(pathCString);
NSString *relativePath = [[NSString alloc] initWithBytesNoCopy:pathCString length:strlen(pathCString) encoding:NSUTF8StringEncoding freeWhenDone:YES];
if (relativePath == nil) {
free(pathCString);
continue;
}
SPUDeltaItemCommands commands = 0;
{
+22 -27
View File
@@ -282,6 +282,21 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
clonedRelativePath = nil;
}
// Decide if we need to preserve original file permissions from the original file
// applyBinaryDeltaToFile() normally preserves file permissions on the file it's replacing.
// However this is not possible if the destination file we're patching is not writable.
// We also need to preserve permissions for clones except when we'll be changing permissions later anyway.
BOOL needsToCopyFilePermissions;
if (![fileManager isWritableFileAtPath:destinationFilePath]) {
// Remove the file non-writable we're patching that may cause issues
[fileManager removeItemAtPath:destinationFilePath error:NULL];
// We will need to preserve permissons if there is no need to make permission changes later on
needsToCopyFilePermissions = (commands & SPUDeltaItemCommandModifyPermissions) == 0;
} else {
needsToCopyFilePermissions = ((commands & SPUDeltaItemCommandClone) != 0) && ((commands & SPUDeltaItemCommandModifyPermissions) == 0);
}
if (!applyBinaryDeltaToFile(tempDiffFile, sourceDiffFilePath, destinationFilePath)) {
if (verbose) {
fprintf(stderr, "\n");
@@ -293,12 +308,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
return;
}
// Preserve original file permissions from the original file
// Only necessary for clones because applyBinaryDeltaToFile() otherwise preserves
// file permissions on the file it's replacing. Also not necessary if we're going to
// change permissions later
if ((commands & SPUDeltaItemCommandClone) != 0 && (commands & SPUDeltaItemCommandModifyPermissions) == 0) {
if (needsToCopyFilePermissions) {
struct stat sourceFileInfo = {0};
if (lstat(sourceDiffFilePath.fileSystemRepresentation, &sourceFileInfo) != 0) {
if (verbose) {
@@ -398,32 +408,17 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
NSTask *dittoTask = [[NSTask alloc] init];
if (@available(macOS 10.13, *)) {
dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO];
} else {
dittoTask.launchPath = @"/usr/bin/ditto";
}
dittoTask.executableURL = [NSURL fileURLWithPath:@"/usr/bin/ditto" isDirectory:NO];
dittoTask.arguments = @[@"--hfsCompression", destination, finalDestination];
// If we fail to apply file system compression, we will try falling back to not doing this
BOOL failedToApplyFileSystemCompression = NO;
if (@available(macOS 10.13, *)) {
NSError *launchError = nil;
if (![dittoTask launchAndReturnError:&launchError]) {
failedToApplyFileSystemCompression = YES;
fprintf(stderr, "\nWarning: failed to launch ditto task for file compression: %s", launchError.localizedDescription.UTF8String);
}
} else {
@try {
[dittoTask launch];
} @catch (NSException *exception) {
failedToApplyFileSystemCompression = YES;
fprintf(stderr, "\nWarning: failed to launch ditto task for file compression: %s", exception.reason.UTF8String);
}
NSError *launchError = nil;
if (![dittoTask launchAndReturnError:&launchError]) {
failedToApplyFileSystemCompression = YES;
fprintf(stderr, "\nWarning: failed to launch ditto task for file compression: %s", launchError.localizedDescription.UTF8String);
}
if (!failedToApplyFileSystemCompression) {
+6
View File
@@ -15,6 +15,9 @@
#define PERMISSION_FLAGS (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX)
#define VALID_SYMBOLIC_LINK_PERMISSIONS 0755
// Enforcing Sparkle's executable permissions to be valid allows us to perform a preflight test before
// downloading delta items
#define VALID_SPARKLE_EXECUTABLE_PERMISSIONS 0755
#define APPLE_CODE_SIGN_XATTR_CODE_DIRECTORY_KEY "com.apple.cs.CodeDirectory"
#define APPLE_CODE_SIGN_XATTR_CODE_REQUIREMENTS_KEY "com.apple.cs.CodeRequirements"
@@ -31,6 +34,9 @@
#define MAJOR_VERSION_IS_AT_LEAST(actualMajor, expectedMajor) (actualMajor >= expectedMajor)
// Relative path of custom icon data that may be set on a bundle via a resource fork
#define CUSTOM_ICON_PATH @"/Icon\r"
// Changes that break backwards compatibility will have different major versions
// Changes that affect creating but not applying patches will have different minor versions
typedef NS_ENUM(uint16_t, SUBinaryDeltaMajorVersion)
+7 -4
View File
@@ -113,9 +113,9 @@ uint16_t latestMinorVersionForMajorVersion(SUBinaryDeltaMajorVersion majorVersio
case SUBinaryDeltaMajorVersion1:
return 2;
case SUBinaryDeltaMajorVersion2:
return 3;
return 4;
case SUBinaryDeltaMajorVersion3:
return 0;
return 1;
}
return 0;
}
@@ -256,8 +256,11 @@ BOOL getRawHashOfTreeAndFileTablesWithVersion(unsigned char *hashBuffer, NSStrin
continue;
NSString *relativePath = pathRelativeToDirectory(normalizedPath, stringWithFileSystemRepresentation(ent->fts_path));
if (relativePath.length == 0)
// Ignore icon resource fork data
if (relativePath.length == 0 || [relativePath isEqualToString:CUSTOM_ICON_PATH]) {
continue;
}
unsigned char fileHash[CC_SHA1_DIGEST_LENGTH];
if (!_hashOfFileContents(fileHash, ent, tempBuffer, tempBufferSize)) {
@@ -326,7 +329,7 @@ NSString *displayHashFromRawHash(const unsigned char *hash)
{
char hexHash[CC_SHA1_DIGEST_LENGTH * 2 + 1] = {0};
for (size_t i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) {
sprintf(hexHash + i * 2, "%02x", hash[i]);
snprintf(hexHash + i * 2, 3, "%02x", hash[i]);
}
return @(hexHash);
}
+48
View File
@@ -440,6 +440,16 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
if (![key length]) {
continue;
}
if ([key isEqualToString:CUSTOM_ICON_PATH]) {
if (verbose) {
fprintf(stderr, "\n");
}
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Diffing bundles with a custom icon set via a resource fork is not supported. Detected presence of %@", @(ent->fts_path)] }];
}
return NO;
}
NSDictionary *info = infoForFile(ent);
if (!info) {
@@ -453,6 +463,20 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
}
originalTreeState[key] = info;
// Ensure Sparkle executable permissions are valid
if (ent->fts_info == FTS_F && [key.lastPathComponent isEqualToString:@"Sparkle"] && [key.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent.lastPathComponent isEqualToString:@"Sparkle.framework"]) {
mode_t permissions = (mode_t)[(NSNumber *)info[INFO_PERMISSIONS_KEY] shortValue];
if (permissions != VALID_SPARKLE_EXECUTABLE_PERMISSIONS) {
if (verbose) {
fprintf(stderr, "\n");
}
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }];
}
return NO;
}
}
if (aclExists(ent)) {
if (verbose) {
fprintf(stderr, "\n");
@@ -531,6 +555,16 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
if (![key length]) {
continue;
}
if ([key isEqualToString:CUSTOM_ICON_PATH]) {
if (verbose) {
fprintf(stderr, "\n");
}
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Diffing bundles with a custom icon set via a resource fork is not supported. Detected presence of %@", @(ent->fts_path)] }];
}
return NO;
}
NSDictionary *info = infoForFile(ent);
if (!info) {
@@ -543,6 +577,20 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
return NO;
}
// Ensure Sparkle executable permissions are valid
if (ent->fts_info == FTS_F && [key.lastPathComponent isEqualToString:@"Sparkle"] && [key.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent.lastPathComponent isEqualToString:@"Sparkle.framework"]) {
mode_t permissions = (mode_t)[(NSNumber *)info[INFO_PERMISSIONS_KEY] shortValue];
if (permissions != VALID_SPARKLE_EXECUTABLE_PERMISSIONS) {
if (verbose) {
fprintf(stderr, "\n");
}
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Permissions for Sparkle executable must be 0%o (found 0%o) on file %@", VALID_SPARKLE_EXECUTABLE_PERMISSIONS, permissions, @(ent->fts_path)] }];
}
return NO;
}
}
// We should validate ACLs even if we don't store the info in the diff in the case of ACLs
// We should also not allow files with code signed extended attributes since Apple doesn't recommend inserting these
// inside an application, and since we don't preserve extended attribitutes anyway
+6 -24
View File
@@ -128,16 +128,8 @@
dispatch_semaphore_signal(terminationSemaphore);
};
if (@available(macOS 10.13, *)) {
if (![task launchAndReturnError:&error]) {
goto reportError;
}
} else {
@try {
[task launch];
} @catch (NSException *) {
goto reportError;
}
if (![task launchAndReturnError:&error]) {
goto reportError;
}
[notifier notifyProgress:0.125];
@@ -221,20 +213,10 @@
task.standardOutput = [NSPipe pipe];
task.standardError = [NSPipe pipe];
if (@available(macOS 10.13, *)) {
NSError *launchCleanupError = nil;
if (![task launchAndReturnError:&launchCleanupError]) {
SULog(SULogLevelError, @"Failed to unmount %@", mountPoint);
SULog(SULogLevelError, @"Error: %@", launchCleanupError);
}
} else {
@try {
[task launch];
} @catch (NSException *exception) {
SULog(SULogLevelError, @"Failed to unmount %@", mountPoint);
SULog(SULogLevelError, @"Exception: %@", exception);
}
NSError *launchCleanupError = nil;
if (![task launchAndReturnError:&launchCleanupError]) {
SULog(SULogLevelError, @"Failed to unmount %@", mountPoint);
SULog(SULogLevelError, @"Error: %@", launchCleanupError);
}
} else {
SULog(SULogLevelError, @"Can't mount DMG %@", self.archivePath);
+9 -21
View File
@@ -56,30 +56,18 @@
task.standardError = nil;
task.standardOutput = nil;
if (@available(macOS 10.13, *)) {
NSError *launchError = nil;
if (![task launchAndReturnError:&launchError]) {
if (error != NULL) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: @"Guided package installer failed to launch" }];
if (launchError != nil) {
userInfo[NSUnderlyingErrorKey] = launchError;
}
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:userInfo];
}
return NO;
}
} else {
@try {
[task launch];
} @catch (NSException *) {
if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: @"Guided package installer task threw an exception" }];
NSError *launchError = nil;
if (![task launchAndReturnError:&launchError]) {
if (error != NULL) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey: @"Guided package installer failed to launch" }];
if (launchError != nil) {
userInfo[NSUnderlyingErrorKey] = launchError;
}
return NO;
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:userInfo];
}
return NO;
}
[task waitUntilExit];
+3 -13
View File
@@ -119,19 +119,9 @@
[task setArguments:[args arrayByAddingObject:destination]];
NSError *launchError = nil;
if (@available(macOS 10.13, *)) {
if (![task launchAndReturnError:&launchError]) {
[notifier notifyFailureWithError:launchError];
return;
}
} else {
@try {
[task launch];
} @catch (NSException *e) {
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, -[NSTask launch] threw exception '%@'", e.description]}];
[notifier notifyFailureWithError:error];
return;
}
if (![task launchAndReturnError:&launchError]) {
[notifier notifyFailureWithError:launchError];
return;
}
NSFileHandle *archiveOutput = [pipe fileHandleForWriting];
+6 -10
View File
@@ -200,17 +200,13 @@
// First try swapping the application atomically
NSError *swapError = nil;
BOOL swappedApp;
if (@available(macOS 10.13, *)) {
// If the app is normalized and the installation path differs, go through the old swap path
if (SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME && ![oldURL.path isEqual:installationURL.path]) {
swappedApp = NO;
} else {
// We will be cleaning up the temporary directory later in -performCleanup:
// We don't want to clean it up now because it can take some time
swappedApp = [fileManager swapItemAtURL:installationURL withItemAtURL:newTempURL error:&swapError];
}
} else {
// If the app is normalized and the installation path differs, go through the old swap path
if (SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME && ![oldURL.path isEqual:installationURL.path]) {
swappedApp = NO;
} else {
// We will be cleaning up the temporary directory later in -performCleanup:
// We don't want to clean it up now because it can take some time
swappedApp = [fileManager swapItemAtURL:installationURL withItemAtURL:newTempURL error:&swapError];
}
if (!swappedApp) {
+3 -3
View File
@@ -17,7 +17,7 @@
#import "SUSignatures.h"
#import "SUErrors.h"
#include <CommonCrypto/CommonDigest.h>
#import "ed25519.h" // Run `git submodule update --init` if you get an error here
#import "ed25519.h"
#include "AppKitPrevention.h"
@@ -269,7 +269,6 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
__block SecGroupTransformRef group = SecTransformCreateGroupTransform();
#pragma clang diagnostic pop
__block SecTransformRef dataReadTransform = NULL;
__block SecTransformRef dataDigestTransform = NULL;
__block SecTransformRef dataVerifyTransform = NULL;
@@ -301,7 +300,7 @@
return cleanup();
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdirect-ivar-access"
dataVerifyTransform = SecVerifyTransformCreate(dsaPubKeySecKey, (__bridge CFDataRef)dsaSignature, &error);
@@ -321,6 +320,7 @@
return cleanup();
}
#pragma clang diagnostic pop
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+43 -8
View File
@@ -12,15 +12,18 @@
#include "AppKitPrevention.h"
#define REPLY_STATUS_INFO_TIMEOUT 2
@interface StatusInfo () <NSXPCListenerDelegate>
@property (nonatomic) NSXPCListener *xpcListener;
@end
@implementation StatusInfo
{
NSXPCListener *_xpcListener;
NSMutableDictionary *_pendingReplies;
NSUInteger _pendingReplyCounter;
}
@synthesize xpcListener = _xpcListener;
@synthesize installationInfoData = _installationInfoData;
- (instancetype)initWithHostBundleIdentifier:(NSString *)bundleIdentifier
@@ -29,19 +32,20 @@
if (self != nil) {
_xpcListener = [[NSXPCListener alloc] initWithMachServiceName:SPUStatusInfoServiceNameForBundleIdentifier(bundleIdentifier)];
_xpcListener.delegate = self;
_pendingReplies = [NSMutableDictionary dictionary];
}
return self;
}
- (void)startListener
{
[self.xpcListener resume];
[_xpcListener resume];
}
- (void)invalidate
{
[self.xpcListener invalidate];
self.xpcListener = nil;
[_xpcListener invalidate];
_xpcListener = nil;
}
- (BOOL)listener:(NSXPCListener *)__unused listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection
@@ -54,10 +58,41 @@
return YES;
}
- (void)setInstallationInfoData:(NSData *)installationInfoData
{
_installationInfoData = installationInfoData;
// Respond to all of our pending replies
for (NSNumber *replyKey in _pendingReplies) {
void (^replyBlock)(NSData * _Nullable) = self->_pendingReplies[replyKey];
replyBlock(_installationInfoData);
}
[_pendingReplies removeAllObjects];
}
- (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable))reply
{
dispatch_async(dispatch_get_main_queue(), ^{
reply(self.installationInfoData);
if (self->_installationInfoData != nil) {
reply(self->_installationInfoData);
} else {
// If we don't have the installation info data currently, we may receive it in a very short window afterwards
// In this case wait a bit for the reply. If we receive the data it will be in -setInstallationInfoData:
NSUInteger currentReplyCounter = self->_pendingReplyCounter;
self->_pendingReplyCounter++;
NSNumber *currentReplyCounterKey = @(currentReplyCounter);
self->_pendingReplies[currentReplyCounterKey] = [reply copy];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(REPLY_STATUS_INFO_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
void (^replyBlock)(NSData * _Nullable) = self->_pendingReplies[currentReplyCounterKey];
if (replyBlock != nil) {
replyBlock(self->_installationInfoData);
[self->_pendingReplies removeObjectForKey:currentReplyCounterKey];
}
});
}
});
}
+84
View File
@@ -1,3 +1,87 @@
# 2.3.0
* Bump minimum deployment target to macOS 10.13 (#2196) (Zorg)
* Remove and preserve necessary updates in generate_appcast (#2218) (Zorg)
* Move old update files no longer needed to old_updates/ in archive directory in generate_appcast (#2228) (Zorg)
* Expose maximum-versions option (per branch) in generate_appcast to preserve in the feed (#2259) (Zorg)
* Add -p option to sign_update to only print the signed signature (#2268) (Zorg)
* Hide automatic install check box when allowsAutomaticUpdates is disabled (#2202) (Jie)
* Allow developer to always force allowing automatic updates (#2266) (Zorg)
* Fix update window going haywire during resize when release notes are hidden by disabling resizing (#2200) (Zorg)
* Allow user to re-try installing/relaunching application when quit is delayed/cancelled (#2234) (Zorg)
* Add delta update attributes for validating an app hasn't been stripped from removed localizations or architectures (#2219) (Zorg)
* Fix delta patches not applying edge case if files from source that need to be diffed are not writeable (#2211) (Zorg)
* Add delegate callback when user makes choice to install, dismiss, or skip an update (#2250) (Zorg)
* Reject serving updates with DSA only and no EdDSA (#2167) (Zorg)
* Find potential matching running apps that are translocated in the updater agent (#2233) (Zorg)
* Expose -[SPUStandardUserDriver activeUpdateAlert] as private API (#2255) (Zorg)
* Add zh_CN l10n for "Version History" (#2247) (kakaiikaka)
* Update zh_TW localization (#2271) (Chiahong)
* Remove ed25519 git submodule in favor of including the dependency directly (#2244) (Zorg)
* Clean up left-over code (#2243) (Eitot)
* Update Package.resolved (#2245) (Zorg)
* Remove model translation table for system profiling (#2188) (Zorg)
* Improve documentation usage for SPUUpdater properties (#2256) (Zorg)
This release improves generate_appcast by automatically removing updates that are no longer needed in the generated appcast, and moving old update files to old_updates/ in the archives directory. New delta update attributes are also added to let Sparkle know when to skip downloading delta updates if the application has been stripped.
macOS 10.13 or later is now required (due to Xcode 14 dropping support for deploying to older OS versions).
If you're not generating appcasts automatically, remember to add `<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>` element to `<item>`s in your appcast.
# 2.2.2
* Critical update alerts may not show up as promptly as they should when they are being automatically installed (#2230) (Zorg)
* Remove module imports from framework headers (#2217) (Zorg)
* Update Portuguese localization (#2224) (Kent Sutherland)
* Update zh_TW localization (#2246) (Chiahong)
# 2.2.1
* Make scroll bar dark in dark theme for Release Notes by default (#2187) (Pavel Moiseenko)
* Fix memory leaks when using generate_appcast (#2193) (Zorg)
* Update Italian localization (#2192) (VinBoiSoft)
# 2.2.0
* Update Focus Improvements (#924)
* Present new scheduled updates in utmost focus only at opportune times (Zorg)
* For regular apps opportune times are: app launch, app re-activation, and system being idle (without a power assertion being held to prevent display sleep).
* For background (dockless) apps opportune time is just app launch. Otherwise, the update is now shown behind other applications and windows, instead of previously stealing focus from other active apps.
* Add APIs and documentation for adding gentle update reminders to compliment Sparkle's standard user interface (Zorg) (#2122)
* Allow status window to be minimizable for regular app installs (Zorg) (#2100)
* Center status window and inherit key focus from the previously shown update alert window (Zorg)
* Activate app when checking for updates if the app is not currently active (e.g, from a menu bar extra menu item) (Zorg)
* Fix issue where bringing status window to front made other active windows exit in macOS Ventura's Stage Manager (#2153) (Zorg)
* Fix showing update in focus not bringing the "checking for updates" window in focus (Zorg) (#2150)
* Rename XPC Service filenames for Sandboxing to show more friendly human-readable name in authorization dialog (Zorg) (#2096)
* Add support for running the framework and sparkle-cli as root (Zorg) (#2119)
* Fix issue where update cycle may not complete in unusual configuration if automatic checks are disabled + automatic downloading is enabled + install requires user interaction (Zorg) (#2133)
* Synchronize usage of XPC connections to main queue to fix potential race conditions (Zorg) (#2178)
* Update last update check time when choosing to install an update & relaunch (Zorg) (#2136)
* Improve error reporting in the framework and sparkle-cli when installation fails with no write permission (Zorg) (#2157)
* Use displayVersionString instead of versionString for OS version mismatch error message (samschott) (#2138)
* Make displayVersionString non-null and update fallback documentation (Zorg) (#2139)
* Ignore custom icons set via resource forks when applying delta updates (Zorg) (#2114)
* Fall back to regular update if delta update fails to download (Zorg) (#2118)
* Skip downloading delta updates when application has been moved to a file system (like FAT) that doesn't support regular permission modes (Zorg) (#2148)
* Bump initial installer message timeouts and declare daemon/agents processes as Interactive (Zorg) (#2162)
* Add and improve translation strings and update pt-BR (BR Lingo) (#2094)
* Update localisations (Eitot) (#2113)
* Update Greek localizations (seitsme) (#2184, #2185)
* Update Japanese localization (1024jp) (#2182)
* Replace deprecated code with newer APIs (Eitot) (#2112)
* Remove obsolete fallbacks for older OS versions (Eitot) (#2110)
* Remove SPUURLRequest (Zorg) (#2124)
* Silence ivar deprecation warnings (Zorg) (#2099)
* Fix Xcode 14 project warnings (Zorg) (#2147, #2179)
* Deprecate -s flag and add --ed-key-file option to generate_appcast (Zorg) (#2170)
* Update text for external licenses (Zorg) (#2164)
This update renames the bundled XPC Services, brings improvements to notifying users of new updates without disrupting their focus, and adds [gentle update reminder APIs](https://sparkle-project.org/documentation/gentle-reminders/) to further customize how Sparkle's standard user interface delivers new update alerts.
The `-s` flag for passing a raw private EdDSA key to sign_update and generate_appcast is now deprecated. If you were using this option previously, please see the help pages of these tools for more information.
# 2.1.0
* New Binary Delta format (version 3)
+1 -1
View File
@@ -1 +1 @@
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz"}
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz"}
+14 -6
View File
@@ -10,7 +10,15 @@ SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE = 1
SPARKLE_EMBED_INSTALLER_STATUS_XPC_SERVICE = 0
SPARKLE_EMBED_INSTALLER_CONNECTION_XPC_SERVICE = 0
// Set this to your own prefix if you want to use XPC Service names with different prefix
// Set these if you want to use custom name for the XPC Services
// For the Installer one in particular, this name may show up in an authorization prompt
// when installing an update that requires authorization.
INSTALLER_CONNECTION_NAME = InstallerConnection
INSTALLER_STATUS_NAME = InstallerStatus
INSTALLER_LAUNCHER_NAME = Installer
DOWNLOADER_NAME = Downloader
// Set this to your own prefix if you want to use XPC Service bundle IDs with different prefix
XPC_SERVICE_BUNDLE_ID_PREFIX = org.sparkle-project
INSTALLER_CONNECTION_BUNDLE_ID = ${XPC_SERVICE_BUNDLE_ID_PREFIX}.InstallerConnection
@@ -34,13 +42,13 @@ SPARKLE_ICON_NAME = AppIcon
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
// These variables must have a space after the '=' too
SPARKLE_VERSION_MAJOR = 2
SPARKLE_VERSION_MINOR = 1
SPARKLE_VERSION_MINOR = 3
SPARKLE_VERSION_PATCH = 0
// This should be in SemVer format or empty, ie. "-beta.1"
// These variables must have a space after the '=' too
SPARKLE_VERSION_SUFFIX =
CURRENT_PROJECT_VERSION = 2013
CURRENT_PROJECT_VERSION = 2021
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
ALWAYS_SEARCH_USER_PATHS = NO
@@ -48,11 +56,11 @@ ENABLE_STRICT_OBJC_MSGSEND = YES
GCC_SYMBOLS_PRIVATE_EXTERN = YES
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
ARCHS = $(ARCHS_STANDARD)
MACOSX_DEPLOYMENT_TARGET = 10.11
MACOSX_DEPLOYMENT_TARGET = 10.13
PRODUCT_NAME = ${TARGET_NAME}
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle.${PRODUCT_NAME:rfc1034identifier}
GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_BUILD_UI_BITS=$(SPARKLE_BUILD_UI_BITS) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" CURRENT_PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\" MARKETING_VERSION=\"$(MARKETING_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_INSTALLER_PROGRESS_TOOL_NAME=\"$(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)\" SPARKLE_ICON_NAME=\"$(SPARKLE_ICON_NAME)\" INSTALLER_LAUNCHER_BUNDLE_ID=\"${INSTALLER_LAUNCHER_BUNDLE_ID}\" INSTALLER_CONNECTION_BUNDLE_ID=\"${INSTALLER_CONNECTION_BUNDLE_ID}\" INSTALLER_STATUS_BUNDLE_ID=\"${INSTALLER_STATUS_BUNDLE_ID}\" DOWNLOADER_BUNDLE_ID=\"${DOWNLOADER_BUNDLE_ID}\"
GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_BUILD_UI_BITS=$(SPARKLE_BUILD_UI_BITS) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" CURRENT_PROJECT_VERSION=\"$(CURRENT_PROJECT_VERSION)\" MARKETING_VERSION=\"$(MARKETING_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_INSTALLER_PROGRESS_TOOL_NAME=\"$(SPARKLE_INSTALLER_PROGRESS_TOOL_NAME)\" SPARKLE_ICON_NAME=\"$(SPARKLE_ICON_NAME)\" INSTALLER_LAUNCHER_NAME=\"${INSTALLER_LAUNCHER_NAME}\" INSTALLER_LAUNCHER_BUNDLE_ID=\"${INSTALLER_LAUNCHER_BUNDLE_ID}\" INSTALLER_CONNECTION_NAME=\"${INSTALLER_CONNECTION_NAME}\" INSTALLER_CONNECTION_BUNDLE_ID=\"${INSTALLER_CONNECTION_BUNDLE_ID}\" INSTALLER_STATUS_NAME=\"${INSTALLER_STATUS_NAME}\" INSTALLER_STATUS_BUNDLE_ID=\"${INSTALLER_STATUS_BUNDLE_ID}\" DOWNLOADER_NAME=\"${DOWNLOADER_NAME}\" DOWNLOADER_BUNDLE_ID=\"${DOWNLOADER_BUNDLE_ID}\"
CODE_SIGN_IDENTITY = -
SDKROOT = macosx
@@ -110,4 +118,4 @@ GCC_WARN_UNUSED_VARIABLE = YES
WARNING_CFLAGS_EXTRA = -Wno-custom-atomic-properties -Wno-implicit-atomic-properties
// Turn on all warnings, then disable a few which are almost impossible to avoid
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-arc-repeated-use-of-weak -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso $(WARNING_CFLAGS_EXTRA)
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-arc-repeated-use-of-weak -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access $(WARNING_CFLAGS_EXTRA)
+1 -1
View File
@@ -3,6 +3,6 @@
INFOPLIST_FILE = Downloader/Info.plist
WRAPPER_EXTENSION = xpc
PRODUCT_BUNDLE_IDENTIFIER = ${DOWNLOADER_BUNDLE_ID}
PRODUCT_NAME = ${DOWNLOADER_BUNDLE_ID}
PRODUCT_NAME = ${DOWNLOADER_NAME}
CODE_SIGN_ENTITLEMENTS = Downloader/${DOWNLOADER_BUNDLE_ID}.entitlements
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) BUILDING_SPARKLE_DOWNLOADER_SERVICE=1
@@ -3,4 +3,4 @@
INFOPLIST_FILE = InstallerConnection/Info.plist
WRAPPER_EXTENSION = xpc
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_CONNECTION_BUNDLE_ID}
PRODUCT_NAME = ${INSTALLER_CONNECTION_BUNDLE_ID}
PRODUCT_NAME = ${INSTALLER_CONNECTION_NAME}
@@ -3,4 +3,4 @@
INFOPLIST_FILE = InstallerLauncher/Info.plist
WRAPPER_EXTENSION = xpc
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_LAUNCHER_BUNDLE_ID}
PRODUCT_NAME = ${INSTALLER_LAUNCHER_BUNDLE_ID}
PRODUCT_NAME = ${INSTALLER_LAUNCHER_NAME}
@@ -3,4 +3,4 @@
INFOPLIST_FILE = InstallerStatus/Info.plist
WRAPPER_EXTENSION = xpc
PRODUCT_BUNDLE_IDENTIFIER = ${INSTALLER_STATUS_BUNDLE_ID}
PRODUCT_NAME = ${INSTALLER_STATUS_BUNDLE_ID}
PRODUCT_NAME = ${INSTALLER_STATUS_NAME}
+39 -33
View File
@@ -48,8 +48,8 @@ if [ "$ACTION" = "" ] ; then
mkdir -p "$CONFIGURATION_BUILD_DIR/staging/Entitlements"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements"
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging/Entitlements/$DOWNLOADER_BUNDLE_ID.entitlements"
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements/$DOWNLOADER_BUNDLE_ID.entitlements"
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging/Entitlements/$DOWNLOADER_NAME.entitlements"
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements/$DOWNLOADER_NAME.entitlements"
fi
mkdir -p "$CONFIGURATION_BUILD_DIR/staging/Symbols"
@@ -66,8 +66,8 @@ if [ "$ACTION" = "" ] ; then
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
cp -R "$CONFIGURATION_BUILD_DIR/Autoupdate.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
cp -R "$CONFIGURATION_BUILD_DIR/Updater.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
cp -R "$CONFIGURATION_BUILD_DIR/${INSTALLER_LAUNCHER_BUNDLE_ID}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
cp -R "$CONFIGURATION_BUILD_DIR/${DOWNLOADER_BUNDLE_ID}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
cp -R "$CONFIGURATION_BUILD_DIR/${INSTALLER_LAUNCHER_NAME}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
cp -R "$CONFIGURATION_BUILD_DIR/${DOWNLOADER_NAME}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols"
fi
cp -R "$CONFIGURATION_BUILD_DIR/staging/bin" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$CONFIGURATION_BUILD_DIR/staging/Symbols" "$CONFIGURATION_BUILD_DIR/staging-spm"
@@ -107,40 +107,46 @@ if [ "$ACTION" = "" ] ; then
rm -rf "/tmp/sparkle-extract"
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
# Generate zip containing the xcframework for SPM
rm -rf "/tmp/sparkle-spm-extract"
mkdir -p "/tmp/sparkle-spm-extract"
cd "$CONFIGURATION_BUILD_DIR/staging-spm"
# rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive"
ditto -c -k --zlibCompressionLevel 9 --rsrc . "../Sparkle-for-Swift-Package-Manager.zip"
# Test code signing validity of the extracted Swift package
# This guards against our archives being corrupt / created incorrectly
ditto -x -k "../Sparkle-for-Swift-Package-Manager.zip" "/tmp/sparkle-spm-extract"
verify_code_signatures "/tmp/sparkle-spm-extract"
rm -rf "/tmp/sparkle-spm-extract"
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
# Get latest git tag
cd "$SRCROOT"
latest_git_tag=$(git describe --tags --abbrev=0)
latest_git_tag=$( git describe --tags --abbrev=0 || true )
# Check semantic versioning
if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
echo "Tag $latest_git_tag follows semantic versioning"
else
echo "ERROR: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" >&2
exit 1
fi
if [ -n "$latest_git_tag" ] ; then
# Generate zip containing the xcframework for SPM
rm -rf "/tmp/sparkle-spm-extract"
mkdir -p "/tmp/sparkle-spm-extract"
cd "$CONFIGURATION_BUILD_DIR/staging-spm"
# rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive"
ditto -c -k --zlibCompressionLevel 9 --rsrc . "../Sparkle-for-Swift-Package-Manager.zip"
# Generate new Package manifest, podspec, and carthage files
cd "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Carthage-dev.json" "$CONFIGURATION_BUILD_DIR"
# Test code signing validity of the extracted Swift package
# This guards against our archives being corrupt / created incorrectly
ditto -x -k "../Sparkle-for-Swift-Package-Manager.zip" "/tmp/sparkle-spm-extract"
verify_code_signatures "/tmp/sparkle-spm-extract"
rm -rf "/tmp/sparkle-spm-extract"
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
cd "$SRCROOT"
if [ "$XCODE_VERSION_MAJOR" -ge "1200" ]; then
# Check semantic versioning
if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
echo "Tag $latest_git_tag follows semantic versioning"
else
echo "ERROR: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" >&2
exit 1
fi
# Generate new Package manifest, podspec, and carthage files
cd "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Carthage-dev.json" "$CONFIGURATION_BUILD_DIR"
fi
if [ -z "$latest_git_tag" ] ; then
echo "warning: No git repository found so skipping updating package management files"
elif [ "$XCODE_VERSION_MAJOR" -ge "1200" ]; then
# is equivalent to shasum -a 256 FILE
spm_checksum=$(swift package compute-checksum "Sparkle-for-Swift-Package-Manager.zip")
rm -rf ".build"
+5 -1
View File
@@ -2,7 +2,11 @@
set -e
# Convenience script to automatically commit Package.swift after updating the checksum and move the latest tag
latest_git_tag=$(git describe --tags --abbrev=0) # gets the latest tag name
latest_git_tag=$( git describe --tags --abbrev=0 || true ) # gets the latest tag name
if [ -z "$latest_git_tag" ] ; then
exit 0
fi
commits_since_tag=$(git rev-list ${latest_git_tag}.. --count)
function move_tag() {
+4 -4
View File
@@ -5,22 +5,22 @@ FRAMEWORK_PATH="${TARGET_BUILD_DIR}"/"${FULL_PRODUCT_NAME}"
removedservices=0
if [[ "$SPARKLE_EMBED_INSTALLER_LAUNCHER_XPC_SERVICE" -eq 0 ]]; then
rm -rf "${FRAMEWORK_PATH}"/"Versions/"${FRAMEWORK_VERSION}"/XPCServices"/"${INSTALLER_LAUNCHER_BUNDLE_ID}.xpc"
rm -rf "${FRAMEWORK_PATH}"/"Versions/"${FRAMEWORK_VERSION}"/XPCServices"/"${INSTALLER_LAUNCHER_NAME}.xpc"
removedservices=$((removedservices+1))
fi
if [[ "$SPARKLE_EMBED_DOWNLOADER_XPC_SERVICE" -eq 0 ]]; then
rm -rf "${FRAMEWORK_PATH}"/"Versions/"${FRAMEWORK_VERSION}"/XPCServices"/"${DOWNLOADER_BUNDLE_ID}.xpc"
rm -rf "${FRAMEWORK_PATH}"/"Versions/"${FRAMEWORK_VERSION}"/XPCServices"/"${DOWNLOADER_NAME}.xpc"
removedservices=$((removedservices+1))
fi
if [[ "$SPARKLE_EMBED_INSTALLER_STATUS_XPC_SERVICE" -eq 0 ]]; then
rm -rf "${FRAMEWORK_PATH}"/"Versions/"${FRAMEWORK_VERSION}"/XPCServices"/"${INSTALLER_STATUS_BUNDLE_ID}.xpc"
rm -rf "${FRAMEWORK_PATH}"/"Versions/"${FRAMEWORK_VERSION}"/XPCServices"/"${INSTALLER_STATUS_NAME}.xpc"
removedservices=$((removedservices+1))
fi
if [[ "$SPARKLE_EMBED_INSTALLER_CONNECTION_XPC_SERVICE" -eq 0 ]]; then
rm -rf "${FRAMEWORK_PATH}"/"Versions/"${FRAMEWORK_VERSION}"/XPCServices"/"${INSTALLER_CONNECTION_BUNDLE_ID}.xpc"
rm -rf "${FRAMEWORK_PATH}"/"Versions/"${FRAMEWORK_VERSION}"/XPCServices"/"${INSTALLER_CONNECTION_NAME}.xpc"
removedservices=$((removedservices+1))
fi
+2
View File
@@ -105,6 +105,8 @@ If the 2nd stage succeeds, the installer sends a `SPUInstallationFinishedStage2`
The updater receives a `SPUInstallationFinishedStage2` message, and reads if the target application had already been terminated. If the target application has not already terminated, the updater tells the user driver to show that the application is being sent a termination request.
In the case termination of the application is delayed or canceled, the user driver may re-try sending a `SPUResumeInstallationToStage2` message to the installer. This time the installer will recognize it already completed stage 2. If it hasn't proceeded onto stage 3 it will send another quit event to the application. This re-try can be done multiple times.
### Showing Progress
When the target application is terminated, if the updater allowed the installer to show UI progress and the installation type doesn't show progress on its own (only interactive package installer shows progress on its own), then the installer sends a `SPUUpdaterAlivePing` message to the updater. If the updater is still alive by now and receives the message, the updater will then send back a `SPUUpdaterAlivePong` message. This lets the installer know that the updater is still active after the target application is terminated, and whether the installer should later be responsible for displaying updater progress or not if a short time passes by, and the installation is still not finished. If the updater is still not alive, then the installer should be responsible for showing progress if otherwise allowed.
+4 -5
View File
@@ -9,7 +9,6 @@
#import "SPUDownloader.h"
#import "SPUDownloaderDelegate.h"
#import "SPULocalCacheDirectory.h"
#import "SPUURLRequest.h"
#import "SPUDownloadData.h"
#import "SPUDownloadDataPrivate.h"
#import "SUErrors.h"
@@ -61,19 +60,19 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
return self;
}
- (void)startDownloadWithRequest:(SPUURLRequest *)request
- (void)startDownloadWithRequest:(NSURLRequest *)request
{
self.downloadSession = [NSURLSession
sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]
delegate:self
delegateQueue:[NSOperationQueue mainQueue]];
self.download = [self.downloadSession downloadTaskWithRequest:request.request];
self.download = [self.downloadSession downloadTaskWithRequest:request];
[self.download resume];
}
// Don't implement dealloc - make the client call cleanup, which is the only way to remove the reference cycle from the delegate anyway
- (void)startPersistentDownloadWithRequest:(SPUURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename
- (void)startPersistentDownloadWithRequest:(NSURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.download == nil && self.delegate != nil) {
@@ -90,7 +89,7 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
});
}
- (void)startTemporaryDownloadWithRequest:(SPUURLRequest *)request
- (void)startTemporaryDownloadWithRequest:(NSURLRequest *)request
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.download == nil && self.delegate != nil) {
+2 -4
View File
@@ -10,14 +10,12 @@
NS_ASSUME_NONNULL_BEGIN
@class SPUURLRequest;
// The protocol that this service will vend as its API. This header file will also need to be visible to the process hosting the service.
@protocol SPUDownloaderProtocol
- (void)startPersistentDownloadWithRequest:(SPUURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename;
- (void)startPersistentDownloadWithRequest:(NSURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename;
- (void)startTemporaryDownloadWithRequest:(SPUURLRequest *)request;
- (void)startTemporaryDownloadWithRequest:(NSURLRequest *)request;
- (void)removeDownloadDirectory:(NSString *)directoryName bundleIdentifier:(NSString *)bundleIdentifier;
+3 -1
View File
@@ -15,7 +15,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUInstallerConnection : NSObject <SUInstallerConnectionProtocol>
// Due to XPC reasons, this delegate is strongly referenced, until it's invalidated
- (instancetype)initWithDelegate:(id<SUInstallerCommunicationProtocol>)delegate;
- (instancetype)initWithDelegate:(id<SUInstallerCommunicationProtocol>)delegate remote:(BOOL)remote;
- (instancetype)init NS_UNAVAILABLE;
@end
+67 -24
View File
@@ -25,21 +25,27 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
@end
@implementation SUInstallerConnection
{
BOOL _remote;
}
@synthesize delegate = _delegate;
@synthesize disabledAutomaticTermination = _disabledAutomaticTermination;
@synthesize invalidationBlock = _invalidationBlock;
@synthesize connection = _connection;
- (instancetype)initWithDelegate:(id<SUInstallerCommunicationProtocol>)delegate
- (instancetype)initWithDelegate:(id<SUInstallerCommunicationProtocol>)delegate remote:(BOOL)remote
{
self = [super init];
if (self != nil) {
_delegate = delegate;
_remote = remote;
// If we are a XPC service, protect it from being terminated until the invalidation handler is set
_disabledAutomaticTermination = YES;
[[NSProcessInfo processInfo] disableAutomaticTermination:SUInstallerConnectionKeepAliveReason];
if (remote) {
// If we are a XPC service, protect it from being terminated until the invalidation handler is set
_disabledAutomaticTermination = YES;
[[NSProcessInfo processInfo] disableAutomaticTermination:SUInstallerConnectionKeepAliveReason];
}
}
return self;
}
@@ -52,7 +58,7 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
}
}
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler
- (void)_setInvalidationHandler:(void (^)(void))invalidationHandler
{
self.invalidationBlock = invalidationHandler;
@@ -60,7 +66,18 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
[self enableAutomaticTermination];
}
- (void)setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler
{
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[self _setInvalidationHandler:invalidationHandler];
});
} else {
[self _setInvalidationHandler:invalidationHandler];
}
}
- (void)_setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain
{
NSXPCConnectionOptions options = systemDomain ? NSXPCConnectionPrivileged : 0;
NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:options];
@@ -74,41 +91,67 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
__weak SUInstallerConnection *weakSelf = self;
self.connection.interruptionHandler = ^{
[weakSelf.connection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.connection invalidate];
});
};
self.connection.invalidationHandler = ^{
SUInstallerConnection *strongSelf = weakSelf;
if (strongSelf != nil) {
strongSelf.connection = nil;
[strongSelf invalidate];
}
dispatch_async(dispatch_get_main_queue(), ^{
SUInstallerConnection *strongSelf = weakSelf;
if (strongSelf != nil) {
strongSelf.connection = nil;
[strongSelf _invalidate];
}
});
};
[self.connection resume];
}
- (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data
- (void)setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain
{
[(id<SUInstallerCommunicationProtocol>)self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[self _setServiceName:serviceName systemDomain:systemDomain];
});
} else {
[self _setServiceName:serviceName systemDomain:systemDomain];
}
}
// This method can be called by us or from a remote
- (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data
{
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[(id<SUInstallerCommunicationProtocol>)self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
});
} else {
[(id<SUInstallerCommunicationProtocol>)self.connection.remoteObjectProxy handleMessageWithIdentifier:identifier data:data];
}
}
- (void)_invalidate
{
if (self.invalidationBlock != nil) {
self.invalidationBlock();
self.invalidationBlock = nil;
}
// Break the retain cycle
self.delegate = nil;
[self enableAutomaticTermination];
}
// This method can be called from us or a remote
- (void)invalidate
{
dispatch_async(dispatch_get_main_queue(), ^{
[self.connection invalidate];
self.connection = nil;
if (self.invalidationBlock != nil) {
self.invalidationBlock();
self.invalidationBlock = nil;
}
// Break the retain cycle
self.delegate = nil;
[self enableAutomaticTermination];
[self _invalidate];
});
}
+1 -1
View File
@@ -26,7 +26,7 @@
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerConnectionProtocol)];
newConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerCommunicationProtocol)];
SUInstallerConnection *exportedObject = [[SUInstallerConnection alloc] initWithDelegate:newConnection.remoteObjectProxy];
SUInstallerConnection *exportedObject = [[SUInstallerConnection alloc] initWithDelegate:newConnection.remoteObjectProxy remote:YES];
newConnection.exportedObject = exportedObject;
+95 -34
View File
@@ -17,6 +17,9 @@
#import "SUHost.h"
#import <ImageIO/ImageIO.h>
#import <ServiceManagement/ServiceManagement.h>
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
#import <SystemConfiguration/SystemConfiguration.h>
#include "AppKitPrevention.h"
@@ -70,13 +73,16 @@
}
}
// If we are running as the root user, there is no need to explicitly set the UserName / GroupName keys
// because we are submitting under the user domain, which should automatically use the the console user.
NSMutableDictionary *jobDictionary = [[NSMutableDictionary alloc] init];
jobDictionary[@"Label"] = label;
jobDictionary[@"ProgramArguments"] = arguments;
jobDictionary[@"EnableTransactions"] = @NO;
jobDictionary[@"KeepAlive"] = @{@"SuccessfulExit" : @NO};
jobDictionary[@"RunAtLoad"] = @NO;
jobDictionary[@"NICE"] = @0;
jobDictionary[@"Nice"] = @0;
jobDictionary[@"ProcessType"] = @"Interactive";
jobDictionary[@"LaunchOnlyOnce"] = @YES;
jobDictionary[@"MachServices"] = @{SPUStatusInfoServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES};
@@ -100,7 +106,7 @@
return (submittedJob == true);
}
- (SUInstallerLauncherStatus)submitInstallerAtPath:(NSString *)installerPath withHostBundle:(NSBundle *)hostBundle updaterIdentifier:(NSString *)updaterIdentifier authorizationPrompt:(NSString *)authorizationPrompt inSystemDomain:(BOOL)systemDomain
- (SUInstallerLauncherStatus)submitInstallerAtPath:(NSString *)installerPath withHostBundle:(NSBundle *)hostBundle updaterIdentifier:(NSString *)updaterIdentifier userName:(NSString *)userName homeDirectory:(NSString *)homeDirectory authorizationPrompt:(NSString *)authorizationPrompt inSystemDomain:(BOOL)systemDomain rootUser:(BOOL)rootUser
{
SUFileManager *fileManager = [[SUFileManager alloc] init];
@@ -110,12 +116,6 @@
NSString *hostBundleIdentifier = hostBundle.bundleIdentifier;
assert(hostBundleIdentifier != nil);
NSString *homeDirectory = NSHomeDirectory();
assert(homeDirectory != nil);
NSString *userName = NSUserName();
assert(userName != nil);
// The first argument has to be the path to the program, and the second is a host identifier so that the installer knows what mach services to host
// The third and forth arguments are for home directory and user name which only pkg installer scripts may need
// We intentionally do not pass any more arguments. Anything else should be done via IPC.
@@ -133,7 +133,7 @@
BOOL canceledAuthorization = NO;
BOOL failedToUseSystemDomain = NO;
if (auth != NULL && systemDomain) {
if (auth != NULL && systemDomain && !rootUser) {
// See Apple's 'EvenBetterAuthorizationSample' sample code and
// https://developer.apple.com/library/mac/technotes/tn2095/_index.html#//apple_ref/doc/uid/DTS10003110-CH1-SECTION7
// We can set a custom right name for authenticating as an administrator
@@ -207,7 +207,16 @@
NSString *path = [[NSString alloc] initWithUTF8String:pathBuffer];
tempIconDestinationURL = [NSURL fileURLWithPath:path];
CGImageDestinationRef imageDestination = CGImageDestinationCreateWithURL((CFURLRef)tempIconDestinationURL, kUTTypePNG, 1, NULL);
CGImageDestinationRef imageDestination = NULL;
if (@available(macOS 11, *)) {
CFStringRef uti = (__bridge CFStringRef)[UTTypePNG identifier];
imageDestination = CGImageDestinationCreateWithURL((CFURLRef)tempIconDestinationURL, uti, 1, NULL);
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
imageDestination = CGImageDestinationCreateWithURL((CFURLRef)tempIconDestinationURL, kUTTypePNG, 1, NULL);
#pragma clang diagnostic pop
}
if (imageDestination != NULL) {
CGImageDestinationAddImageFromSource(imageDestination, imageSource, imageIndex, (CFDictionaryRef)@{});
if (CGImageDestinationFinalize(imageDestination)) {
@@ -269,7 +278,7 @@
}
}
NSDictionary *jobDictionary = @{@"Label" : label, @"ProgramArguments" : arguments, @"EnableTransactions" : @NO, @"KeepAlive" : @{@"SuccessfulExit" : @NO}, @"RunAtLoad" : @NO, @"Nice" : @0, @"LaunchOnlyOnce": @YES, @"MachServices" : @{SPUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES, SPUProgressAgentServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}};
NSDictionary *jobDictionary = @{@"Label" : label, @"ProgramArguments" : arguments, @"EnableTransactions" : @NO, @"KeepAlive" : @{@"SuccessfulExit" : @NO}, @"RunAtLoad" : @NO, @"Nice" : @0, @"ProcessType": @"Interactive", @"LaunchOnlyOnce": @YES, @"MachServices" : @{SPUInstallerServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES, SPUProgressAgentServiceNameForBundleIdentifier(hostBundleIdentifier) : @YES}};
CFErrorRef submitError = NULL;
#pragma clang diagnostic push
@@ -361,38 +370,46 @@ BOOL SPUSystemNeedsAuthorizationAccessForBundlePath(NSString *bundlePath)
return needsAuthorization;
}
static BOOL SPUSystemNeedsAuthorizationAccess(NSString *path, NSString *installationType)
static BOOL SPUUsesSystemDomainForBundlePath(NSString *path, NSString *installationType, BOOL rootUser)
{
BOOL needsAuthorization;
if ([installationType isEqualToString:SPUInstallationTypeGuidedPackage]) {
needsAuthorization = YES;
} else if ([installationType isEqualToString:SPUInstallationTypeInteractivePackage]) {
needsAuthorization = NO;
if (!rootUser) {
if ([installationType isEqualToString:SPUInstallationTypeGuidedPackage]) {
return YES;
} else if ([installationType isEqualToString:SPUInstallationTypeInteractivePackage]) {
return NO;
} else {
return SPUSystemNeedsAuthorizationAccessForBundlePath(path);
}
} else {
needsAuthorization = SPUSystemNeedsAuthorizationAccessForBundlePath(path);
// If we are the root user we use the system domain even if we don't need escalated authorization.
// Note interactive package installations are not supported as root.
return YES;
}
return needsAuthorization;
}
// Note: do not pass untrusted information such as paths to the installer and progress agent tools, when we can find them ourselves here
- (void)launchInstallerWithHostBundlePath:(NSString *)hostBundlePath updaterIdentifier:(NSString *)updaterIdentifier authorizationPrompt:(NSString *)authorizationPrompt installationType:(NSString *)installationType allowingDriverInteraction:(BOOL)allowingDriverInteraction completion:(void (^)(SUInstallerLauncherStatus, BOOL))completionHandler
{
dispatch_async(dispatch_get_main_queue(), ^{
BOOL needsSystemAuthorization = SPUSystemNeedsAuthorizationAccess(hostBundlePath, installationType);
// We could do a sort of preflight Authorization test instead of testing if we are running as root,
// but I think this is not necessarily a better approach. We have to chown() the launcher cache directory later on,
// and that is not necessarily related to a preflight test. It's more related to being ran under a root / different user from the active GUI session
BOOL rootUser = (geteuid() == 0);
BOOL inSystemDomain = SPUUsesSystemDomainForBundlePath(hostBundlePath, installationType, rootUser);
NSBundle *hostBundle = [NSBundle bundleWithPath:hostBundlePath];
if (hostBundle == nil) {
SULog(SULogLevelError, @"InstallerLauncher failed to create bundle at %@", hostBundlePath);
SULog(SULogLevelError, @"Please make sure InstallerLauncher is not sandboxed and do not sign your app by passing --deep. Check: codesign -d --entitlements :- \"%@\"", NSBundle.mainBundle.bundlePath);
SULog(SULogLevelError, @"More information regarding sandboxing: https://sparkle-project.org/documentation/sandboxing/");
completionHandler(SUInstallerLauncherFailure, needsSystemAuthorization);
completionHandler(SUInstallerLauncherFailure, inSystemDomain);
return;
}
// if we need to use the system domain and we aren't allowed interaction, then try sometime later when interaction is allowed
if (needsSystemAuthorization && !allowingDriverInteraction) {
completionHandler(SUInstallerLauncherAuthorizeLater, needsSystemAuthorization);
// if we need to use the system authorization from non-root and we aren't allowed interaction, then try sometime later when interaction is allowed
if (inSystemDomain && !rootUser && !allowingDriverInteraction) {
completionHandler(SUInstallerLauncherAuthorizeLater, inSystemDomain);
return;
}
@@ -407,7 +424,7 @@ static BOOL SPUSystemNeedsAuthorizationAccess(NSString *path, NSString *installa
NSString *installerPath = [self pathForBundledTool:@""SPARKLE_RELAUNCH_TOOL_NAME extension:@"" fromBundle:ourBundle];
if (installerPath == nil) {
SULog(SULogLevelError, @"Error: Cannot submit installer because the installer could not be located");
completionHandler(SUInstallerLauncherFailure, needsSystemAuthorization);
completionHandler(SUInstallerLauncherFailure, inSystemDomain);
return;
}
@@ -416,7 +433,7 @@ static BOOL SPUSystemNeedsAuthorizationAccess(NSString *path, NSString *installa
if (progressToolResourcePath == nil) {
SULog(SULogLevelError, @"Error: Cannot submit progress tool because the progress tool could not be located");
completionHandler(SUInstallerLauncherFailure, needsSystemAuthorization);
completionHandler(SUInstallerLauncherFailure, inSystemDomain);
return;
}
@@ -432,25 +449,69 @@ static BOOL SPUSystemNeedsAuthorizationAccess(NSString *path, NSString *installa
NSString *launcherCachePath = [SPULocalCacheDirectory createUniqueDirectoryInDirectory:rootLauncherCachePath];
if (launcherCachePath == nil) {
SULog(SULogLevelError, @"Failed to create cache directory for progress tool in %@", rootLauncherCachePath);
completionHandler(SUInstallerLauncherFailure, needsSystemAuthorization);
completionHandler(SUInstallerLauncherFailure, inSystemDomain);
return;
}
SUFileManager *fileManager = [[SUFileManager alloc] init];
NSString *userName;
NSString *homeDirectory;
if (!rootUser) {
// Normal path
homeDirectory = NSHomeDirectory();
assert(homeDirectory != nil);
userName = NSUserName();
assert(userName != nil);
} else {
// As the root user we need to obtain the user name and home directory reflecting
// the user's console session.
uid_t uid = 0;
gid_t gid = 0;
CFStringRef userNameRef = SCDynamicStoreCopyConsoleUser(NULL, &uid, &gid);
if (userNameRef == NULL) {
SULog(SULogLevelError, @"Failed to retrieve user name from the console user");
completionHandler(SUInstallerLauncherFailure, inSystemDomain);
return;
}
userName = (NSString *)CFBridgingRelease(userNameRef);
homeDirectory = NSHomeDirectoryForUser(userName);
if (homeDirectory == nil) {
SULog(SULogLevelError, @"Failed to retrieve home directory for user: %@", userName);
completionHandler(SUInstallerLauncherFailure, inSystemDomain);
return;
}
// Ensure the console user has ownership of the launcher cache directory
// Otherwise the updater may not launch and not be able to clean up itself
NSError *changeOwnerAndGroupError = nil;
if (![fileManager changeOwnerAndGroupOfItemAtURL:[NSURL fileURLWithPath:launcherCachePath] ownerID:uid groupID:gid error:&changeOwnerAndGroupError]) {
SULog(SULogLevelError, @"Failed to change owner and group for launcher cache directory: %@", changeOwnerAndGroupError);
completionHandler(SUInstallerLauncherFailure, inSystemDomain);
return;
}
}
NSString *progressToolPath = [launcherCachePath stringByAppendingPathComponent:@""SPARKLE_INSTALLER_PROGRESS_TOOL_NAME@".app"];
NSError *copyError = nil;
// SUFileManager is more reliable for copying files around
if (![[[SUFileManager alloc] init] copyItemAtURL:[NSURL fileURLWithPath:progressToolResourcePath] toURL:[NSURL fileURLWithPath:progressToolPath] error:&copyError]) {
if (![fileManager copyItemAtURL:[NSURL fileURLWithPath:progressToolResourcePath] toURL:[NSURL fileURLWithPath:progressToolPath] error:&copyError]) {
SULog(SULogLevelError, @"Failed to copy progress tool to cache: %@", copyError);
completionHandler(SUInstallerLauncherFailure, needsSystemAuthorization);
completionHandler(SUInstallerLauncherFailure, inSystemDomain);
return;
}
SUInstallerLauncherStatus installerStatus = [self submitInstallerAtPath:installerPath withHostBundle:hostBundle updaterIdentifier:updaterIdentifier authorizationPrompt:authorizationPrompt inSystemDomain:needsSystemAuthorization];
SUInstallerLauncherStatus installerStatus = [self submitInstallerAtPath:installerPath withHostBundle:hostBundle updaterIdentifier:updaterIdentifier userName:userName homeDirectory:homeDirectory authorizationPrompt:authorizationPrompt inSystemDomain:inSystemDomain rootUser:rootUser];
BOOL submittedProgressTool = NO;
if (installerStatus == SUInstallerLauncherSuccess) {
submittedProgressTool = [self submitProgressToolAtPath:progressToolPath withHostBundle:hostBundle inSystemDomainForInstaller:needsSystemAuthorization];
submittedProgressTool = [self submitProgressToolAtPath:progressToolPath withHostBundle:hostBundle inSystemDomainForInstaller:inSystemDomain];
if (!submittedProgressTool) {
SULog(SULogLevelError, @"Failed to submit progress tool job");
@@ -461,9 +522,9 @@ static BOOL SPUSystemNeedsAuthorizationAccess(NSString *path, NSString *installa
}
if (installerStatus == SUInstallerLauncherCanceled) {
completionHandler(installerStatus, needsSystemAuthorization);
completionHandler(installerStatus, inSystemDomain);
} else {
completionHandler(submittedProgressTool ? SUInstallerLauncherSuccess : SUInstallerLauncherFailure, needsSystemAuthorization);
completionHandler(submittedProgressTool ? SUInstallerLauncherSuccess : SUInstallerLauncherFailure, inSystemDomain);
}
});
}
+4
View File
@@ -12,4 +12,8 @@
// This object implements the protocol which we have defined. It provides the actual behavior for the service. It is 'exported' by the service to make it available to the process hosting the service over an NSXPCConnection.
@interface SUInstallerStatus : NSObject <SUInstallerStatusProtocol>
- (instancetype)initWithRemote:(BOOL)remote;
- (instancetype)init NS_UNAVAILABLE;
@end
+66 -16
View File
@@ -19,16 +19,34 @@
@end
@implementation SUInstallerStatus
{
BOOL _remote;
}
@synthesize invalidationBlock = _invalidationBlock;
@synthesize connection = _connection;
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler
- (instancetype)initWithRemote:(BOOL)remote
{
self.invalidationBlock = invalidationHandler;
self = [super init];
if (self != nil) {
_remote = remote;
}
return self;
}
- (void)setServiceName:(NSString *)serviceName
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler
{
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
self.invalidationBlock = invalidationHandler;
});
} else {
self.invalidationBlock = invalidationHandler;
}
}
- (void)_setServiceName:(NSString *)serviceName
{
NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:(NSXPCConnectionOptions)0];
@@ -38,41 +56,73 @@
__weak SUInstallerStatus *weakSelf = self;
self.connection.interruptionHandler = ^{
[weakSelf.connection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.connection invalidate];
});
};
self.connection.invalidationHandler = ^{
SUInstallerStatus *strongSelf = weakSelf;
if (strongSelf != nil) {
strongSelf.connection = nil;
[strongSelf invalidate];
}
dispatch_async(dispatch_get_main_queue(), ^{
SUInstallerStatus *strongSelf = weakSelf;
if (strongSelf != nil) {
strongSelf.connection = nil;
[strongSelf _invokeInvalidationBlock];
}
});
};
[self.connection resume];
}
- (void)setServiceName:(NSString *)serviceName
{
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[self _setServiceName:serviceName];
});
} else {
[self _setServiceName:serviceName];
}
}
- (void)probeStatusInfoWithReply:(void (^)(NSData * _Nullable installationInfoData))reply
{
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
});
} else {
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusInfoWithReply:reply];
}
}
- (void)probeStatusConnectivityWithReply:(void (^)(void))reply
{
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
if (_remote) {
dispatch_async(dispatch_get_main_queue(), ^{
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
});
} else {
[(id<SUStatusInfoProtocol>)self.connection.remoteObjectProxy probeStatusConnectivityWithReply:reply];
}
}
// This method can be called by us or from a remote
- (void)_invokeInvalidationBlock
{
if (self.invalidationBlock != nil) {
self.invalidationBlock();
self.invalidationBlock = nil;
}
}
// This method can be called from us or a remote
- (void)invalidate
{
dispatch_async(dispatch_get_main_queue(), ^{
[self.connection invalidate];
self.connection = nil;
if (self.invalidationBlock != nil) {
self.invalidationBlock();
self.invalidationBlock = nil;
}
[self _invokeInvalidationBlock];
});
}
+1 -1
View File
@@ -25,7 +25,7 @@
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerStatusProtocol)];
// Next, set the object that the connection exports. All messages sent on the connection to this service will be sent to the exported object to handle. The connection retains the exported object.
SUInstallerStatus *exportedObject = [SUInstallerStatus new];
SUInstallerStatus *exportedObject = [[SUInstallerStatus alloc] initWithRemote:YES];
newConnection.exportedObject = exportedObject;
// Resuming the connection allows the system to deliver more incoming messages.
+76 -3
View File
@@ -29,13 +29,86 @@ EXTERNAL LICENSES
=================
bspatch.c and bsdiff.c, from bsdiff 4.3 <http://www.daemonology.net/bsdiff/>:
Copyright (c) 2003-2005 Colin Percival.
Copyright 2003-2005 Colin Percival
All rights reserved
Redistribution and use in source and binary forms, with or without
modification, are permitted providing that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
--
sais.c and sais.c, from sais-lite (2010/08/07) <https://sites.google.com/site/yuta256/sais>:
Copyright (c) 2008-2010 Yuta Mori.
The sais-lite copyright is as follows:
Copyright (c) 2008-2010 Yuta Mori All Rights Reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
--
Portable C implementation of Ed25519, from https://github.com/orlp/ed25519
Copyright (c) 2015 Orson Peters <orsonpeters@gmail.com>
This software is provided 'as-is', without any express or implied warranty. In no event will the
authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the
original software. If you use this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as
being the original software.
3. This notice may not be removed or altered from any source distribution.
--
SUSignatureVerifier.m:
Copyright (c) 2011 Mark Hamlin.
Copyright (c) 2011 Mark Hamlin.
All rights reserved.
+4 -4
View File
@@ -7,10 +7,10 @@ ifndef BUILDDIR
endif
localizable-strings:
rm -f Sparkle/en.lproj/Sparkle.strings
genstrings -o Sparkle/en.lproj -s SULocalizedString Sparkle/*.m Sparkle/*.h
iconv -f UTF-16 -t UTF-8 < Sparkle/en.lproj/Localizable.strings > Sparkle/en.lproj/Sparkle.strings
rm Sparkle/en.lproj/Localizable.strings
rm -f Sparkle/Base.lproj/Sparkle.strings
genstrings -o Sparkle/Base.lproj -s SULocalizedString Sparkle/*.m
iconv -f UTF-16 -t UTF-8 < Sparkle/Base.lproj/Localizable.strings > Sparkle/Base.lproj/Sparkle.strings
rm Sparkle/Base.lproj/Localizable.strings
release:
xcodebuild -scheme Distribution -configuration Release -derivedDataPath "$(BUILDDIR)" build
+3 -3
View File
@@ -2,10 +2,10 @@
import PackageDescription
// Version is technically not required here, SPM doesn't check
let version = "2.1.0"
let version = "2.3.0"
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
let tag = "2.1.0"
let checksum = "6a540f9bd4ef096b6229f134a6b98dea265c8f89ede418b50d49fc49d7fe0b46"
let tag = "2.3.0"
let checksum = "a32f43511071c4df4e3aa766ed3e8e0fc03dd5912d8a0db9e266794735ad247f"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
let package = Package(
+1 -8
View File
@@ -29,7 +29,7 @@ Please visit [Sparkle's website](http://sparkle-project.org) for up to date docu
## Requirements
* Runtime: macOS 10.11 or greater
* Runtime: macOS 10.13 or greater for 2.3, macOS 10.11 or greater for 2.2.x
* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less.
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
@@ -37,13 +37,6 @@ Please visit [Sparkle's website](http://sparkle-project.org) for up to date docu
See [getting started guide](https://sparkle-project.org/documentation/). No code is necessary, but a bit of Xcode configuration is required.
## Development
This repository uses git submodules, and will not build unless you clone recursively. Also, GitHub-provided ZIP/tar archives are broken due to GitHub not supporting git submodules properly.
git clone https://github.com/sparkle-project/Sparkle
git submodule update --init --recursive
### Troubleshooting
* Please check **Console.app** for logs under your application. Sparkle prints detailed information there about all problems it encounters. It often also suggests solutions to the problems, so please read Sparkle's log messages carefully.
+1
View File
@@ -1,5 +1,6 @@
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
color: white;
background: transparent;
}
-314
View File
@@ -1,314 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ADP2,1</key>
<string>Developer Transition Kit</string>
<key>iMac1,1</key>
<string>iMac G3 (Rev A-D)</string>
<key>iMac4,1</key>
<string>iMac (Core Duo)</string>
<key>iMac4,2</key>
<string>iMac for Education (17 inch, Core Duo)</string>
<key>iMac5,1</key>
<string>iMac (Core 2 Duo, 17 or 20 inch, SuperDrive)</string>
<key>iMac5,2</key>
<string>iMac (Core 2 Duo, 17 inch, Combo Drive)</string>
<key>iMac6,1</key>
<string>iMac (Core 2 Duo, 24 inch, SuperDrive)</string>
<key>iMac7,1</key>
<string>iMac Intel Core 2 Duo (aluminum enclosure)</string>
<key>iMac8,1</key>
<string>iMac (Core 2 Duo, 20 or 24 inch, Early 2008 )</string>
<key>iMac9,1</key>
<string>iMac (Core 2 Duo, 20 or 24 inch, Early or Mid 2009 )</string>
<key>iMac10,1</key>
<string>iMac (Core 2 Duo, 21.5 or 27 inch, Late 2009 )</string>
<key>iMac11,1</key>
<string>iMac (Core i5 or i7, 27 inch Late 2009)</string>
<key>iMac11,2</key>
<string>21.5&quot; iMac (mid 2010)</string>
<key>iMac11,3</key>
<string>iMac (Core i5 or i7, 27 inch Mid 2010)</string>
<key>iMac12,1</key>
<string>iMac (Core i3 or i5 or i7, 21.5 inch Mid 2010 or Late 2011)</string>
<key>iMac12,2</key>
<string>iMac (Core i5 or i7, 27 inch Mid 2011)</string>
<key>iMac13,1</key>
<string>iMac (Core i3 or i5 or i7, 21.5 inch Late 2012 or Early 2013)</string>
<key>iMac13,2</key>
<string>iMac (Core i5 or i7, 27 inch Late 2012)</string>
<key>iMac14,1</key>
<string>iMac (Core i5, 21.5 inch Late 2013)</string>
<key>iMac14,2</key>
<string>iMac (Core i5 or i7, 27 inch Late 2013)</string>
<key>iMac14,3</key>
<string>iMac (Core i5 or i7, 21.5 inch Late 2013)</string>
<key>iMac14,4</key>
<string>iMac (Core i5, 21.5 inch Mid 2014)</string>
<key>iMac15,1</key>
<string>iMac (Retina 5K Core i5 or i7, 27 inch Late 2014 or Mid 2015)</string>
<key>iMac16,1</key>
<string>iMac (Core i5, 21,5 inch Late 2015)</string>
<key>iMac16,2</key>
<string>iMac (Retina 4K Core i5 or i7, 21.5 inch Late 2015)</string>
<key>iMac17,1</key>
<string>iMac (Retina 5K Core i5 or i7, 27 inch Late 2015)</string>
<key>MacBook1,1</key>
<string>MacBook (Core Duo)</string>
<key>MacBook2,1</key>
<string>MacBook (Core 2 Duo)</string>
<key>MacBook4,1</key>
<string>MacBook (Core 2 Duo Feb 2008)</string>
<key>MacBook5,1</key>
<string>MacBook (Core 2 Duo, Late 2008, Unibody)</string>
<key>MacBook5,2</key>
<string>MacBook (Core 2 Duo, Early 2009, White)</string>
<key>MacBook6,1</key>
<string>MacBook (Core 2 Duo, Late 2009, Unibody)</string>
<key>MacBook7,1</key>
<string>MacBook (Core 2 Duo, Mid 2010, White)</string>
<key>MacBook8,1</key>
<string>MacBook (Core M, 12 inch, Early 2015)</string>
<key>MacBookAir1,1</key>
<string>MacBook Air (Core 2 Duo, 13 inch, Early 2008)</string>
<key>MacBookAir2,1</key>
<string>MacBook Air (Core 2 Duo, 13 inch, Mid 2009)</string>
<key>MacBookAir3,1</key>
<string>MacBook Air (Core 2 Duo, 11 inch, Late 2010)</string>
<key>MacBookAir3,2</key>
<string>MacBook Air (Core 2 Duo, 13 inch, Late 2010)</string>
<key>MacBookAir4,1</key>
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2011)</string>
<key>MacBookAir4,2</key>
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2011)</string>
<key>MacBookAir5,1</key>
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2012)</string>
<key>MacBookAir5,2</key>
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2012)</string>
<key>MacBookAir6,1</key>
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2013 or Early 2014)</string>
<key>MacBookAir6,2</key>
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2013 or Early 2014)</string>
<key>MacBookAir7,1</key>
<string>MacBook Air (Core i5 or i7, 11 inch, Early 2015)</string>
<key>MacBookAir7,2</key>
<string>MacBook Air (Core i5 or i7, 13 inch, Early 2015)</string>
<key>MacBookPro1,1</key>
<string>MacBook Pro Core Duo (15-inch)</string>
<key>MacBookPro1,2</key>
<string>MacBook Pro Core Duo (17-inch)</string>
<key>MacBookPro2,1</key>
<string>MacBook Pro Core 2 Duo (17-inch)</string>
<key>MacBookPro2,2</key>
<string>MacBook Pro Core 2 Duo (15-inch)</string>
<key>MacBookPro3,1</key>
<string>MacBook Pro Core 2 Duo (15-inch LED, Core 2 Duo)</string>
<key>MacBookPro3,2</key>
<string>MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo)</string>
<key>MacBookPro4,1</key>
<string>MacBook Pro (Core 2 Duo Feb 2008)</string>
<key>MacBookPro5,1</key>
<string>MacBook Pro Intel Core 2 Duo (aluminum unibody)</string>
<key>MacBookPro5,2</key>
<string>MacBook Pro Intel Core 2 Duo (aluminum unibody)</string>
<key>MacBookPro5,3</key>
<string>MacBook Pro Intel Core 2 Duo (aluminum unibody)</string>
<key>MacBookPro5,4</key>
<string>MacBook Pro Intel Core 2 Duo (aluminum unibody)</string>
<key>MacBookPro5,5</key>
<string>MacBook Pro Intel Core 2 Duo (aluminum unibody)</string>
<key>MacBookPro6,1</key>
<string>MacBook Pro Intel Core i5, Intel Core i7 (mid 2010)</string>
<key>MacBookPro6,2</key>
<string>MacBook Pro Intel Core i5, Intel Core i7 (mid 2010)</string>
<key>MacBookPro7,1</key>
<string>MacBook Pro Intel Core 2 Duo (mid 2010)</string>
<key>MacBookPro8,1</key>
<string>MacBook Pro Intel Core i5, Intel Core i7, 13&quot; (early 2011)</string>
<key>MacBookPro8,2</key>
<string>MacBook Pro Intel Core i7, 15&quot; (early 2011)</string>
<key>MacBookPro8,3</key>
<string>MacBook Pro Intel Core i7, 17&quot; (early 2011)</string>
<key>MacBookPro9,1</key>
<string>MacBook Pro (15-inch, Mid 2012)</string>
<key>MacBookPro9,2</key>
<string>MacBook Pro (13-inch, Mid 2012)</string>
<key>MacBookPro10,1</key>
<string>MacBook Pro (Retina, Mid 2012)</string>
<key>MacBookPro10,2</key>
<string>MacBook Pro (Retina, 13-inch, Late 2012)</string>
<key>MacBookPro11,1</key>
<string>MacBook Pro (Retina, 13-inch, Late 2013)</string>
<key>MacBookPro11,2</key>
<string>MacBook Pro (Retina, 15-inch, Late 2013)</string>
<key>MacBookPro11,3</key>
<string>MacBook Pro (Retina, 15-inch, Late 2013)</string>
<key>MacbookPro11,4</key>
<string>MacBook Pro (Retina, 15-inch, Mid 2015)</string>
<key>MacbookPro11,5</key>
<string>MacBook Pro (Retina, 15-inch, Mid 2015)</string>
<key>MacbookPro12,1 </key>
<string>MacBook Pro (Retina, 13-inch, Early 2015)</string>
<key>Macmini1,1</key>
<string>Mac Mini (Core Solo/Duo)</string>
<key>Macmini2,1</key>
<string>Mac mini Intel Core</string>
<key>Macmini3,1</key>
<string>Mac mini Intel Core</string>
<key>Macmini4,1</key>
<string>Mac mini Intel Core (Mid 2010)</string>
<key>Macmini5,1</key>
<string>Mac mini (Core i5, Mid 2011)</string>
<key>Macmini5,2</key>
<string>Mac mini (Core i5 or Core i7, Mid 2011)</string>
<key>Macmini5,3</key>
<string>Mac mini (Core i7, Server, Mid 2011)</string>
<key>Macmini6,1</key>
<string>Mac mini (Core i5, Late 2012)</string>
<key>Macmini6,2</key>
<string>Mac mini (Core i7, Normal or Server, Late 2012)</string>
<key>Macmini7,1</key>
<string>Mac mini (Core i5 or Core i7, Late 2014)</string>
<key>MacPro1,1,Quad</key>
<string>Mac Pro</string>
<key>MacPro1,1</key>
<string>Mac Pro (four-core)</string>
<key>MacPro2,1</key>
<string>Mac Pro (eight-core)</string>
<key>MacPro3,1</key>
<string>Mac Pro (January 2008 4- or 8- core &quot;Harpertown&quot;)</string>
<key>MacPro4,1</key>
<string>Mac Pro (March 2009)</string>
<key>MacPro5,1</key>
<string>Mac Pro (2010 or 2012)</string>
<key>MacPro6,1</key>
<string>Mac Pro (Late 2013)</string>
<key>PowerBook1,1</key>
<string>PowerBook G3</string>
<key>PowerBook2,1</key>
<string>iBook G3</string>
<key>PowerBook2,2</key>
<string>iBook G3 (FireWire)</string>
<key>PowerBook2,3</key>
<string>iBook G3</string>
<key>PowerBook2,4</key>
<string>iBook G3</string>
<key>PowerBook3,1</key>
<string>PowerBook G3 (FireWire)</string>
<key>PowerBook3,2</key>
<string>PowerBook G4</string>
<key>PowerBook3,3</key>
<string>PowerBook G4 (Gigabit Ethernet)</string>
<key>PowerBook3,4</key>
<string>PowerBook G4 (DVI)</string>
<key>PowerBook3,5</key>
<string>PowerBook G4 (1GHz / 867MHz)</string>
<key>PowerBook4,1</key>
<string>iBook G3 (Dual USB, Late 2001)</string>
<key>PowerBook4,2</key>
<string>iBook G3 (16MB VRAM)</string>
<key>PowerBook4,3</key>
<string>iBook G3 Opaque 16MB VRAM, 32MB VRAM, Early 2003)</string>
<key>PowerBook5,1</key>
<string>PowerBook G4 (17 inch)</string>
<key>PowerBook5,2</key>
<string>PowerBook G4 (15 inch FW 800)</string>
<key>PowerBook5,3</key>
<string>PowerBook G4 (17-inch 1.33GHz)</string>
<key>PowerBook5,4</key>
<string>PowerBook G4 (15 inch 1.5/1.33GHz)</string>
<key>PowerBook5,5</key>
<string>PowerBook G4 (17-inch 1.5GHz)</string>
<key>PowerBook5,6</key>
<string>PowerBook G4 (15 inch 1.67GHz/1.5GHz)</string>
<key>PowerBook5,7</key>
<string>PowerBook G4 (17-inch 1.67GHz)</string>
<key>PowerBook5,8</key>
<string>PowerBook G4 (Double layer SD, 15 inch)</string>
<key>PowerBook5,9</key>
<string>PowerBook G4 (Double layer SD, 17 inch)</string>
<key>PowerBook6,1</key>
<string>PowerBook G4 (12 inch)</string>
<key>PowerBook6,2</key>
<string>PowerBook G4 (12 inch, DVI)</string>
<key>PowerBook6,3</key>
<string>iBook G4</string>
<key>PowerBook6,4</key>
<string>PowerBook G4 (12 inch 1.33GHz)</string>
<key>PowerBook6,5</key>
<string>iBook G4 (Early-Late 2004)</string>
<key>PowerBook6,7</key>
<string>iBook G4 (Mid 2005)</string>
<key>PowerBook6,8</key>
<string>PowerBook G4 (12 inch 1.5GHz)</string>
<key>PowerMac1,1</key>
<string>Power Macintosh G3 (Blue &amp; White)</string>
<key>PowerMac1,2</key>
<string>Power Macintosh G4 (PCI Graphics)</string>
<key>PowerMac2,1</key>
<string>iMac G3 (Slot-loading CD-ROM)</string>
<key>PowerMac2,2</key>
<string>iMac G3 (Summer 2000)</string>
<key>PowerMac3,1</key>
<string>Power Macintosh G4 (AGP Graphics)</string>
<key>PowerMac3,2</key>
<string>Power Macintosh G4 (AGP Graphics)</string>
<key>PowerMac3,3</key>
<string>Power Macintosh G4 (Gigabit Ethernet)</string>
<key>PowerMac3,4</key>
<string>Power Macintosh G4 (Digital Audio)</string>
<key>PowerMac3,5</key>
<string>Power Macintosh G4 (Quick Silver)</string>
<key>PowerMac3,6</key>
<string>Power Macintosh G4 (Mirrored Drive Door)</string>
<key>PowerMac4,1</key>
<string>iMac G3 (Early/Summer 2001)</string>
<key>PowerMac4,2</key>
<string>iMac G4 (Flat Panel)</string>
<key>PowerMac4,4</key>
<string>eMac</string>
<key>PowerMac4,5</key>
<string>iMac G4 (17-inch Flat Panel)</string>
<key>PowerMac5,1</key>
<string>Power Macintosh G4 Cube</string>
<key>PowerMac5,2</key>
<string>Power Mac G4 Cube</string>
<key>PowerMac6,1</key>
<string>iMac G4 (USB 2.0)</string>
<key>PowerMac6,3</key>
<string>iMac G4 (20-inch Flat Panel)</string>
<key>PowerMac6,4</key>
<string>eMac (USB 2.0, 2005)</string>
<key>PowerMac7,2</key>
<string>Power Macintosh G5</string>
<key>PowerMac7,3</key>
<string>Power Macintosh G5</string>
<key>PowerMac8,1</key>
<string>iMac G5</string>
<key>PowerMac8,2</key>
<string>iMac G5 (Ambient Light Sensor)</string>
<key>PowerMac9,1</key>
<string>Power Macintosh G5 (Late 2005)</string>
<key>PowerMac10,1</key>
<string>Mac Mini G4</string>
<key>PowerMac10,2</key>
<string>Mac Mini (Late 2005)</string>
<key>PowerMac11,2</key>
<string>Power Macintosh G5 (Late 2005)</string>
<key>PowerMac12,1</key>
<string>iMac G5 (iSight)</string>
<key>RackMac1,1</key>
<string>Xserve G4</string>
<key>RackMac1,2</key>
<string>Xserve G4 (slot-loading, cluster node)</string>
<key>RackMac3,1</key>
<string>Xserve G5</string>
<key>Xserve1,1</key>
<string>Xserve (Intel Xeon)</string>
<key>Xserve2,1</key>
<string>Xserve (January 2008 quad-core)</string>
<key>Xserve3,1</key>
<string>Xserve (early 2009)</string>
</dict>
</plist>
+3 -3
View File
@@ -16,7 +16,7 @@
</sparkle:fullReleaseNotesLink>
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
<enclosure url="https://you.com/app/Your%20Great%20App%202.0.zip" length="1623481" type="application/octet-stream" sparkle:edSignature="WVyVJpOx+a5+vNWJVY79TRjFKveNk+VhGJf2iti4CZtJsJewIUGvh/1AKKEAFbH1qUwx+vro1ECuzOsMmumoBA==" />
<sparkle:minimumSystemVersion>10.11</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>
</item>
<item>
@@ -31,7 +31,7 @@
</sparkle:fullReleaseNotesLink>
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
<enclosure url="https://you.com/app/Your%20Great%20App%201.5.zip" length="1472893" type="application/octet-stream" sparkle:edSignature="pNFd7KbcQSu+Mq7UYrbQXTPq82luht2ACXm/r2utp1u/Uv/5hWqctdT2jwQgMejW7DRoeV/hVr6J4VdZYdwWDw==" />
<sparkle:minimumSystemVersion>10.11</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>
</item>
<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. -->
@@ -48,7 +48,7 @@
<sparkle:shortVersionString>1.4</sparkle:shortVersionString>
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
<enclosure url="https://you.com/app/Your%20Great%20App%201.4.zip" sparkle:edSignature="Ody3D/ybSMH4T+P/oNj3LN4F0SA8RJGLEr1TI4UemrBAiJ9aEcDnYV3u58P75AbcFjI13jPYmHDUHXMSTFQbDw==" length="1472349" type="application/octet-stream" />
<sparkle:minimumSystemVersion>10.11</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "2.1.0"
s.version = "2.3.0"
s.summary = "A software update framework for macOS"
s.description = "Sparkle is an easy-to-use software update framework for macOS."
s.homepage = "https://sparkle-project.org"
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
'Andy Matuschak' => 'andy@andymatuschak.org',
}
s.platform = :osx, '10.11'
s.platform = :osx, '10.13'
s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.xz" }
s.source_files = 'Sparkle.framework/Versions/B/Headers/*.h'
+151 -62
View File
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {
/* Begin PBXAggregateTarget section */
@@ -85,7 +85,6 @@
61299A6009CA6EB100B7442F /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; };
61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; };
612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */; };
615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; };
6196CFF909C72148000DC222 /* SUStatusController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6196CFE309C71ADE000DC222 /* SUStatusController.h */; settings = {ATTRIBUTES = (); }; };
6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6196CFE409C71ADE000DC222 /* SUStatusController.m */; };
61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A2259C0D1C495D00430CCD /* SUVersionComparisonProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -107,10 +106,10 @@
61EF67560E25B58D00F754E0 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; };
61EF67590E25C5B400F754E0 /* SUHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 61EF67580E25C5B400F754E0 /* SUHost.h */; };
7202DC9A269ABD3500737EC4 /* testappcast_phasedRollout.xml in Resources */ = {isa = PBXBuildFile; fileRef = 7202DC99269ABD3500737EC4 /* testappcast_phasedRollout.xml */; };
72045CE026FEE535004F96E5 /* org.sparkle-project.Downloader.xpc in Copy XPC Services */ = {isa = PBXBuildFile; fileRef = 726E07EF1CAF37BD001A286B /* org.sparkle-project.Downloader.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
72045CE126FEE535004F96E5 /* org.sparkle-project.InstallerConnection.xpc in Copy XPC Services */ = {isa = PBXBuildFile; fileRef = 724BB36C1D31D0B7005D534A /* org.sparkle-project.InstallerConnection.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
72045CE226FEE535004F96E5 /* org.sparkle-project.InstallerLauncher.xpc in Copy XPC Services */ = {isa = PBXBuildFile; fileRef = 726E07AD1CAF08D6001A286B /* org.sparkle-project.InstallerLauncher.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
72045CE326FEE535004F96E5 /* org.sparkle-project.InstallerStatus.xpc in Copy XPC Services */ = {isa = PBXBuildFile; fileRef = 724BB3931D333832005D534A /* org.sparkle-project.InstallerStatus.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
72045CE026FEE535004F96E5 /* Downloader.xpc in Copy XPC Services */ = {isa = PBXBuildFile; fileRef = 726E07EF1CAF37BD001A286B /* Downloader.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
72045CE126FEE535004F96E5 /* InstallerConnection.xpc in Copy XPC Services */ = {isa = PBXBuildFile; fileRef = 724BB36C1D31D0B7005D534A /* InstallerConnection.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
72045CE226FEE535004F96E5 /* Installer.xpc in Copy XPC Services */ = {isa = PBXBuildFile; fileRef = 726E07AD1CAF08D6001A286B /* Installer.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
72045CE326FEE535004F96E5 /* InstallerStatus.xpc in Copy XPC Services */ = {isa = PBXBuildFile; fileRef = 724BB3931D333832005D534A /* InstallerStatus.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
720595EF1D700568000572E8 /* SUApplicationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 725602D41C83551C00DAA70E /* SUApplicationInfo.m */; };
7205C4411E13049400E370AE /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7205C4401E13049400E370AE /* main.swift */; };
7205C44C1E1304CE00E370AE /* Appcast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7205C4471E1304CE00E370AE /* Appcast.swift */; };
@@ -132,7 +131,6 @@
7205C4621E1306A600E370AE /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5711D3D895B00D1BF90 /* SUBinaryDeltaCommon.m */; };
7205C4631E1306B500E370AE /* libxar.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 726E07681CA616A4001A286B /* libxar.tbd */; };
7205C4641E1306BE00E370AE /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 726E076A1CA616B3001A286B /* libbz2.tbd */; };
720767D31E2EE9C200F9A850 /* SUTouchBarForwardDeclarations.h in Headers */ = {isa = PBXBuildFile; fileRef = 720767D21E2EE9C200F9A850 /* SUTouchBarForwardDeclarations.h */; };
720AC2A42618E85700E25A3E /* SPUInstallationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5B51D3D8AEE00D1BF90 /* SPUInstallationInfo.m */; };
720AC2C92618E89500E25A3E /* SUAppcastItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B5FC5409C5182000B25A18 /* SUAppcastItem.m */; };
720AC2DC2618E8A500E25A3E /* SPUSecureCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 726E075B1CA3A6D6001A286B /* SPUSecureCoding.m */; };
@@ -172,6 +170,7 @@
7229E1BA1C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7229E1B81C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m */; };
7229E1BD1C98EFF200CB50D0 /* SPUDownloadDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7229E1BB1C98EFF200CB50D0 /* SPUDownloadDriver.h */; };
7229E1BE1C98EFF200CB50D0 /* SPUDownloadDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7229E1BC1C98EFF200CB50D0 /* SPUDownloadDriver.m */; };
722C9539286EA68C0033908A /* SPUGentleUserDriverReminders.h in Headers */ = {isa = PBXBuildFile; fileRef = 722C9538286EA54A0033908A /* SPUGentleUserDriverReminders.h */; settings = {ATTRIBUTES = (Private, ); }; };
722FB7E5260EE53F00EB571C /* SUNormalization.m in Sources */ = {isa = PBXBuildFile; fileRef = 722FB7E4260EE53F00EB571C /* SUNormalization.m */; };
722FB7E6260EE53F00EB571C /* SUNormalization.m in Sources */ = {isa = PBXBuildFile; fileRef = 722FB7E4260EE53F00EB571C /* SUNormalization.m */; };
72316BD31E0DA8430039EFD9 /* SUUnarchiverNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 72316BD21E0DA8430039EFD9 /* SUUnarchiverNotifier.m */; };
@@ -339,9 +338,6 @@
728ED34C277DA23400D9238F /* SPUSparkleDeltaArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 728ED349277DA23400D9238F /* SPUSparkleDeltaArchive.m */; };
728ED34D277DA23400D9238F /* SPUSparkleDeltaArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 728ED349277DA23400D9238F /* SPUSparkleDeltaArchive.m */; };
729051E41DC82AC0003DEA7F /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; };
7293A1AE1CEE933800B957A7 /* SPUURLRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7293A1AC1CEE933800B957A7 /* SPUURLRequest.h */; };
7293A1AF1CEE933800B957A7 /* SPUURLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7293A1AD1CEE933800B957A7 /* SPUURLRequest.m */; };
7293A1B11CEE9B9F00B957A7 /* SPUURLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7293A1AD1CEE933800B957A7 /* SPUURLRequest.m */; };
729743AB279D1BD2009910B2 /* SUCodeSigningVerifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 7267E5991D3D8A5A00D1BF90 /* SUCodeSigningVerifier.m */; };
729924941DF4A45000DBCDF5 /* SUUpdateValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 729924931DF4A45000DBCDF5 /* SUUpdateValidator.m */; };
729F7EAC27366353004592DC /* test-links.xml in Resources */ = {isa = PBXBuildFile; fileRef = 729F7EAB27366353004592DC /* test-links.xml */; };
@@ -381,6 +377,7 @@
72BC6C3D275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg in Resources */ = {isa = PBXBuildFile; fileRef = 72BC6C3C275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg */; };
72BEBFEF1D7287570019146B /* SUSpotlightImporterTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72BEBFEE1D7287560019146B /* SUSpotlightImporterTest.swift */; };
72CCDEBE27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip in Resources */ = {isa = PBXBuildFile; fileRef = 72CCDEBD27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip */; };
72D60CD928C2BAE900189AB8 /* SPUStandardUserDriver+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 72D60CD828C2BA2100189AB8 /* SPUStandardUserDriver+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
72D954811CBACC35006F28BD /* InstallerProgressAppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954801CBACC35006F28BD /* InstallerProgressAppController.m */; };
72D954831CBAD34F006F28BD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954821CBAD34F006F28BD /* main.m */; };
72D954A21CBB415C006F28BD /* SPUCommandLineDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 72D954A11CBB415C006F28BD /* SPUCommandLineDriver.m */; };
@@ -467,6 +464,7 @@
EA1E287022B66621004AA304 /* SUSignatures.m in Sources */ = {isa = PBXBuildFile; fileRef = EA1E286D22B665E8004AA304 /* SUSignatures.m */; };
EA1E287922B666EB004AA304 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA1E287822B666EB004AA304 /* main.swift */; };
EA1E287E22B66705004AA304 /* libed25519.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA1E282D22B660BE004AA304 /* libed25519.a */; };
F6D399512814387000A8C0DA /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6D399502814387000A8C0DA /* UniformTypeIdentifiers.framework */; };
F8761EB11ADC5068000C9034 /* SUCodeSigningVerifierTest.m in Sources */ = {isa = PBXBuildFile; fileRef = F8761EB01ADC5068000C9034 /* SUCodeSigningVerifierTest.m */; };
F8761EB31ADC50EB000C9034 /* SparkleTestCodeSignApp.zip in Resources */ = {isa = PBXBuildFile; fileRef = F8761EB21ADC50EB000C9034 /* SparkleTestCodeSignApp.zip */; };
FA30773D24CBC295007BA37D /* testlocalizedreleasenotesappcast.xml in Resources */ = {isa = PBXBuildFile; fileRef = FA30773C24CBC295007BA37D /* testlocalizedreleasenotesappcast.xml */; };
@@ -656,6 +654,55 @@
remoteGlobalIDString = 72B398D11D3D879300EE297F;
remoteInfo = Autoupdate;
};
72CCCC14287B3D1900E7156B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = Sparkle;
};
72CCCC16287B3D3400E7156B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = EA1E280E22B64522004AA304;
remoteInfo = bsdiff;
};
72CCCC18287B3D3D00E7156B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = EA1E282C22B660BE004AA304;
remoteInfo = ed25519;
};
72CCCC1A287B3D9000E7156B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = EA1E282C22B660BE004AA304;
remoteInfo = ed25519;
};
72CCCC1C287B3D9600E7156B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = EA1E282C22B660BE004AA304;
remoteInfo = ed25519;
};
72CCCC1E287B3DA100E7156B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = EA1E282C22B660BE004AA304;
remoteInfo = ed25519;
};
72CCCC20287B3DA400E7156B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = EA1E280E22B64522004AA304;
remoteInfo = bsdiff;
};
72D954B91CBB6E27006F28BD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -748,10 +795,10 @@
dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices";
dstSubfolderSpec = 16;
files = (
72045CE026FEE535004F96E5 /* org.sparkle-project.Downloader.xpc in Copy XPC Services */,
72045CE126FEE535004F96E5 /* org.sparkle-project.InstallerConnection.xpc in Copy XPC Services */,
72045CE226FEE535004F96E5 /* org.sparkle-project.InstallerLauncher.xpc in Copy XPC Services */,
72045CE326FEE535004F96E5 /* org.sparkle-project.InstallerStatus.xpc in Copy XPC Services */,
72045CE026FEE535004F96E5 /* Downloader.xpc in Copy XPC Services */,
72045CE126FEE535004F96E5 /* InstallerConnection.xpc in Copy XPC Services */,
72045CE226FEE535004F96E5 /* Installer.xpc in Copy XPC Services */,
72045CE326FEE535004F96E5 /* InstallerStatus.xpc in Copy XPC Services */,
);
name = "Copy XPC Services";
runOnlyForDeploymentPostprocessing = 0;
@@ -918,8 +965,7 @@
612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionPrompt.m; sourceTree = "<group>"; };
613151B20FB4946A000DCD59 /* is */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Sparkle.strings; sourceTree = "<group>"; };
615409C4103BBC4000125AF1 /* cs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Sparkle.strings; sourceTree = "<group>"; };
615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SUModelTranslation.plist; sourceTree = "<group>"; };
6186554310D7484E00B1E074 /* pt_PT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Sparkle.strings; sourceTree = "<group>"; };
6186554310D7484E00B1E074 /* pt-PT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Sparkle.strings"; sourceTree = "<group>"; };
618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = "<group>"; };
6195D4920E404AD700D41A50 /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Sparkle.strings; sourceTree = "<group>"; };
6196CFE309C71ADE000DC222 /* SUStatusController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusController.h; sourceTree = "<group>"; };
@@ -948,7 +994,7 @@
61B5FCA109C5228F00B25A18 /* SUUpdateAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdateAlert.m; sourceTree = "<group>"; };
61BA66CC14BDFA0400D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/Sparkle.strings; sourceTree = "<group>"; };
61C268090E2DB5D000175E6C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; };
61E31A80103299500051D188 /* pt_BR */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pt_BR; path = pt_BR.lproj/Sparkle.strings; sourceTree = "<group>"; };
61E31A80103299500051D188 /* pt-BR */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Sparkle.strings"; sourceTree = "<group>"; };
61EF67550E25B58D00F754E0 /* SUHost.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUHost.m; sourceTree = "<group>"; };
61EF67580E25C5B400F754E0 /* SUHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUHost.h; sourceTree = "<group>"; };
61F3AC1215C22D4A00260CA2 /* th */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = th; path = th.lproj/Sparkle.strings; sourceTree = "<group>"; };
@@ -970,7 +1016,6 @@
7205C46E1E13254500E370AE /* ConfigUITestDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITestDebug.xcconfig; sourceTree = "<group>"; };
7205C46F1E13255900E370AE /* ConfigUITestRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigUITestRelease.xcconfig; sourceTree = "<group>"; };
720767D11E2EB86200F9A850 /* AppKitPrevention.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitPrevention.h; sourceTree = "<group>"; };
720767D21E2EE9C200F9A850 /* SUTouchBarForwardDeclarations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUTouchBarForwardDeclarations.h; sourceTree = "<group>"; };
720B16421C66433D006985FB /* UITests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "UITests-Info.plist"; path = "UITests/UITests-Info.plist"; sourceTree = SOURCE_ROOT; };
720B16431C66433D006985FB /* SUTestApplicationTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SUTestApplicationTest.swift; path = UITests/SUTestApplicationTest.swift; sourceTree = SOURCE_ROOT; };
720B4C2325EBFAFD005A0592 /* link-tools.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "link-tools.sh"; sourceTree = "<group>"; };
@@ -1014,6 +1059,7 @@
7229E1B81C97CC4D00CB50D0 /* SPUScheduledUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUScheduledUpdateDriver.m; sourceTree = "<group>"; };
7229E1BB1C98EFF200CB50D0 /* SPUDownloadDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUDownloadDriver.h; sourceTree = "<group>"; };
7229E1BC1C98EFF200CB50D0 /* SPUDownloadDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUDownloadDriver.m; sourceTree = "<group>"; };
722C9538286EA54A0033908A /* SPUGentleUserDriverReminders.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPUGentleUserDriverReminders.h; sourceTree = "<group>"; };
722FB7CA1DD69897001D40CE /* ConfigSwift.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigSwift.xcconfig; sourceTree = "<group>"; };
722FB7E3260EE53F00EB571C /* SUNormalization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUNormalization.h; sourceTree = "<group>"; };
722FB7E4260EE53F00EB571C /* SUNormalization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUNormalization.m; sourceTree = "<group>"; };
@@ -1040,8 +1086,8 @@
723ABD5C259A9C3B00BDB4FA /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
723ABD5D259A9C3D00BDB4FA /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
723ABD5E259A9C4000BDB4FA /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
723ABD5F259A9C4900BDB4FA /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_BR; path = pt_BR.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
723ABD60259A9C4B00BDB4FA /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
723ABD5F259A9C4900BDB4FA /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/SUUpdateAlert.strings"; sourceTree = "<group>"; };
723ABD60259A9C4B00BDB4FA /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/SUUpdateAlert.strings"; sourceTree = "<group>"; };
723ABD61259A9C5400BDB4FA /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
723ABD62259A9C5700BDB4FA /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
723ABD63259A9C5900BDB4FA /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
@@ -1070,8 +1116,8 @@
723ABD93259A9D3C00BDB4FA /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
723ABD94259A9D3E00BDB4FA /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
723ABD95259A9D4100BDB4FA /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
723ABD96259A9D4600BDB4FA /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_BR; path = pt_BR.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
723ABD97259A9D4900BDB4FA /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
723ABD96259A9D4600BDB4FA /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/SUUpdatePermissionPrompt.strings"; sourceTree = "<group>"; };
723ABD97259A9D4900BDB4FA /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/SUUpdatePermissionPrompt.strings"; sourceTree = "<group>"; };
723ABD98259A9D4C00BDB4FA /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
723ABD99259A9D4F00BDB4FA /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
723ABD9A259A9D5200BDB4FA /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
@@ -1103,8 +1149,8 @@
723ABE2A259A9F0600BDB4FA /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/MainMenu.strings; sourceTree = "<group>"; };
723ABE2B259A9F0800BDB4FA /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/MainMenu.strings; sourceTree = "<group>"; };
723ABE2C259A9F0B00BDB4FA /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/MainMenu.strings; sourceTree = "<group>"; };
723ABE2D259A9F0F00BDB4FA /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_BR; path = pt_BR.lproj/MainMenu.strings; sourceTree = "<group>"; };
723ABE2E259A9F1100BDB4FA /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/MainMenu.strings; sourceTree = "<group>"; };
723ABE2D259A9F0F00BDB4FA /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/MainMenu.strings"; sourceTree = "<group>"; };
723ABE2E259A9F1100BDB4FA /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/MainMenu.strings"; sourceTree = "<group>"; };
723ABE2F259A9F1400BDB4FA /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/MainMenu.strings; sourceTree = "<group>"; };
723ABE30259A9F1700BDB4FA /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/MainMenu.strings; sourceTree = "<group>"; };
723ABE31259A9F1A00BDB4FA /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/MainMenu.strings; sourceTree = "<group>"; };
@@ -1132,7 +1178,7 @@
723EDC3E26885A8E000BCBA4 /* testappcast_channels.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast_channels.xml; sourceTree = "<group>"; };
7246E0A11C83B685003B4E75 /* SPUStandardUpdaterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUStandardUpdaterController.h; sourceTree = "<group>"; };
7246E0A21C83B685003B4E75 /* SPUStandardUpdaterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUStandardUpdaterController.m; sourceTree = "<group>"; };
724BB36C1D31D0B7005D534A /* org.sparkle-project.InstallerConnection.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = "org.sparkle-project.InstallerConnection.xpc"; sourceTree = BUILT_PRODUCTS_DIR; };
724BB36C1D31D0B7005D534A /* InstallerConnection.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = InstallerConnection.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
724BB36E1D31D0B7005D534A /* SUInstallerConnectionProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerConnectionProtocol.h; sourceTree = "<group>"; };
724BB36F1D31D0B7005D534A /* SUInstallerConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerConnection.h; sourceTree = "<group>"; };
724BB3701D31D0B7005D534A /* SUInstallerConnection.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUInstallerConnection.m; sourceTree = "<group>"; };
@@ -1143,7 +1189,7 @@
724BB3801D31F186005D534A /* SUInstallerCommunicationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerCommunicationProtocol.h; sourceTree = "<group>"; };
724BB3851D32A167005D534A /* SUXPCInstallerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUXPCInstallerConnection.h; sourceTree = "<group>"; };
724BB3861D32A167005D534A /* SUXPCInstallerConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUXPCInstallerConnection.m; sourceTree = "<group>"; };
724BB3931D333832005D534A /* org.sparkle-project.InstallerStatus.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = "org.sparkle-project.InstallerStatus.xpc"; sourceTree = BUILT_PRODUCTS_DIR; };
724BB3931D333832005D534A /* InstallerStatus.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = InstallerStatus.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
724BB3951D333832005D534A /* SUInstallerStatusProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerStatusProtocol.h; sourceTree = "<group>"; };
724BB3961D333832005D534A /* SUInstallerStatus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerStatus.h; sourceTree = "<group>"; };
724BB3971D333832005D534A /* SUInstallerStatus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUInstallerStatus.m; sourceTree = "<group>"; };
@@ -1238,14 +1284,14 @@
726E076A1CA616B3001A286B /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
726E078B1CA891E9001A286B /* SPUUpdaterSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUUpdaterSettings.h; sourceTree = "<group>"; };
726E078C1CA891E9001A286B /* SPUUpdaterSettings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUUpdaterSettings.m; sourceTree = "<group>"; };
726E07AD1CAF08D6001A286B /* org.sparkle-project.InstallerLauncher.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = "org.sparkle-project.InstallerLauncher.xpc"; sourceTree = BUILT_PRODUCTS_DIR; };
726E07AD1CAF08D6001A286B /* Installer.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = Installer.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
726E07AF1CAF08D6001A286B /* SUInstallerLauncherProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerLauncherProtocol.h; sourceTree = "<group>"; };
726E07B01CAF08D6001A286B /* SUInstallerLauncher.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SUInstallerLauncher.h; sourceTree = "<group>"; };
726E07B11CAF08D6001A286B /* SUInstallerLauncher.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUInstallerLauncher.m; sourceTree = "<group>"; };
726E07B31CAF08D6001A286B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
726E07B51CAF08D6001A286B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
726E07C11CAF1E79001A286B /* ConfigInstallerLauncher.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigInstallerLauncher.xcconfig; sourceTree = "<group>"; };
726E07EF1CAF37BD001A286B /* org.sparkle-project.Downloader.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = "org.sparkle-project.Downloader.xpc"; sourceTree = BUILT_PRODUCTS_DIR; };
726E07EF1CAF37BD001A286B /* Downloader.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = Downloader.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
726E4A111C86C44A00C57C6A /* Sparkle-Test-App.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Sparkle-Test-App.entitlements"; sourceTree = "<group>"; };
726E4A161C86C88F00C57C6A /* TestAppHelper.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = TestAppHelper.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
726E4A181C86C88F00C57C6A /* TestAppHelperProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestAppHelperProtocol.h; sourceTree = "<group>"; };
@@ -1266,8 +1312,6 @@
728638EE1CAF589C00783084 /* ConfigDownloader.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigDownloader.xcconfig; sourceTree = "<group>"; };
728ED348277DA23400D9238F /* SPUSparkleDeltaArchive.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SPUSparkleDeltaArchive.h; path = Autoupdate/SPUSparkleDeltaArchive.h; sourceTree = SOURCE_ROOT; };
728ED349277DA23400D9238F /* SPUSparkleDeltaArchive.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SPUSparkleDeltaArchive.m; path = Autoupdate/SPUSparkleDeltaArchive.m; sourceTree = SOURCE_ROOT; };
7293A1AC1CEE933800B957A7 /* SPUURLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUURLRequest.h; sourceTree = "<group>"; };
7293A1AD1CEE933800B957A7 /* SPUURLRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUURLRequest.m; sourceTree = "<group>"; };
729924921DF4A45000DBCDF5 /* SUUpdateValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUUpdateValidator.h; path = Sparkle/SUUpdateValidator.h; sourceTree = SOURCE_ROOT; };
729924931DF4A45000DBCDF5 /* SUUpdateValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUpdateValidator.m; path = Sparkle/SUUpdateValidator.m; sourceTree = SOURCE_ROOT; };
729BB3D11D503826007C4276 /* org.sparkle-project.Downloader.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "org.sparkle-project.Downloader.entitlements"; path = "Downloader/org.sparkle-project.Downloader.entitlements"; sourceTree = SOURCE_ROOT; };
@@ -1313,6 +1357,7 @@
72BC6C3C275027BF0083F14B /* SparkleTestCodeSign_apfs.dmg */ = {isa = PBXFileReference; lastKnownFileType = file; path = SparkleTestCodeSign_apfs.dmg; sourceTree = "<group>"; };
72BEBFEE1D7287560019146B /* SUSpotlightImporterTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUSpotlightImporterTest.swift; sourceTree = "<group>"; };
72CCDEBD27421FD500B53718 /* SparkleTestCodeSignApp_bad_header.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = SparkleTestCodeSignApp_bad_header.zip; sourceTree = "<group>"; };
72D60CD828C2BA2100189AB8 /* SPUStandardUserDriver+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SPUStandardUserDriver+Private.h"; sourceTree = "<group>"; };
72D9547F1CBACC35006F28BD /* InstallerProgressAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstallerProgressAppController.h; path = Sparkle/InstallerProgress/InstallerProgressAppController.h; sourceTree = SOURCE_ROOT; };
72D954801CBACC35006F28BD /* InstallerProgressAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InstallerProgressAppController.m; path = Sparkle/InstallerProgress/InstallerProgressAppController.m; sourceTree = SOURCE_ROOT; };
72D954821CBAD34F006F28BD /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Sparkle/InstallerProgress/main.m; sourceTree = SOURCE_ROOT; };
@@ -1401,6 +1446,10 @@
EA1E287622B666EB004AA304 /* sign_update */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = sign_update; sourceTree = BUILT_PRODUCTS_DIR; };
EA1E287822B666EB004AA304 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
EA1E287F22B667D8004AA304 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
F67C9B7B281410B600740813 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Sparkle.strings; sourceTree = "<group>"; };
F67C9B7C281410B600740813 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
F6D399502814387000A8C0DA /* UniformTypeIdentifiers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UniformTypeIdentifiers.framework; path = System/Library/Frameworks/UniformTypeIdentifiers.framework; sourceTree = SDKROOT; };
F6E11510281410D10003736C /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Sparkle.strings; sourceTree = "<group>"; };
F8761EB01ADC5068000C9034 /* SUCodeSigningVerifierTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUCodeSigningVerifierTest.m; sourceTree = "<group>"; };
F8761EB21ADC50EB000C9034 /* SparkleTestCodeSignApp.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = SparkleTestCodeSignApp.zip; sourceTree = "<group>"; };
FA1941CA0D94A70100DD942E /* ConfigFrameworkDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ConfigFrameworkDebug.xcconfig; sourceTree = "<group>"; };
@@ -1480,6 +1529,7 @@
files = (
721C245A1CB75756005440CB /* Cocoa.framework in Frameworks */,
724BB3B71D35ABA8005D534A /* Security.framework in Frameworks */,
F6D399512814387000A8C0DA /* UniformTypeIdentifiers.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1593,10 +1643,10 @@
72B398D21D3D879300EE297F /* Autoupdate */,
5D06E8D00FD68C7C005AE3F6 /* BinaryDelta */,
7205C43E1E13049400E370AE /* generate_appcast */,
726E07EF1CAF37BD001A286B /* org.sparkle-project.Downloader.xpc */,
724BB36C1D31D0B7005D534A /* org.sparkle-project.InstallerConnection.xpc */,
726E07AD1CAF08D6001A286B /* org.sparkle-project.InstallerLauncher.xpc */,
724BB3931D333832005D534A /* org.sparkle-project.InstallerStatus.xpc */,
726E07EF1CAF37BD001A286B /* Downloader.xpc */,
724BB36C1D31D0B7005D534A /* InstallerConnection.xpc */,
726E07AD1CAF08D6001A286B /* Installer.xpc */,
724BB3931D333832005D534A /* InstallerStatus.xpc */,
61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */,
612279D90DB5470200AB99EA /* Sparkle Unit Tests.xctest */,
72D9549E1CBB415B006F28BD /* sparkle.app */,
@@ -1655,6 +1705,7 @@
7267E5CF1D3D8C8500D1BF90 /* SecurityFoundation.framework */,
724BB3B51D35AAC3005D534A /* ServiceManagement.framework */,
55C14F31136EFC2400649790 /* SystemConfiguration.framework */,
F6D399502814387000A8C0DA /* UniformTypeIdentifiers.framework */,
61B5FC3F09C4FD4000B25A18 /* WebKit.framework */,
14732BD219610A1800593899 /* XCTest.framework */,
);
@@ -1715,7 +1766,6 @@
1420DF4F196247F900203BB0 /* Images.xcassets */,
14732BBC1960EFB500593899 /* README.markdown */,
14732BB91960EEEE00593899 /* SampleAppcast.xml */,
615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */,
1EAA4C8A2132C7BF00604473 /* ReleaseNotesColorStyle.css */,
);
path = Resources;
@@ -1875,8 +1925,6 @@
721AB11626C777D900D34A86 /* SPUDownloadDataPrivate.h */,
72F9EC431D5E9ED8004AC8B6 /* SPUDownloadData.m */,
7214B8851D45AD9A00CB5CED /* SPUInstallationType.h */,
7293A1AC1CEE933800B957A7 /* SPUURLRequest.h */,
7293A1AD1CEE933800B957A7 /* SPUURLRequest.m */,
61B5FB9409C4F04600B25A18 /* SUAppcast.h */,
725DED72263D10C400E7FA8F /* SUAppcast+Private.h */,
61B5FB9509C4F04600B25A18 /* SUAppcast.m */,
@@ -1912,7 +1960,6 @@
723AC036259DBF1B00BDB4FA /* Web View */,
612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */,
612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */,
720767D21E2EE9C200F9A850 /* SUTouchBarForwardDeclarations.h */,
723C8A521E2D60DB00C14942 /* SUTouchBarButtonGroup.h */,
723C8A531E2D60DB00C14942 /* SUTouchBarButtonGroup.m */,
3772FEA813DE0B6B00F79537 /* SUVersionDisplayProtocol.h */,
@@ -2160,8 +2207,10 @@
7246E0A11C83B685003B4E75 /* SPUStandardUpdaterController.h */,
7246E0A21C83B685003B4E75 /* SPUStandardUpdaterController.m */,
725CB9581C7121830064365A /* SPUStandardUserDriver.h */,
72D60CD828C2BA2100189AB8 /* SPUStandardUserDriver+Private.h */,
725CB9591C7121830064365A /* SPUStandardUserDriver.m */,
726E4A361C89116000C57C6A /* SPUStandardUserDriverDelegate.h */,
722C9538286EA54A0033908A /* SPUGentleUserDriverReminders.h */,
726DF88D1C84277500188804 /* SPUUserUpdateState.h */,
7269E49C2648FC6C0088C213 /* SPUUserUpdateState+Private.h */,
7269E4992648F7C00088C213 /* SPUUserUpdateState.m */,
@@ -2311,7 +2360,7 @@
EA1E284422B660ED004AA304 /* ge.h */,
);
name = ed25519;
path = ed25519/src;
path = "ed25519-sparkle/src";
sourceTree = "<group>";
};
EA1E285F22B66487004AA304 /* generate_keys */ = {
@@ -2436,6 +2485,8 @@
7246E0A31C83B685003B4E75 /* SPUStandardUpdaterController.h in Headers */,
725CB95A1C7121830064365A /* SPUStandardUserDriver.h in Headers */,
726E4A371C89116000C57C6A /* SPUStandardUserDriverDelegate.h in Headers */,
72D60CD928C2BAE900189AB8 /* SPUStandardUserDriver+Private.h in Headers */,
722C9539286EA68C0033908A /* SPUGentleUserDriverReminders.h in Headers */,
729F7EAF273F1840004592DC /* SPUUserAgent+Private.h in Headers */,
72EE17FC26D1CC9D00C58B19 /* SPUInstallationType.h in Headers */,
72EF30BE2675CF38008CE987 /* SPUAppcastItemStateResolver.h in Headers */,
@@ -2453,7 +2504,6 @@
72F9EC3F1D5E823F004AC8B6 /* SPUUpdaterTimer.h in Headers */,
7269E494264798200088C213 /* SPUSkippedUpdate.h in Headers */,
723ABFC4259D4CB300BDB4FA /* SUWKWebView.h in Headers */,
7293A1AE1CEE933800B957A7 /* SPUURLRequest.h in Headers */,
725CB9571C7120410064365A /* SPUUserDriver.h in Headers */,
72B767DE1C9CDB9700A07552 /* SPUUserInitiatedUpdateDriver.h in Headers */,
72F94F581CC44DE1002DEE68 /* SPUXPCServiceInfo.h in Headers */,
@@ -2462,7 +2512,6 @@
61B5FC7009C51F4A00B25A18 /* SUAppcastItem.h in Headers */,
725602D51C83551C00DAA70E /* SUApplicationInfo.h in Headers */,
7214B8811D456A8500CB5CED /* SUBundleIcon.h in Headers */,
720767D31E2EE9C200F9A850 /* SUTouchBarForwardDeclarations.h in Headers */,
55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */,
14652F8419A978C200959E44 /* SUExport.h in Headers */,
7267E5E51D3D90AA00D1BF90 /* SUFileManager.h in Headers */,
@@ -2576,6 +2625,8 @@
buildRules = (
);
dependencies = (
72CCCC19287B3D3D00E7156B /* PBXTargetDependency */,
72CCCC17287B3D3400E7156B /* PBXTargetDependency */,
61B5F91C09C4CF7200B25A18 /* PBXTargetDependency */,
726E4A201C86C88F00C57C6A /* PBXTargetDependency */,
);
@@ -2595,6 +2646,8 @@
buildRules = (
);
dependencies = (
72CCCC21287B3DA400E7156B /* PBXTargetDependency */,
72CCCC1F287B3DA100E7156B /* PBXTargetDependency */,
);
name = generate_appcast;
packageProductDependencies = (
@@ -2635,7 +2688,7 @@
);
name = SparkleInstallerConnection;
productName = InstallerConnection;
productReference = 724BB36C1D31D0B7005D534A /* org.sparkle-project.InstallerConnection.xpc */;
productReference = 724BB36C1D31D0B7005D534A /* InstallerConnection.xpc */;
productType = "com.apple.product-type.xpc-service";
};
724BB3921D333832005D534A /* SparkleInstallerStatus */ = {
@@ -2652,7 +2705,7 @@
);
name = SparkleInstallerStatus;
productName = InstallerStatus;
productReference = 724BB3931D333832005D534A /* org.sparkle-project.InstallerStatus.xpc */;
productReference = 724BB3931D333832005D534A /* InstallerStatus.xpc */;
productType = "com.apple.product-type.xpc-service";
};
726B2B5C1C645FC900388755 /* UI Tests */ = {
@@ -2686,7 +2739,7 @@
);
name = SparkleInstallerLauncher;
productName = InstallerLauncher;
productReference = 726E07AD1CAF08D6001A286B /* org.sparkle-project.InstallerLauncher.xpc */;
productReference = 726E07AD1CAF08D6001A286B /* Installer.xpc */;
productType = "com.apple.product-type.xpc-service";
};
726E07EE1CAF37BD001A286B /* SparkleDownloader */ = {
@@ -2703,7 +2756,7 @@
);
name = SparkleDownloader;
productName = UpdateDownloader;
productReference = 726E07EF1CAF37BD001A286B /* org.sparkle-project.Downloader.xpc */;
productReference = 726E07EF1CAF37BD001A286B /* Downloader.xpc */;
productType = "com.apple.product-type.xpc-service";
};
726E4A151C86C88F00C57C6A /* TestAppHelper */ = {
@@ -2717,6 +2770,7 @@
buildRules = (
);
dependencies = (
72CCCC15287B3D1900E7156B /* PBXTargetDependency */,
);
name = TestAppHelper;
productName = TestAppHelper;
@@ -2835,6 +2889,7 @@
buildRules = (
);
dependencies = (
72CCCC1B287B3D9000E7156B /* PBXTargetDependency */,
);
name = generate_keys;
packageProductDependencies = (
@@ -2855,6 +2910,7 @@
buildRules = (
);
dependencies = (
72CCCC1D287B3D9600E7156B /* PBXTargetDependency */,
);
name = sign_update;
packageProductDependencies = (
@@ -2872,7 +2928,7 @@
attributes = {
CLASSPREFIX = SU;
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1400;
ORGANIZATIONNAME = "Sparkle Project";
TargetAttributes = {
5D06E8CF0FD68C7C005AE3F6 = {
@@ -2973,7 +3029,6 @@
ja,
ko,
nl,
no,
pl,
ru,
sk,
@@ -2981,9 +3036,6 @@
th,
tr,
zh_CN,
fr_ca,
pt_BR,
pt_PT,
pt,
ro,
sl,
@@ -2997,7 +3049,6 @@
"pt-PT",
"pt-BR",
Base,
fr_CA,
hr,
fa,
);
@@ -3139,7 +3190,6 @@
61AAE8280A321A7F00D8810D /* Sparkle.strings in Resources */,
1EAA4C8B2132C7BF00604473 /* ReleaseNotesColorStyle.css in Resources */,
723ABD38259A9BA500BDB4FA /* SUUpdateAlert.xib in Resources */,
615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */,
55C14BEF136EF21700649790 /* SUStatus.xib in Resources */,
723ABD6C259A9CBC00BDB4FA /* SUUpdatePermissionPrompt.xib in Resources */,
);
@@ -3150,6 +3200,7 @@
/* Begin PBXShellScriptBuildPhase section */
6131B1910DDCDE32005215F0 /* Run Script: Set Git Version Info */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 12;
files = (
);
@@ -3165,6 +3216,7 @@
};
72045CE626FEE8CC004F96E5 /* Strip XPC Services */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -3183,6 +3235,7 @@
};
720B4C2125EBFAA5005A0592 /* Run Script: Link Tools */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -3411,7 +3464,6 @@
72E539121D68C3FA0092CE5E /* SPUDownloadData.m in Sources */,
723B5DA91CF7AB0100365F95 /* SPUDownloader.m in Sources */,
721BC2101D1CDE55002BC71E /* SPULocalCacheDirectory.m in Sources */,
7293A1B11CEE9B9F00B957A7 /* SPUURLRequest.m in Sources */,
728638ED1CAF50CE00783084 /* SUConstants.m in Sources */,
721D8A871D4C5BF10032E472 /* SULog.m in Sources */,
);
@@ -3518,7 +3570,6 @@
726E078E1CA891E9001A286B /* SPUUpdaterSettings.m in Sources */,
721D588F25BE59F900D23BEA /* SUPhasedUpdateGroupInfo.m in Sources */,
72F9EC401D5E823F004AC8B6 /* SPUUpdaterTimer.m in Sources */,
7293A1AF1CEE933800B957A7 /* SPUURLRequest.m in Sources */,
72B767DF1C9CDB9700A07552 /* SPUUserInitiatedUpdateDriver.m in Sources */,
72F94F591CC44DE1002DEE68 /* SPUXPCServiceInfo.m in Sources */,
61B5FBB709C4FAFF00B25A18 /* SUAppcast.m in Sources */,
@@ -3731,6 +3782,41 @@
target = 72B398D11D3D879300EE297F /* Autoupdate */;
targetProxy = 72A5D5AB1D6929260009E5AC /* PBXContainerItemProxy */;
};
72CCCC15287B3D1900E7156B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8DC2EF4F0486A6940098B216 /* Sparkle */;
targetProxy = 72CCCC14287B3D1900E7156B /* PBXContainerItemProxy */;
};
72CCCC17287B3D3400E7156B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = EA1E280E22B64522004AA304 /* bsdiff */;
targetProxy = 72CCCC16287B3D3400E7156B /* PBXContainerItemProxy */;
};
72CCCC19287B3D3D00E7156B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = EA1E282C22B660BE004AA304 /* ed25519 */;
targetProxy = 72CCCC18287B3D3D00E7156B /* PBXContainerItemProxy */;
};
72CCCC1B287B3D9000E7156B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = EA1E282C22B660BE004AA304 /* ed25519 */;
targetProxy = 72CCCC1A287B3D9000E7156B /* PBXContainerItemProxy */;
};
72CCCC1D287B3D9600E7156B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = EA1E282C22B660BE004AA304 /* ed25519 */;
targetProxy = 72CCCC1C287B3D9600E7156B /* PBXContainerItemProxy */;
};
72CCCC1F287B3DA100E7156B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = EA1E282C22B660BE004AA304 /* ed25519 */;
targetProxy = 72CCCC1E287B3DA100E7156B /* PBXContainerItemProxy */;
};
72CCCC21287B3DA400E7156B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = EA1E280E22B64522004AA304 /* bsdiff */;
targetProxy = 72CCCC20287B3DA400E7156B /* PBXContainerItemProxy */;
};
72D954BA1CBB6E27006F28BD /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 721C24441CB753E6005440CB /* Installer Progress */;
@@ -3788,8 +3874,8 @@
4607BEA21948443800EF8DA4 /* nb */,
61AAE8710A321F7700D8810D /* nl */,
611A904210240DD300CC659E /* pl */,
61E31A80103299500051D188 /* pt_BR */,
6186554310D7484E00B1E074 /* pt_PT */,
61E31A80103299500051D188 /* pt-BR */,
6186554310D7484E00B1E074 /* pt-PT */,
004A8652192A492B00C9730D /* ro */,
6195D4920E404AD700D41A50 /* ru */,
FE5536F617A2C6AB007CB333 /* sk */,
@@ -3803,6 +3889,8 @@
723ABCD7259A9A9D00BDB4FA /* Base */,
72E1DACB25B3E8DF0001BA6D /* hr */,
726FD2CC25F4BE5F00123BC6 /* fa */,
F67C9B7B281410B600740813 /* hu */,
F6E11510281410D10003736C /* ar */,
);
name = Sparkle.strings;
sourceTree = "<group>";
@@ -3830,8 +3918,8 @@
723ABD5C259A9C3B00BDB4FA /* ko */,
723ABD5D259A9C3D00BDB4FA /* nb */,
723ABD5E259A9C4000BDB4FA /* pl */,
723ABD5F259A9C4900BDB4FA /* pt_BR */,
723ABD60259A9C4B00BDB4FA /* pt_PT */,
723ABD5F259A9C4900BDB4FA /* pt-BR */,
723ABD60259A9C4B00BDB4FA /* pt-PT */,
723ABD61259A9C5400BDB4FA /* ro */,
723ABD62259A9C5700BDB4FA /* ru */,
723ABD63259A9C5900BDB4FA /* sk */,
@@ -3842,6 +3930,7 @@
723ABD68259A9C6300BDB4FA /* tr */,
723ABD69259A9C6600BDB4FA /* uk */,
72E1DAB625B3E8AE0001BA6D /* hr */,
F67C9B7C281410B600740813 /* hu */,
);
name = SUUpdateAlert.xib;
sourceTree = "<group>";
@@ -3868,8 +3957,8 @@
723ABD93259A9D3C00BDB4FA /* ko */,
723ABD94259A9D3E00BDB4FA /* nb */,
723ABD95259A9D4100BDB4FA /* pl */,
723ABD96259A9D4600BDB4FA /* pt_BR */,
723ABD97259A9D4900BDB4FA /* pt_PT */,
723ABD96259A9D4600BDB4FA /* pt-BR */,
723ABD97259A9D4900BDB4FA /* pt-PT */,
723ABD98259A9D4C00BDB4FA /* ro */,
723ABD99259A9D4F00BDB4FA /* ru */,
723ABD9A259A9D5200BDB4FA /* sk */,
@@ -3916,8 +4005,8 @@
723ABE2A259A9F0600BDB4FA /* ko */,
723ABE2B259A9F0800BDB4FA /* nb */,
723ABE2C259A9F0B00BDB4FA /* pl */,
723ABE2D259A9F0F00BDB4FA /* pt_BR */,
723ABE2E259A9F1100BDB4FA /* pt_PT */,
723ABE2D259A9F0F00BDB4FA /* pt-BR */,
723ABE2E259A9F1100BDB4FA /* pt-PT */,
723ABE2F259A9F1400BDB4FA /* ro */,
723ABE30259A9F1700BDB4FA /* ru */,
723ABE31259A9F1A00BDB4FA /* sk */,
@@ -1,16 +1,14 @@
{
"object": {
"pins": [
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
"state": {
"branch": null,
"revision": "83b23d940471b313427da226196661856f6ba3e0",
"version": "0.4.4"
}
"pins" : [
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "83b23d940471b313427da226196661856f6ba3e0",
"version" : "0.4.4"
}
]
},
"version": 1
}
],
"version" : 2
}
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
@@ -52,6 +52,13 @@
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "TEST_MODE"
value = "DELTA"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1400"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
+3 -3
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21208.1" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="18122"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21208.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -20,7 +20,7 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowCollectionBehavior key="collectionBehavior" fullScreenAuxiliary="YES"/>
<windowPositionMask key="initialPositionMask" topStrut="YES" bottomStrut="YES"/>
+81 -81
View File
@@ -1,152 +1,152 @@
/* Description text for SUUpdateAlert when the critical update has already been downloaded and ready to install. */
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?";
/* Description text for SUUpdateAlert when the update has already been downloaded and ready to install. */
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?";
"%1$@ can't be updated, because it was opened from a read-only or a temporary location." = "%1$@ can't be updated, because it was opened from a read-only or a temporary location.";
/* No comment provided by engineer. */
"%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@." = "%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@.";
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.";
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "Quit %1$@, move it into your Applications folder, relaunch it from there and try again.";
/* No comment provided by engineer. */
"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required." = "%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required.";
/* No comment provided by engineer. */
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ can’t be updated if it’s running from the location it was downloaded to.";
/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ can’t be updated, because it was opened from a read-only or a temporary location.";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ is currently the newest version available.\n(You are currently running version %3$@.)";
/* No comment provided by engineer. */
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ is currently the newest version available.\n(You are currently running version %3$@.)";
"An error occurred while running the updater. Please try again later." = "An error occurred while running the updater. Please try again later.";
"An error occurred while starting the installer. Please try again later." = "An error occurred while starting the installer. Please try again later.";
"An error occurred while connecting to the installer. Please try again later." = "An error occurred while connecting to the installer. Please try again later.";
"An error occurred while launching the installer. Please try again later." = "An error occurred while launching the installer. Please try again later.";
"Update Installed" = "Update Installed";
"%@ is now updated to version %@!" = "%@ is now updated to version %@!";
"%@ is now updated!" = "%@ is now updated!";
/* Description text for SUUpdateAlert when the critical update is downloadable. */
"%@ %@ is now available—you have %@. This is an important update; would you like to download it now?" = "%1$@ %2$@ is now available—you have %3$@. This is an important update; would you like to download it now?";
/* Description text for SUUpdateAlert when the update is downloadable. */
"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ is now available—you have %3$@. Would you like to download it now?";
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ is now available—you have %3$@. Would you like to download it now?";
/* Description text for SUUpdateAlert when the update informational with no download. */
"%@ %@ is now available--you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ is now available—you have %3$@. Would you like to learn more about this update on the web?";
/* Critical downloadable update */
"%@ %@ is now available--you have %@. This is an important update; would you like to download it now?" = "%1$@ %2$@ is now available—you have %3$@. This is an important update; would you like to download it now?";
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%1$@ %2$@ is now available—you have %3$@. Would you like to learn more about this update on the web?";
/* The download progress in a unit of bytes, e.g. 100 KB */
"%@ downloaded" = "%@ downloaded";
/* No comment provided by engineer. */
"%@ is now updated to version %@!" = "%1$@ is now updated to version %2$@!";
/* No comment provided by engineer. */
"%@ is now updated!" = "%@ is now updated!";
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
"%@ of %@" = "%1$@ of %2$@";
/* No comment provided by engineer. */
"A new version of %@ is available!" = "A new version of %@ is available!";
/* No comment provided by engineer. */
"A new version of %@ is ready to install!" = "A new version of %@ is ready to install!";
/* No comment provided by engineer. */
"An error occurred in retrieving update information. Please try again later." = "An error occurred in retrieving update information. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while connecting to the installer. Please try again later." = "An error occurred while connecting to the installer. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while downloading the update. Please try again later." = "An error occurred while downloading the update. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while extracting the archive. Please try again later." = "An error occurred while extracting the archive. Please try again later.";
"An error occurred while installing the update. Please try again later." = "An error occurred while installing the update. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while launching the installer. Please try again later." = "An error occurred while launching the installer. Please try again later.";
/* No comment provided by engineer. */
"An error occurred while parsing the update feed." = "An error occurred while parsing the update feed.";
"An error occurred while downloading the update feed." = "An error occurred while downloading the update feed.";
/* No comment provided by engineer. */
"An error occurred while running the updater. Please try again later." = "An error occurred while running the updater. Please try again later.";
"Failed to resume installing update." = "Failed to resume installing update.";
"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@." = "An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.";
/* No comment provided by engineer. */
"An error occurred while starting the installer. Please try again later." = "An error occurred while starting the installer. Please try again later.";
/* No comment provided by engineer. */
"An important update to %@ is ready to install" = "An important update to %@ is ready to install";
"Unable to Check For Updates" = "Unable to Check For Updates";
"The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version" = "The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version";
/* the unit for bytes */
"B" = "B";
/* No comment provided by engineer. */
"Cancel" = "Cancel";
/* No comment provided by engineer. */
"Cancel Update" = "Cancel Update";
"Checking for updates..." = "Checking for updates…";
/* No comment provided by engineer. */
"Checking for updates…" = "Checking for updates…";
/* Take care not to overflow the status window. */
"Downloading update..." = "Downloading update…";
"Downloading update…" = "Downloading update…";
/* Take care not to overflow the status window. */
"Extracting update..." = "Extracting update…";
"Extracting update…" = "Extracting update…";
/* the unit for gigabytes */
"GB" = "GB";
/* No comment provided by engineer. */
"Failed to resume installing update." = "Failed to resume installing update.";
/* No comment provided by engineer. */
"Install and Relaunch" = "Install and Relaunch";
/* Alternate title for 'Remind Me Later' button when downloaded updates can be resumed */
"Install on Quit" = "Install on Quit";
/* Take care not to overflow the status window. */
"Installing update..." = "Installing update…";
"Installing update…" = "Installing update…";
/* Title confirmation for skipping major upgrade and future updates */
"Are you sure you want to skip this upgrade?" = "Are you sure you want to skip this upgrade?";
/* Alternate title for 'Install Update' button when there's no download in RSS feed. */
"Learn More…" = "Learn More…";
/* Skipping major upgrade */
"Skip Upgrade" = "Skip Upgrade";
/* Not skipping a major upgrade */
"Don't Skip" = "Don't Skip";
/* the unit for kilobytes */
"KB" = "KB";
/* Alternative name for "Install" button if we have a paid update or other update
without a download but with a URL. */
"Learn More..." = "Learn More…";
/* the unit for megabytes */
"MB" = "MB";
/* OK button. */
/* No comment provided by engineer. */
"OK" = "OK";
/* Status message on progress window once download has finished. */
/* No comment provided by engineer. */
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "Quit %1$@, move it into your Applications folder, relaunch it from there and try again.";
/* No comment provided by engineer. */
"Ready to Install" = "Ready to Install";
/* Message that is optionally shown at startup to allow users to turn on/off update checks. */
/* No comment provided by engineer. */
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu.";
"The update is improperly signed." = "The update is improperly signed.";
/* No comment provided by engineer. */
"The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version." = "The update checker failed to start correctly. You should contact the app developer to report this issue and verify that you have the latest version.";
/* No comment provided by engineer. */
"The update is improperly signed and could not be validated. Please try again later or contact the app developer." = "The update is improperly signed and could not be validated. Please try again later or contact the app developer.";
/* No comment provided by engineer. */
"Unable to Check For Updates" = "Unable to Check For Updates";
/* No comment provided by engineer. */
"Update Error!" = "Update Error!";
/* No comment provided by engineer. */
"Update Installed" = "Update Installed";
/* No comment provided by engineer. */
"Updating %@" = "Updating %@";
/* 'Error' message when the user checks for updates but is already current or the feed doesn't contain any updates. (not necessarily shown in UI) */
"You already have the newest version of %@." = "You already have the newest version of %@.";
/* No comment provided by engineer. */
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You're up-to-date!" = "You’re up to date!";
"Your macOS version is too old" = "Your macOS version is too old";
"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required." = "%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required.";
"Your macOS version is too new" = "Your macOS version is too new";
"%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@." = "%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@.";
/* Used when a new update is not found */
/* No comment provided by engineer. */
"Version History" = "Version History";
/* Authorization message shown when app wants permission to update itself. */
"%1$@ wants permission to update." = "%1$@ wants permission to update.";
/* No comment provided by engineer. */
"Your macOS version is too new" = "Your macOS version is too new";
/* Authorization message shown when app wants permission to update another app / bundle. */
"%1$@ wants permission to update %2$@." = "%1$@ wants permission to update %2$@.";
/* No comment provided by engineer. */
"Your macOS version is too old" = "Your macOS version is too old";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You’re up-to-date!" = "You’re up-to-date!";
+25 -7
View File
@@ -126,7 +126,9 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
__weak InstallerProgressAppController *weakSelf = self;
_connection.interruptionHandler = ^{
[weakSelf.connection invalidate];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.connection invalidate];
});
};
_connection.invalidationHandler = ^{
@@ -222,18 +224,34 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3;
NSMutableArray<NSRunningApplication *> *matchedRunningApplications = [[NSMutableArray alloc] init];
if (bundleIdentifier != nil && bundlePathComponents != nil) {
NSArray *runningApplications =
(bundleIdentifier != nil) ?
[NSRunningApplication runningApplicationsWithBundleIdentifier:bundleIdentifier] :
[[NSWorkspace sharedWorkspace] runningApplications];
NSArray *runningApplications = [NSRunningApplication runningApplicationsWithBundleIdentifier:bundleIdentifier];
// If we find any running application that is translocated and looks like the bundle, we should record those too
// We will want to terminate those apps and observe their pids, but we will only do this if we don't find any regular matches
NSMutableArray<NSRunningApplication *> *potentialMatchingTranslocatedRunningApplications = [[NSMutableArray alloc] init];
for (NSRunningApplication *runningApplication in runningApplications) {
// Comparing the URLs hasn't worked well for me in practice, so I'm comparing the file paths instead
NSString *candidatePath = runningApplication.bundleURL.URLByResolvingSymlinksInPath.path;
if (candidatePath != nil && [candidatePath.pathComponents isEqualToArray:bundlePathComponents]) {
[matchedRunningApplications addObject:runningApplication];
if (candidatePath != nil) {
NSArray<NSString *> *candidatePathComponents = candidatePath.pathComponents;
if ([candidatePathComponents isEqualToArray:bundlePathComponents]) {
[matchedRunningApplications addObject:runningApplication];
} else if (matchedRunningApplications.count == 0 && candidatePathComponents.count > 0 && bundlePathComponents.count > 0) {
NSString *lastBundlePathComponent = bundlePathComponents.lastObject;
NSString *lastCandidatePathComponent = candidatePathComponents.lastObject;
if (lastBundlePathComponent != nil && lastCandidatePathComponent != nil && [lastBundlePathComponent isEqualToString:lastCandidatePathComponent] && [candidatePathComponents containsObject:@"AppTranslocation"]) {
[potentialMatchingTranslocatedRunningApplications addObject:runningApplication];
}
}
}
}
// Non-translocated apps take priority first
// And we only use translocated version of apps if there are no regular apps matched
if (matchedRunningApplications.count == 0) {
[matchedRunningApplications addObjectsFromArray:potentialMatchingTranslocatedRunningApplications];
}
}
return [matchedRunningApplications copy];
+2 -2
View File
@@ -24,10 +24,10 @@
- (void)installerProgressShouldDisplayWithHost:(SUHost *)host
{
self.statusController = [[SUStatusController alloc] initWithHost:host];
self.statusController = [[SUStatusController alloc] initWithHost:host centerPointValue:nil minimizable:NO closable:NO];
[self.statusController setButtonTitle:SULocalizedString(@"Cancel Update", @"") target:nil action:nil isDefault:NO];
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"") maxProgressValue:0 statusText:@""];
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing update…", @"") maxProgressValue:0 statusText:@""];
[self.statusController showWindow:self];
}
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
+8 -1
View File
@@ -61,6 +61,11 @@
{
}
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler
{
[self.coreDriver setUpdateWillInstallHandler:updateWillInstallHandler];
}
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders
{
[self.coreDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders inBackground:YES requiresSilentInstall:YES];
@@ -105,7 +110,9 @@
if (self.willInstallSilently && [updaterDelegate respondsToSelector:@selector(updater:willInstallUpdateOnQuit:immediateInstallationBlock:)]) {
__weak SPUAutomaticUpdateDriver *weakSelf = self;
installationHandledByDelegate = [updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationBlock:^{
[weakSelf.coreDriver finishInstallationWithResponse:SPUUserUpdateChoiceInstall displayingUserInterface:NO];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.coreDriver finishInstallationWithResponse:SPUUserUpdateChoiceInstall displayingUserInterface:NO];
});
}];
}
+32 -21
View File
@@ -18,6 +18,7 @@
#import "SPUResumableUpdate.h"
#import "SPUAppcastItemState.h"
#import "SUAppcastItem+Private.h"
#import "SPUInstallationType.h"
#include "AppKitPrevention.h"
@@ -75,7 +76,7 @@
if ([self.host isRunningTranslocated]) {
[self.delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningTranslocated userInfo:@{ NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedString(@"Quit %1$@, move it into your Applications folder, relaunch it from there and try again.", nil), hostName], NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can’t be updated if it’s running from the location it was downloaded to.", nil), hostName], }]];
} else {
[self.delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated, because it was opened from a read-only or a temporary location.", nil), hostName], NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedString(@"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.", nil), hostName] }]];
[self.delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can’t be updated, because it was opened from a read-only or a temporary location.", nil), hostName], NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedString(@"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.", nil), hostName] }]];
}
} else {
[self.appcastDriver loadAppcastFromURL:appcastURL userAgent:userAgent httpHeaders:httpHeaders inBackground:background];
@@ -139,21 +140,31 @@
- (void)notifyFoundValidUpdateWithAppcastItem:(SUAppcastItem *)updateItem secondaryAppcastItem:(SUAppcastItem * _Nullable)secondaryUpdateItem systemDomain:(NSNumber * _Nullable)systemDomain resuming:(BOOL)resuming
{
if (!self.aborted) {
// If the update is not being resumed from a prior session, give the delegate a chance to bail
NSError *shouldNotProceedError = nil;
if (!resuming && [self.updaterDelegate respondsToSelector:@selector(updater:shouldProceedWithUpdate:updateCheck:error:)] && ![self.updaterDelegate updater:self.updater shouldProceedWithUpdate:updateItem updateCheck:self.updateCheck error:&shouldNotProceedError]) {
[self.delegate basicDriverIsRequestingAbortUpdateWithError:shouldNotProceedError];
} else {
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification
object:self.updater
userInfo:@{ SUUpdaterAppcastItemNotificationKey: updateItem }];
if ([self.updaterDelegate respondsToSelector:@selector((updater:didFindValidUpdate:))]) {
[self.updaterDelegate updater:self.updater didFindValidUpdate:updateItem];
if (!resuming) {
// interactive pkg based updates are not supported under root user
if ([updateItem.installationType isEqualToString:SPUInstallationTypeInteractivePackage] && geteuid() == 0) {
[self.delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationRootInteractiveError userInfo:@{ NSLocalizedDescriptionKey: SULocalizedString(@"Interactive based packages cannot be installed as the root user.", nil) }]];
return;
} else {
// Give the delegate a chance to bail
NSError *shouldNotProceedError = nil;
if ([self.updaterDelegate respondsToSelector:@selector(updater:shouldProceedWithUpdate:updateCheck:error:)] && ![self.updaterDelegate updater:self.updater shouldProceedWithUpdate:updateItem updateCheck:self.updateCheck error:&shouldNotProceedError]) {
[self.delegate basicDriverIsRequestingAbortUpdateWithError:shouldNotProceedError];
return;
}
}
[self.delegate basicDriverDidFindUpdateWithAppcastItem:updateItem secondaryAppcastItem:secondaryUpdateItem systemDomain:systemDomain];
}
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification
object:self.updater
userInfo:@{ SUUpdaterAppcastItemNotificationKey: updateItem }];
if ([self.updaterDelegate respondsToSelector:@selector((updater:didFindValidUpdate:))]) {
[self.updaterDelegate updater:self.updater didFindValidUpdate:updateItem];
}
[self.delegate basicDriverDidFindUpdateWithAppcastItem:updateItem secondaryAppcastItem:secondaryUpdateItem systemDomain:systemDomain];
}
}
@@ -173,15 +184,15 @@
switch (hostToLatestAppcastItemComparisonResult) {
case NSOrderedDescending:
// This means the user is a 'newer than latest' version. give a slight hint to the user instead of wrongly claiming this version is identical to the latest feed version.
localizedDescription = SULocalizedString(@"You're up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
localizedDescription = SULocalizedString(@"You’re up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.\n(You are currently running version %@.)", nil), [self.host name], latestAppcastItem.displayVersionString, [self.host displayVersion]];
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.\n(You are currently running version %@.)", nil), [self.host name], latestAppcastItem.displayVersionString, [self.host displayVersion]];
reason = SPUNoUpdateFoundReasonOnNewerThanLatestVersion;
break;
case NSOrderedSame:
// No new update is available and we're on the latest
localizedDescription = SULocalizedString(@"You're up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
localizedDescription = SULocalizedString(@"You’re up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [self.host name], [self.host displayVersion]];
@@ -193,18 +204,18 @@
if (!latestAppcastItem.minimumOperatingSystemVersionIsOK) {
localizedDescription = SULocalizedString(@"Your macOS version is too old", nil);
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required.", nil), [self.host name], latestAppcastItem.versionString, latestAppcastItem.minimumSystemVersion];
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required.", nil), [self.host name], latestAppcastItem.displayVersionString, latestAppcastItem.minimumSystemVersion];
reason = SPUNoUpdateFoundReasonSystemIsTooOld;
} else if (!latestAppcastItem.maximumOperatingSystemVersionIsOK) {
localizedDescription = SULocalizedString(@"Your macOS version is too new", nil);
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@.", nil), [self.host name], latestAppcastItem.versionString, latestAppcastItem.maximumSystemVersion];
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@.", nil), [self.host name], latestAppcastItem.displayVersionString, latestAppcastItem.maximumSystemVersion];
reason = SPUNoUpdateFoundReasonSystemIsTooNew;
} else {
// We shouldn't realistically get here
localizedDescription = SULocalizedString(@"You're up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
localizedDescription = SULocalizedString(@"You’re up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [self.host name], [self.host displayVersion]];
@@ -217,7 +228,7 @@
// We will need to assume the user is up to date if the feed doen't have any applicable update items
// There could be update items on channels the updater is not subscribed to for example. But we can't tell the user about them.
// There could also only be update items available for other platforms or none at all.
localizedDescription = SULocalizedString(@"You're up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
localizedDescription = SULocalizedString(@"You’re up-to-date!", "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
recoverySuggestion = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [self.host name], [self.host displayVersion]];
reason = SPUNoUpdateFoundReasonOnLatestVersion;
+2
View File
@@ -52,6 +52,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setCompletionHandler:(SPUUpdateDriverCompletion)completionBlock;
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler;
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders inBackground:(BOOL)background requiresSilentInstall:(BOOL)silentInstall;
- (void)resumeInstallingUpdate;
+30 -12
View File
@@ -13,6 +13,7 @@
#import "SPUInstallerDriver.h"
#import "SPUDownloadDriver.h"
#import "SULog.h"
#import "SULog+NSError.h"
#import "SUErrors.h"
#import "SPUResumableUpdate.h"
#import "SPUDownloadedUpdate.h"
@@ -88,6 +89,11 @@
[self.basicDriver setCompletionHandler:completionBlock];
}
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler
{
[self.installerDriver setUpdateWillInstallHandler:updateWillInstallHandler];
}
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders inBackground:(BOOL)background requiresSilentInstall:(BOOL)silentInstall
{
self.userAgent = userAgent;
@@ -247,18 +253,25 @@
- (void)downloadDriverDidFailToDownloadFileWithError:(NSError *)error
{
if ([self.updaterDelegate respondsToSelector:@selector((updater:failedToDownloadUpdate:error:))]) {
NSError *errorToReport = [error.userInfo objectForKey:NSUnderlyingErrorKey];
if (errorToReport == nil) {
errorToReport = error;
if ([self.updateItem isDeltaUpdate]) {
SULog(SULogLevelError, @"Failed to download delta update. Falling back to regular update...");
SULogError(error);
[self fallBackAndDownloadRegularUpdate];
} else {
if ([self.updaterDelegate respondsToSelector:@selector((updater:failedToDownloadUpdate:error:))]) {
NSError *errorToReport = [error.userInfo objectForKey:NSUnderlyingErrorKey];
if (errorToReport == nil) {
errorToReport = error;
}
[self.updaterDelegate updater:self.updater
failedToDownloadUpdate:self.updateItem
error:errorToReport];
}
[self.updaterDelegate updater:self.updater
failedToDownloadUpdate:self.updateItem
error:errorToReport];
[self.delegate coreDriverIsRequestingAbortUpdateWithError:error];
}
[self.delegate coreDriverIsRequestingAbortUpdateWithError:error];
}
- (void)installerDidStartInstallingWithApplicationTerminated:(BOOL)applicationTerminated
@@ -335,15 +348,13 @@
[self.delegate basicDriverIsRequestingAbortUpdateWithError:error];
}
- (void)installerDidFailToApplyDeltaUpdate
- (void)fallBackAndDownloadRegularUpdate
{
SUAppcastItem *secondaryUpdateItem = self.secondaryUpdateItem;
assert(secondaryUpdateItem != nil);
BOOL backgroundDownload = self.downloadDriver.inBackground;
[self clearDownloadedUpdate];
// Fall back to the non-delta update. Note that we don't want to trigger another update was found event.
self.updateItem = secondaryUpdateItem;
self.secondaryUpdateItem = nil;
@@ -351,6 +362,13 @@
[self downloadUpdateFromAppcastItem:secondaryUpdateItem secondaryAppcastItem:nil inBackground:backgroundDownload];
}
- (void)installerDidFailToApplyDeltaUpdate
{
[self clearDownloadedUpdate];
[self fallBackAndDownloadRegularUpdate];
}
- (void)abortUpdateAndShowNextUpdateImmediately:(BOOL)shouldShowUpdateImmediately error:(nullable NSError *)error
{
[self.installerDriver abortInstall];
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#ifdef BUILDING_SPARKLE_DOWNLOADER_SERVICE
// Ignore incorrect warning
+2 -3
View File
@@ -16,7 +16,6 @@
#import "SUHost.h"
#import "SULog.h"
#import "SUErrors.h"
#import "SPUURLRequest.h"
#import "SPUDownloadedUpdate.h"
#import "SPUDownloadData.h"
@@ -160,9 +159,9 @@
NSString *bundleIdentifier = self.host.bundle.bundleIdentifier;
assert(bundleIdentifier != nil);
[self.downloader startPersistentDownloadWithRequest:[SPUURLRequest URLRequestWithRequest:self.request] bundleIdentifier:bundleIdentifier desiredFilename:desiredFilename];
[self.downloader startPersistentDownloadWithRequest:self.request bundleIdentifier:bundleIdentifier desiredFilename:desiredFilename];
} else {
[self.downloader startTemporaryDownloadWithRequest:[SPUURLRequest URLRequestWithRequest:self.request]];
[self.downloader startTemporaryDownloadWithRequest:self.request];
}
}
+22
View File
@@ -0,0 +1,22 @@
//
// SPUGentleUserDriverReminders.h
// Sparkle
//
// Copyright © 2022 Sparkle Project. All rights reserved.
//
#ifndef SPUGentleUserDriverReminders_h
#define SPUGentleUserDriverReminders_h
/**
A private protocol for user drivers implementing gentle scheduled reminders
*/
@protocol SPUGentleUserDriverReminders
- (void)logGentleScheduledUpdateReminderWarningIfNeeded;
- (void)resetTimeSinceOpportuneUpdateNotice;
@end
#endif /* SPUGentleUserDriverReminders_h */
+2
View File
@@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)resumeInstallingUpdateWithUpdateItem:(SUAppcastItem *)updateItem systemDomain:(BOOL)systemDomain;
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler;
- (void)extractDownloadedUpdate:(SPUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently completion:(void (^)(NSError * _Nullable))completionHandler;
- (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI;
+46 -14
View File
@@ -64,6 +64,9 @@
@end
@implementation SPUInstallerDriver
{
void (^_updateWillInstallHandler)(void);
}
@synthesize host = _host;
@synthesize applicationBundle = _applicationBundle;
@@ -95,25 +98,50 @@
return self;
}
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler
{
_updateWillInstallHandler = [updateWillInstallHandler copy];
}
- (void)_reportInstallerError:(nullable NSError *)currentInstallerError genericErrorCode:(NSInteger)genericErrorCode genericUserInfo:(NSDictionary *)genericUserInfo
{
// First see if there is a good custom error we can show
// We only check for signing validation errors currently
NSError *customError;
// We only check for signing validation errors and installation errors due to not having write permission currently
NSError *customError = nil;
if (currentInstallerError != nil) {
NSError *underlyingError = currentInstallerError.userInfo[NSUnderlyingErrorKey];
if (underlyingError != nil && underlyingError.code == SUValidationError) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: SULocalizedString(@"The update is improperly signed and could not be validated. Please try again later or contact the app developer.", nil),
NSUnderlyingErrorKey: (NSError * _Nonnull)currentInstallerError
};
customError = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:userInfo];
} else {
customError = nil;
if (underlyingError != nil) {
if (underlyingError.code == SUValidationError) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: SULocalizedString(@"The update is improperly signed and could not be validated. Please try again later or contact the app developer.", nil),
NSUnderlyingErrorKey: (NSError * _Nonnull)currentInstallerError
};
customError = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:userInfo];
} else if (underlyingError.code == SUInstallationError) {
NSError *secondUnderlyingError = underlyingError.userInfo[NSUnderlyingErrorKey];
if (secondUnderlyingError != nil && [secondUnderlyingError.domain isEqualToString:NSCocoaErrorDomain] && secondUnderlyingError.code == NSFileWriteNoPermissionError) {
// Note: these error strings will only surface for external app updaters like sparkle-cli (i.e, updaters that update other app bundles)
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{
NSLocalizedDescriptionKey: SULocalizedString(@"The installation failed due to not having permission to write the new update.", nil),
NSUnderlyingErrorKey: (NSError * _Nonnull)currentInstallerError
}];
// macOS 13 and later introduce a policy where Gatekeeper can block app modifications if the apps have different Team IDs
if (@available(macOS 13, *)) {
NSBundle *mainBundle = [NSBundle mainBundle];
if (![mainBundle isEqual:self.host.bundle]) {
SUHost *mainBundleHost = [[SUHost alloc] initWithBundle:mainBundle];
userInfo[NSLocalizedRecoverySuggestionErrorKey] = [NSString stringWithFormat:SULocalizedString(@"You may need to allow modifications from %1$@ in System Settings under Privacy & Security and App Management to install future updates.", nil), mainBundleHost.name];
}
}
customError = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationWriteNoPermissionError userInfo:userInfo];
}
}
}
} else {
customError = nil;
}
// Otherwise if there's no custom error, then use a generic installer error to show
@@ -142,7 +170,7 @@
assert(hostBundleIdentifier != nil);
if (!SPUXPCServiceIsEnabled(SUEnableInstallerConnectionServiceKey)) {
self.installerConnection = [[SUInstallerConnection alloc] initWithDelegate:self];
self.installerConnection = [[SUInstallerConnection alloc] initWithDelegate:self remote:NO];
} else {
self.installerConnection = [[SUXPCInstallerConnection alloc] initWithDelegate:self];
}
@@ -476,6 +504,10 @@
}
}
if (_updateWillInstallHandler != NULL) {
_updateWillInstallHandler();
}
// Set up connection to the installer if one is not set up already
[self setUpConnection];
+2 -2
View File
@@ -30,7 +30,7 @@
id<SUInstallerStatusProtocol> installerStatus = nil;
BOOL usesXPC = SPUXPCServiceIsEnabled(SUEnableInstallerStatusServiceKey);
if (!usesXPC) {
installerStatus = [[SUInstallerStatus alloc] init];
installerStatus = [[SUInstallerStatus alloc] initWithRemote:NO];
} else {
installerStatus = [[SUXPCInstallerStatus alloc] init];
}
@@ -93,7 +93,7 @@
id<SUInstallerStatusProtocol> installerStatus = nil;
BOOL usesXPC = SPUXPCServiceIsEnabled(SUEnableInstallerStatusServiceKey);
if (!usesXPC) {
installerStatus = [[SUInstallerStatus alloc] init];
installerStatus = [[SUInstallerStatus alloc] initWithRemote:NO];
} else {
installerStatus = [[SUXPCInstallerStatus alloc] init];
}
+4
View File
@@ -42,6 +42,10 @@
{
}
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler
{
}
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders
{
[self.basicDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders inBackground:YES];
+5
View File
@@ -48,6 +48,11 @@
self.updateDidShowHandler = handler;
}
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler
{
[self.uiDriver setUpdateWillInstallHandler:updateWillInstallHandler];
}
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders
{
[self.uiDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders inBackground:YES];
+10 -48
View File
@@ -16,58 +16,20 @@ static NSString *SURootObjectArchiveKey = @"SURootObjectArchive";
NSData * _Nullable SPUArchiveRootObjectSecurely(id<NSSecureCoding> rootObject)
{
if (@available(macOS 10.13, *)) {
NSError *error = nil;
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rootObject requiringSecureCoding:YES error:&error];
if (data == nil) {
SULog(SULogLevelError, @"Error while securely archiving object: %@", error);
}
return data;
} else {
NSMutableData *data = [NSMutableData data];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSKeyedArchiver *keyedArchiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
#pragma clang diagnostic pop
keyedArchiver.requiresSecureCoding = YES;
@try {
[keyedArchiver encodeObject:rootObject forKey:SURootObjectArchiveKey];
[keyedArchiver finishEncoding];
return [data copy];
} @catch (NSException *exception) {
SULog(SULogLevelError, @"Exception while securely archiving object: %@", exception);
[keyedArchiver finishEncoding];
return nil;
}
NSError *error = nil;
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rootObject requiringSecureCoding:YES error:&error];
if (data == nil) {
SULog(SULogLevelError, @"Error while securely archiving object: %@", error);
}
return data;
}
id<NSSecureCoding> _Nullable SPUUnarchiveRootObjectSecurely(NSData *data, Class klass)
{
if (@available(macOS 10.13, *)) {
NSError *error = nil;
id<NSSecureCoding> rootObject = [NSKeyedUnarchiver unarchivedObjectOfClass:klass fromData:data error:&error];
if (rootObject == nil) {
SULog(SULogLevelError, @"Error while securely unarchiving object: %@", error);
}
return rootObject;
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
#pragma clang diagnostic pop
unarchiver.requiresSecureCoding = YES;
@try {
id<NSSecureCoding> rootObject = [unarchiver decodeObjectOfClass:klass forKey:SURootObjectArchiveKey];
[unarchiver finishDecoding];
return rootObject;
} @catch (NSException *exception) {
SULog(SULogLevelError, @"Exception while securely unarchiving object: %@", exception);
[unarchiver finishDecoding];
return nil;
}
NSError *error = nil;
id<NSSecureCoding> rootObject = [NSKeyedUnarchiver unarchivedObjectOfClass:klass fromData:data error:&error];
if (rootObject == nil) {
SULog(SULogLevelError, @"Error while securely unarchiving object: %@", error);
}
return rootObject;
}
+3 -7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
@@ -38,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
SU_EXPORT @interface SPUStandardUpdaterController : NSObject
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-interface-ivars"
/**
* Interface builder outlet for the updater's delegate.
*/
@@ -47,6 +42,7 @@ SU_EXPORT @interface SPUStandardUpdaterController : NSObject
* Interface builder outlet for the user driver's delegate.
*/
IBOutlet __weak id<SPUStandardUserDriverDelegate> userDriverDelegate;
#pragma clang diagnostic pop
}
/**
+31
View File
@@ -0,0 +1,31 @@
//
// SPUStandardUserDriver+Private.h
// Sparkle
//
// Copyright © 2022 Sparkle Project. All rights reserved.
//
#ifndef SPUStandardUserDriver_Private_h
#define SPUStandardUserDriver_Private_h
#import <Sparkle/SPUStandardUserDriver.h>
#import <Sparkle/SUExport.h>
@class NSWindowController;
NS_ASSUME_NONNULL_BEGIN
SU_EXPORT @interface SPUStandardUserDriver (Private)
/**
Private API for accessing the active update alert's window controller.
This is the window controller that shows the update's release notes and install choices.
This can be accessed in -[SPUStandardUserDriverDelegate standardUserDriverWillHandleShowingUpdate:forUpdate:state:]
*/
@property (nonatomic, readonly, nullable) NSWindowController *activeUpdateAlert;
@end
NS_ASSUME_NONNULL_END
#endif /* SPUStandardUserDriver_Private_h */
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SPUUserDriver.h>
#import <Sparkle/SUExport.h>
+386 -73
View File
@@ -10,6 +10,7 @@
#import "SPUStandardUserDriver.h"
#import "SPUStandardUserDriverDelegate.h"
#import "SPUGentleUserDriverReminders.h"
#import "SUAppcastItem.h"
#import "SUVersionDisplayProtocol.h"
#import "SUHost.h"
@@ -21,10 +22,19 @@
#import "SUOperatingSystem.h"
#import "SPUUserUpdateState.h"
#import "SUErrors.h"
#import "SPUInstallationType.h"
#import "SULog.h"
#include <time.h>
#include <mach/mach_time.h>
#import <IOKit/pwr_mgt/IOPMLib.h>
#import <AppKit/AppKit.h>
@interface SPUStandardUserDriver ()
// The amount of time the app is allowed to be idle for us to consider showing an update prompt right away when the app is active
static const NSTimeInterval SUScheduledUpdateIdleEventLeewayInterval = DEBUG ? 30.0 : 5 * 60.0;
@interface SPUStandardUserDriver () <SPUGentleUserDriverReminders>
@property (nonatomic, readonly) SUHost *host;
// We must store the oldHostName before the host is potentially replaced
@@ -38,6 +48,7 @@
@property (nonatomic, copy) void (^cancellation)(void);
@property (nonatomic) SUStatusController *checkingController;
// Note: we expose a private interface for activeUpdateAlert in SPUStandardUserDriver+Private.h as NSWindowController
@property (nonatomic) SUUpdateAlert *activeUpdateAlert;
@property (nonatomic) SUStatusController *statusController;
@property (nonatomic) SUUpdatePermissionPrompt *permissionPrompt;
@@ -48,6 +59,17 @@
@end
@implementation SPUStandardUserDriver
{
void (^_retryTerminatingApplication)(void);
mach_timebase_info_data_t _timebaseInfo;
double _timeSinceOpportuneUpdateNotice;
id<NSObject> _applicationBecameActiveAfterUpdateAlertBecameKeyObserver;
NSValue *_updateAlertWindowFrameValue;
BOOL _updateAlertWindowWasInactive;
BOOL _loggedGentleUpdateReminderWarning;
BOOL _regularApplicationUpdate;
BOOL _updateReceivedUserAttention;
}
@synthesize host = _host;
@synthesize oldHostName = _oldHostName;
@@ -72,10 +94,33 @@
_oldHostName = _host.name;
_oldHostBundleURL = hostBundle.bundleURL;
_delegate = delegate;
kern_return_t timebaseInfoResult = mach_timebase_info(&_timebaseInfo);
if (timebaseInfoResult != KERN_SUCCESS) {
SULog(SULogLevelError, @"Error: failed to fill mach_timebase_info() with error %d", timebaseInfoResult);
_timebaseInfo.numer = 0;
_timebaseInfo.denom = 0;
}
}
return self;
}
- (double)currentTime
{
if (_timebaseInfo.denom > 0) {
return (1.0 * mach_absolute_time() * _timebaseInfo.numer / _timebaseInfo.denom);
} else {
return 0.0;
}
}
// This private method is used by SPUUpdater for resetting the opportune time to show an update notice in utmost focus
- (void)resetTimeSinceOpportuneUpdateNotice
{
_timeSinceOpportuneUpdateNotice = [self currentTime];
}
#pragma mark Update Permission
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)request reply:(void (^)(SUUpdatePermissionResponse *))reply
@@ -97,31 +142,186 @@
#pragma mark Update Alert Focus
- (void)setUpFocusForActiveUpdateAlertWithUserInitiation:(BOOL)userInitiated
// This private method is used by SPUUpdater when scheduling for update checks
- (void)logGentleScheduledUpdateReminderWarningIfNeeded
{
id<SPUStandardUserDriverDelegate> delegate = self.delegate;
if (!_loggedGentleUpdateReminderWarning && (![delegate respondsToSelector:@selector(supportsGentleScheduledUpdateReminders)] || !delegate.supportsGentleScheduledUpdateReminders)) {
BOOL isBackgroundApp = [SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]];
if (isBackgroundApp) {
SULog(SULogLevelError, @"Warning: Background app automatically schedules for update checks but does not implement gentle reminders. As a result, users may not take notice to update alerts that show up in the background. Please visit https://sparkle-project.org/documentation/gentle-reminders for more information. This warning will only be logged once.");
_loggedGentleUpdateReminderWarning = YES;
}
}
}
// updateItem should be non-nil when showing an update for first time for scheduled updates
// If appcastItem is != nil, then state must be != nil
- (void)setUpActiveUpdateAlertForScheduledUpdate:(SUAppcastItem * _Nullable)updateItem state:(SPUUserUpdateState * _Nullable)state
{
// Make sure the window is loaded in any case
[self.activeUpdateAlert window];
// If the app is a menubar app or the like, we need to focus it first and alter the
// update prompt to behave like a normal window. Otherwise if the window were hidden
// there may be no way for the application to be activated to make it visible again.
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
[NSApp activateIgnoringOtherApps:YES];
}
[self _removeApplicationBecomeActiveObserver];
// Only show the update alert if the app is active; otherwise, we'll wait until it is.
if ([NSApp isActive]) {
[self.activeUpdateAlert setInstallButtonFocus:userInitiated];
if (updateItem == nil) {
// This is a user initiated check or a check to bring the already shown update back in focus
if (![NSApp isActive]) {
// If the user initiated an update check, we should make the app active,
// regardless if it's a background running app or not
[NSApp activateIgnoringOtherApps:YES];
}
[self.activeUpdateAlert showWindow:nil];
[self.activeUpdateAlert setInstallButtonFocus:YES];
} else {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
// Handle scheduled update check
uint64_t timeElapsedSinceOpportuneUpdateNotice = (uint64_t)([self currentTime] - _timeSinceOpportuneUpdateNotice);
// Give scheduled update alerts priority if 3 or less seconds have passed since our last opportune time
BOOL appNearUpdaterInitialization = (timeElapsedSinceOpportuneUpdateNotice <= 3000000000ULL);
// We will always show an update alert at the right time
[self.activeUpdateAlert setInstallButtonFocus:YES];
// If the delegate doesn't override our behavior:
// For regular applications, only show the update alert if the app is active and if it's an an opportune time, otherwise, we'll wait until the app becomes active again.
// For background applications, if the app is active, we will show the update window ordered back.
// If the app is inactive, we'll show the update alert in the background behind other running apps
// But we are near app launch, we will activate the app and show the alert as key
BOOL backgroundApp = [SUApplicationInfo isBackgroundApplication:NSApp];
BOOL driverShowingUpdateNow;
BOOL immediateFocus;
BOOL showingUpdateInBack;
BOOL activatingApp;
if ([NSApp isActive]) {
BOOL systemHasBeenIdle;
{
// If the system has been inactive for several minutes, allow the update alert to show up immediately. We assume it's likely the user isn't at their computer in this case.
// Note this is not done for background running applications.
CFTimeInterval timeSinceLastEvent;
if (!appNearUpdaterInitialization && !backgroundApp) {
timeSinceLastEvent = CGEventSourceSecondsSinceLastEventType(kCGEventSourceStateHIDSystemState, kCGAnyInputEventType);
if (timeSinceLastEvent >= SUScheduledUpdateIdleEventLeewayInterval) {
// Make sure there's no active power management assertions preventing
// the display from sleeping by the current application.
// If there is, then the app may still actively be in use
CFDictionaryRef cfAssertions = NULL;
if (IOPMCopyAssertionsByProcess(&cfAssertions) == kIOReturnSuccess) {
NSDictionary<NSNumber *, NSArray<NSDictionary<NSString *, id> *> *> *assertions = CFBridgingRelease(cfAssertions);
pid_t currentProcessIdentifier = NSRunningApplication.currentApplication.processIdentifier;
NSNumber *processIdentifierKey = @(currentProcessIdentifier);
NSArray<NSDictionary<NSString *, id> *> *currentProcessAssertions = assertions[processIdentifierKey];
BOOL foundNoDisplaySleepAssertion = NO;
for (NSDictionary<NSString *, id> *assertion in currentProcessAssertions) {
NSString *assertionType = assertion[(NSString *)kIOPMAssertionTypeKey];
NSNumber *assertionLevel = assertion[(NSString *)kIOPMAssertionLevelKey];
if ([assertionType isEqualToString:(NSString *)kIOPMAssertionTypeNoDisplaySleep] && [assertionLevel isEqual:@(kIOPMAssertionLevelOn)]) {
foundNoDisplaySleepAssertion = YES;
break;
}
}
systemHasBeenIdle = !foundNoDisplaySleepAssertion;
} else {
systemHasBeenIdle = NO;
}
} else {
systemHasBeenIdle = NO;
}
} else {
systemHasBeenIdle = NO;
}
}
if (appNearUpdaterInitialization || systemHasBeenIdle) {
driverShowingUpdateNow = YES;
immediateFocus = YES;
showingUpdateInBack = NO;
activatingApp = backgroundApp;
} else {
driverShowingUpdateNow = backgroundApp;
immediateFocus = NO;
// If there is a key window active in the app, show the update alert behind other windows
showingUpdateInBack = backgroundApp && ([NSApp keyWindow] != nil);
activatingApp = NO;
}
} else {
// For regular applications, we will show the update alert when the user comes back to the app
// For background applications, we will show the update alert right away but in the background,
// unless focus is requested
if (!backgroundApp) {
driverShowingUpdateNow = NO;
immediateFocus = NO;
showingUpdateInBack = NO;
activatingApp = NO;
} else {
driverShowingUpdateNow = YES;
immediateFocus = appNearUpdaterInitialization;
showingUpdateInBack = NO;
activatingApp = appNearUpdaterInitialization;
}
}
BOOL handleShowingUpdates;
if ([self.delegate respondsToSelector:@selector(standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:)]) {
handleShowingUpdates = [self.delegate standardUserDriverShouldHandleShowingScheduledUpdate:(SUAppcastItem * _Nonnull)updateItem andInImmediateFocus:immediateFocus];
} else {
handleShowingUpdates = YES;
}
if (!handleShowingUpdates) {
// Delay a runloop cycle to make sure the update can properly be checked
SPUStandardUserDriver *__weak weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
id<SPUStandardUserDriverDelegate> delegate = weakSelf.delegate;
if ([delegate respondsToSelector:@selector(standardUserDriverWillHandleShowingUpdate:forUpdate:state:)]) {
[delegate standardUserDriverWillHandleShowingUpdate:handleShowingUpdates forUpdate:(SUAppcastItem * _Nonnull)updateItem state:(SPUUserUpdateState * _Nonnull)state];
} else {
SULog(SULogLevelError, @"Error: Delegate <%@> is handling showing scheduled update but does not implement %@", delegate, NSStringFromSelector(@selector(standardUserDriverWillHandleShowingUpdate:forUpdate:state:)));
}
});
} else {
// The update will be shown, but not necessarily immediately if !driverShowingUpdateNow
// It is useful to post this early in case the delegate wants to post a notification
if ([self.delegate respondsToSelector:@selector(standardUserDriverWillHandleShowingUpdate:forUpdate:state:)]) {
[self.delegate standardUserDriverWillHandleShowingUpdate:handleShowingUpdates forUpdate:(SUAppcastItem * _Nonnull)updateItem state:(SPUUserUpdateState * _Nonnull)state];
}
if (!driverShowingUpdateNow) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
} else {
if (activatingApp) {
[NSApp activateIgnoringOtherApps:YES];
}
if (showingUpdateInBack) {
[self.activeUpdateAlert.window orderBack:nil];
} else {
[self.activeUpdateAlert showWindow:nil];
}
}
}
}
}
- (void)_removeApplicationBecomeActiveObserver
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationDidBecomeActiveNotification object:NSApp];
}
- (void)applicationDidBecomeActive:(NSNotification *)__unused aNotification
{
[self.activeUpdateAlert showWindow:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationDidBecomeActiveNotification object:NSApp];
[self.activeUpdateAlert setInstallButtonFocus:YES];
[self _removeApplicationBecomeActiveObserver];
}
#pragma mark Update Found
@@ -137,13 +337,84 @@
versionDisplayer = [self.delegate standardUserDriverRequestsVersionDisplayer];
}
BOOL needsToObserveUserAttention = [self.delegate respondsToSelector:@selector(standardUserDriverDidReceiveUserAttentionForUpdate:)];
__weak SPUStandardUserDriver *weakSelf = self;
self.activeUpdateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:appcastItem state:state host:self.host versionDisplayer:versionDisplayer completionBlock:^(SPUUserUpdateChoice choice) {
__weak id<SPUStandardUserDriverDelegate> weakDelegate = self.delegate;
self.activeUpdateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:appcastItem state:state host:self.host versionDisplayer:versionDisplayer completionBlock:^(SPUUserUpdateChoice choice, NSRect windowFrame, BOOL wasKeyWindow) {
reply(choice);
weakSelf.activeUpdateAlert = nil;
SPUStandardUserDriver *strongSelf = weakSelf;
if (strongSelf != nil) {
if (needsToObserveUserAttention && !strongSelf->_updateReceivedUserAttention) {
strongSelf->_updateReceivedUserAttention = YES;
id<SPUStandardUserDriverDelegate> strongDelegate = weakDelegate;
// needsToObserveUserAttention already checks delegate responds to this selector
[strongDelegate standardUserDriverDidReceiveUserAttentionForUpdate:appcastItem];
}
// Record the window frame of the update alert right before we deallocate it
// So we can center future status window to where the update alert last was.
// Also record if the window was inactive at the time a response was made
// (the window may not be key if the window e.g. holds command while clicking on a response button)
strongSelf->_updateAlertWindowFrameValue = [NSValue valueWithRect:windowFrame];
strongSelf->_updateAlertWindowWasInactive = !wasKeyWindow;
strongSelf.activeUpdateAlert = nil;
}
} didBecomeKeyBlock:^{
if (!needsToObserveUserAttention) {
return;
}
if ([NSApp isActive]) {
SPUStandardUserDriver *strongSelf = weakSelf;
if (strongSelf != nil && !strongSelf->_updateReceivedUserAttention) {
strongSelf->_updateReceivedUserAttention = YES;
id<SPUStandardUserDriverDelegate> strongDelegate = weakDelegate;
// needsToObserveUserAttention already checks delegate responds to this selector
[strongDelegate standardUserDriverDidReceiveUserAttentionForUpdate:appcastItem];
}
} else {
// We need to listen for when the app becomes active again, and then test if the window alert
// is still key. if it is, let the delegate know. Remove the observation after that.
SPUStandardUserDriver *strongSelfOuter = weakSelf;
if (strongSelfOuter != nil && strongSelfOuter->_applicationBecameActiveAfterUpdateAlertBecameKeyObserver == nil) {
strongSelfOuter->_applicationBecameActiveAfterUpdateAlertBecameKeyObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidBecomeActiveNotification object:NSApp queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull __unused note) {
SPUStandardUserDriver *strongSelf = weakSelf;
if (strongSelf != nil) {
if (!strongSelf->_updateReceivedUserAttention && [strongSelf.activeUpdateAlert.window isKeyWindow]) {
strongSelf->_updateReceivedUserAttention = YES;
id<SPUStandardUserDriverDelegate> strongDelegate = weakDelegate;
// needsToObserveUserAttention already checks delegate responds to this selector
[strongDelegate standardUserDriverDidReceiveUserAttentionForUpdate:appcastItem];
}
if (strongSelf->_applicationBecameActiveAfterUpdateAlertBecameKeyObserver != nil) {
[[NSNotificationCenter defaultCenter] removeObserver:strongSelf->_applicationBecameActiveAfterUpdateAlertBecameKeyObserver];
strongSelf->_applicationBecameActiveAfterUpdateAlertBecameKeyObserver = nil;
}
}
}];
}
}
}];
[self setUpFocusForActiveUpdateAlertWithUserInitiation:state.userInitiated];
_regularApplicationUpdate = [appcastItem.installationType isEqualToString:SPUInstallationTypeApplication];
// For user initiated checks, let the delegate know we'll be showing an update
// For scheduled checks, -setUpActiveUpdateAlertForUpdate:state: below will handle this
if (state.userInitiated && [self.delegate respondsToSelector:@selector(standardUserDriverWillHandleShowingUpdate:forUpdate:state:)]) {
[self.delegate standardUserDriverWillHandleShowingUpdate:YES forUpdate:appcastItem state:state];
}
[self setUpActiveUpdateAlertForScheduledUpdate:(state.userInitiated ? nil : appcastItem) state:state];
}
- (void)showUpdateReleaseNotesWithDownloadData:(SPUDownloadData *)downloadData
@@ -165,27 +436,49 @@
- (void)showUpdateInFocus
{
BOOL mayNeedToActivateApp;
if (self.activeUpdateAlert != nil) {
[self setUpFocusForActiveUpdateAlertWithUserInitiation:YES];
[self setUpActiveUpdateAlertForScheduledUpdate:nil state:nil];
mayNeedToActivateApp = NO;
} else if (self.permissionPrompt != nil) {
[self.permissionPrompt showWindow:nil];
mayNeedToActivateApp = YES;
} else if (self.statusController != nil) {
[self.statusController showWindow:nil];
mayNeedToActivateApp = YES;
} else if (self.checkingController != nil) {
[self.checkingController showWindow:nil];
mayNeedToActivateApp = YES;
} else if (_retryTerminatingApplication != nil) {
[self _showAndConfigureStatusControllerForReadyToInstallWithAction:@selector(retryTermination:) closable:YES];
mayNeedToActivateApp = YES;
} else {
mayNeedToActivateApp = NO;
}
if (mayNeedToActivateApp && ![NSApp isActive]) {
// Make the app active if it's not already active, e.g, from a menu bar extra
[NSApp activateIgnoringOtherApps:YES];
}
}
#pragma mark Install & Relaunch Update
- (void)showReadyToInstallAndRelaunch:(void (^)(SPUUserUpdateChoice))installUpdateHandler
- (void)_showAndConfigureStatusControllerForReadyToInstallWithAction:(SEL)selector closable:(BOOL)closable
{
assert(NSThread.isMainThread);
[self createAndShowStatusController];
[self createAndShowStatusControllerWithClosable:closable];
[self.statusController beginActionWithTitle:SULocalizedString(@"Ready to Install", nil) maxProgressValue:1.0 statusText:nil];
[self.statusController setProgressValue:1.0]; // Fill the bar.
[self.statusController setButtonEnabled:YES];
[self.statusController setButtonTitle:SULocalizedString(@"Install and Relaunch", nil) target:self action:@selector(installAndRestart:) isDefault:YES];
[self.statusController setButtonTitle:SULocalizedString(@"Install and Relaunch", nil) target:self action:selector isDefault:YES];
}
- (void)showReadyToInstallAndRelaunch:(void (^)(SPUUserUpdateChoice))installUpdateHandler
{
assert(NSThread.isMainThread);
[self _showAndConfigureStatusControllerForReadyToInstallWithAction:@selector(installAndRestart:) closable:NO];
[NSApp requestUserAttention:NSInformationalRequest];
@@ -200,6 +493,13 @@
}
}
- (void)retryTermination:(id)__unused sender
{
if (_retryTerminatingApplication != nil) {
_retryTerminatingApplication();
}
}
#pragma mark Check for Updates
- (void)showUserInitiatedUpdateCheckWithCancellation:(void (^)(void))cancellation
@@ -208,9 +508,9 @@
self.cancellation = cancellation;
self.checkingController = [[SUStatusController alloc] initWithHost:self.host];
self.checkingController = [[SUStatusController alloc] initWithHost:self.host centerPointValue:nil minimizable:NO closable:NO];
[[self.checkingController window] center]; // Force the checking controller to load its window.
[self.checkingController beginActionWithTitle:SULocalizedString(@"Checking for updates...", nil) maxProgressValue:0.0 statusText:nil];
[self.checkingController beginActionWithTitle:SULocalizedString(@"Checking for updates…", nil) maxProgressValue:0.0 statusText:nil];
[self.checkingController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO];
[self.checkingController showWindow:self];
@@ -313,7 +613,7 @@
case SPUNoUpdateFoundReasonSystemIsTooNew:
if (latestAppcastItem.infoURL != nil) {
// Show the user the product's link if available
[alert addButtonWithTitle:SULocalizedString(@"Learn More...", nil)];
[alert addButtonWithTitle:SULocalizedString(@"Learn More…", nil)];
secondaryAction = ^{
[[NSWorkspace sharedWorkspace] openURL:(NSURL * _Nonnull)latestAppcastItem.infoURL];
@@ -338,10 +638,6 @@
[delegate standardUserDriverWillShowModalAlert];
}
// When showing a modal alert we need to ensure that background applications
// are focused to inform the user since there is no dock icon to notify them.
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; }
[alert setIcon:[SUApplicationInfo bestIconForHost:self.host]];
NSModalResponse response = [alert runModal];
@@ -356,11 +652,37 @@
#pragma mark Download & Install Updates
- (void)createAndShowStatusController
- (void)createAndShowStatusControllerWithClosable:(BOOL)closable
{
if (self.statusController == nil) {
self.statusController = [[SUStatusController alloc] initWithHost:self.host];
[self.statusController showWindow:self];
// We will make the status window minimizable for regular app updates which are often
// quick and atomic to install on quit. But we won't do this for package based updates.
BOOL minimizable;
if (!_regularApplicationUpdate) {
minimizable = NO;
} else if ([self.delegate respondsToSelector:@selector(standardUserDriverAllowsMinimizableStatusWindow)]) {
minimizable = [self.delegate standardUserDriverAllowsMinimizableStatusWindow];
} else {
minimizable = YES;
}
NSValue *centerPointValue;
if (_updateAlertWindowFrameValue != nil) {
NSRect updateAlertFrame = _updateAlertWindowFrameValue.rectValue;
NSPoint centerPoint = NSMakePoint(updateAlertFrame.origin.x + updateAlertFrame.size.width / 2.0, updateAlertFrame.origin.y + updateAlertFrame.size.height / 2.0);
centerPointValue = [NSValue valueWithPoint:centerPoint];
} else {
centerPointValue = nil;
}
self.statusController = [[SUStatusController alloc] initWithHost:self.host centerPointValue:centerPointValue minimizable:minimizable closable:closable];
if (_updateAlertWindowWasInactive) {
[self.statusController.window orderFront:nil];
} else {
[self.statusController showWindow:self];
}
}
}
@@ -370,9 +692,9 @@
self.cancellation = cancellation;
[self createAndShowStatusController];
[self createAndShowStatusControllerWithClosable:NO];
[self.statusController beginActionWithTitle:SULocalizedString(@"Downloading update...", @"Take care not to overflow the status window.") maxProgressValue:1.0 statusText:nil];
[self.statusController beginActionWithTitle:SULocalizedString(@"Downloading update…", @"Take care not to overflow the status window.") maxProgressValue:1.0 statusText:nil];
[self.statusController setProgressValue:0.0];
[self.statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO];
@@ -397,50 +719,23 @@
}
}
- (NSString *)localizedStringFromByteCount:(long long)value
{
if (![SUOperatingSystem isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 8, 0}]) {
if (value < 1000) {
return [NSString stringWithFormat:@"%.0lf %@", value / 1.0,
SULocalizedString(@"B", @"the unit for bytes")];
}
if (value < 1000 * 1000) {
return [NSString stringWithFormat:@"%.0lf %@", value / 1000.0,
SULocalizedString(@"KB", @"the unit for kilobytes")];
}
if (value < 1000 * 1000 * 1000) {
return [NSString stringWithFormat:@"%.1lf %@", value / 1000.0 / 1000.0,
SULocalizedString(@"MB", @"the unit for megabytes")];
}
return [NSString stringWithFormat:@"%.2lf %@", value / 1000.0 / 1000.0 / 1000.0,
SULocalizedString(@"GB", @"the unit for gigabytes")];
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
NSByteCountFormatter *formatter = [[NSByteCountFormatter alloc] init];
[formatter setZeroPadsFractionDigits:YES];
return [formatter stringFromByteCount:value];
#pragma clang diagnostic pop
}
- (void)showDownloadDidReceiveDataOfLength:(uint64_t)length
{
assert(NSThread.isMainThread);
self.bytesDownloaded += length;
NSByteCountFormatter *formatter = [[NSByteCountFormatter alloc] init];
[formatter setZeroPadsFractionDigits:YES];
if (self.expectedContentLength > 0.0) {
double newProgressValue = (double)self.bytesDownloaded / (double)self.expectedContentLength;
[self.statusController setProgressValue:MIN(newProgressValue, 1.0)];
[self.statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ of %@", nil), [self localizedStringFromByteCount:(long long)self.bytesDownloaded], [self localizedStringFromByteCount:(long long)MAX(self.bytesDownloaded, self.expectedContentLength)]]];
[self.statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ of %@", @"The download progress in units of bytes, e.g. 100 KB of 1,0 MB"), [formatter stringFromByteCount:(long long)self.bytesDownloaded], [formatter stringFromByteCount:(long long)MAX(self.bytesDownloaded, self.expectedContentLength)]]];
} else {
[self.statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ downloaded", nil), [self localizedStringFromByteCount:(long long)self.bytesDownloaded]]];
[self.statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ downloaded", @"The download progress in a unit of bytes, e.g. 100 KB"), [formatter stringFromByteCount:(long long)self.bytesDownloaded]]];
}
}
@@ -450,8 +745,8 @@
self.cancellation = nil;
[self createAndShowStatusController];
[self.statusController beginActionWithTitle:SULocalizedString(@"Extracting update...", @"Take care not to overflow the status window.") maxProgressValue:1.0 statusText:nil];
[self createAndShowStatusControllerWithClosable:NO];
[self.statusController beginActionWithTitle:SULocalizedString(@"Extracting update…", @"Take care not to overflow the status window.") maxProgressValue:1.0 statusText:nil];
[self.statusController setProgressValue:0.0];
[self.statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:nil action:nil isDefault:NO];
[self.statusController setButtonEnabled:NO];
@@ -464,12 +759,13 @@
[self.statusController setProgressValue:progress];
}
- (void)showInstallingUpdateWithApplicationTerminated:(BOOL)applicationTerminated
- (void)showInstallingUpdateWithApplicationTerminated:(BOOL)applicationTerminated retryTerminatingApplication:(void (^)(void))retryTerminatingApplication
{
assert(NSThread.isMainThread);
if (applicationTerminated) {
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil];
// Note this will only show up if -showReadyToInstallAndRelaunch: was called beforehand
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing update…", @"Take care not to overflow the status window.") maxProgressValue:0.0 statusText:nil];
[self.statusController setButtonEnabled:NO];
} else {
// The "quit" event can always be canceled or delayed by the application we're updating
@@ -477,6 +773,9 @@
// We close our status window because we don't want it persisting for too long and have it obscure other windows
[self.statusController close];
self.statusController = nil;
// Keep retry handler in case user tries to show update in focus again
_retryTerminatingApplication = [retryTerminatingApplication copy];
}
}
@@ -509,7 +808,7 @@
}
if (hostVersion != nil) {
alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ is now updated to version %@!", nil), hostName, hostVersion];
alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ is now updated to version %@!", nil), hostName, hostVersion];
} else {
alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ is now updated!", nil), hostName];
}
@@ -525,8 +824,20 @@
{
assert(NSThread.isMainThread);
id<SPUStandardUserDriverDelegate> delegate = self.delegate;
if ([delegate respondsToSelector:@selector(standardUserDriverWillFinishUpdateSession)]) {
[delegate standardUserDriverWillFinishUpdateSession];
}
if (_applicationBecameActiveAfterUpdateAlertBecameKeyObserver != nil) {
[[NSNotificationCenter defaultCenter] removeObserver:_applicationBecameActiveAfterUpdateAlertBecameKeyObserver];
_applicationBecameActiveAfterUpdateAlertBecameKeyObserver = nil;
}
_updateReceivedUserAttention = NO;
self.installUpdateHandler = nil;
self.cancellation = nil;
_retryTerminatingApplication = nil;
[self closeCheckingWindow];
@@ -544,6 +855,8 @@
[self.activeUpdateAlert close];
self.activeUpdateAlert = nil;
}
[self _removeApplicationBecomeActiveObserver];
}
@end
+116 -8
View File
@@ -6,17 +6,14 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
@protocol SUVersionDisplay;
@class SUAppcastItem;
@class SPUUserUpdateState;
/**
A protocol for Sparkle's standard user driver's delegate
@@ -59,6 +56,117 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
@param item The appcast item corresponding to the latest version available.
*/
- (void)standardUserDriverShowVersionHistoryForAppcastItem:(SUAppcastItem *_Nonnull)item;
- (void)standardUserDriverShowVersionHistoryForAppcastItem:(SUAppcastItem *)item;
/**
Specifies whether or not the download, extraction, and installing status windows allows to be minimized.
By default, the status window showing the current status of the update (download, extraction, ready to install) is allowed to be minimized
for regular application bundle updates.
@return @c YES if the status window is allowed to be minimized (default behavior), otherwise @c NO.
*/
- (BOOL)standardUserDriverAllowsMinimizableStatusWindow;
/**
Declares whether or not gentle scheduled update reminders are supported.
The delegate may implement scheduled update reminders that are presented in a gentle manner by implementing one or both of:
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:` and `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@return @c YES if gentle scheduled update reminders are implemented by standard user driver delegate, otherwise @c NO (default).
*/
@property (nonatomic, readonly) BOOL supportsGentleScheduledUpdateReminders;
/**
Specifies if the standard user driver should handle showing a new scheduled update, or if its delegate should handle showing the update instead.
If you implement this method and return @c NO the delegate is then responsible for showing the update,
which must be implemented and done in `-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
The motivation for the delegate being responsible for showing updates is to override Sparkle's default behavior
and add gentle reminders for new updates.
Returning @c YES is the default behavior and allows the standard user driver to handle showing the update.
If the standard user driver handles showing the update, `immediateFocus` reflects whether or not it will show the update in immediate and utmost focus.
The standard user driver may choose to show the update in immediate and utmost focus when the app was launched recently
or the system has been idle for some time.
If `immediateFocus` is @c NO the standard user driver may want to defer showing the update until the user comes back to the app.
For background running applications, when `immediateFocus` is @c NO the standard user driver will always want to show
the update alert immediately, but behind other running applications or behind the app's own windows if it's currently active.
There should be no side effects made when implementing this method so you should just return @c YES or @c NO
You will also want to implement `-standardUserDriverWillHandleShowingUpdate:forUpdate:state:` for adding additional update reminders.
This method is not called for user-initiated update checks. The standard user driver always handles those.
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@param update The update the standard user driver should show.
@param immediateFocus If @c immediateFocus is @c YES, then the standard user driver proposes to show the update in immediate and utmost focus. See discussion for more details.
@return @c YES if the standard user should handle showing the scheduled update (default behavior), otherwise @c NO if the delegate handles showing it.
*/
- (BOOL)standardUserDriverShouldHandleShowingScheduledUpdate:(SUAppcastItem *)update andInImmediateFocus:(BOOL)immediateFocus;
/**
Called before an update will be shown to the user.
If the standard user driver handles showing the update, `handleShowingUpdate` will be `YES`.
Please see `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:` for how the standard user driver
may handle showing scheduled updates when `handleShowingUpdate` is `YES` and `state.userInitiated` is `NO`.
If the delegate declared it handles showing the update by returning @c NO in `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
then the delegate should handle showing update reminders in this method, or at some later point.
In this case, `handleShowingUpdate` will be @c NO.
To bring the update alert in focus, you may call `-[SPUStandardUpdaterController checkForUpdates:]` or `-[SPUUpdater checkForUpdates]`.
You may want to show additional UI indicators in your application that will show this update in focus
and want to dismiss additional UI indicators in `-standardUserDriverWillFinishUpdateSession` or `-standardUserDriverDidReceiveUserAttentionForUpdate:`
If `state.userInitiated` is @c YES then the standard user driver always handles showing the new update and `handleShowingUpdate` will be @c YES.
In this case, it may still be useful for the delegate to intercept this method right before a new update will be shown.
This method is not called when bringing an update that has already been presented back in focus.
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@param handleShowingUpdate @c YES if the standard user driver handles showing the update, otherwise @c NO if the delegate handles showing the update.
@param update The update that will be shown.
@param state The user state of the update which includes if the update check was initiated by the user.
*/
- (void)standardUserDriverWillHandleShowingUpdate:(BOOL)handleShowingUpdate forUpdate:(SUAppcastItem *)update state:(SPUUserUpdateState *)state;
/**
Called when a new update first receives attention from the user.
This occurs either when the user first brings the update alert in utmost focus or when the user makes a choice to install an update or dismiss/skip it.
This may be useful to intercept for dismissing custom attention-based UI indicators (e.g, user notifications) introduced when implementing
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
For custom UI indicators that need to still be on screen after the user has started to install an update, please see `-standardUserDriverWillFinishUpdateSession`.
@param update The new update that the user gave attention to.
*/
- (void)standardUserDriverDidReceiveUserAttentionForUpdate:(SUAppcastItem *)update;
/**
Called before the standard user driver session will finish its current update session.
This may occur after the user has dismissed / skipped a new update or after an update error has occurred.
For updaters updating external/other bundles, this may also be called after an update has been successfully installed.
This may be useful to intercept for dismissing custom UI indicators introduced when implementing
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
For UI indicators that need to be dismissed when the user has given attention to a new update alert,
please see `-standardUserDriverDidReceiveUserAttentionForUpdate:`
*/
- (void)standardUserDriverWillFinishUpdateSession;
@end
NS_ASSUME_NONNULL_END
+2
View File
@@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setCompletionHandler:(SPUUpdateDriverCompletion)completionBlock;
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler;
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders inBackground:(BOOL)background;
- (void)resumeInstallingUpdate;
+27 -5
View File
@@ -132,6 +132,11 @@
[self.coreDriver setCompletionHandler:completionBlock];
}
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler
{
[self.coreDriver setUpdateWillInstallHandler:updateWillInstallHandler];
}
- (void)_clearSkippedUpdatesIfUserInitiated
{
if (self.userInitiated) {
@@ -199,6 +204,15 @@
validatedChoice = userChoice;
}
if ([self.updaterDelegate respondsToSelector:@selector(updater:userDidMakeChoice:forUpdate:state:)]) {
[self.updaterDelegate updater:self.updater userDidMakeChoice:validatedChoice forUpdate:updateItem state:state];
} else if (validatedChoice == SPUUserUpdateChoiceSkip && [self.updaterDelegate respondsToSelector:@selector(updater:userDidSkipThisVersion:)]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[self.updaterDelegate updater:self.updater userDidSkipThisVersion:updateItem];
#pragma clang diagnostic pop
}
switch (validatedChoice) {
case SPUUserUpdateChoiceInstall: {
switch (stage) {
@@ -217,10 +231,6 @@
case SPUUserUpdateChoiceSkip: {
[SPUSkippedUpdate skipUpdate:updateItem host:self.host];
if ([self.updaterDelegate respondsToSelector:@selector(updater:userDidSkipThisVersion:)]) {
[self.updaterDelegate updater:self.updater userDidSkipThisVersion:updateItem];
}
switch (stage) {
case SPUUserUpdateStageDownloaded:
case SPUUserUpdateStageNotDownloaded:
@@ -312,8 +322,20 @@
- (void)installerDidStartInstallingWithApplicationTerminated:(BOOL)applicationTerminated
{
if ([self.userDriver respondsToSelector:@selector(showInstallingUpdateWithApplicationTerminated:)]) {
if ([self.userDriver respondsToSelector:@selector(showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication:)]) {
__weak __typeof__(self) weakSelf = self;
[self.userDriver showInstallingUpdateWithApplicationTerminated:applicationTerminated retryTerminatingApplication:^{
if (!applicationTerminated) {
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.coreDriver finishInstallationWithResponse:SPUUserUpdateChoiceInstall displayingUserInterface:YES];
});
}
}];
} else if ([self.userDriver respondsToSelector:@selector(showInstallingUpdateWithApplicationTerminated:)]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[self.userDriver showInstallingUpdateWithApplicationTerminated:applicationTerminated];
#pragma clang diagnostic pop
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-31
View File
@@ -1,31 +0,0 @@
//
// SPUURLRequest.h
// Sparkle
//
// Created by Mayur Pawashe on 5/19/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
// A class that wraps NSURLRequest and implements NSSecureCoding
// This class exists because NSURLRequest did not support NSSecureCoding in macOS 10.8
// I have not verified if NSURLRequest in 10.9 implements NSSecureCoding or not
@interface SPUURLRequest : NSObject <NSSecureCoding>
// Creates a new URL request
// Only these properties are currently tracked:
// * URL
// * Cache policy
// * Timeout interval
// * HTTP header fields
// * networkServiceType
+ (instancetype)URLRequestWithRequest:(NSURLRequest *)request;
@property (nonatomic, readonly) NSURLRequest *request;
@end
NS_ASSUME_NONNULL_END
-94
View File
@@ -1,94 +0,0 @@
//
// SPUURLRequest.m
// Sparkle
//
// Created by Mayur Pawashe on 5/19/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import "SPUURLRequest.h"
#include "AppKitPrevention.h"
static NSString *SPUURLRequestURLKey = @"SPUURLRequestURL";
static NSString *SPUURLRequestCachePolicyKey = @"SPUURLRequestCachePolicy";
static NSString *SPUURLRequestTimeoutIntervalKey = @"SPUURLRequestTimeoutInterval";
static NSString *SPUURLRequestHttpHeaderFieldsKey = @"SPUURLRequestHttpHeaderFields";
static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServiceType";
@interface SPUURLRequest ()
@property (nonatomic, readonly) NSURL *url;
@property (nonatomic, readonly) NSURLRequestCachePolicy cachePolicy;
@property (nonatomic, readonly) NSTimeInterval timeoutInterval;
@property (nonatomic, readonly, nullable) NSDictionary<NSString *, NSString *> *httpHeaderFields;
@property (nonatomic, readonly) NSURLRequestNetworkServiceType networkServiceType;
@end
@implementation SPUURLRequest
@synthesize url = _url;
@synthesize cachePolicy = _cachePolicy;
@synthesize timeoutInterval = _timeoutInterval;
@synthesize httpHeaderFields = _httpHeaderFields;
@synthesize networkServiceType = _networkServiceType;
- (instancetype)initWithURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval)timeoutInterval httpHeaderFields:(NSDictionary<NSString *, NSString *> *)httpHeaderFields networkServiceType:(NSURLRequestNetworkServiceType)networkServiceType
{
self = [super init];
if (self != nil) {
_url = url;
_cachePolicy = cachePolicy;
_timeoutInterval = timeoutInterval;
_httpHeaderFields = httpHeaderFields;
_networkServiceType = networkServiceType;
}
return self;
}
+ (instancetype)URLRequestWithRequest:(NSURLRequest *)request
{
return [(SPUURLRequest *)[[self class] alloc] initWithURL:request.URL cachePolicy:request.cachePolicy timeoutInterval:request.timeoutInterval httpHeaderFields:request.allHTTPHeaderFields networkServiceType:request.networkServiceType];
}
+ (BOOL)supportsSecureCoding
{
return YES;
}
- (void)encodeWithCoder:(NSCoder *)coder
{
[coder encodeObject:self.url forKey:SPUURLRequestURLKey];
[coder encodeInteger:(NSInteger)self.cachePolicy forKey:SPUURLRequestCachePolicyKey];
[coder encodeDouble:self.timeoutInterval forKey:SPUURLRequestTimeoutIntervalKey];
[coder encodeInteger:(NSInteger)self.networkServiceType forKey:SPUURLRequestNetworkServiceTypeKey];
if (self.httpHeaderFields != nil) {
[coder encodeObject:self.httpHeaderFields forKey:SPUURLRequestHttpHeaderFieldsKey];
}
}
- (instancetype)initWithCoder:(NSCoder *)decoder
{
NSURL *url = [decoder decodeObjectOfClass:[NSURL class] forKey:SPUURLRequestURLKey];
NSURLRequestCachePolicy cachePolicy = (NSURLRequestCachePolicy)[decoder decodeIntegerForKey:SPUURLRequestCachePolicyKey];
NSTimeInterval timeoutInterval = [decoder decodeDoubleForKey:SPUURLRequestTimeoutIntervalKey];
NSDictionary<NSString *, NSString *> *httpHeaderFields = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class]]] forKey:SPUURLRequestHttpHeaderFieldsKey];
NSURLRequestNetworkServiceType networkServiceType = (NSURLRequestNetworkServiceType)[decoder decodeIntegerForKey:SPUURLRequestNetworkServiceTypeKey];
return [self initWithURL:url cachePolicy:cachePolicy timeoutInterval:timeoutInterval httpHeaderFields:httpHeaderFields networkServiceType:networkServiceType];
}
- (NSURLRequest *)request
{
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.url cachePolicy:self.cachePolicy timeoutInterval:self.timeoutInterval];
if (self.httpHeaderFields != nil) {
request.allHTTPHeaderFields = self.httpHeaderFields;
}
request.networkServiceType = self.networkServiceType;
return [request copy];
}
@end
+2
View File
@@ -23,6 +23,8 @@ typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, id<S
- (void)setUpdateShownHandler:(void (^)(void))updateShownHandler;
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler;
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders;
- (void)resumeInstallingUpdate;
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
+33 -22
View File
@@ -6,14 +6,7 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUUserDriver.h>
@@ -32,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
Prefer to set initial properties in your bundle's Info.plist as described in [Customizing Sparkle](https://sparkle-project.org/documentation/customization/).
Otherwise only if you need dynamic behavior (eg. for user preferences) should you set properties on the updater such as:
Otherwise only if you need dynamic behavior for user settings should you set properties on the updater such as:
- `automaticallyChecksForUpdates`
- `updateCheckInterval`
- `automaticallyDownloadsUpdates`
@@ -102,19 +95,24 @@ SU_EXPORT @interface SPUUpdater : NSObject
- (void)checkForUpdates;
/**
Checks for updates, but does not display any UI unless an update is found.
Checks for updates, but does not show any UI unless an update is found.
You usually do not need to call this method directly. If `automaticallyChecksForUpdates` is @c YES,
Sparkle calls this method automatically according to its update schedule using the `updateCheckInterval`
and the `lastUpdateCheckDate`.
and the `lastUpdateCheckDate`. Therefore, you should typically only consider calling this method directly if you
opt out of automatic update checks.
This is meant for programmatically initating a check for updates in the background without the user initiating it.
This check will not show UI if no new updates are found.
If a new update is found, the updater's user driver may handle showing it at an appropriate (but not necessarily immediate) time.
If you want control over when and how a new update is shown, please see https://sparkle-project.org/documentation/gentle-reminders/
Note if automated updating is turned on, either a new update may be downloaded in the background to be installed silently,
or an already downloaded update may be shown.
This is meant for programmatically initating a check for updates.
That is, it will display no UI unless it finds an update, in which case it proceeds as usual.
This will not find updates that the user has opted into skipping.
Note if there is no resumable update found, and automated updating is turned on,
the update will be downloaded in the background without disrupting the user.
This method does not do anything if there is a `sessionInProgress`.
*/
- (void)checkForUpdatesInBackground;
@@ -177,7 +175,11 @@ SU_EXPORT @interface SPUUpdater : NSObject
this permission request is not performed however.
Setting this property will persist in the host bundle's user defaults.
Only set this property if you need dynamic behavior (e.g. user preferences).
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
For testing environments, you can disable update checks by passing `-SUEnableAutomaticChecks NO`
to your app's command line arguments instead of setting this property.
The update schedule cycle will be reset in a short delay after the property's new value is set.
This is to allow reverting this property without kicking off a schedule change immediately
@@ -187,9 +189,12 @@ SU_EXPORT @interface SPUUpdater : NSObject
/**
A property indicating the current automatic update check interval in seconds.
Prefer to set SUScheduledCheckInterval directly in your Info.plist for setting the initial value.
Setting this property will persist in the host bundle's user defaults.
For this reason, only set this property if you need dynamic behavior (eg user preferences).
Otherwise prefer to set SUScheduledCheckInterval directly in your Info.plist.
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
The update schedule cycle will be reset in a short delay after the property's new value is set.
This is to allow reverting this property without kicking off a schedule change immediately
@@ -201,12 +206,15 @@ SU_EXPORT @interface SPUUpdater : NSObject
By default, updates are not automatically downloaded.
Note that the developer can disallow automatic downloading of updates from being enabled.
Note that the developer can disallow automatic downloading of updates from being enabled (via `SUAllowsAutomaticUpdates` Info.plist key).
In this case, this property will return NO regardless of how this property is set.
Prefer to set SUAutomaticallyUpdate directly in your Info.plist for setting the initial value.
Setting this property will persist in the host bundle's user defaults.
For this reason, only set this property if you need dynamic behavior (eg user preferences).
Otherwise prefer to set SUAutomaticallyUpdate directly in your Info.plist.
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
*/
@property (nonatomic) BOOL automaticallyDownloadsUpdates;
@@ -218,6 +226,9 @@ SU_EXPORT @interface SPUUpdater : NSObject
Otherwise the feed URL in the host bundle's Info.plist will be returned.
If no feed URL can be retrieved, returns nil.
For setting a primary feed URL, please set the `SUFeedURL` property in your Info.plist.
For setting an alternative feed URL, please prefer `-[SPUUpdaterDelegate feedURLStringForUpdater:]` over `-setFeedURL:`
This property must be called on the main thread; calls from background threads will return nil.
*/
@property (nonatomic, readonly, nullable) NSURL *feedURL;
@@ -281,7 +292,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
@property (nonatomic, readonly, copy, nullable) NSDate *lastUpdateCheckDate;
/**
Appropriately schedules or cancels the update checking timer according to the preferences for time interval and automatic checks.
Appropriately schedules or cancels the update checking timer according to the settings for the time interval and automatic checks.
If you change the `updateCheckInterval` or `automaticallyChecksForUpdates` properties, the update cycle will be reset automatically after a short delay.
The update cycle is also started automatically after the updater is started. In all these cases, this method should not be called directly.
+35 -11
View File
@@ -32,6 +32,7 @@
#import "SPUResumableUpdate.h"
#import "SUSignatures.h"
#import "SPUUserAgent+Private.h"
#import "SPUGentleUserDriverReminders.h"
#include "AppKitPrevention.h"
@@ -94,11 +95,14 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
@synthesize loggedNoSecureKeyWarning = _loggedNoSecureKeyWarning;
#if DEBUG
+ (void)load
+ (void)initialize
{
// We're using NSLog instead of SULog here because we don't want to start Sparkle's logger here,
// and because this is not really an error, just a warning notice
NSLog(@"WARNING: This is running a Debug build of Sparkle 2; don't use this in production!");
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// We're using NSLog instead of SULog here because we don't want to start Sparkle's logger here,
// and because this is not really an error, just a warning notice
NSLog(@"WARNING: This is running a Debug build of Sparkle 2; don't use this in production!");
});
}
#endif
@@ -166,6 +170,10 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
return NO;
}
if ([self.userDriver respondsToSelector:@selector(resetTimeSinceOpportuneUpdateNotice)]) {
[(id<SPUGentleUserDriverReminders>)self.userDriver resetTimeSinceOpportuneUpdateNotice];
}
self.startedUpdater = YES;
self.canCheckForUpdates = YES;
@@ -221,7 +229,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
SUHost *mainBundleHost = self.mainBundleHost;
if (validateXPCServices) {
// Check that all enabled XPC Services are embedded
NSArray<NSString *> *xpcServiceIDs = @[@INSTALLER_LAUNCHER_BUNDLE_ID, @DOWNLOADER_BUNDLE_ID, @INSTALLER_CONNECTION_BUNDLE_ID, @INSTALLER_STATUS_BUNDLE_ID];
NSArray<NSString *> *xpcServiceIDs = @[@INSTALLER_LAUNCHER_NAME, @DOWNLOADER_NAME, @INSTALLER_CONNECTION_NAME, @INSTALLER_STATUS_NAME];
NSArray<NSString *> *xpcServiceEnabledKeys = @[SUEnableInstallerLauncherServiceKey, SUEnableDownloaderServiceKey, SUEnableInstallerConnectionServiceKey, SUEnableInstallerStatusServiceKey];
NSUInteger xpcServiceCount = xpcServiceIDs.count;
@@ -275,7 +283,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
NSBundle *downloaderBundle;
if ([mainBundleHost boolForInfoDictionaryKey:SUEnableDownloaderServiceKey]) {
NSURL *downloaderServiceBundleURL = [[[self.sparkleBundle.bundleURL URLByAppendingPathComponent:@"XPCServices"] URLByAppendingPathComponent:@DOWNLOADER_BUNDLE_ID] URLByAppendingPathExtension:@"xpc"];
NSURL *downloaderServiceBundleURL = [[[self.sparkleBundle.bundleURL URLByAppendingPathComponent:@"XPCServices"] URLByAppendingPathComponent:@DOWNLOADER_NAME] URLByAppendingPathExtension:@"xpc"];
downloaderBundle = [NSBundle bundleWithURL:downloaderServiceBundleURL];
} else {
downloaderBundle = nil;
@@ -339,10 +347,11 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
}
} else if (publicKeys.ed25519PubKey == nil) {
// No EdDSA key is available, so app must be using DSA
if (updatingMainBundle && !self.loggedNoSecureKeyWarning) {
SULog(SULogLevelError, @"Error: Serving updates without an EdDSA key is insecure and deprecated. DSA support may be removed in a future Sparkle release. Please migrate to using EdDSA (ed25519). Visit Sparkle's documentation for migration information: https://sparkle-project.org/documentation/#3-segue-for-security-concerns");
self.loggedNoSecureKeyWarning = YES;
if (updatingMainBundle) {
if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUNoPublicDSAFoundError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"For security reasons, updates need to be signed with an EdDSA key for %@. Please migrate to using EdDSA (ed25519). Visit Sparkle's documentation for migration information: https://sparkle-project.org/documentation/#3-segue-for-security-concerns.", hostName] }];
}
return NO;
}
}
@@ -443,7 +452,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
{
[self.updaterTimer invalidate];
if (![self automaticallyChecksForUpdates]) {
if (!firingImmediately && ![self automaticallyChecksForUpdates]) {
if ([self.delegate respondsToSelector:@selector(updaterWillNotScheduleUpdateCheck:)]) {
[self.delegate updaterWillNotScheduleUpdateCheck:self];
}
@@ -510,6 +519,11 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
if ([self.delegate respondsToSelector:@selector(updater:willScheduleUpdateCheckAfterDelay:)]) {
[self.delegate updater:self willScheduleUpdateCheckAfterDelay:delayUntilCheck];
}
if ([self.userDriver respondsToSelector:@selector(logGentleScheduledUpdateReminderWarningIfNeeded)]) {
[(id<SPUGentleUserDriverReminders>)self.userDriver logGentleScheduledUpdateReminderWarningIfNeeded];
}
[self.updaterTimer startAndFireAfterDelay:delayUntilCheck];
} else {
// We're overdue! Run one now.
@@ -755,6 +769,10 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
weakSelf.canCheckForUpdates = YES;
}];
[self.driver setUpdateWillInstallHandler:^{
[weakSelf updateLastUpdateCheckDate];
}];
if (installerInProgress) {
// Resume an update that has already begun installing in the background
[self.driver resumeInstallingUpdate];
@@ -789,6 +807,12 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
return; // not even ready yet
}
// Note this resets the opportune time when user grants Sparkle permission to check for updates
// and when the user changes preferences on automatically checking for updates or the update time check interval
if ([self.userDriver respondsToSelector:@selector(resetTimeSinceOpportuneUpdateNotice)]) {
[(id<SPUGentleUserDriverReminders>)self.userDriver resetTimeSinceOpportuneUpdateNotice];
}
if (!self.sessionInProgress) {
[self cancelNextUpdateCycle];
[self scheduleNextUpdateCheckFiringImmediately:NO usingCurrentDate:YES];
+19 -12
View File
@@ -6,19 +6,13 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUUpdateCheck.h>
#import <Sparkle/SPUUserUpdateState.h>
@protocol SUVersionComparison;
@class SPUUpdater, SUAppcast, SUAppcastItem;
@class SPUUpdater, SUAppcast, SUAppcastItem, SPUUserUpdateState;
NS_ASSUME_NONNULL_BEGIN
@@ -243,12 +237,23 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey;
- (BOOL)updater:(SPUUpdater *)updater shouldProceedWithUpdate:(SUAppcastItem *)updateItem updateCheck:(SPUUpdateCheck)updateCheck error:(NSError * __autoreleasing *)error;
/**
Called when an update is skipped by the user.
Called when a user makes a choice to install, dismiss, or skip an update.
If the @c choice is `SPUUserUpdateChoiceDismiss` and @c state.stage is `SPUUserUpdateStageDownloaded` the downloaded update is kept
around until the next time Sparkle reminds the user of the update.
If the @c choice is `SPUUserUpdateChoiceDismiss` and @c state.stage is `SPUUserUpdateStageInstalling` the update is still set to install on application termination.
If the @c choice is `SPUUserUpdateChoiceSkip` the user will not be reminded in the future for this update unless they initiate an update check themselves.
If @c updateItem.isInformationOnlyUpdate is @c YES the @c choice cannot be `SPUUserUpdateChoiceInstall`.
@param updater The updater instance.
@param item The appcast item corresponding to the update that the user skipped.
@param choice The choice (install, dismiss, or skip) the user made for this @c updateItem
@param updateItem The appcast item corresponding to the update that the user made a choice on.
@param state The current state for the update which includes if the update has already been downloaded or already installing.
*/
- (void)updater:(SPUUpdater *)updater userDidSkipThisVersion:(SUAppcastItem *)item;
- (void)updater:(SPUUpdater *)updater userDidMakeChoice:(SPUUserUpdateChoice)choice forUpdate:(SUAppcastItem *)updateItem state:(SPUUserUpdateState *)state;
/**
Returns whether the release notes (if available) should be downloaded after an update is found and shown.
@@ -409,7 +414,7 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey;
@param updater The updater instance.
@param item The appcast item corresponding to the update that is proposed to be installed.
@param immediateInstallHandler The install handler to immediately install the update. No UI interaction will be shown and the application will be relaunched after installation.
@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.
@return @c YES if the delegate will handle installing the update or @c NO if the updater should be given responsibility.
*/
- (BOOL)updater:(SPUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)(void))immediateInstallHandler;
@@ -453,6 +458,8 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey;
- (BOOL)updaterMayCheckForUpdates:(SPUUpdater *)updater __deprecated_msg("Please use -[SPUUpdaterDelegate updater:mayPerformUpdateCheck:error:] instead.");
- (void)updater:(SPUUpdater *)updater userDidSkipThisVersion:(SUAppcastItem *)item __deprecated_msg("Please use -[SPUUpdaterDelegate updater:userDidMakeChoice:forUpdate:state:] instead.");
@end
NS_ASSUME_NONNULL_END
+6 -7
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
@@ -38,6 +31,12 @@ SU_EXPORT @interface SPUUpdaterSettings : NSObject
*/
@property (readonly, nonatomic) NSTimeInterval updateCheckInterval;
/**
* Indicates whether or not automatically downloading updates is allowed to be turned on by the user.
* If this value is nil, the developer has not explicitly specified this option.
*/
@property (readonly, nonatomic, nullable) NSNumber *allowsAutomaticUpdatesOption;
/**
* Indicates whether or not automatically downloading updates is allowed to be turned on by the user.
*/
+7 -1
View File
@@ -52,9 +52,15 @@
}
// For allowing automatic downloaded updates to be turned on or off
- (BOOL)allowsAutomaticUpdates
- (NSNumber * _Nullable)allowsAutomaticUpdatesOption
{
NSNumber *developerAllowsAutomaticUpdates = [self.host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey];
return [developerAllowsAutomaticUpdates isKindOfClass:[NSNumber class]] ? developerAllowsAutomaticUpdates : nil;
}
- (BOOL)allowsAutomaticUpdates
{
NSNumber *developerAllowsAutomaticUpdates = [self allowsAutomaticUpdatesOption];
return (developerAllowsAutomaticUpdates == nil || developerAllowsAutomaticUpdates.boolValue);
}
+11 -11
View File
@@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SPUUserUpdateState.h>
#import <Sparkle/SUExport.h>
@@ -226,8 +219,13 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
* If the application hasn't been terminated, a quit event is sent to the running application before installing the update.
* If the application or user delays or cancels termination, there may be an indefinite period of time before the application fully quits.
* It is up to the implementor whether or not to decide to continue showing installation progress in this case.
*
* @param retryTerminatingApplication This handler gives a chance for the application to re-try sending a quit event to the running application before installing the update.
* The application may cancel or delay termination. This handler gives the user driver another chance to allow the user to try terminating the application again.
* If the application does not delay or cancel application termination, there is no need to invoke this handler. This handler may be invoked multiple times.
* Note this handler should not be invoked if @c applicationTerminated is already @c YES
*/
- (void)showInstallingUpdateWithApplicationTerminated:(BOOL)applicationTerminated;
- (void)showInstallingUpdateWithApplicationTerminated:(BOOL)applicationTerminated retryTerminatingApplication:(void (^)(void))retryTerminatingApplication;
/**
* Show the user that the update installation finished
@@ -238,7 +236,7 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
* the updater's lifetime is tied to the application it is updating. This implementation must not try to reference
* the old bundle prior to the installation, which will no longer be around.
*
* Before this point, `-showInstallingUpdateWithApplicationTerminated:` will be called.
* Before this point, `-showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication:` will be called.
*
* @param relaunched Indicates if the update was relaunched.
* @param acknowledgement Acknowledge to the updater that the finished installation was shown.
@@ -278,9 +276,11 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
- (void)dismissUserInitiatedUpdateCheck __deprecated_msg("Transition to new UI appropriately when a new update is shown, when no update is found, or when an update error occurs.");
- (void)showInstallingUpdate __deprecated_msg("Implement -showInstallingUpdateWithApplicationTerminated: instead.");
- (void)showInstallingUpdate __deprecated_msg("Implement -showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication: instead.");
- (void)showSendingTerminationSignal __deprecated_msg("Implement -showInstallingUpdateWithApplicationTerminated: instead.");
- (void)showSendingTerminationSignal __deprecated_msg("Implement -showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication: instead.");
- (void)showInstallingUpdateWithApplicationTerminated:(BOOL)applicationTerminated __deprecated_msg("Implement -showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication: instead.");;
@end
+5
View File
@@ -53,6 +53,11 @@
self.updateDidShowHandler = handler;
}
- (void)setUpdateWillInstallHandler:(void (^)(void))updateWillInstallHandler
{
[self.uiDriver setUpdateWillInstallHandler:updateWillInstallHandler];
}
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders
{
self.showingUserInitiatedProgress = YES;
-7
View File
@@ -9,14 +9,7 @@
#ifndef SPUUserUpdateState_h
#define SPUUserUpdateState_h
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
-7
View File
@@ -6,14 +6,7 @@
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
NS_ASSUME_NONNULL_BEGIN
-7
View File
@@ -9,14 +9,7 @@
#ifndef SUAPPCAST_H
#define SUAPPCAST_H
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
+108 -2
View File
@@ -111,7 +111,108 @@
{
SUAppcastItem *deltaItem = (regularItem != nil) ? [[self class] deltaUpdateFromAppcastItem:regularItem hostVersion:self.host.version] : nil;
if (deltaItem != nil) {
BOOL supportsDeltaItem;
if (deltaItem == nil) {
supportsDeltaItem = NO;
} else {
// Delta updates are not supported when bundles are transferred over to some file systems like fat32 and exfat systems
// This is because they do not preserve permissions completely, which we require for diff'ing.
// We shouldn't download delta updates in cases where we can detect they aren't supported
// More accurately we will detect if the host bundle's permission bits have been 'tainted'
// which is more reliable than checking the underlying file system.
// To do this, we will check the Sparkle executable's permission bits, which is produced from us
// We will also check if the executable file or the localization files have been stripped from Sparkle.framework
NSFileManager *fileManager = NSFileManager.defaultManager;
NSBundle *hostBundle = self.host.bundle;
NSString *sparkleExecutablePath;
NSString *sparkleResourcesPath;
if ([hostBundle isEqual:NSBundle.mainBundle]) {
NSBundle *sparkleBundle = [NSBundle bundleForClass:[self class]];
sparkleExecutablePath = sparkleBundle.executableURL.URLByResolvingSymlinksInPath.path;
sparkleResourcesPath = sparkleBundle.resourcePath;
} else {
// If we are not updating ourselves, make a good guess to the Sparkle executable location
NSURL *frameworksURL = hostBundle.privateFrameworksURL;
NSURL *sparkleSymlinkURL = [frameworksURL URLByAppendingPathComponent:@"Sparkle.framework/Sparkle"];
NSString *candidateExecutablePath = sparkleSymlinkURL.URLByResolvingSymlinksInPath.path;
if ([fileManager fileExistsAtPath:candidateExecutablePath]) {
sparkleExecutablePath = candidateExecutablePath;
sparkleResourcesPath = [candidateExecutablePath.stringByDeletingLastPathComponent stringByAppendingPathComponent:@"Resources"];
} else {
sparkleExecutablePath = nil;
sparkleResourcesPath = nil;
}
}
if (sparkleExecutablePath != nil) {
NSError *attributesError = nil;
NSDictionary<NSFileAttributeKey, id> *attributes = [fileManager attributesOfItemAtPath:sparkleExecutablePath error:&attributesError];
BOOL sparkleExecutableIsOK;
if (attributes != nil) {
// Skip delta updates if permissions are not 0755
NSNumber *posixPermissions = attributes[NSFilePosixPermissions];
if (posixPermissions != nil && posixPermissions.shortValue != 0755) {
sparkleExecutableIsOK = NO;
// Irregular permissions on the Sparkle executable could mean the app was transferred on a file system we don't support
// (which doesn't track all permissions)
SULog(SULogLevelDefault, @"Encountered irregular POSIX permissions 0%o for Sparkle executable, which is not 0755. Skipping delta updates..", posixPermissions.shortValue);
} else {
// Test if Sparkle's executable file on disk has expected file size for applying this delta update
// If the file size has been reduced, the user could have stripped an architecture out
if (deltaItem.deltaFromSparkleExecutableSize != nil) {
NSNumber *fileSize = attributes[NSFileSize];
if (fileSize != nil && ![deltaItem.deltaFromSparkleExecutableSize isEqualToNumber:fileSize]) {
sparkleExecutableIsOK = NO;
SULog(SULogLevelDefault, @"Expected file size (%lld) of Sparkle's executable does not match actual file size (%lld). Skipping delta update.", deltaItem.deltaFromSparkleExecutableSize.unsignedLongLongValue, fileSize.unsignedLongLongValue);
} else {
sparkleExecutableIsOK = YES;
}
} else {
sparkleExecutableIsOK = YES;
}
}
} else {
sparkleExecutableIsOK = YES;
SULog(SULogLevelError, @"Error: Failed to retrieve attributes from Sparkle executable: %@", attributesError.localizedDescription);
}
// Test if Sparkle's expected localization files on disk are still present for applying this delta update
// If there are missing localization files, the user could have stripped them out
// No need to test this though if !sparkleExecutableIsOK
BOOL sparkleResourcesAreOK;
if (sparkleExecutableIsOK && sparkleResourcesPath != nil && deltaItem.deltaFromSparkleLocales != nil) {
BOOL foundAllExpectedLocales = YES;
for (NSString *locale in deltaItem.deltaFromSparkleLocales) {
NSString *localeProjectPath = [[sparkleResourcesPath stringByAppendingPathComponent:locale] stringByAppendingPathExtension:@"lproj"];
if (![fileManager fileExistsAtPath:localeProjectPath]) {
foundAllExpectedLocales = NO;
SULog(SULogLevelDefault, @"Expected project locale (%@) is missing in Sparkle.framework. Skipping delta update.", locale);
break;
}
}
sparkleResourcesAreOK = foundAllExpectedLocales;
} else {
sparkleResourcesAreOK = YES;
}
supportsDeltaItem = sparkleExecutableIsOK && sparkleResourcesAreOK;
} else {
supportsDeltaItem = YES;
SULog(SULogLevelError, @"Error: Failed to unexpectably retrieve Sparkle executable URL from %@", hostBundle.bundlePath);
}
}
if (supportsDeltaItem) {
if (secondaryUpdate != NULL) {
*secondaryUpdate = regularItem;
}
@@ -140,7 +241,6 @@
regularItemFromDelegate = nil;
delegateOptedOutOfSelection = NO;
} else {
assert(!candidateItem.deltaUpdate);
if (candidateItem.deltaUpdate) {
// Client would have to go out of their way to examine the .deltaUpdates to return one
// We need them to give us a regular update item back instead..
@@ -253,6 +353,12 @@
return NO;
}
// Delta updates cannot be top-level entries
BOOL isDeltaUpdate = [item isDeltaUpdate];
if (isDeltaUpdate) {
return NO;
}
NSString *channel = item.channel;
if (channel == nil) {
// Item is on the default channel
Loaded 100 of 268 files, more files were not shown because too many files have changed in this diff. Show more