Compare commits

..
342 Commits
Author SHA1 Message Date
Kornel c0933a516b Update Package.swift 2021-02-27 12:02:42 +00:00
Mayur Pawashe 490f8aa71a Merge pull request #1785 from sparkle-project/bump-unarchiving-test-timeout
Bump unarchiving tests timeout from 7 seconds to 30 seconds
2021-02-22 07:44:23 -08:00
Mayur Pawashe 2931c3f8aa Merge pull request #1782 from sparkle-project/bz2-make-fallback
Add fallback to bz2 when building Sparkle distribution
2021-02-22 07:44:00 -08:00
Kornel b5c9539f16 Fight SPM retagging 2021-02-22 09:46:32 +00:00
Kornel 9d9205851d Changelog 2021-02-22 09:37:50 +00:00
Zorg 22c15e8d79 Bump unarchiving tests timeout from 7 seconds to 30 seconds 2021-02-21 18:03:01 -08:00
Mayur Pawashe 056d84eaca Merge pull request #1780 from sparkle-project/fix-compiling
Fix compilation issues & add building distribution in Release in CI
2021-02-21 17:49:04 -08:00
Zorg 252cfc32e1 Add fallback to bz2 when building Sparkle distribution 2021-02-21 17:16:06 -08:00
Zorg cde2af9c7f Add SULog.m to Sparkle Test App to fix compile failures 2021-02-21 15:39:27 -08:00
Zorg 741bb2825d Add building distribution in Release in CI 2021-02-21 15:30:02 -08:00
Kornel 1a52f7df98 Bump 2021-02-21 17:23:31 +00:00
Kornel 26882d4ed4 Update Package.swift 2021-02-21 17:19:26 +00:00
Kornel 1b926c85f5 1.25.0 2021-02-21 17:17:10 +00:00
Mayur Pawashe 4853c187ae Merge pull request #1775 from sparkle-project/ignore-format-non-iso
Ignore -Wno-format-non-iso warnings
2021-02-21 07:14:19 -08:00
Zorg 8409cbb9f6 Ignore -Wno-format-non-iso warnings 2021-02-20 20:41:13 -08:00
Mayur Pawashe 126f9d214a Merge pull request #1772 from lovette/patch-2
Correct generate_appcast -s command line argument usage help
2021-02-20 20:00:34 -08:00
Lance Lovette c7b1d221b9 Correct generate_appcast -s command line argument usage help
Fixes sparkle-project/Sparkle#1766
2021-02-20 11:47:16 -05:00
Mayur Pawashe 1013c5076d Merge pull request #1771 from sparkle-project/fix-1768
Fix XQuartz update failing because NSLog caused issues
2021-02-20 08:35:10 -08:00
Zorg a1133829e4 Fix wrong SULog format specifier 2021-02-20 08:22:24 -08:00
Zorg 7980c4dfdc Disable determinate progress for guided pkg install properly 2021-02-19 20:50:04 -08:00
Zorg acd22dda12 Undo removing progress change 2021-02-19 20:38:47 -08:00
Zorg 9f5dd63697 Fix unit tests not building due to missing SULog symbol 2021-02-19 19:54:08 -08:00
Zorg 28a4d70aa0 Fix XQuartz update failing because NSLog caused issues
In Sparkle 1.x, Autoupdate is NSTask'ed from the updater with LSBackgroundOnly / LSUIElement set. Somehow when updating XQuartz, any NSLog usage makes Autoupdate get mysteriously killed afterwards.

Literally if I put the two statements right in main():

NSLog(@"foo");
NSLog(@"bar");

Only foo would be logged, bar would not be logged. I even verified this was not just a "logging" issue by writing out files to disk.

So in SUFileManager before we prompt the user an authorization dialog, we logged:
Sparkle: Authorization required to run pkg installer file:///Users/msp/Library/Caches/org.xquartz.X11/org.sparkle-project.Sparkle/PersistentDownloads/YYhaX4Tma/XQuartz%202.8.8/Xquartz.pkg

Which is the last thing seen. Normally if an error occurred we'd log it.

I don't know if there is an OS bug involved but anyway, we should just replace all NSLog usage with SULog in Autoupdate. fileop in 1.x which uses SUFileManager should probably never NSLog anyway. Autoupdate tool in 2.x is spawned as a launchd daemon for package installs, so it might not be affected, but I should update SULog usages there anyway to be in sync.

The determinate progress reporting was also broken (#1402), so I'm making it an indeterminate progress bar again rather than trying to debug what has apparently become fragile text parsing.
2021-02-19 19:29:10 -08:00
Mayur Pawashe abe6b493f8 Merge pull request #1765 from lovette/patch-1
Fix -f command line argument handling
2021-02-17 20:32:20 -08:00
Lance Lovette d5e80b56d6 Fix -f command line argument handling
https://github.com/sparkle-project/Sparkle/issues/1763
2021-02-17 08:54:51 -05:00
Kornel eee82a9b5c Merge pull request #1760 from vojtakonarik/master 2021-02-16 09:28:11 +00:00
Vojtěch Koňařík cdd1392362 Update Sparkle.strings 2021-02-14 00:13:22 +01:00
Vojtěch Koňařík a8be860ed9 Update Sparkle.strings 2021-02-14 00:09:43 +01:00
Vojtěch Koňařík 6d392e6800 Update SUUpdatePermissionPrompt.strings 2021-02-13 23:56:50 +01:00
Vojtěch Koňařík bf30749aa3 Update SUUpdateAlert.strings 2021-02-13 23:29:31 +01:00
Vojtěch Koňařík eb2b818c35 Update SUAutomaticUpdateAlert.strings 2021-02-13 22:08:38 +01:00
Mayur Pawashe 057e15e5f2 Merge pull request #1746 from sparkle-project/flat-package-1x
Backport flat non-archived package support from #1745 (for 1.x)
2021-02-13 11:14:01 -08:00
Zorg 6673fc18e2 Support mpkg for updating/installing flat non-archived packages 2021-02-13 10:14:53 -08:00
Kornel c7c90d4d1d Merge pull request #1748 from grit96/patch-1
Apply custom headers to app download
2021-02-07 15:02:47 +00:00
Geraint White 8ffb4956de Apply custom headers to app download
The custom headers added in #489 only applied to the appcast download.
This makes them apply to the app download as well for the case when both are hosted behind authentication.
2021-02-07 09:54:16 +00:00
Mayur Pawashe e1c565f6ce Merge pull request #1756 from sparkle-project/describe-tests
Add description of test cases in PR review template
2021-02-07 00:13:35 -08:00
Zorg 5a2bd7421a Add description of test cases in PR review template 2021-02-07 00:04:56 -08:00
Kornel 07b044dd8f Update Package.swift 2021-02-06 02:07:55 +00:00
Kornel cd9495214d RC 2021-02-06 02:04:17 +00:00
Mayur Pawashe be3fb5caf2 Merge pull request #1751 from thebluepotato/patch-2
Fix Package.swift
2021-02-05 15:43:44 -08:00
Jonas Zaugg 3b500aeaa3 Update make-release-package.sh
Now provides an error and exits when not complying with SemVer
2021-02-05 21:05:14 +01:00
Jonas Zaugg cc1e43c115 Update make-release-package.sh
Only check and update tag in Package.swift when not running a CI build. As long as GitHub actions are reserved for tests, this should be ok as this is a "fake" update of Package.swift anyway. If you ever use GitHub actions for releases, you'll probably have to rethink the tagging logic once again
2021-02-05 00:15:18 +01:00
Jonas Zaugg 07dfc86c47 Checks SemVer and default to force tagging 2021-02-04 14:29:03 +01:00
Jonas Zaugg 22e130d10b Various fixes to SPM logic
Improves prompt asking to force move tag (default is NO, but can be triggered after `make release`). Fixes issues with single quotes in make-release-package.sh.
2021-02-04 13:36:51 +01:00
Jonas Zaugg 75dfdd8279 Include tag instead of version in Package.swift 2021-02-04 13:13:31 +01:00
Kornel 27448add37 Changelog 2021-02-03 12:11:16 +00:00
Zorg 067eedbb7a Fix generate_appcast compile error 2021-01-31 00:18:29 -08:00
Zorg a841415046 Backport flat package support from #1745 2021-01-31 00:02:38 -08:00
Mayur Pawashe 3b78c78702 Merge pull request #1740 from sparkle-project/phased-group-fixes-1x
Fix issues with phased group updates found in #1736
2021-01-30 18:17:05 -08:00
Zorg a8ec752c51 Add phased rollouts feature to automatic update driver too
Previously phased rollouts did not work if the user/developer set updates to be automatically downloaded in 1.x
2021-01-30 17:54:23 -08:00
Mayur Pawashe 464142c73d Merge pull request #1742 from sparkle-project/remove-disable-automatic-skip-1x
Remove hiding skip button and retitling later button
2021-01-30 12:54:43 -08:00
Mayur Pawashe baa26a1b19 Merge pull request #1743 from sparkle-project/deprecate-installUpdatesIfAvailable
Deprecate installUpdatesIfAvailable
2021-01-30 12:34:39 -08:00
Mayur Pawashe 513158dfcc Merge pull request #1744 from sparkle-project/revert-exposing-system-profile-array
Revert exposing systemProfileInformationArray until implemented a better way
2021-01-30 12:34:04 -08:00
Zorg 901683d837 Revert "Exposed systemProfileInformationArray, e.g. for use by the app preferences GUI"
This reverts commit 1c32cc7fcb.

* We cannot make it look like applications are collecting system profile information all the time.
* The method collects non-system profile information too (feed parameters from delegate). Presumably users only cares about system profile information. Otherwise the name is incorrect.
* Adding a mutable property to SUUpdater is heavyweight; perhaps an API to ask and compute for the systemProfileArray is better idea. Or a delegate API when system profile array will be sent.
* This change introduced nullability warnings in SUUpdater.h due to other things not being null annotated there.
2021-01-30 11:08:46 -08:00
Zorg 10d24078cc Add note about using automaticallyDownloadsUpdates property 2021-01-30 10:40:16 -08:00
Zorg 9944f000f8 Deprecate installUpdatesIfAvailable 2021-01-30 08:59:41 -08:00
Zorg bf96a6e066 Remove hiding skip button and retitling later button
Same reason as #1741

If we can handle all cases properly (minimumAutoupdateVersion, user opting out of automatic downloads, and absence of allowsAutomaticUpdates which is removed in 2.x to both handle sandboxing and resuming automatic downloads) we can possibly accept a contribution to disable skipping / remind me later buttons.

But right now this is edge case-y and not compatible to 2.x going forward.
2021-01-30 08:51:00 -08:00
Kornel 8fb9c83adf Bump 2021-01-30 11:25:45 +00:00
Zorg d662b67a58 Fix issues with phased group updates found in #1736 2021-01-29 22:12:07 -08:00
Mayur Pawashe 0b682d3349 Merge pull request #1734 from sparkle-project/alert-adjustments-1x
Alert adjustments 1x
2021-01-24 10:15:41 -08:00
Zorg 9561d522e3 Keep skip button available if there is a minimum autoupdate version 2021-01-24 01:09:36 -08:00
Zorg f60b60b08f Fix automatic updates checkbox state when not showing release notes 2021-01-23 21:14:59 -08:00
Zorg a85db747f1 Add more comments 2021-01-23 19:37:29 -08:00
Zorg 9cc9f51d7c Add clarification on developer too 2021-01-23 19:20:33 -08:00
Zorg bb9ee3c59b Fix edge cases with hiding alert buttons and using "Install Later" 2021-01-23 19:09:25 -08:00
Mayur Pawashe 4cb4ab8954 Merge pull request #1732 from sparkle-project/migrate-keys-1.x
Integrate generate_keys export/import options changes from #1730
2021-01-23 16:39:22 -08:00
Mayur Pawashe ab82c70aef Merge pull request #1731 from sparkle-project/update-pr-template
Update pull request template
2021-01-23 08:20:18 -08:00
Zorg eb9f4c303a Integrate generate_keys export/import options changes from #1730 2021-01-23 08:13:31 -08:00
Zorg e3c4a702f4 Update pull request template 2021-01-23 08:09:05 -08:00
Mayur Pawashe 039a46c96a Merge pull request #1729 from R4N/fr_translation_capitalization
Capitalizes french translation of "Vous utilisez actuellement..." ("Y…
2021-01-20 19:16:42 -08:00
Micah Moore f711abe9de Capitalizes french translation of "Vous utilisez actuellement..." ("You are currently running...") 2021-01-20 14:06:55 -05:00
Kornel dfecd4d2fa Merge pull request #1727 from zorgiepoo/pr-issues-templates 2021-01-19 11:39:53 +00:00
Kornel fddbadb114 Merge pull request #1696 from lorenrh/customUpdateButtons
Hide automatic update button and skip button, depending on `SUAutomaticallyUpdate` key
2021-01-19 11:39:09 +00:00
Kornel bfdce8d232 Merge pull request #1723 from zorgiepoo/about-blank-fix
Ignore opening about:blank URLs
2021-01-19 11:36:16 +00:00
Kornel 3111483cb2 Merge pull request #1725 from zorgiepoo/update-readme-build
Update build information in 1.x ReadMe
2021-01-19 11:35:30 +00:00
Zorg f5282705b4 Updated PR template regarding back porting and types of testing 2021-01-18 09:23:49 -08:00
Lorena Rangel 4c9397d752 Show check for updates button only when automatic updates are enabled
Signed-off-by: Lorena Rangel <lorena.rangel@docker.com>
2021-01-18 17:18:56 +01:00
Zorg 43184ea0bf Add pull request template and update issue templates
These changes require development changes to be made on 2.x branch first. This is separate from changing the default branch, which can happen and be done independently.

On the repo level, I also want to protect master and 2.x from direct pushes because inevitably it's tempting to push changes directly that should be reviewed -- and changes that get integrated that way are less pleasant to track.

And I want to require a minimum of two project members to review PR changes (with a reasonable bypass for trivial bug-fixes, localization or doc updates). With that, I will put a commitment in reviewing changes here, and this would result in less work for project members and better quality review.
2021-01-18 00:15:34 -08:00
Zorg 866bb8245f Update build information in 1.x ReadMe 2021-01-17 12:29:56 -08:00
Zorg 65f473b237 Ignore opening about:blank URLs
Fix from 8f19f6a8cc which I regressed accidentally.
2021-01-16 21:04:25 -08:00
Tobias Fonfara 0c8b7f1d25 Don't initialize the webview if we don't show release notes 2021-01-06 18:02:56 +00:00
Kornel 06520272ee Merge pull request #1710 from thebluepotato/fix-catch-22 2021-01-05 14:45:24 +00:00
Jonas Zaugg 602ac871b8 Update release-move-tag.sh
Fixes commit counting logic, some typos and logs more info.
2021-01-05 14:42:40 +01:00
Jonas Zaugg 1b5e938423 Update Makefile 2021-01-05 13:17:05 +01:00
Jonas Zaugg d21a303b2e Update release-move-tag.sh
Prevents re-tagging when there are more than one commits since latest tag (to prevent accidentally moving an old tag)
2021-01-05 13:07:11 +01:00
Jonas Zaugg 2e048a8601 Add script to commit and re-tag changes to Package.swift 2021-01-05 12:19:14 +01:00
Kornel da1748f7bd Merge pull request #1709 from zorgiepoo/webkit2-1.x 2021-01-05 02:17:28 +00:00
Zorg 54bbaee7f5 Re-add setting WebUIDelegate fix for legacy web view 2021-01-04 16:24:15 -08:00
Zorg 8bba4d21fc Fix not adding effectiveAppearance observer during merge 2021-01-04 16:16:16 -08:00
Zorg 6283992215 Implement loadRequest method on SUWebView 2021-01-04 16:12:58 -08:00
Zorg dfff98d19e Adopt WKWebView for 1.x 2021-01-04 16:08:19 -08:00
Jonas Zaugg 0ca9d34f42 [WIP] Fix catch-22 Swift Package Manager binary target
Should fix #1674, currently WIP
2021-01-04 11:24:26 +01:00
Kornel 5f47ce3dea Merge pull request #1707 from sparkle-project/github-ci-1.x 2021-01-03 10:09:01 +00:00
Zorg 470e3734b9 Use macos-10.15 instead of macOS-latest 2021-01-02 12:58:31 -08:00
Zorg 397467e6d7 Specify Xcode version to use instead of macOS version
It is more important OS version is stable in their virtual environment setup.
2021-01-01 19:55:35 -08:00
Zorg 3695ae6059 Adopt GitHub Actions for CI and fix issues with our UI test 2021-01-01 19:25:39 -08:00
Kornel 544df06b72 Merge pull request #1702 from sparkle-project/base-internationalization 2020-12-29 16:26:39 +00:00
Zorg 239693a91b Add auto layout constraints to SUAutomaticUpdateAlert window 2020-12-28 16:12:03 -08:00
Zorg 4022e128d3 Use SUAdHocCodeSigning to reduce code duplication 2020-12-28 15:43:11 -08:00
Zorg 6bdaeab2c6 Fix CheckLocalizations script because I moved english Sparkle.strings 2020-12-28 11:46:17 -08:00
Zorg 82718ca77f Add explicit CODE_SIGN_IDENTITY ad-hoc setting for test app 2020-12-28 11:35:38 -08:00
Zorg 84c442c3eb Specify ENABLE_HARDENED_RUNTIME in xcconfig files 2020-12-28 11:31:25 -08:00
Zorg 848eb7955e Add comment where codesignAppURL: was taken from 2020-12-28 11:22:23 -08:00
Zorg d7cead40be Fix and cleanup Hebrew, Catalan, Finnish localizations 2020-12-28 11:18:09 -08:00
Zorg eac1a41dba Fix Test Application and add localizations to test app 2020-12-28 11:07:52 -08:00
Zorg 4bde9854f7 Add localizations to xib files properly 2020-12-28 10:28:21 -08:00
Zorg 0909f0db81 Remove non-english localizations from TestApplication 2020-12-27 23:29:55 -08:00
Zorg cdd373b800 Remove English localization for Sparkle.strings 2020-12-27 23:25:52 -08:00
Zorg 66589042db Remove contents of English Sparkle.strings 2020-12-27 23:24:16 -08:00
Zorg 6b715b7c37 Add base localization file for Sparkle.strings 2020-12-27 23:22:46 -08:00
Zorg 0a5add74f8 Enable base internalization for alert xibs 2020-12-27 21:59:22 -08:00
Adam Tharani 02d0d749a0 Add —release-notes-url-prefix support to localized release notes
Signed-off-by: Adam Tharani <adamtharani@me.com>
2020-12-09 22:48:25 +00:00
pierswalter 65eb63f1d7 Allow an appcast to prevent the new version from being installed automatically (#1688) 2020-12-02 21:43:53 +00:00
Kornel d4d4c68ad2 Remove locale symlinks 2020-12-01 11:10:41 +00:00
Piers Uso Walter 1c32cc7fcb Exposed systemProfileInformationArray, e.g. for use by the app preferences GUI 2020-11-27 17:49:59 +00:00
Piers Uso Walter 79589c3e2b Made buttons wide enough to display the full text.
Made window wide enough to display the widened buttons (el, fi, ru, uk)
2020-11-27 11:54:27 +00:00
pierswalter d39fc1d75e Update SUSystemProfiler.m
Fixed syntax error
2020-11-27 10:40:58 +00:00
pierswalter a38e8c4607 Update SUSystemProfiler.m
Masked sysctl hw.cputype value when evaluating the CPU type.
Used macros from mach/machine.h instead of magic numbers.
Added support for ARM in evaluation of hw.cpusubtype.
2020-11-27 10:40:58 +00:00
Kornel d5b0804b4a Add explicit dependencies to fix Xcode linking errors 2020-11-20 18:05:46 +00:00
Kornel c3c1b1af99 Raise minimum system version to 10.9 2020-11-20 13:03:47 +00:00
George Nachman 4aff5912a5 Remove width constraint 2020-11-17 10:18:36 +00:00
George Nachman 3d0e7a26f1 Remove max size from update alert. 2020-11-17 10:18:36 +00:00
Kornel Lesiński 891afd44c7 Rename SPM zip 2020-11-15 21:27:23 +00:00
Kornel Lesiński 489ae19e74 Release 2020-11-13 18:40:00 +00:00
Nicolas Bosi 0e162c98be Prioritize UserDefaults when fetching value for EnableAutomaticChecks
Users of the framework may override the value for this setting in runtime, as oppossed to using a static value written into Info.plist.
With the current implementation, the fix for issue 1480 was a breaking change, making users that set this parameter dinamically not see the 'Remind me later' button anymore, unless a value is provided in Info.plist.
Sparkle users that set this parameter in runtime should not be forced to set the parameter in Info.plist as a workaround to have the 'Remind me later' button visible. Instead, Sparkle should honour its documentation and make the value dinamically set via [SUUpdater setAutomaticChecksEnabled] take precedence over the defualt set in Info.plist.
2020-11-12 15:38:14 +00:00
Kornel cf8e5163b6 Merge pull request #1668 from xhacker/zh-hans 2020-11-03 16:52:29 +00:00
柳东原 · Dongyuan Liu c8f6eca09a Update zh_CN localization 2020-11-03 22:36:59 +08:00
Kornel dbfb300931 Merge pull request #1667 from vojtakonarik/patch-1
Czech localization update
2020-10-26 20:39:34 +00:00
Vojtěch Koňařík eeab95936a Update Sparkle.strings 2020-10-26 10:50:19 +01:00
Kornel 04dbde7b8d Merge pull request #1661 from zorgiepoo/master-double-quote-include 2020-10-03 14:13:59 +01:00
Zorg c1e7c09886 Remove -Wno-quoted-include-in-framework-header from WARNING_CFLAGS
It is already specified above as CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER.
2020-10-03 01:01:02 -07:00
Zorg c15b9da2a7 Set CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER instead 2020-10-03 00:43:57 -07:00
Zorg 80264da368 Add -Wno-quoted-include-in-framework-header to ConfigCommon 2020-10-03 00:14:06 -07:00
Zorg a5725cf443 Use double quote includes with pragma ignore warning 2020-10-02 23:58:23 -07:00
Dom Neill 22bc73be59 Corrected hyphenation for 'already current' status message 2020-09-28 12:22:59 +01:00
Georg Seifert 989589524b Use spaces (#1657) 2020-09-24 15:11:49 +01:00
Kornel dcf59b1f8a Merge pull request #1655 from vitorgalvao/master 2020-09-17 18:49:37 +01:00
Julian Mayer a64af3517c Change lockfile directory to /private/tmp/ so that it is cleared on reboot 2020-09-17 17:31:23 +02:00
CoreCode cfd963002f Create lockfile for improved compatibility with 3rd party updaters 2020-09-16 03:07:23 +01:00
Denis Dzyubenko 7233bb93e7 generate_appcast follow symbolic links
When archives are stored as symlinks e.g. due to storing binary files in a
git-annex repository, everything works file except file size in the generate
feed xml file. This patch makes generate_appcast correctly determine file size
by following the symlink
2020-09-10 13:40:34 +01:00
Bi11 f2fc729b69 Support App Store URL scheme in release note webview 2020-09-03 13:49:01 +01:00
Brad Andalman 7c7e924ed4 generate_appcast can update the release notes element’s URL when required
Previously, generate_appcast could only add or remove the release notes element for an update. This was probably fine, because it was unlikely to change: the release notes URL was determined by the SUFeedURL.

However, now that —release-notes-url-prefix was added, the release notes element CAN change. So, with this commit, if the release notes element is present for an update, the URL will be set correctly.
2020-09-03 13:47:05 +01:00
Kornel 640ba1b737 Merge pull request #1648 from oneeightyg/feature-1646-generate-appcast-output-filename 2020-09-03 13:46:13 +01:00
Brad Andalman 215b7db5a1 Fix incorrect comment for parseCommandLineOptions
This function returns a *struct*, not a dictionary.
2020-09-02 18:47:55 -07:00
Brad Andalman 4fec1b7301 Use a struct to simplify command line argument parsing
Changed parseCommandLineOptions so that it returns a struct that contains possible argument values, rather than a tuple.

Also unified the “help” and “usage” messages into a single message.
2020-09-02 15:57:05 -07:00
Brad Andalman 7c84c537a5 Add output filename option to generate_appcast
Added a “-o <filename.xml>” to generate_appcast so that users can specify the destination for the appcast. It’s an error if this is specified and multiple appcasts would be written.
2020-09-02 14:13:32 -07:00
Milen Dzhumerov a3a0ec7e2f Use angle-bracketed includes for all public framework headers (#1645) 2020-09-02 00:36:44 +01:00
Kornel 7ea72a2af4 Merge pull request #1644 from oneeightyg/feature-1642-release-notes-url-prefix
Add —release-notes-url-prefix to generate_appcast
2020-09-01 22:13:13 +01:00
Brad Andalman 752849d727 Add —release-notes-url-prefix to generate_appcast
Added a —release-notes-url-prefix argument to generate_appcast so that users can provide a prefix that will be used to construct the URL for the location of release notes.
2020-09-01 13:39:34 -07:00
Kornel 360575c611 Merge pull request #1634 from thebluepotato/spm-xcframework 2020-08-29 14:05:10 +01:00
Kornel bfccdabfa2 Merge pull request #1640 from trevordevore/tkd-issue-373
fix: read SUAutomaticallyUpdate from Info.plist
2020-08-29 12:21:48 +01:00
Trevor DeVore 4f47fb02db fix: read SUAutomaticallyUpdate from Info.plist
`SUAutomaticallyUpdate` will now be read from `Info.plist` if it has not been set in `NSUserDefaults`. This brings the behavior into line with the documentation.
2020-08-28 20:30:22 -05:00
Jonas Zaugg 7962e95fd9 Travis updated to more recent Xcode 12 beta 2020-08-29 01:32:40 +02:00
Jonas Zaugg 2629a05e48 Light renaming and cleanup 2020-08-03 02:43:13 +02:00
Jonas Zaugg a56ca505ea Distribution target now builds the XCFramework as well 2020-08-03 01:43:33 +02:00
Jonas Zaugg 17d78dfc0f Update README.markdown 2020-08-02 22:33:57 +02:00
Jonas Zaugg 23a24f17ec Finalize Travis integration 2020-08-02 16:17:03 +02:00
Jonas Zaugg 1ac42dcd5b Update .travis.yml 2020-08-02 15:45:17 +02:00
Jonas Zaugg 8199aee292 Debug Travis build 2020-08-02 15:15:41 +02:00
Jonas Zaugg b3e5f7b000 Update .travis.yml
The current version of Xcode on Travis does not support the `-debug-symbols` flag for `-create-xcframework`
2020-07-31 09:55:56 +02:00
Jonas Zaugg dd12653c29 Removing the need for Package-template 2020-07-31 01:28:53 +02:00
Jonas Zaugg c7f1a75f95 Improve inclusion of debug symbols and include binaries alongside XCFramework 2020-07-30 01:09:05 +02:00
Jonas Zaugg 7c5adb11ac Bundle more files into the XCFramework 2020-07-29 22:35:20 +02:00
Jonas Zaugg cae2068a44 Only one release and improve zipping 2020-07-29 13:27:27 +02:00
Jonas Zaugg d95a0d5c92 Enable SPM support via binary target 2020-07-29 12:01:22 +02:00
Kevin Wojniak 1ff3ed7fad Fix casting Boolean to BOOL on Apple Silicon
This fixes the following error when compiling for Apple Silicon on Xcode 12:

> SUHost.m:231:23: Cast from function call of type 'Boolean' (aka 'unsigned char') to non-matching type 'BOOL' (aka 'bool')
2020-06-29 02:02:04 +01:00
Nate Weaver b7793249e0 Fix timeout in testDeprecatedDownloader() 2020-06-16 13:20:49 +01:00
milotype e26f1dab23 Update Croatian (#1603) 2020-05-31 21:41:52 +01:00
Kornel 8a9963bf04 Merge pull request #1596 from rajivshah3/chore/swiftlint 2020-05-26 13:34:24 +01:00
Kornel 0b14472ede Merge pull request #1597 from rajivshah3/fix/ci 2020-05-26 13:04:47 +01:00
Rajiv Shah d0e054fc54 Only use Xcode 10.3 and 11.4 2020-05-26 00:58:25 -04:00
Rajiv Shah df718b0c4c Fix SUCodeSigningVerifierTest on macOS 10.15
Pre-installed apps, such as Calculator, are now installed under the System folder
2020-05-26 00:46:50 -04:00
Rajiv Shah 1690ce6cbc Only run tests on Xcode 10+
Sparkle uses Swift 4.2 which isn't supported on earlier Xcode versions
2020-05-26 00:46:50 -04:00
Rajiv Shah a746675f53 Set Swift Language Version to 4.2 in top level config 2020-05-25 23:13:59 -04:00
Rajiv Shah 13cadf0118 Fix CI test script 2020-05-25 23:05:13 -04:00
Rajiv Shah 6c3ce5cb97 Remove old code coverage configurations
Apple has a new way of enabling and formatting code coverage info
2020-05-25 22:57:43 -04:00
Rajiv Shah 372d75cc09 Fail the build if xcodebuild runs into an error 2020-05-25 22:15:39 -04:00
Rajiv Shah 6468ea2bb5 Remove brew update, nothing is being installed afterwards 2020-05-25 22:09:51 -04:00
Rajiv Shah c49df15f13 Use build matrix to test on multiple Xcode versions 2020-05-25 22:05:57 -04:00
Rajiv Shah 0090aa227b Allow force tries and force casts in tests 2020-05-25 17:29:30 -04:00
Rajiv Shah e9ab9d09a5 Relax rules a bit 2020-05-25 17:26:38 -04:00
Rajiv Shah 9c13919fd8 Run SwiftLint autocorrect 2020-05-25 17:06:53 -04:00
Rajiv Shah 6d7753ea66 Add SwiftLint config 2020-05-25 16:27:53 -04:00
Xashyar b9fa2f43b7 Persian translation 2020-05-18 16:18:52 +01:00
Kornel 2c1125a86a Revert "Persian translations"
This reverts commit e33a10638d.
2020-05-18 16:18:00 +01:00
Kornel d37d85b812 Merge pull request #1591 from R4N/fullscreen-alert-fix-v1 2020-05-15 20:39:06 +01:00
Kornel 388915c8d0 Merge pull request #1593 from Xashyar/patch-6 2020-05-15 20:38:33 +01:00
Xashyar e33a10638d Persian translations 2020-05-15 23:27:15 +04:30
Micah Moore d1d71dc127 Sets UpdateAlert and AutomaticUpdateAlert window's fullscreen collectionBehavior to NSWindowCollectionBehaviorFullScreenAuxiliary to allow them to present on top of the Main App's window if it's fullscreen. 2020-05-15 14:06:52 -04:00
Kornel 4ed56d5961 Merge pull request #1589 from ianbytchek/master 2020-05-15 17:33:58 +01:00
Ian Bytchek 1ab5ad82b5 Improve best appcast item selection handling
This fixes #1572 and takes care of situations when item dates are unavailable and when items with higher versions use earlier dates than items with lower versions, e.g., version 1.2.3 was published today and version 2.3.4 was published yesterday.
2020-05-15 17:08:34 +01:00
Kornel d01298c9ce Bump 2020-05-13 11:15:47 +01:00
Kornel a242035c74 Merge pull request #1586 from lwouis/fix-iframe-popup 2020-05-12 13:54:36 +01:00
Louis Pontoise 8f19f6a8cc fix: when the user set a release note url, and that page was creating iframes without src attributes, these would make popups appear saying "There is no application set to open the URL about:blank."
A request URL to about:blank has no purpose of being opened, so we ignore it.
2020-05-12 02:12:54 +09:00
Kornel 9568732f78 Merge pull request #1582 from Wevah/generate-appcast-hashpath 2020-05-02 15:53:48 +01:00
Nate Weaver f49295b054 Use the SHA-256 hash of the archive as the extraction path
Issue #1559.
2020-05-01 19:49:20 -05:00
Nate Weaver aff67ceda8 Add documentation comments; don't return an optional from the FileHandle method 2020-05-01 19:23:58 -05:00
Nate Weaver c8d5d18ce0 Add URL+Hashing 2020-05-01 19:15:29 -05:00
Kornel f1167b3649 Merge pull request #1575 from DanielFirlej/Polish2622
Update SUUpdateAlert.xib
2020-04-12 22:20:35 +01:00
DanielFirlej 3077864a3e Update SUUpdateAlert.xib
Missing translation > Software Update > Uaktualnienie oprogramowania
2020-04-12 20:40:15 +02:00
Kornel 2db0d8cb37 Merge pull request #1571 from D0miH/feature/1569-download-url-prefix-option
Prefix for download url can be provided to generate_appcast
2020-04-07 00:17:05 +01:00
Dominik H 0d16b459a5 added help command line option 2020-04-06 17:09:55 +02:00
Dominik H 4c3e202d2e added function that parses all command line options 2020-04-06 16:57:17 +02:00
Dominik H 96d162c7e5 command line option to provide a download url prefix is now parsed and set on each archive item 2020-04-04 23:12:26 +02:00
Kornel 01b48d44e8 Merge pull request #1561 from TheTechRobo/master
Update README.markdown
2020-03-17 14:08:01 +00:00
Ittussarom Retals Mail Ynohtna c39f7df513 Update README.markdown
A few changes to the README file to make it a tad more clear
2020-03-17 09:38:22 -04:00
Kornel ec15362770 Compress with lzma 2020-02-11 18:24:54 +00:00
Kenneth Johnsen 962878b843 Fix missing Danish translations in Sparkle.strings 2020-02-03 17:23:52 +00:00
pteeson 9d8909c38d Remove .h files from Build Rules for bsdiff and ed25519 (#1538)
On branch VendorBuildPhasesFix
Changes to be committed:
	modified:   Sparkle.xcodeproj/project.pbxproj

Building the Sparkle framework produced 10 Warnings caused by .h files
being added to the Build Rules Compile Sources. Thanks to tip from
Stackoverflow https://stackoverflow.com/questions/6509600/

"Click on your project, and check that this file is not present in the
tab Build Phases. Normally no header files should stay here.
Clean and build it again, it should work!"

It does work.
2020-01-25 12:25:04 +00:00
BR Lingo 99a00a2c17 Update Sparkle.strings (#1531) 2019-12-31 11:01:10 +00:00
Kornel 1d2b74e39d Merge pull request #1527 from quinntaylor/hoist-SWIFT_VERSION-4.2
Hoist `SWIFT_VERSION = 4.2` setting up to ConfigSwift.xcconfig, remove unnecessary target overrides.
2019-12-17 00:05:43 +00:00
Kornel b097e64b56 Merge pull request #1526 from quinntaylor/array-generics
Added array generics to fix warnings, and fixed typo in variable name…
2019-12-17 00:05:19 +00:00
Kornel 28a245dd53 Merge pull request #1525 from quinntaylor/Turkish-strings-missing-quote
Fixed missing quote in Turkish strings file, caused by PR #1516.
2019-12-17 00:04:41 +00:00
Quinn Taylor 4eabf002c5 Hoist SWIFT_VERSION = 4.2 setting up to ConfigSwift.xcconfig, remove unnecessary target overrides. 2019-12-16 10:53:29 -05:00
Quinn Taylor ae4af4d61f Added array generics to fix warnings, and fixed typo in variable name when parsing BinaryDelta command-line arg flags. 2019-12-16 09:40:17 -05:00
Quinn Taylor dd9c7d0e1c Fixed missing quote in Turkish strings file, caused by PR #1516. 2019-12-16 09:18:48 -05:00
Kornel 7ab8823757 Bump 2019-12-15 21:40:47 +00:00
Kornel dd287029db Fix second bold sentence in read-only update alert dialog. (#15… (#1516)
Fix second bold sentence in read-only update alert dialog. (#1515)
2019-12-15 17:07:51 +00:00
Quinn Taylor 6ec6007091 Fix second bold sentence in read-only update alert dialog. (#1515)
• Updated error dialog code in SUBasicUpdateDriver, and created a local variable to reuse `[aHost name]`.
• Updated content of Sparkle.strings files, splitting existing affected translations into 2 chunks each.
• Fixed the Catalan translation, which was using an old string key.
• Removed a few unnecessary comments in the Polish translation.
2019-12-14 13:28:40 -05:00
Kornel 985be854c4 Merge pull request #1520 from jakob/update-readme-1.x
Update README for Sparkle 1.x
2019-12-14 16:51:18 +00:00
Kornel 8129cc1c03 Merge pull request #1519 from jakob/issue-templates
Separate issue templates for Sparkle 1.x and 2.x
2019-12-14 16:49:44 +00:00
Jakob dddba708d2 Add prominent note about Sparkle 2.x to README 2019-12-14 15:39:14 +01:00
Jakob 2596a54935 Add link to 2.x branch 2019-12-14 15:38:57 +01:00
Jakob 794a90a5e2 Add 1.x version number to README title 2019-12-14 15:38:26 +01:00
Jakob 9e7c3463e0 Add Issue templates for Sparkle 1.x and 2.x 2019-12-14 15:23:25 +01:00
CoreCode ed40ef1267 update PR #1512 again to fix compilation issues (#1518)
* Update SUPlainInstaller.m
2019-12-13 16:35:10 +00:00
CoreCode b9a4917f81 Update for PR #1512 to correctly support 10.7 and 10.8 (#1514)
* Update SUPlainInstaller.m

Try to preserve Finder tags while updating apps

* Update SUPlainInstaller.m
2019-12-12 11:06:00 +00:00
CoreCode 1081dcdda1 Update SUPlainInstaller.m (#1512)
Try to preserve Finder tags while updating apps
2019-12-11 19:11:28 +00:00
Frank Chiarulli Jr 3a497ddcbd fix spelling (#1508) 2019-12-04 00:05:09 +00:00
Alec Larson 8f6c7ccdeb feat: properly compare versions with commit SHA (#1504) 2019-11-22 15:12:19 +00:00
Alik Vovkotrub 0e9d96a303 Support generating appcast with localizations (#1499)
* 1205 generate_appcast support localized Release Notes
2019-11-12 16:43:38 +00:00
marchyang 531b767c0b feat: sign_update support key argument 2019-10-18 12:36:17 +01:00
Kenneth Johnsen 0cfedd4516 Hide "Skip..." and "Remind..." buttons. (#1480)
Show/Hide skip/later buttons based on whether update is critical / automatic updates enabled.

The skip-button is now hidden for critical updates, and the later-button is hidden if automatic updates are disabled.
Note that the user can still choose to just close the window by clicking the red dot at the top of the window.
2019-10-15 14:04:31 +01:00
Kornel 8f01babdd3 Merge pull request #1485 from bitigchi/patch-1
Update Sparkle.strings
2019-10-09 21:06:54 +01:00
Emir Sarı 5dab9c40ab Update Sparkle.strings
Added some missed translation.
2019-10-09 18:48:33 +03:00
Kornel Lesiński f2dd8fe371 Move BR locale files to correct location 2019-10-09 00:08:38 +01:00
Kornel 5d0e5dd407 Terminology Update for BR (#1484)
Terminology Update for BR
2019-10-09 00:05:44 +01:00
BR Lingo 39fb433131 Add files via upload 2019-10-08 17:40:49 -04:00
BR Lingo e68a2621ed Merge pull request #3 from sparkle-project/master
Commits from original
2019-10-08 17:28:32 -04:00
Kornel cb6545d601 Merge pull request #1483 from qwertyyb/master
fix public key doesn't match problem
2019-10-08 18:43:33 +01:00
marchyang 6dbbf08654 fix public key dont match problem when use generate_appcast with -s <private_key> <folder> arguments 2019-10-08 19:43:20 +08:00
Kornel d5222353e6 Merge pull request #1458 from BitShift-Tech/appcast-generation-file-extention
SUFeedUrl generate appcast file extension (let fix)
2019-08-21 10:57:45 +01:00
Tom Vos 2657a41d55 Update ArchiveItem.swift
feedURl was a let and therefore not assignable
2019-08-21 11:16:06 +02:00
Kornel 08d3ff747d Merge pull request #1454
SUFeedUrl generate appcast file extension
2019-08-21 09:58:08 +01:00
Tom Vos fedb22e224 Update ArchiveItem.swift
The *ing methods didn't alter the value, they provided a new value which was not assigned to anything.
2019-08-21 10:20:37 +02:00
Kornel 8293c3c6ae Merge pull request #1457 from LeoNatan/master
Fix incorrect and inconsistent selectors and delegate methods
2019-08-20 02:58:35 +01:00
Leo Natan 181f813b01 Fix incorrect and inconsistent selectors and delegate methods. 2019-08-20 04:12:33 +03:00
Kornel a10a974609 Merge pull request #1456 from webjib/patch-1
Update Sparkle.strings
2019-08-19 14:38:39 +01:00
Jean-Baptiste f8572f79cb Update Sparkle.strings
Issue #1429
https://github.com/sparkle-project/Sparkle/issues/1429
2019-08-19 15:18:14 +02:00
Kornel 2b54753090 add delegate userDidSkipThisVersion (#1409)
add delegate userDidSkipThisVersion
2019-08-14 09:40:01 +01:00
bono yusuke 2db2fffab9 Update SUUIBasedUpdateDriver.m 2019-08-14 17:12:16 +09:00
Tom Vos 035bfc4919 Fix typo 2019-08-13 12:18:42 +02:00
Tom Vos 48fc202f36 Processed requested changes
Instead of using find and replace, use the correct methods on URL to change the file name and extention.
2019-08-13 12:17:12 +02:00
Tom Vos 28ff3069ff Update ArchiveItem.swift
When the SUFeedURL extention is "php", replace filename.php with appcast.xml in generate_appcast
2019-08-13 09:45:10 +02:00
Kornel 795ce1278d Merge pull request #1445 from fujisoft/patch-1
Update Japanese localization #1429
2019-08-03 15:48:27 +01:00
fujisoft 6ac853271d Update Japanese localization
#1429
2019-08-03 13:38:13 +09:00
Kornel 7e5e91888f Merge pull request #1444 from jfenton-tsc/fix/normalize-should-respect-specified-bundle-name
check if SUBundleName is set before normalizing
2019-08-03 00:00:55 +01:00
Jake Fenton b0d29ae798 check if SUBundleName is set before normalizing
When changing the name of an app, there's a couple things to do in order
to ensure auto-updates still work:

1. set SUBundle Name. This basically tells Sparkle "ey, expect an app
of {SUBundleName}.(app|pkg) instead of the normal name."
2. set `SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME` in
commonConfig.xccconfig to reset the name of the app.

in (2), we always used the host's bundle name, instead of checking to
see if SUBundleName was set, which means normalization doesn't work as
expected during app name changes.
2019-08-02 09:29:12 -04:00
Kornel 09bbf9fdc6 Merge pull request #1443 from gotow/master
In 'newer than latest' alert, show displayVersionString instead of versionString
2019-08-02 10:49:28 +01:00
gotow f2bd7ea2b2 Update SUUIBasedUpdateDriver.m 2019-08-01 22:35:28 -06:00
Kornel 35deefdc0c Merge pull request #1439 from whakkee/master
cast to NSInteger to get rid of warning on Xcode 11
2019-07-14 21:19:51 +01:00
Marga Keuvelaar 3e53979236 cast to NSInteger to get rid of warning on Xcode 11 2019-07-12 21:53:29 +02:00
Kornel f8971098be Reset timers after computer sleep (#1437)
Update SUUpdater.m
2019-07-09 18:45:13 +01:00
CoreCode efd1840f35 Update SUUpdater.m 2019-07-08 20:51:16 +02:00
Kornel 17dbdf98e1 Merge pull request #1435 from Yakuhzi/master
Support providing private key as argument
2019-07-05 22:59:20 +02:00
Yakuhzi 79f110a17b Support providing private key as argument 2019-07-05 13:12:11 +02:00
Kornel 5ab0baf84c Merge pull request #1431 from vitu/master
BR update of new string on Sparkle.strings
2019-07-02 11:39:22 +01:00
BR Lingo 578dac0ad7 BR update of new string on Sparkle.strings
Translation for string added by CoreCode.
2019-06-30 02:56:55 -04:00
BR Lingo 920b5bac5e Merge pull request #2 from sparkle-project/master
Update from original repo
2019-06-30 02:45:09 -04:00
Kornel 9ae7224a47 Changelog 2019-06-29 14:41:52 +01:00
Kornel 685be61bc3 Use recommended locale names 2019-06-29 14:41:06 +01:00
Kornel 9be76d3d5a Build with hardened runtime 2019-06-29 14:41:06 +01:00
Kornel fc1960966a Update Sparkle.strings 2019-06-29 14:00:36 +01:00
Kornel 7248e40fda Fix issue #1411 (#1427)
Fix issue #1411
2019-06-28 18:32:20 +01:00
Julian Mayer b8d37346a6 Add translations for new string 2019-06-28 15:07:30 +02:00
CoreCode 2769221117 Update SUBasicUpdateDriver.h 2019-06-27 17:22:12 +02:00
CoreCode 6317a6c74f Update SUBasicUpdateDriver.m 2019-06-27 17:21:50 +02:00
CoreCode f785c7177c Update SUUIBasedUpdateDriver.m
Provide fix for issue #1411
2019-06-27 17:19:03 +02:00
Kornel cd78595c63 Move header copies for bsdiff and ed25519 into a Copy Files build phase (#1421)
Move header copies for bsdiff and ed25519 into a Copy Files build phase
2019-06-17 23:56:40 +01:00
Tony Arnold 4fd2a7b15f Move header copies for bsdiff and ed25519 into a Copy Files build phase
Headers build phases do not work correctly with static library targets when archiving in Xcode. Delete this phase, add a Copy Files build phase to your library, and use it to export your header files.

Reference TN2215: https://developer.apple.com/library/archive/technotes/tn2215/_index.html#//apple_ref/doc/uid/DTS40011221-CH1-PROJ

Fixes #1420
2019-06-16 15:36:54 +10:00
Kornel 186bbb83d5 Merge pull request #1413 from tonyarnold/minor-fixes
Minor fixes
2019-05-28 14:15:13 +01:00
Tony Arnold 0cc8a2f16a Fix a spelling mistake in the submodule comments 2019-05-28 22:55:11 +10:00
Tony Arnold 0eb1caeec5 Rename “Third Party” Xcode group to “Vendor” to match underlying folder name 2019-05-28 22:54:03 +10:00
Tony Arnold 7138663f86 Separate the bsdiff sources into a new static library, and use them in targets 2019-05-28 22:53:26 +10:00
Tony Arnold b767285be0 Separate the ed25519 sources into a new static library 2019-05-28 22:45:53 +10:00
Tony Arnold 5886c2b9b9 Move ed25519 dependency to the Vendor directory 2019-05-28 22:20:58 +10:00
BobZombie f9b534a6b6 add delegate userDidSkipThisVersion 2019-05-17 17:15:41 +09:00
vojtakonarik 5a586d393a Correction of Czech localization inconsistency (#1403)
* Update Sparkle.strings
2019-05-05 00:11:47 +01:00
Michael Buckley b3cc7aed8a Annotate SUHost for nullability 2019-04-22 21:50:20 +01:00
Kornel deb8ea8cc1 Merge pull request #1396 from fumoboy007/pretty-print
Use `XMLNode.Options.nodePrettyPrint` in `generate_appcast` instead of trying to add whitespace manually
2019-04-21 19:09:52 +01:00
fumoboy007 4a3cc18dc3 Use XMLNode.Options.nodePrettyPrint in generate_appcast instead of trying to add whitespace manually 2019-04-20 21:28:45 -07:00
Kornel 75404f6d83 Merge pull request #1392 from panicinc/app-translocation-fix
Improved error when running from translocated location
2019-04-18 20:20:57 +01:00
Michael Buckley 954ed60ecb Improved error when running from translocated location 2019-04-17 20:51:59 -07:00
Kornel ecb5257b2b Update README.markdown 2019-04-14 14:34:04 +01:00
Fabian Jäger fb18c1e542 Phased rollout interval is an appcast item attribute and not its own element (#1385)
* phased rollout interval is an appcast item attribute and not its own element

* add basic test for getting phased rollout interval from appcast item
2019-04-02 15:26:35 +01:00
Fabian Jäger 99f5573619 Allow updating to previous versions if newest appcast item is blocked due to phased rollout (#1384)
The current version of phased rollouts would not find other valid items if the latest one is not ready yet based on the phased rollout group. This PR changes this behavior by using the system's rollout group when finding valid appcast items.
2019-03-29 19:36:29 +00:00
Kornel Lesiński 1edfcaba71 Ignore non-standard permissions in delta updates instead of failing the build
Fixes #1383
2019-03-29 00:06:55 +00:00
Kornel Lesiński fc3221c5d2 Squashed commit of the following:
commit 89a8f1a8b3
Author: Emir Sarı <emirsari@gmail.com>
Date:   Thu Mar 21 20:35:02 2019 -0700

    Fixed capitalization

commit ad0582a89e
Author: Emir Sarı <emirsari@gmail.com>
Date:   Thu Mar 21 17:28:53 2019 -0700

    Fix for changed string

commit 77016c7dff
Author: Emir Sarı <emirsari@gmail.com>
Date:   Thu Mar 21 17:23:21 2019 -0700

    Improvements

    Improvements and layout fixes
2019-03-22 12:06:52 +00:00
Fabian Jäger 26db6982b3 Allow to configure update groups for updating in phases (#1381) 2019-03-20 12:45:48 +00:00
Kornel f550b92f72 Merge pull request #1377 from hofman/master
Fix ed25519 and UITest group paths in project
2019-03-14 11:38:35 +00:00
Christiaan Hofman 5f5fe1b5f9 Fix path for UITests group in project 2019-03-14 11:19:37 +01:00
Christiaan Hofman 6027f2852a fix path for ed5519 group in project 2019-03-14 11:14:12 +01:00
Kornel 60c2f16c9d Merge pull request #1376 from hofman/master
Use AVAILABLE macro to allow compiling with Xcode 8
2019-03-13 23:28:30 +00:00
hofman 5ae7fa7212 Use SUAVAILABLE macro in SPUURLRequest.m 2019-03-13 23:06:25 +01:00
hofman 614b2cc1f3 Use SUAVAILABLE macro in SPUDownloadData.m 2019-03-13 23:04:55 +01:00
hofman 6500bf8c2f Use SUAVAILABLE macro in SUUpdateAlert.m 2019-03-13 23:03:10 +01:00
hofman 3e060d4a7b Use SUAvailable.m in SUStatusController.m 2019-03-13 22:59:53 +01:00
hofman 5286371cb7 Use SUAVAILABLE macro in SUUpdater.m 2019-03-13 22:57:54 +01:00
hofman 2a802447a3 Use SUAVAILABLE macro in SUBasicUpdateDriver.m 2019-03-13 22:55:27 +01:00
hofman c40b42deb1 Use SUAVAILABLE macro in SUAppcast.m 2019-03-13 22:53:32 +01:00
hofman 5d9f41142b Define a macro for @available to have a workaround for Xcode 8 2019-03-13 22:51:14 +01:00
Kornel d540c6a1b9 Merge pull request #1375 from hofman/master
Add -cleanup to -downloadDidUpdate:
2019-03-13 20:47:12 +00:00
hofman e63bcbc047 Add -cleanup to -downloadDidUpdate: 2019-03-13 21:07:22 +01:00
Kornel 4f65e14ee8 Update README.markdown 2019-03-11 14:03:23 +00:00
Kornel fdca1ce6cf Bump 2019-03-10 12:07:53 +00:00
Kornel c3255ed3a7 Merge pull request #1363 from gnachman/gentleRemindersPR
Add delegate methods to suppress update alert.
2019-03-09 23:03:29 +00:00
George Nachman 9b6346516e Pass item to updaterShouldShowUpdateAlertForScheduledUpdate delegate method 2019-03-09 14:58:08 -08:00
Nate Weaver e1f13ebcad Disambiguate signing error messages. 2019-03-03 02:17:24 +00:00
nivekkagicom 420be06ba0 fix warnings when using modules (#1244) 2019-03-02 16:25:15 +00:00
Kornel c7beba948d Add issue templates 2019-02-24 17:35:21 +00:00
Kornel 639b6df47b Merge pull request #1367 from Mailbutler/master
Block-based alternatives to NSInvocation-based delegate methods
2019-02-24 17:05:10 +00:00
Fabian Jäger c9a9cba167 block-based alternatives to NSInvocation-based delegate methods 2019-02-24 16:25:31 +01:00
George Nachman 9f01fd303c Add delegate methods to suppress update alert.
Some applications may prefer to show their own unobtrusive
notification that an update is available when using the
scheduled update driver. This commit adds new delegate
methods to enable that behavior. The delegate may suppress
the alert; if the alert is shown, the delegate is informed
when the user is not interested in a particular update so
they can remove their own notification.
2019-02-21 22:19:31 -08:00
Kornel 1ff1577108 Bump 2019-02-11 14:15:20 +00:00
Kornel 74f2ea540e Merge pull request #1358 from barijaona/smallimages
Losslessly reduced the size of PNG
2019-02-05 02:00:32 +00:00
Barijaona Ramaholimihaso 2652be32f7 Losslessly reduced the size of PNG
By use of OxiPNG, PNGOUT and zopflipng.
Initially submitted by Sveinbjorn Thordarson (@sveinbjornt) at
ViennaRSS/vienna-rss#1237.
2019-02-05 04:46:18 +03:00
Kornel 5118f2b27f Merge pull request #1353 from core-code/master
fix #1352
2019-01-30 15:41:34 +00:00
Julian Mayer b97b60b611 fix 2019-01-30 15:02:13 +01:00
Julian Mayer 3c793482c8 #1352 2019-01-30 13:31:07 +01:00
Kornel 89b4bcde61 Merge pull request #1351 from Wevah/master
Use contentsOfDirectory(at:...) instead of atPath:....
2019-01-26 20:48:12 +00:00
Nate Weaver 3690dd028a Use contentsOfDirectory(at:...) instead of atPath:..., and rename apps to bundles. 2019-01-26 10:59:19 -06:00
Kornel 52e2ef88eb Merge pull request #1350 from Wevah/generate-appcast-bundle-check
Check for all bundles instead of just apps.
2019-01-25 15:41:08 +00:00
Nate Weaver d81633a7d3 Check for all bundles instead of just apps. 2019-01-24 11:49:24 -06:00
Kornel a9e20c7d0a Merge pull request #1347 from pNre/master
Check that effectiveAppearance is being observed before calling removeObserver
2019-01-18 15:21:37 +00:00
Kornel 03a9f57704 Check that effectiveAppearance is being observed before calling removeObserver 2019-01-18 15:58:43 +01:00
Kornel 2f8df626d7 Merge pull request #1340 from kant/patch-1
Semantic issue on #151. Fix typo on paragraph #149
2019-01-12 13:32:52 +00:00
Kornel f5cb6988ed Merge pull request #1341 from kant/patch-2
Fixed typo on string #021
2019-01-12 13:32:20 +00:00
Darío Hereñú 2bfab80998 Fixed typo on string #021 2019-01-12 08:41:46 -03:00
Darío Hereñú 4fa2a37798 Semantic issue on #151. Fix typo on paragraph #149 2019-01-12 08:37:30 -03:00
Kornel 888a7f48a6 Formatting 2018-12-23 11:53:21 +00:00
Kornel 82726c4386 Make it clear that quarantine error is only a warning 2018-12-23 11:53:13 +00:00
BR Lingo 9453761aef Merge pull request #1 from sparkle-project/master
Hey, self. Please let me in.
2018-06-09 00:38:49 -04:00
426 changed files with 10140 additions and 19648 deletions

No files matched your search

@@ -0,0 +1,19 @@
---
name: Enhancements and Bug Fixes
about: Found a bug? Want to implement a new feature?
title: ''
assignees: ''
---
## Summary
[provide general summary to the issue or enhancement and its rationale]
## Possible Fix
[not obligatory, but suggest fixes or reasons for the bug]
## Version
[please specify versions of Sparkle this is applicable to; note new pull requests must be developed and landed in 2.x development branch first]
@@ -0,0 +1,34 @@
---
name: Sparkle 1.x doesn't work in my app
about: Problems with integration, unexpected errors
title: ''
labels: '1.x'
assignees: ''
---
<!--
The answer to your issue is probably already 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
-->
### Description of the problem
### Do you use Sandboxing in your app?
### Version of `Sparkle.framework` in the latest version of your app
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
### Sparkle's output from Console.app
```
```
### Steps to reproduce the behavior
@@ -0,0 +1,34 @@
---
name: Sparkle 2.x doesn't work in my app
about: Problems with using the beta version of Sparkle 2
title: ''
labels: '2.x'
assignees: ''
---
<!--
The answer to your issue is probably already 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
-->
### Description of the problem
### Do you use Sandboxing in your app?
### Version of `Sparkle.framework` in the latest version of your app
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
### Sparkle's output from Console.app
```
```
### Steps to reproduce the behavior
+29
View File
@@ -0,0 +1,29 @@
(Insert summary of your pull request here)
Fixes # (issue)
## Checklist:
- [ ] My change is being tested and reviewed against the Sparkle 2.x branch. New changes must be developed on the 2.x development branch first.
- [ ] My change is being backported to master branch (Sparkle 1.x), if deemed necessary. Please create a separate pull request for 1.x, should it be backported.
- [ ] I have reviewed and commented my code, particularly in hard-to-understand areas.
## Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] My change is or requires a documentation or localization update
## Testing
I tested and verified my change by using one or multiple of these methods:
- [ ] Sparkle Test App
- [ ] Unit Tests
- [ ] My own app
- [ ] Other (please specify)
(Describe all the cases that were tested)
macOS version tested: [place version here]
+52
View File
@@ -0,0 +1,52 @@
name: Build & Tests
on:
push:
branches: [ 2.x, master ]
pull_request:
branches: [ 2.x, master ]
jobs:
build:
strategy:
matrix:
xcode: ['/Applications/Xcode_12.2.app/Contents/Developer', '/Applications/Xcode_11.7.app/Contents/Developer']
name: Build and Test Sparkle
runs-on: macos-10.15
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Build Unit Tests
env:
DEVELOPER_DIR: ${{ matrix.xcode }}
run: |
xcodebuild build-for-testing -project Sparkle.xcodeproj -scheme Distribution -enableCodeCoverage YES -derivedDataPath build
- name: Run Unit Tests
env:
DEVELOPER_DIR: ${{ matrix.xcode }}
run: |
xcodebuild test-without-building -project Sparkle.xcodeproj -scheme Distribution -enableCodeCoverage YES -derivedDataPath build
- name: Build UI Tests
env:
DEVELOPER_DIR: ${{ matrix.xcode }}
run: |
xcodebuild build-for-testing -project Sparkle.xcodeproj -scheme UITests -configuration Debug -derivedDataPath build
- name: Run UI Tests
env:
DEVELOPER_DIR: ${{ matrix.xcode }}
run: |
xcodebuild test-without-building -project Sparkle.xcodeproj -scheme UITests -configuration Debug -derivedDataPath build
- name: Build Release Distribution
env:
DEVELOPER_DIR: ${{ matrix.xcode }}
run: |
xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build
- name: Archive Test Results
if: failure()
uses: actions/upload-artifact@v2
with:
name: build-logs
path: build/Logs
+4
View File
@@ -41,3 +41,7 @@ Carthage/Build
Network Trash Folder
Temporary Items
.apdisk
# Swift Package Manager
/.build
.swiftpm
+2 -2
View File
@@ -1,3 +1,3 @@
[submodule "ed25519"]
path = ed25519
[submodule "Vendor/ed25519"]
path = Vendor/ed25519
url = https://github.com/orlp/ed25519
+20
View File
@@ -0,0 +1,20 @@
excluded:
- Vendor
disabled_rules:
- opening_brace
- empty_parentheses_with_trailing_closure
- function_body_length
- line_length
- cyclomatic_complexity
- large_tuple
# Rule-specific config
trailing_comma:
mandatory_comma: true
force_try:
severity: warning
force_cast:
severity: warning
identifier_name:
min_length:
warning: 2
-5
View File
@@ -1,5 +0,0 @@
language: objective-c
osx_image: xcode9
before_install:
- brew update
script: make ci
+111
View File
@@ -1,3 +1,114 @@
# 1.26.0
* Flat package support from #1745 (Zorg)
* Correct generate_appcast -s command line argument usage help (Lance Lovette)
* Fix -f command line argument handling (Lance Lovette)
* Fix progress for guided pkg install (Zorg)
* Fix XQuartz update failing because NSLog caused issues (Zorg)
* Update localization (Vojtěch Koňařík)
* Various fixes to SPM logic (Jonas Zaugg)
# 1.25.0
* Raise minimum system version to 10.9 (Kornel)
* Allow an appcast to prevent the new version from being installed automatically (#1688) (pierswalter)
* UI fixes
* Show check for updates button only when automatic updates are enabled (Lorena Rangel)
* Don't initialize the webview if we don't show release notes (Tobias Fonfara)
* Keep skip button available if there is a minimum autoupdate version (Zorg)
* Fix automatic updates checkbox state when not showing release notes (Zorg)
* Fix edge cases with hiding alert buttons and using "Install Later" (Zorg)
* Re-add setting WebUIDelegate fix for legacy web view (Zorg)
* Adopt WKWebView for 1.x (Zorg)
* Add auto layout constraints to SUAutomaticUpdateAlert window (Zorg)
* Made buttons wide enough to display the full text. Made window wide enough to display the widened buttons (el, fi, ru, uk) (Piers Uso Walter)
* Remove max size from update alert. (George Nachman)
* Integrate generate_keys export/import options changes from #1730 (Zorg)
* Add `—release-notes-url-prefix` support to localized release notes (Adam Tharani)
* Translations
* Enable base internalization for alert xibs (Zorg)
* Capitalizes french translation of "Vous utilisez actuellement..." ("You are currently running...") (Micah Moore)
* Fix and cleanup Hebrew, Catalan, Finnish localizations (Zorg)
* Remove non-english localizations from TestApplication (Zorg)
* Fix catch-22 Swift Package Manager binary target (Jonas Zaugg)
* Add explicit dependencies to fix Xcode linking errors (Kornel)
* Add phased rollouts feature to automatic update driver too (Zorg)
* Remove hiding skip button and retitling later button (Zorg)
* Deprecate installUpdatesIfAvailable (Zorg)
* Apply custom headers to app download (Geraint White)
# 1.24.0
* Prioritize UserDefaults when fetching value for EnableAutomaticChecks (Nicolas Bosi)
* Improve best appcast item selection handling (Ian Bytchek)
* Create lockfile for improved compatibility with 3rd party updaters (CoreCode)
* Enable SPM support via binary target (Jonas Zaugg)
* `generate_appcast` improvements:
* follow symbolic links (Denis Dzyubenko)
* update the release notes element’s URL when required (Brad Andalman)
* Added output filename option to generate_appcast (Brad Andalman)
* Added —release-notes-url-prefix to generate_appcast (Brad Andalman)
* Command line option to provide a download url prefix is now parsed and set on each archive item (Dominik H)
* Added help command line option (Dominik H)
* Locale updates:
* Update zh_CN localization (柳东原 · Dongyuan Liu)
* Update Sparkle.strings (Vojtěch Koňařík)
* Update Croatian (#1603) (milotype)
* Update SUUpdateAlert.xib (DanielFirlej)
* fix: read SUAutomaticallyUpdate from Info.plist (Trevor DeVore)
* Fix casting Boolean to BOOL on Apple Silicon (Kevin Wojniak)
* Use build matrix to test on multiple Xcode versions (Rajiv Shah)
* Set UpdateAlert and AutomaticUpdateAlert window's fullscreen collectionBehavior to NSWindowCollectionBehaviorFullScreenAuxiliary to allow them to present on top of the Main App's window if it's fullscreen. (Micah Moore)
* Fixed error about "about:blank" release notes (Louis Pontoise)
* Support App Store URL scheme in release note webview (Bi11)
* Use the SHA-256 hash of the archive as the cache path (Nate Weaver)
* Don't return an optional from the FileHandle method (Nate Weaver)
* Added URL+Hashing (Nate Weaver)
# 1.23.0
* Support generating appcast with localizations (#1499) (Alik Vovkotrub)
* Support versions with git commit SHA (#1504) (Alec Larson)
* Hide "Skip..." and "Remind..." buttons when they're not relevant (#1480) (Kenneth Johnsen)
* Preserve Finder tags while updating apps (#1512) (CoreCode)
* Read-only update alert dialog formatting improvements (#1515) (Quinn Taylor)
* Check if `SUBundleName` is set before normalizing (Jake Fenton)
* `NSInteger` cast warning on Xcode 11 (Marga Keuvelaar)
* Correct appcast file extension (Tom Vos)
* Update Sparkle.strings (Emir Sarı)
* Fix spelling (#1508) (Frank Chiarulli Jr)
# 1.22.0
* Enabled "Hardened Runtime" build option for Apple's notarization requirement
* Add delegate methods to suppress update alerts (George Nachman)
* Improved error when running from translocated location (Michael Buckley)
* Add phased rollout feature (#1381) (Fabian Jäger)
* Ignore non-standard permissions in delta updates instead of failing the build (Kornel Lesiński)
* Notify user when installed version is newer than the latest in the appcast (CoreCode)
* Reset timers after computer sleep (CoreCode)
* Block-based alternatives to `NSInvocation`-based delegate methods (Fabian Jäger)
* Add delegate `userDidSkipThisVersion` (BobZombie, Leo Natan, bono yusuke)
* Pass item to updaterShouldShowUpdateAlertForScheduledUpdate delegate method (George Nachman)
* Support providing private key as argument in `generate_appcast` (Yakuhzi, marchyang)
* Separate the ed25519 sources into a new static library (Tony Arnold)
* Disambiguate signing error messages (Nate Weaver)
* Use `XMLNode.Options.nodePrettyPrint` in `generate_appcast` instead of trying to add whitespace manually (fumoboy007)
* Annotate SUHost for nullability (Michael Buckley)
* Use SUAVAILABLE macro (Christiaan Hofman)
* Fix warnings when using modules (nivekkagicom)
* Correction of Czech localization inconsistency (#1403) (vojtakonarik)
* BR locale fix (BR Lingo)
* Update Japanese localization (fujisoft)
* French Sparkle.strings (Jean-Baptiste)
# 1.21.3
* Losslessly reduced the size of PNG (Barijaona Ramaholimihaso)
* Catch exceptions from subcommands (Julian Mayer)
* `generate_appcast` can sign any bundles instead of just apps (Nate Weaver)
* Check that effectiveAppearance is being observed before calling removeObserver (Pierluigi)
# 1.21.2
* Allow EdDSA for delta updates, too (Kornel)
+6 -8
View File
@@ -16,8 +16,8 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
SPARKLE_VERSION_MAJOR = 1
SPARKLE_VERSION_MINOR = 21
SPARKLE_VERSION_PATCH = 2
SPARKLE_VERSION_MINOR = 26
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
@@ -26,12 +26,13 @@ ENABLE_STRICT_OBJC_MSGSEND = YES
GCC_SYMBOLS_PRIVATE_EXTERN = YES
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
ARCHS = $(ARCHS_STANDARD)
MACOSX_DEPLOYMENT_TARGET = 10.7
MACOSX_DEPLOYMENT_TARGET = 10.9
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_AUTOMATED_DOWNGRADES=$(SPARKLE_AUTOMATED_DOWNGRADES) SPARKLE_APPEND_VERSION_NUMBER=$(SPARKLE_APPEND_VERSION_NUMBER) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_FILEOP_TOOL_NAME=\"$(SPARKLE_FILEOP_TOOL_NAME)\"
ENABLE_HARDENED_RUNTIME = YES;
CLANG_ENABLE_OBJC_ARC = YES
GCC_ENABLE_PASCAL_STRINGS = NO
GCC_NO_COMMON_BLOCKS = YES;
@@ -54,6 +55,7 @@ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
CLANG_WARN_UNREACHABLE_CODE = YES
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES
@@ -80,12 +82,8 @@ GCC_WARN_UNUSED_LABEL = YES
GCC_WARN_UNUSED_PARAMETER = YES
GCC_WARN_UNUSED_VARIABLE = YES
// Fixes a strange issue where the compiler thinks references to some enums are ambiguous
CLANG_ENABLE_MODULES[sdk=macosx10.7] = NO
CLANG_ENABLE_MODULES[sdk=macosx10.8] = NO
// These should be removed once the conversion to ARC is complete
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 $(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 $(WARNING_CFLAGS_EXTRA)
@@ -1,10 +0,0 @@
#include "ConfigCommonDebug.xcconfig"
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
GCC_GENERATE_TEST_COVERAGE_FILES = YES
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES
+1 -1
View File
@@ -1,2 +1,2 @@
SWIFT_VERSION = 4.0
SWIFT_VERSION = 4.2
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
+2
View File
@@ -5,3 +5,5 @@ WRAPPER_EXTENSION = app
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
LD_RUNPATH_SEARCH_PATHS = @executable_path/../Frameworks
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.SparkleTestApp
ENABLE_HARDENED_RUNTIME = NO
CODE_SIGN_IDENTITY = -
+1
View File
@@ -5,6 +5,7 @@
INFOPLIST_FILE = UITests/UITests-Info.plist
WRAPPER_EXTENSION = xctest
MACOSX_DEPLOYMENT_TARGET = 10.11
ENABLE_HARDENED_RUNTIME = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) $(DEVELOPER_FRAMEWORKS_DIR)
LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks
@@ -1,4 +0,0 @@
#include "ConfigUITest.xcconfig"
GCC_GENERATE_TEST_COVERAGE_FILES = NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
@@ -1,4 +0,0 @@
#include "ConfigUnitTest.xcconfig"
GCC_GENERATE_TEST_COVERAGE_FILES = NO
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
+3
View File
@@ -0,0 +1,3 @@
// Copyright © 2019 Sparkle Project. All rights reserved.
#include "bsdiff-Shared.xcconfig"
+3
View File
@@ -0,0 +1,3 @@
// Copyright © 2019 Sparkle Project. All rights reserved.
#include "bsdiff-Shared.xcconfig"
+14
View File
@@ -0,0 +1,14 @@
// Copyright © 2019 Sparkle Project. All rights reserved.
// Deployment
SKIP_INSTALL = YES
// Packaging
EXECUTABLE_PREFIX = lib
PRODUCT_NAME = $(TARGET_NAME)
// Search Paths
ALWAYS_SEARCH_USER_PATHS = NO
// Disable Warnings - this is a third-party project, and we'll trust that the maintainers know what they're doing.
WARNING_CFLAGS = $(inherited) -Wno-comma
+3
View File
@@ -0,0 +1,3 @@
// Copyright © 2019 Sparkle Project. All rights reserved.
#include "ed25519-Shared.xcconfig"
+3
View File
@@ -0,0 +1,3 @@
// Copyright © 2019 Sparkle Project. All rights reserved.
#include "ed25519-Shared.xcconfig"
+14
View File
@@ -0,0 +1,14 @@
// Copyright © 2019 Sparkle Project. All rights reserved.
// Deployment
SKIP_INSTALL = YES
// Packaging
EXECUTABLE_PREFIX = lib
PRODUCT_NAME = $(TARGET_NAME)
// Search Paths
ALWAYS_SEARCH_USER_PATHS = NO
// Disable Warnings - this is a third-party project, and we'll trust that the maintainers know what they're doing.
WARNING_CFLAGS = $(inherited) -Wno-cast-qual -Wno-conversion -Wno-sign-conversion
+66 -1
View File
@@ -12,17 +12,24 @@ if [ "$ACTION" = "" ] ; then
fi
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.xz"
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2"
rm -f "Sparkle-for-Swift-Package-Manager.zip"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp "$CONFIGURATION_BUILD_DIR/generate_appcast" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp "$CONFIGURATION_BUILD_DIR/sign_update" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.xcframework" "$CONFIGURATION_BUILD_DIR/staging-spm"
# Only copy dSYMs for Release builds, but don't check for the presence of the actual files
# because missing dSYMs in a release build SHOULD trigger a build failure
@@ -32,11 +39,69 @@ if [ "$ACTION" = "" ] ; then
cp -R "$CONFIGURATION_BUILD_DIR/generate_keys.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/sign_update.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
fi
cp -R "$CONFIGURATION_BUILD_DIR/staging/bin" "$CONFIGURATION_BUILD_DIR/staging-spm"
cd "$CONFIGURATION_BUILD_DIR/staging"
if [ -x "$(command -v xz)" ]; then
XZ_EXISTS=1
else
XZ_EXISTS=0
fi
# Sorted file list groups similar files together, which improves tar compression
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2" --files-from=-
if [ "$XZ_EXISTS" -eq 1 ] ; then
find . \! -type d | rev | sort | rev | tar cv --files-from=- | xz -9 > "../Sparkle-$CURRENT_PROJECT_VERSION.tar.xz"
else
# Fallback to bz2 compression if xz utility is not available
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2" --files-from=-
fi
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
# Generate zip containing the xcframework for SPM
cd "$CONFIGURATION_BUILD_DIR/staging-spm"
#rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive"
zip -rqyX -9 "../Sparkle-for-Swift-Package-Manager.zip" *
# GitHub actions set the CI environment variable to true
if [ "$CI" != true ]; then
# Get latest git tag
cd "$SRCROOT"
latest_git_tag=$(git describe --tags --abbrev=0)
# 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
else
# Dummy placeholder for CI test builds as we don't really need to update Package.swift for building and testing purposes
latest_git_tag="CI_BUILD"
fi
# Generate new Package manifest
cd "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
if [ "$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"
sed -E -i '' -e "/let tag/ s/\".+\"/\"$latest_git_tag\"/" -e "/let version/ s/\".+\"/\"$CURRENT_PROJECT_VERSION\"/" -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
cp "Package.swift" "$SRCROOT"
echo "Package.swift updated with the following values:"
echo "Version: $CURRENT_PROJECT_VERSION"
echo "Tag: $latest_git_tag"
echo "Checksum: $spm_checksum"
else
echo "warning: Xcode version $XCODE_VERSION_ACTUAL does not support computing checksums for Swift Packages. Please update the Package manifest manually."
fi
if [ "$XZ_EXISTS" -eq 1 ] ; then
echo "WARNING: xz compression is used for official releases but bz2 is being used instead because xz tool is not installed on your system."
fi
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
fi
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
set -e
# Convenience script to automatically commit Package.swift after updating the checksum and move the latest tag
latest_git_tag=$(git describe --abbrev=0 --tags) # gets the latest tag name
commits_since_tag=$(git rev-list ${latest_git_tag}.. --count)
if [ "$commits_since_tag" -gt 0 ]; then
# If there have been commits since the latest tag, it's highly likely that we did not intend to do a full release
echo "WARNING: $commits_since_tag commit(s) since tag '$latest_git_tag'. Did you tag a new version?"
echo "Package.swift has not been committed and tag has not been moved."
else
# TODO: add sanity check to see if version is actually being updated or not?
read -p "Do you want to commit changes to Package.swift and force move tag '$latest_git_tag'? (required for SPM release) [Y/n]" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo "Package.swift has not been committed and tag has not been moved."
else
git add Package.swift
git commit -m "Update Package.swift"
git tag -f $latest_git_tag
echo "Package.swift committed and tag '$latest_git_tag' moved."
fi
fi
+1 -1
View File
@@ -9,7 +9,7 @@ if [ -z "$SRCROOT" ] || \
[ -z "$BUILT_PRODUCTS_DIR" ] || \
[ -z "$INFOPLIST_PATH" ] || \
[ -z "$CURRENT_PROJECT_VERSION" ]; then
echo "$0: Must be run from Xcode!" 1>&2
echo "$0: Must be run from Xcode!" 1>&2
exit 1
fi
+3 -1
View File
@@ -14,9 +14,11 @@ localizable-strings:
release:
xcodebuild -scheme Distribution -configuration Release -derivedDataPath "$(BUILDDIR)" build
open -R "$(BUILDDIR)/Build/Products/Release/Sparkle-"*.tar.bz2
./Configurations/release-move-tag.sh
open "$(BUILDDIR)/Build/Products/Release/"
cat Sparkle.podspec
@echo "Don't forget to update CocoaPods! pod trunk push"
@echo "Don't forget to upload Sparkle-for-Swift-Package-Manager.zip!"
build:
xcodebuild clean build
+27
View File
@@ -0,0 +1,27 @@
// swift-tools-version:5.3
import PackageDescription
// Version is technically not required here, SPM doesn't check
let version = "1.26.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 = "1.26.0"
let checksum = "0e7bd37ddfd6785f57f03451fef7397fe4ebee96a8613033cbf7d9bed19a7a60"
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
let package = Package(
name: "Sparkle",
platforms: [.macOS(.v10_11)],
products: [
.library(
name: "Sparkle",
targets: ["Sparkle"])
],
targets: [
.binaryTarget(
name: "Sparkle",
url: url,
checksum: checksum
)
]
)
+12 -14
View File
@@ -1,9 +1,12 @@
# Sparkle [![Build Status](https://travis-ci.org/sparkle-project/Sparkle.svg?branch=master)](https://travis-ci.org/sparkle-project/Sparkle) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods](https://img.shields.io/cocoapods/v/Sparkle.svg?maxAge=2592000)]() <a href="https://www.stackpath.com/?utm_source=sparkle-github&amp;utm_medium=badge&amp;utm_campaign=readme"><img src="https://img.shields.io/badge/sponsored%20by-StackPath-orange.svg" alt="sponsored by: StackPath"></a>
# Sparkle 1.x ![Build Status](https://github.com/sparkle-project/Sparkle/workflows/Build%20%26%20Tests/badge.svg?branch=master) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods](https://img.shields.io/cocoapods/v/Sparkle.svg?maxAge=2592000)]() <a href="https://www.stackpath.com/?utm_source=sparkle-github&amp;utm_medium=badge&amp;utm_campaign=readme"><img src="https://img.shields.io/badge/sponsored%20by-StackPath-orange.svg" alt="sponsored by: StackPath"></a>
Secure and reliable software update framework for Cocoa developers.
<img src="Resources/Screenshot.png" width="732" alt="Sparkle shows familiar update window with release notes">
This branch is the production ready, battle-tested version of Sparkle used by thousands of Mac apps.
The upcoming Sparkle 2 (currently in beta) can be found in the [2.x branch](https://github.com/sparkle-project/Sparkle/tree/2.x).
## Features
* Seamless. There's no mention of Sparkle; your icons and app name are used.
@@ -13,26 +16,17 @@ Secure and reliable software update framework for Cocoa developers.
* Supports bundles, preference panes, plugins, and other non-.app software. Can install .pkg files for more complicated products.
* Handles permissions, quarantine and automatically asks for authentication if needed.
* Uses RSS-based appcasts for release information. Appcasts are a de-facto standard supported by 3rd party update-tracking programs and websites.
* Sparkle stays hidden until second launch for better first impressions.
* Stays hidden until second launch for better first impressions.
* Truly self-updating — the user can choose to automatically download and install all updates in the background.
## Changes since 1.5b
* Compatibilty with macOS Sierra (and all newer versions).
* Up-to-date with 10.14 SDK and Xcode 10 (supports macOS 10.7+).
* Important security fixes and more secure signature algorithm.
* Cleaned up and modernized code, using ARC and Autolayout.
* Truly automatic background updates (no UI at all) when user agreed to "Automatically download and install updates in the future."
* Upgraded and more reliable binary delta and code signing verification.
* Ability to mark updates as critical.
* Progress and status notifications for the host app.
## Requirements
* Runtime: macOS 10.7 or greater
* Build: Xcode 8 and 10.11 SDK or greater
* Runtime: macOS 10.9 or greater
* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less; at least Xcode 12 if using Swift Package Manager.
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
* No sandboxing. Sparkle 1.x can't update sandboxed apps. Sparkle 2.0 (alpha) can.
* No sandboxing. Sparkle 1.x can't update sandboxed apps. However, [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
## Usage
@@ -40,6 +34,10 @@ See [getting started guide](https://sparkle-project.org/documentation/). No code
## 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 --recursive https://github.com/sparkle-project/Sparkle
### Troubleshooting
* Please check **Console.app**. 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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 827 B

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 KiB

After

Width:  |  Height:  |  Size: 176 KiB

+12
View File
@@ -0,0 +1,12 @@
@media (prefers-color-scheme: dark) {
html {
color: white;
background: transparent;
}
:link {
color: #419CFF;
}
:link:active {
color: #FF1919;
}
}
+3 -3
View File
@@ -12,7 +12,7 @@
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
<!-- Sparkle 1.21+ uses sparkle::edSignature="ed25519" instead of sparkle::dsaSignature="deprecated DSA" -->
<enclosure url="http://you.com/app/Your%20Great%20App%202.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
</item>
<item>
@@ -23,7 +23,7 @@
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
<!-- Sparkle 1.21+ uses sparkle::edSignature="ed25519" instead of sparkle::dsaSignature="deprecated DSA" -->
<enclosure url="http://you.com/app/Your%20Great%20App%201.5.zip" sparkle:version="1.5" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>10.9</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. -->
@@ -35,7 +35,7 @@
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
<!-- Sparkle 1.21+ uses sparkle::edSignature="ed25519" instead of sparkle::dsaSignature="deprecated DSA" -->
<enclosure url="http://you.com/app/Your%20Great%20App%201.4.zip" sparkle:version="241" sparkle:shortVersionString="1.4" sparkle:dsaSignature="MC0CFBfeCa1JyW30nbkBwainOzrN6EQuAh=" length="1472349" type="application/octet-stream" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 100 KiB

+3 -3
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "1.21.2"
s.version = "1.26.0"
s.summary = "A software update framework for macOS"
s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers."
s.homepage = "http://sparkle-project.org"
@@ -18,8 +18,8 @@ Pod::Spec.new do |s|
'Andy Matuschak' => 'andy@andymatuschak.org',
}
s.platform = :osx, '10.7'
s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.bz2" }
s.platform = :osx, '10.9'
s.source = { :http => "https://github.com/sparkle-project/Sparkle/releases/download/#{s.version}/Sparkle-#{s.version}.tar.xz" }
s.source_files = 'Sparkle.framework/Versions/A/Headers/*.h'
s.preserve_paths = 'bin/*'
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -3,7 +3,7 @@
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "61B5F90109C4CEE200B25A18"
BuildableName = "Sparkle Test App.app"
BlueprintName = "Sparkle Test App"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "61B5F90109C4CEE200B25A18"
BuildableName = "Sparkle Test App.app"
BlueprintName = "Sparkle Test App"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "61B5F90109C4CEE200B25A18"
BuildableName = "Sparkle Test App.app"
BlueprintName = "Sparkle Test App"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "895C5DB924D75F370058A82D"
BuildableName = "XCFramework"
BlueprintName = "XCFramework"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "895C5DB924D75F370058A82D"
BuildableName = "XCFramework"
BlueprintName = "XCFramework"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+10 -8
View File
@@ -89,14 +89,14 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5;
SULog(SULogLevelError, @"Failed to listen for application termination");
// Continue on with the installation anyway?
}
if (self.shouldShowUI) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(SUInstallationTimeLimit * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (!self.isTerminating) {
// Show app icon in the dock
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
}
if (!self.isTerminating) {
// Show app icon in the dock
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
}
});
}
@@ -136,7 +136,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5;
self.statusController = [[SUStatusController alloc] initWithHost:host];
[self.statusController setButtonTitle:SULocalizedString(@"Cancel Update", @"") target:nil action:Nil isDefault:NO];
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"")
maxProgressValue:100 statusText: @""];
maxProgressValue:installer.supportsDeterminateProgress ? 100 : 0 statusText: @""];
[self.statusController showWindow:self];
}
@@ -153,7 +153,9 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5;
void(^progressBlock)(double) = ^(double progress){
dispatch_async(dispatch_get_main_queue(), ^(){
self.statusController.progressValue = progress * 100.0;
if (installer.supportsDeterminateProgress) {
self.statusController.progressValue = progress * 100.0;
}
});
};
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SUAutomaticUpdateAlert">
@@ -17,25 +18,28 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUAutomaticUpdateAlert" animationBehavior="default" id="5" userLabel="Window">
<windowStyleMask key="styleMask" titled="YES"/>
<windowCollectionBehavior key="collectionBehavior" fullScreenAuxiliary="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="114" y="521" width="616" height="152"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<value key="minSize" type="size" width="511" height="152"/>
<view key="contentView" id="6">
<rect key="frame" x="0.0" y="0.0" width="616" height="152"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView id="7">
<imageView translatesAutoresizingMaskIntoConstraints="NO" id="7">
<rect key="frame" x="23" y="73" width="64" height="64"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="64" id="HIJ-Gw-yTF"/>
<constraint firstAttribute="height" constant="64" id="hbh-y8-N7K"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSApplicationIcon" id="38"/>
<connections>
<binding destination="-2" name="value" keyPath="applicationIcon" id="10"/>
</connections>
</imageView>
<textField verticalHuggingPriority="750" id="8">
<rect key="frame" x="105" y="120" width="497" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="8">
<rect key="frame" x="105" y="121" width="497" height="16"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="39">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -45,9 +49,8 @@
<binding destination="-2" name="value" keyPath="titleText" id="11"/>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="9">
<rect key="frame" x="105" y="81" width="497" height="31"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="9">
<rect key="frame" x="105" y="99" width="493" height="14"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="40">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -57,9 +60,8 @@
<binding destination="-2" name="value" keyPath="descriptionText" id="14"/>
</connections>
</textField>
<button verticalHuggingPriority="750" id="15">
<rect key="frame" x="435" y="12" width="167" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="15">
<rect key="frame" x="446" y="12" width="156" height="32"/>
<buttonCell key="cell" type="push" title="Install and Relaunch" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="41">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -71,9 +73,8 @@ DQ
<action selector="installNow:" target="-2" id="33"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="16">
<rect key="frame" x="306" y="12" width="129" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="16">
<rect key="frame" x="328" y="12" width="118" height="32"/>
<buttonCell key="cell" type="push" title="Install on Quit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="42">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -85,9 +86,8 @@ Gw
<action selector="installLater:" target="-2" id="34"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="30">
<rect key="frame" x="102" y="12" width="116" height="32"/>
<autoresizingMask key="autoresizingMask"/>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="30">
<rect key="frame" x="100" y="12" width="107" height="32"/>
<buttonCell key="cell" type="push" title="Don't Install" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="44">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -96,9 +96,8 @@ Gw
<action selector="doNotInstall:" target="-2" id="35"/>
</connections>
</button>
<button id="17">
<rect key="frame" x="105" y="58" width="619" height="18"/>
<autoresizingMask key="autoresizingMask"/>
<button translatesAutoresizingMaskIntoConstraints="NO" id="17">
<rect key="frame" x="106" y="58" width="489" height="18"/>
<buttonCell key="cell" type="check" title="Automatically download and install updates in the future" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="43">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
@@ -108,11 +107,34 @@ Gw
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="15" firstAttribute="leading" secondItem="16" secondAttribute="trailing" constant="14" id="1z5-yw-8XJ"/>
<constraint firstItem="30" firstAttribute="top" secondItem="17" secondAttribute="bottom" constant="20" symbolic="YES" id="3AQ-x0-2t4"/>
<constraint firstItem="7" firstAttribute="leading" secondItem="6" secondAttribute="leading" constant="23" id="3ak-LX-g8l"/>
<constraint firstItem="17" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="20" id="600-33-4ZV"/>
<constraint firstItem="16" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="30" secondAttribute="trailing" constant="100" id="86g-dm-fdN"/>
<constraint firstItem="8" firstAttribute="top" secondItem="6" secondAttribute="top" constant="15" id="Adf-rF-bOx"/>
<constraint firstItem="9" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="20" id="CKo-2e-9BO"/>
<constraint firstAttribute="trailing" secondItem="17" secondAttribute="trailing" constant="21" id="Hen-8y-ckS"/>
<constraint firstItem="30" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="20" id="T5I-iM-tWw"/>
<constraint firstItem="17" firstAttribute="top" secondItem="9" secondAttribute="bottom" constant="24" id="eo1-MH-1S4"/>
<constraint firstAttribute="bottom" secondItem="15" secondAttribute="bottom" constant="19" id="h6K-Du-mzi"/>
<constraint firstAttribute="bottom" secondItem="16" secondAttribute="bottom" constant="19" id="iJb-rw-tCI"/>
<constraint firstAttribute="trailing" secondItem="8" secondAttribute="trailing" constant="16" id="k1D-UP-haL"/>
<constraint firstAttribute="trailing" secondItem="9" secondAttribute="trailing" constant="20" id="k4f-2L-XBk"/>
<constraint firstItem="15" firstAttribute="top" secondItem="17" secondAttribute="bottom" constant="20" symbolic="YES" id="pU4-ge-nz4"/>
<constraint firstItem="7" firstAttribute="top" secondItem="6" secondAttribute="top" constant="15" id="pxH-Va-6al"/>
<constraint firstItem="9" firstAttribute="top" secondItem="8" secondAttribute="bottom" constant="8" symbolic="YES" id="qgx-nM-F29"/>
<constraint firstItem="16" firstAttribute="top" secondItem="17" secondAttribute="bottom" constant="20" id="sTJ-dt-fNH"/>
<constraint firstAttribute="trailing" secondItem="15" secondAttribute="trailing" constant="21" id="txY-6K-ogq"/>
<constraint firstItem="8" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="20" id="vhw-bw-hJ4"/>
</constraints>
</view>
<point key="canvasLocation" x="117" y="124"/>
</window>
<userDefaultsController representsSharedInstance="YES" id="18" userLabel="Shared Defaults"/>
</objects>
<resources>
<image name="NSApplicationIcon" width="128" height="128"/>
<image name="NSApplicationIcon" width="32" height="32"/>
</resources>
</document>
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<plugIn identifier="com.apple.WebKitIBPlugin" version="11542"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="box content view" minToolsVersion="7.0"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SUUpdateAlert">
@@ -15,8 +12,8 @@
<outlet property="descriptionField" destination="101" id="9oA-2S-eXN"/>
<outlet property="installButton" destination="76" id="176"/>
<outlet property="laterButton" destination="22" id="177"/>
<outlet property="releaseNotesBoxView" destination="89" id="FhX-K4-uzH"/>
<outlet property="releaseNotesContainerView" destination="fKC-QA-GZa" id="BYw-MA-Z5h"/>
<outlet property="releaseNotesView" destination="18" id="32"/>
<outlet property="skipButton" destination="23" id="178"/>
<outlet property="window" destination="5" id="69"/>
</connections>
@@ -25,11 +22,11 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" 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"/>
<rect key="contentRect" x="746" y="229" width="620" height="370"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<value key="minSize" type="size" width="550" height="150"/>
<value key="maxSize" type="size" width="700" height="600"/>
<view key="contentView" id="6">
<rect key="frame" x="0.0" y="0.0" width="620" height="370"/>
<autoresizingMask key="autoresizingMask"/>
@@ -76,34 +73,15 @@
</connections>
</textField>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="fKC-QA-GZa" userLabel="Container to hide release notes">
<rect key="frame" x="108" y="74" width="492" height="234"/>
<rect key="frame" x="108" y="73" width="492" height="235"/>
<subviews>
<box boxType="oldStyle" borderType="line" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="89">
<rect key="frame" x="0.0" y="0.0" width="492" height="214"/>
<rect key="frame" x="0.0" y="0.0" width="492" height="215"/>
<view key="contentView" id="hbB-V1-Bf6">
<rect key="frame" x="1" y="1" width="490" height="212"/>
<rect key="frame" x="1" y="1" width="490" height="213"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<webView maintainsBackForwardList="NO" translatesAutoresizingMaskIntoConstraints="NO" id="18">
<rect key="frame" x="0.0" y="-2" width="492" height="214"/>
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12" minimumFontSize="7" plugInsEnabled="NO" javaEnabled="NO" javaScriptCanOpenWindowsAutomatically="NO">
<nil key="identifier"/>
</webPreferences>
<connections>
<binding destination="-2" name="hidden" keyPath="showsReleaseNotes" id="161">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>
</webView>
</subviews>
</view>
<constraints>
<constraint firstItem="18" firstAttribute="top" secondItem="89" secondAttribute="top" constant="1" id="3ps-Yo-uZA"/>
<constraint firstAttribute="trailing" secondItem="18" secondAttribute="trailing" constant="-1" id="5W0-Eb-Snn"/>
<constraint firstAttribute="bottom" secondItem="18" secondAttribute="bottom" constant="-1" id="NOY-VJ-z4I"/>
<constraint firstItem="18" firstAttribute="leading" secondItem="89" secondAttribute="leading" constant="1" id="kSE-Xj-CRB"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="100" id="pvn-8k-9Ev"/>
</constraints>
<font key="titleFont" size="11" name="LucidaGrande"/>
@@ -116,7 +94,7 @@
</connections>
</box>
<textField verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="17">
<rect key="frame" x="-2" y="220" width="88" height="14"/>
<rect key="frame" x="-2" y="221" width="88" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" priority="100" constant="100" id="gkn-FW-9aC"/>
</constraints>
@@ -144,7 +122,7 @@
</constraints>
</customView>
<button horizontalHuggingPriority="150" verticalHuggingPriority="750" horizontalCompressionResistancePriority="997" translatesAutoresizingMaskIntoConstraints="NO" id="22">
<rect key="frame" x="331" y="12" width="143" height="32"/>
<rect key="frame" x="338" y="12" width="137" height="32"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" priority="222" constant="90" id="2Zy-5G-GBj"/>
</constraints>
@@ -160,7 +138,7 @@ Gw
</connections>
</button>
<button verticalHuggingPriority="750" horizontalCompressionResistancePriority="998" translatesAutoresizingMaskIntoConstraints="NO" id="23">
<rect key="frame" x="103" y="12" width="145" height="32"/>
<rect key="frame" x="102" y="12" width="139" height="32"/>
<buttonCell key="cell" type="push" title="Skip This Version" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="172">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -170,7 +148,7 @@ Gw
</connections>
</button>
<button horizontalHuggingPriority="20" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="76">
<rect key="frame" x="474" y="12" width="132" height="32"/>
<rect key="frame" x="473" y="12" width="134" height="32"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" priority="222" constant="120" id="N94-uf-6oP"/>
</constraints>
@@ -186,7 +164,7 @@ DQ
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="117">
<rect key="frame" x="106" y="49" width="495" height="20"/>
<rect key="frame" x="108" y="50" width="491" height="16"/>
<constraints>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="28" id="0AI-ue-a0r"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="14" id="yM1-TA-HfP"/>
@@ -196,11 +174,6 @@ DQ
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<binding destination="-2" name="hidden" keyPath="allowsAutomaticUpdates" id="141">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="93" name="value" keyPath="values.SUAutomaticallyUpdate" id="135"/>
</connections>
</button>
@@ -242,6 +215,6 @@ DQ
<userDefaultsController representsSharedInstance="YES" id="93" userLabel="Shared Defaults"/>
</objects>
<resources>
<image name="NSApplicationIcon" width="128" height="128"/>
<image name="NSApplicationIcon" width="32" height="32"/>
</resources>
</document>
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SUUpdatePermissionPrompt">
@@ -22,13 +23,13 @@
<windowStyleMask key="styleMask" titled="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="83" y="492" width="438" height="168"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1418"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<value key="minSize" type="size" width="213" height="107"/>
<view key="contentView" id="6">
<rect key="frame" x="0.0" y="0.0" width="438" height="168"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button verticalHuggingPriority="750" tag="1" id="13">
<button verticalHuggingPriority="750" fixedFrame="YES" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="13">
<rect key="frame" x="260" y="12" width="164" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<buttonCell key="cell" type="push" title="Check Automatically" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" tag="1" inset="2" id="176">
@@ -42,7 +43,7 @@ DQ
<action selector="finishPrompt:" target="-2" id="144"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="14">
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="14">
<rect key="frame" x="145" y="12" width="115" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<buttonCell key="cell" type="push" title="Don’t Check" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="177">
@@ -56,7 +57,7 @@ Gw
<action selector="finishPrompt:" target="-2" id="145"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="32">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="32">
<rect key="frame" x="104" y="114" width="289" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Check for updates automatically?" id="178">
@@ -65,7 +66,7 @@ Gw
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="33">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="33">
<rect key="frame" x="104" y="81" width="315" height="42"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="DO NOT LOCALIZE" id="179">
@@ -77,7 +78,7 @@ Gw
<binding destination="-2" name="value" keyPath="promptDescription" id="161"/>
</connections>
</textField>
<button focusRingType="none" id="34">
<button focusRingType="none" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="34">
<rect key="frame" x="104" y="53" width="278" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Include anonymous system profile" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" focusRingType="none" inset="2" id="180">
@@ -98,7 +99,7 @@ Gw
</binding>
</connections>
</button>
<imageView id="37">
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="37">
<rect key="frame" x="23" y="84" width="64" height="64"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="axesIndependently" image="NSApplicationIcon" id="181"/>
@@ -106,7 +107,7 @@ Gw
<binding destination="-2" name="value" keyPath="icon" id="130"/>
</connections>
</imageView>
<button focusRingType="none" horizontalHuggingPriority="750" verticalHuggingPriority="750" id="71">
<button focusRingType="none" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="71">
<rect key="frame" x="80" y="50" width="27" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="disclosureTriangle" bezelStyle="disclosure" imagePosition="overlaps" alignment="center" borderStyle="border" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="182">
@@ -124,6 +125,7 @@ Gw
</button>
</subviews>
</view>
<point key="canvasLocation" x="13" y="131"/>
</window>
<arrayController editable="NO" preservesSelection="NO" selectsInsertedObjects="NO" avoidsEmptySelection="NO" id="24" userLabel="Array Controller">
<declaredKeys>
@@ -140,7 +142,7 @@ Gw
<rect key="frame" x="0.0" y="0.0" width="362" height="205"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="46">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="46">
<rect key="frame" x="1" y="128" width="358" height="70"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="183">
@@ -152,7 +154,7 @@ This is the information that would be sent:</string>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<scrollView autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="0.0" verticalLineScroll="16" verticalPageScroll="0.0" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="40">
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="0.0" verticalLineScroll="16" verticalPageScroll="0.0" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="40">
<rect key="frame" x="4" y="5" width="355" height="115"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" id="sbp-rk-wxX">
@@ -161,14 +163,13 @@ This is the information that would be sent:</string>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="14" id="41">
<rect key="frame" x="0.0" y="0.0" width="353" height="113"/>
<autoresizingMask key="autoresizingMask"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn editable="NO" width="128" minWidth="40" maxWidth="1000" id="42">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
</tableHeaderCell>
@@ -182,9 +183,8 @@ This is the information that would be sent:</string>
<binding destination="24" name="value" keyPath="arrangedObjects.displayKey" id="174"/>
</connections>
</tableColumn>
<tableColumn editable="NO" width="219" minWidth="40" maxWidth="1000" id="44">
<tableColumn editable="NO" width="210" minWidth="40" maxWidth="1000" id="44">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
</tableHeaderCell>
@@ -202,11 +202,11 @@ This is the information that would be sent:</string>
</tableView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="185">
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="185">
<rect key="frame" x="-100" y="-100" width="345" height="11"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="NO" id="184">
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" controlSize="small" horizontal="NO" id="184">
<rect key="frame" x="-22" y="1" width="11" height="125"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
@@ -221,6 +221,6 @@ This is the information that would be sent:</string>
</userDefaultsController>
</objects>
<resources>
<image name="NSApplicationIcon" width="128" height="128"/>
<image name="NSApplicationIcon" width="32" height="32"/>
</resources>
</document>
@@ -2,10 +2,18 @@
"%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. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.";
"%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.";
"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.";
"%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.";
"%@ %@ 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$@.)";
/* 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?";
@@ -86,4 +94,4 @@
"You already have the newest version of %@." = "You already have the newest version of %@.";
/* 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!";
"You're up-to-date!" = "You’re up to date!";
+2 -2
View File
@@ -21,7 +21,7 @@ if sparkleRoot == nil || htmlPath == nil {
die("Missing arguments")
}
let enStringsPath = sparkleRoot! + "/Sparkle/en.lproj/Sparkle.strings"
let enStringsPath = sparkleRoot! + "/Sparkle/Base.lproj/Sparkle.strings"
let enStringsDict = NSDictionary(contentsOfFile: enStringsPath)
if enStringsDict == nil {
die("Invalid English strings")
@@ -51,7 +51,7 @@ head.addChild(XMLElement(name: "style", stringValue: css))
let locale = Locale.current
for dirEntry in dirContents {
if NSString(string: dirEntry).pathExtension != "lproj" || dirEntry == "en.lproj" {
if NSString(string: dirEntry).pathExtension != "lproj" || dirEntry == "Base.lproj" || dirEntry == "en.lproj" {
continue
}
-9
View File
@@ -1,9 +0,0 @@
html {
color: #FFFFFFD8;
}
:link {
color: #419CFF;
}
:link:active {
color: #FF1919;
}
+1 -4
View File
@@ -8,6 +8,7 @@
#import "SPUDownloadData.h"
#import "SUOperatingSystem.h"
#include "AppKitPrevention.h"
@@ -52,7 +53,6 @@ static NSString *SPUDownloadMIMETypeKey = @"SPUDownloadMIMEType";
- (nullable instancetype)initWithCoder:(NSCoder *)decoder
{
if (@available(macOS 10.8, *)) {
NSData *data = [decoder decodeObjectOfClass:[NSData class] forKey:SPUDownloadDataKey];
if (data == nil) {
return nil;
@@ -63,9 +63,6 @@ static NSString *SPUDownloadMIMETypeKey = @"SPUDownloadMIMEType";
NSString *MIMEType = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadMIMETypeKey];
return [self initWithData:data textEncodingName:textEncodingName MIMEType:MIMEType];
} else {
abort(); // Not used on 10.7
}
}
@end
-13
View File
@@ -1,13 +0,0 @@
//
// SPUDownloaderDeprecated.h
// Sparkle
//
// Created by Deadpikle on 12/20/17.
// Copyright © 2017 Sparkle Project. All rights reserved.
//
#import "SPUDownloader.h"
@interface SPUDownloaderDeprecated : SPUDownloader <SPUDownloaderProtocol>
@end
-167
View File
@@ -1,167 +0,0 @@
//
// SPUDownloaderDeprecated.m
// Sparkle
//
// Created by Deadpikle on 12/20/17.
// Copyright © 2017 Sparkle Project. All rights reserved.
//
#import "SPUDownloaderDeprecated.h"
#import "SPUURLRequest.h"
#import "SPUDownloader_Private.h"
#import "SPUDownloadData.h"
#import "SPULocalCacheDirectory.h"
#import "SUErrors.h"
#include "AppKitPrevention.h"
@interface SPUDownloaderDeprecated () <NSURLDownloadDelegate>
@property (nonatomic) NSURLDownload *download;
@property (nonatomic) NSURLResponse *response;
@end
@implementation SPUDownloaderDeprecated
@synthesize download = _download;
@synthesize response = _response;
- (void)startPersistentDownloadWithRequest:(SPUURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.download == nil && self.delegate != nil) {
// Prevent service from automatically terminating while downloading the update asynchronously without any reply blocks
[[NSProcessInfo processInfo] disableAutomaticTermination:SUDownloadingReason];
self.disabledAutomaticTermination = YES;
self.mode = SPUDownloadModePersistent;
self.desiredFilename = desiredFilename;
self.bundleIdentifier = bundleIdentifier;
self.download = [[NSURLDownload alloc] initWithRequest:request.request delegate:self];
}
});
}
- (void)startTemporaryDownloadWithRequest:(SPUURLRequest *)request
{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.download == nil && self.delegate != nil) {
// Prevent service from automatically terminating while downloading the update asynchronously without any reply blocks
[[NSProcessInfo processInfo] disableAutomaticTermination:SUDownloadingReason];
self.disabledAutomaticTermination = YES;
self.mode = SPUDownloadModeTemporary;
self.download = [[NSURLDownload alloc] initWithRequest:request.request delegate:self];
}
});
}
- (void)download:(NSURLDownload *)__unused d decideDestinationWithSuggestedFilename:(NSString *)name
{
if (self.mode == SPUDownloadModeTemporary) {
// Files downloaded in temporary mode should not last for very long,
// so it's ideal to place them in a system temporary directory
NSString *destinationFilename = NSTemporaryDirectory();
if (destinationFilename) {
destinationFilename = [destinationFilename stringByAppendingPathComponent:name];
[self.download setDestination:destinationFilename allowOverwrite:NO];
}
} else {
NSString *tempDir = [super getAndCleanTempDirectory];
if (tempDir != nil) {
NSString *downloadFileName = self.desiredFilename;
NSString *downloadFileNameDirectory = [tempDir stringByAppendingPathComponent:downloadFileName];
NSError *createError = nil;
if (![[NSFileManager defaultManager] createDirectoryAtPath:downloadFileNameDirectory withIntermediateDirectories:NO attributes:nil error:&createError]) {
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUTemporaryDirectoryError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Can't make a download file name %@ directory inside temporary directory for the update download at %@.", downloadFileName, downloadFileNameDirectory] }];
[self.delegate downloaderDidFailWithError:error];
} else {
[self.download setDestination:[downloadFileNameDirectory stringByAppendingPathComponent:name] allowOverwrite:YES];
[self.delegate downloaderDidSetDestinationName:name temporaryDirectory:downloadFileNameDirectory];
}
}
}
}
- (void)download:(NSURLDownload *)__unused aDownload didCreateDestination:(NSString *)path
{
self.downloadFilename = path;
}
- (void)download:(NSURLDownload *)__unused download didReceiveResponse:(NSURLResponse *)response
{
self.response = response;
if (self.mode == SPUDownloadModePersistent) {
// It might be tempting to send over the response object instead of the expected content length but this isn't a good idea
// For one, we are only ever concerned about the expected content length
// Another reason is that NSURLResponse doesn't support NSSecureCoding in older OS releases (eg: 10.8), which cause issues with XPC
[self.delegate downloaderDidReceiveExpectedContentLength:response.expectedContentLength];
}
}
- (void)download:(NSURLDownload *)__unused download didReceiveDataOfLength:(NSUInteger)length
{
if (self.mode == SPUDownloadModePersistent) {
[self.delegate downloaderDidReceiveDataOfLength:length];
}
}
- (void)downloadDidFinish:(NSURLDownload *)__unused d
{
[self downloadDidFinish];
}
- (void)download:(NSURLDownload *)__unused download didFailWithError:(NSError *)error
{
self.download = nil;
[self.delegate downloaderDidFailWithError:error];
[self cleanup];
}
- (BOOL)download:(NSURLDownload *)__unused download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType
{
// We don't want the download system to extract our gzips for persistent downloads
// Note that we use a substring matching here instead of direct comparison because the docs say "application/gzip" but the system *uses* "application/x-gzip". This is a documentation bug.
return (self.mode == SPUDownloadModeTemporary || [encodingType rangeOfString:@"gzip"].location == NSNotFound);
}
- (void)downloadDidFinish
{
assert(self.response != nil);
assert(self.downloadFilename != nil);
SPUDownloadData *downloadData = nil;
if (self.mode == SPUDownloadModeTemporary) {
NSData *data = [NSData dataWithContentsOfFile:self.downloadFilename];
if (data != nil) {
downloadData = [[SPUDownloadData alloc] initWithData:data textEncodingName:self.response.textEncodingName MIMEType:self.response.MIMEType];
}
}
self.download = nil;
[super downloadDidFinishWithData:downloadData];
}
-(void)cleanup
{
[self.download cancel];
self.download = nil;
self.response = nil;
[super cleanup];
}
- (void)cancel
{
[self cleanup];
}
@end
+3 -6
View File
@@ -8,6 +8,7 @@
#import "SPUURLRequest.h"
#import "SUOperatingSystem.h"
#include "AppKitPrevention.h"
@@ -61,9 +62,9 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ
- (void)encodeWithCoder:(NSCoder *)coder
{
[coder encodeObject:self.url forKey:SPUURLRequestURLKey];
[coder encodeInteger:self.cachePolicy forKey:SPUURLRequestCachePolicyKey];
[coder encodeInteger:(NSInteger)self.cachePolicy forKey:SPUURLRequestCachePolicyKey];
[coder encodeDouble:self.timeoutInterval forKey:SPUURLRequestTimeoutIntervalKey];
[coder encodeInteger:self.networkServiceType forKey:SPUURLRequestNetworkServiceTypeKey];
[coder encodeInteger:(NSInteger)self.networkServiceType forKey:SPUURLRequestNetworkServiceTypeKey];
if (self.httpHeaderFields != nil) {
[coder encodeObject:self.httpHeaderFields forKey:SPUURLRequestHttpHeaderFieldsKey];
@@ -72,7 +73,6 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ
- (instancetype)initWithCoder:(NSCoder *)decoder
{
if (@available(macOS 10.8, *)) {
NSURL *url = [decoder decodeObjectOfClass:[NSURL class] forKey:SPUURLRequestURLKey];
NSURLRequestCachePolicy cachePolicy = (NSURLRequestCachePolicy)[decoder decodeIntegerForKey:SPUURLRequestCachePolicyKey];
NSTimeInterval timeoutInterval = [decoder decodeDoubleForKey:SPUURLRequestTimeoutIntervalKey];
@@ -80,9 +80,6 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ
NSURLRequestNetworkServiceType networkServiceType = (NSURLRequestNetworkServiceType)[decoder decodeIntegerForKey:SPUURLRequestNetworkServiceTypeKey];
return [self initWithURL:url cachePolicy:cachePolicy timeoutInterval:timeoutInterval httpHeaderFields:httpHeaderFields networkServiceType:networkServiceType];
} else {
abort(); // Not used on 10.7
}
}
- (NSURLRequest *)request
-4
View File
@@ -9,11 +9,7 @@
#ifndef SUAPPCAST_H
#define SUAPPCAST_H
#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"
NS_ASSUME_NONNULL_BEGIN
+9 -19
View File
@@ -16,7 +16,6 @@
#import "SUOperatingSystem.h"
#import "SPUDownloadData.h"
#import "SPUDownloaderDelegate.h"
#import "SPUDownloaderDeprecated.h"
#import "SPUDownloaderSession.h"
#include "AppKitPrevention.h"
@@ -84,17 +83,8 @@
}
[request setValue:@"application/rss+xml,*/*;q=0.1" forHTTPHeaderField:@"Accept"];
if ([SUOperatingSystem isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 9, 0}]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
self.download = [[SPUDownloaderSession alloc] initWithDelegate:self];
#pragma clang diagnostic pop
}
else {
self.download = [[SPUDownloaderDeprecated alloc] initWithDelegate:self];
}
self.download = [[SPUDownloaderSession alloc] initWithDelegate:self];
SPUURLRequest *urlRequest = [SPUURLRequest URLRequestWithRequest:request];
[self.download startTemporaryDownloadWithRequest:urlRequest];
@@ -199,7 +189,7 @@
NSUInteger options = NSXMLNodeLoadExternalEntitiesNever; // Prevent inclusion from file://
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:appcastData options:options error:errorp];
if (nil == document) {
if (nil == document) {
return nil;
}
@@ -212,7 +202,7 @@
NSEnumerator *nodeEnum = [xmlItems objectEnumerator];
NSXMLNode *node;
while((node = [nodeEnum nextObject])) {
while((node = [nodeEnum nextObject])) {
NSMutableDictionary *nodesDict = [NSMutableDictionary dictionary];
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
@@ -239,7 +229,7 @@
// enclosure is flattened as a separate dictionary for some reason
NSDictionary *encDict = [self attributesOfNode:(NSXMLElement *)node];
[dict setObject:encDict forKey:name];
}
}
else if ([name isEqualToString:SURSSElementPubDate]) {
// We don't want to parse and create a NSDate instance -
// that's a risk we can avoid. We don't use the date anywhere other
@@ -248,8 +238,8 @@
if (dateString) {
[dict setObject:dateString forKey:name];
}
}
else if ([name isEqualToString:SUAppcastElementDeltas]) {
}
else if ([name isEqualToString:SUAppcastElementDeltas]) {
NSMutableArray *deltas = [NSMutableArray array];
NSEnumerator *childEnum = [[node children] objectEnumerator];
for (NSXMLNode *child in childEnum) {
@@ -258,7 +248,7 @@
}
}
[dict setObject:deltas forKey:name];
}
}
else if ([name isEqualToString:SUAppcastElementTags]) {
NSMutableArray *tags = [NSMutableArray array];
NSEnumerator *childEnum = [[node children] objectEnumerator];
@@ -270,7 +260,7 @@
}
[dict setObject:tags forKey:name];
}
else if (name != nil) {
else if (name != nil) {
// add all other values as strings
NSString *theValue = [[node stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (theValue != nil) {
@@ -283,7 +273,7 @@
SUAppcastItem *anItem = [[SUAppcastItem alloc] initWithDictionary:dict failureReason:&errString];
if (anItem) {
[appcastItems addObject:anItem];
}
}
else {
SULog(SULogLevelError, @"Sparkle Updater: Failed to parse appcast item: %@.\nAppcast dictionary was: %@", errString, dict);
if (errorp) *errorp = [NSError errorWithDomain:SUSparkleErrorDomain
+3
View File
@@ -20,6 +20,7 @@
SU_EXPORT @interface SUAppcastItem : NSObject
@property (copy, readonly) NSString *title;
@property (copy, readonly) NSString *dateString;
@property (copy, readonly) NSDate *date;
@property (copy, readonly) NSString *itemDescription;
@property (strong, readonly) NSURL *releaseNotesURL;
@property (strong, readonly) SUSignatures *signatures;
@@ -32,6 +33,8 @@ SU_EXPORT @interface SUAppcastItem : NSObject
@property (copy, readonly) NSString *displayVersionString;
@property (copy, readonly) NSDictionary *deltaUpdates;
@property (strong, readonly) NSURL *infoURL;
@property (copy, readonly) NSNumber* phasedRolloutInterval;
@property (copy, readonly) NSString *minimumAutoupdateVersion;
// Initializes with data from a dictionary provided by the RSS class.
- (instancetype)initWithDictionary:(NSDictionary *)dict;
+25 -2
View File
@@ -28,6 +28,8 @@
@property (copy, readwrite) NSDictionary *deltaUpdates;
@property (strong, readwrite) NSURL *infoURL;
@property (readwrite, copy) NSDictionary *propertiesDictionary;
@property (copy, readwrite) NSNumber* phasedRolloutInterval;
@property (copy, readwrite) NSString *minimumAutoupdateVersion;
@end
@implementation SUAppcastItem
@@ -46,6 +48,8 @@
@synthesize versionString;
@synthesize osString;
@synthesize propertiesDictionary;
@synthesize phasedRolloutInterval;
@synthesize minimumAutoupdateVersion;
- (BOOL)isDeltaUpdate
{
@@ -63,6 +67,18 @@
return self.osString == nil || [self.osString isEqualToString:SUAppcastAttributeValueMacOS];
}
- (NSDate*)date {
if(self.dateString == nil) {
return nil;
}
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
dateFormatter.dateFormat = @"E, dd MMM yyyy HH:mm:ss Z";
return [dateFormatter dateFromString:self.dateString];
}
- (BOOL)isInformationOnlyUpdate
{
return self.infoURL && !self.fileURL;
@@ -125,7 +141,7 @@
}
// Need an info URL or an enclosure URL. Former to show "More Info"
// page, latter to download & install:
// page, latter to download & install:
if (!enclosure && !theInfoURL) {
if (error) {
*error = @"No enclosure in feed item";
@@ -140,7 +156,7 @@
}
return nil;
}
if (enclosureURLString) {
NSString *enclosureLengthString = [enclosure objectForKey:SURSSAttributeLength];
long long contentLength = 0;
@@ -175,6 +191,11 @@
self.displayVersionString = self.versionString;
}
NSString* enclosureRolloutIntervalString = [dict objectForKey:SUAppcastElementPhasedRolloutInterval];
if(enclosureRolloutIntervalString) {
self.phasedRolloutInterval = @(enclosureRolloutIntervalString.integerValue);
}
// Find the appropriate release notes URL.
NSString *releaseNotesString = [dict objectForKey:SUAppcastElementReleaseNotesLink];
if (releaseNotesString) {
@@ -206,6 +227,8 @@
}
self.deltaUpdates = deltas;
}
self.minimumAutoupdateVersion = [dict objectForKey:SUAppcastElementMinimumAutoupdateVersion];
}
return self;
}
+13 -2
View File
@@ -96,6 +96,12 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationInvocation:invocation];
}
else if ([updaterDelegate respondsToSelector:@selector(updater:willInstallUpdateOnQuit:immediateInstallationBlock:)])
{
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationBlock:^{
[self installWithToolAndRelaunch:YES displayingUserInterface:NO];
}];
}
// If this is marked as a critical update, we'll prompt the user to install it right away.
if ([self.updateItem isCriticalUpdate])
@@ -173,8 +179,8 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
- (void)automaticUpdateAlertFinishedWithChoice:(SUAutomaticInstallationChoice)choice
{
self.alert = nil;
switch (choice)
{
switch (choice)
{
case SUInstallNowChoice:
[self stopUpdatingOnTermination];
[self installWithToolAndRelaunch:YES];
@@ -228,4 +234,9 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
}
}
- (BOOL)usesPhasedRollout
{
return YES;
}
@end
+5 -1
View File
@@ -17,13 +17,17 @@
@interface SUBasicUpdateDriver : SUUpdateDriver <SPUDownloaderDelegate>
@property (strong, readonly) SUAppcastItem *updateItem;
@property (strong, readonly) SUAppcastItem *latestAppcastItem;
@property (assign, readonly) NSComparisonResult latestAppcastItemComparisonResult;
@property (strong, readonly) SPUDownloader *download;
@property (copy, readonly) NSString *downloadPath;
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
- (BOOL)isItemNewer:(SUAppcastItem *)ui;
+ (BOOL)hostSupportsItem:(SUAppcastItem *)ui;
- (BOOL)itemPreventsAutoupdate:(SUAppcastItem *)ui;
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui;
- (BOOL)usesPhasedRollout;
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui;
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui;
- (void)appcastDidFinishLoading:(SUAppcast *)ac;
+155 -60
View File
@@ -22,16 +22,20 @@
#import "SUUpdateValidator.h"
#import "SULocalizations.h"
#import "SUErrors.h"
#import "SUUpdater.h"
#import "SUAppcast.h"
#import "SUAppcastItem.h"
#import "SUGlobalUpdateLock.h"
#import "SUSystemUpdateInfo.h"
#import "SPUURLRequest.h"
#import "SPUDownloaderDeprecated.h"
#import "SPUDownloaderSession.h"
@interface SUBasicUpdateDriver ()
@property (strong) SUAppcastItem *updateItem;
@property (strong) SUAppcastItem *latestAppcastItem;
@property (assign) NSComparisonResult latestAppcastItemComparisonResult;
@property (strong) SPUDownloader *download;
@property (copy) NSString *downloadPath;
@@ -46,6 +50,8 @@
@implementation SUBasicUpdateDriver
@synthesize updateItem;
@synthesize latestAppcastItem;
@synthesize latestAppcastItemComparisonResult;
@synthesize download;
@synthesize downloadPath;
@@ -58,9 +64,17 @@
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
{
[super checkForUpdatesAtURL:URL host:aHost];
if ([aHost isRunningOnReadOnlyVolume])
{
[self abortUpdateWithError:[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. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.", nil), [aHost name]] }]];
if ([aHost isRunningOnReadOnlyVolume])
{
NSString *hostName = [aHost name];
if ([aHost isRunningTranslocated])
{
[self abortUpdateWithError:[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 abortUpdateWithError:[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] }]];
}
return;
}
@@ -82,7 +96,7 @@
{
id<SUVersionComparison> comparator = nil;
id<SUUpdaterPrivate> updater = self.updater;
// Give the delegate a chance to provide a custom version comparator
if ([[updater delegate] respondsToSelector:@selector(versionComparatorForUpdater:)]) {
comparator = [[updater delegate] versionComparatorForUpdater:self.updater];
@@ -96,31 +110,74 @@
return comparator;
}
+ (SUAppcastItem *)bestItemFromAppcastItems:(NSArray *)appcastItems getDeltaItem:(SUAppcastItem * __autoreleasing *)deltaItem withHostVersion:(NSString *)hostVersion comparator:(id<SUVersionComparison>)comparator
// This method is only used for testing
+ (SUAppcastItem *)bestItemFromAppcastItems:(NSArray *)appcastItems getDeltaItem:(SUAppcastItem *_Nullable __autoreleasing *_Nullable)deltaItem withHostVersion:(NSString *)hostVersion comparator:(id<SUVersionComparison>)comparator {
SUBasicUpdateDriver* basicUpdateDriver = [[SUBasicUpdateDriver alloc] initWithUpdater:(id<SUUpdaterPrivate>)[SUUpdater sharedUpdater]];
return [basicUpdateDriver bestItemFromAppcastItems:appcastItems getDeltaItem:deltaItem withHostVersion:hostVersion comparator:comparator];
}
- (SUAppcastItem *)bestItemFromAppcastItems:(NSArray *)appcastItems getDeltaItem:(SUAppcastItem * __autoreleasing *)deltaItem withHostVersion:(NSString *)hostVersion comparator:(id<SUVersionComparison>)comparator
{
SUAppcastItem *item = nil;
NSComparisonResult order;
for(SUAppcastItem *candidate in appcastItems) {
if ([[self class] hostSupportsItem:candidate]) {
if (!item || [comparator compareVersion:item.versionString toVersion:candidate.versionString] == NSOrderedAscending) {
if ([self hostSupportsItem:candidate]) {
// Pick this item if nothing is picked yet. Always pick an item with a higher version. Only if versions are the same
// compare their dates and pick this item if its date is not lower – this covers cases when no date is available
// and picks items at the end of the appcast list as they are more likely to be the most recent releases.
if (
!item
|| (order = [comparator compareVersion:item.versionString toVersion:candidate.versionString]) == NSOrderedAscending
|| (order == NSOrderedSame && [item.date compare:candidate.date] != NSOrderedDescending)
) {
item = candidate;
}
}
}
if (item && deltaItem) {
SUAppcastItem *deltaUpdateItem = [[item deltaUpdates] objectForKey:hostVersion];
if (deltaUpdateItem && [[self class] hostSupportsItem:deltaUpdateItem]) {
if (deltaUpdateItem && [self hostSupportsItem:deltaUpdateItem]) {
*deltaItem = deltaUpdateItem;
}
}
return item;
}
+ (BOOL)hostSupportsItem:(SUAppcastItem *)ui
- (BOOL)usesPhasedRollout
{
return NO;
}
- (BOOL)isItemReadyForPhasedRollout:(SUAppcastItem *)ui {
if(![self usesPhasedRollout] || [ui isCriticalUpdate] || ![ui phasedRolloutInterval]) {
return YES;
}
NSDate* itemReleaseDate = ui.date;
if(!itemReleaseDate) {
return YES;
}
NSTimeInterval timeSinceRelease = [[NSDate date] timeIntervalSinceDate:itemReleaseDate];
NSTimeInterval phasedRolloutInterval = [[ui phasedRolloutInterval] doubleValue];
NSTimeInterval timeToWaitForGroup = phasedRolloutInterval * [SUSystemUpdateInfo updateGroupForHost:self.host];
return timeSinceRelease >= timeToWaitForGroup;
}
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui
{
return [self hostSupportsOperatingSystemInItem:ui] && [self isItemReadyForPhasedRollout:ui];
}
- (BOOL)hostSupportsOperatingSystemInItem:(SUAppcastItem *)ui
{
BOOL osOK = [ui isMacOsUpdate];
if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) &&
if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) &&
([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) {
return osOK;
}
@@ -146,16 +203,21 @@
return [[self versionComparator] compareVersion:[self.host version] toVersion:[ui versionString]] == NSOrderedAscending;
}
- (BOOL)itemPreventsAutoupdate:(SUAppcastItem *)ui
{
return ([ui minimumAutoupdateVersion] && ! [[ui minimumAutoupdateVersion] isEqualToString:@""] && ([[self versionComparator] compareVersion:[self.host version] toVersion:[ui minimumAutoupdateVersion]] == NSOrderedAscending));
}
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui
{
NSString *skippedVersion = [self.host objectForUserDefaultsKey:SUSkippedVersionKey];
if (skippedVersion == nil) { return NO; }
if (skippedVersion == nil) { return NO; }
return [[self versionComparator] compareVersion:[ui versionString] toVersion:skippedVersion] != NSOrderedDescending;
}
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui
{
return ui && [[self class] hostSupportsItem:ui] && [self isItemNewer:ui] && ![self itemContainsSkippedVersion:ui];
return ui && [self hostSupportsItem:ui] && [self isItemNewer:ui] && ![self itemContainsSkippedVersion:ui];
}
- (void)appcastDidFinishLoading:(SUAppcast *)ac
@@ -175,7 +237,7 @@
{
item = [[updater delegate] bestValidUpdateInAppcast:ac forUpdater:self.updater];
}
if (item != nil) // Does the delegate want to handle it?
{
if ([item isDeltaUpdate]) {
@@ -186,14 +248,18 @@
{
// Find the best supported update
SUAppcastItem *deltaUpdateItem = nil;
item = [[self class] bestItemFromAppcastItems:ac.items getDeltaItem:&deltaUpdateItem withHostVersion:self.host.version comparator:[self versionComparator]];
item = [self bestItemFromAppcastItems:ac.items getDeltaItem:&deltaUpdateItem withHostVersion:self.host.version comparator:[self versionComparator]];
if (item && deltaUpdateItem) {
self.nonDeltaUpdateItem = item;
item = deltaUpdateItem;
}
}
self.latestAppcastItem = item;
self.latestAppcastItemComparisonResult = [[self versionComparator] compareVersion:[self.host version] toVersion:[item versionString]];
if ([self itemContainsValidUpdate:item]) {
self.updateItem = item;
[self performSelectorOnMainThread:@selector(didFindValidUpdate) withObject:nil waitUntilDone:NO];
@@ -206,7 +272,14 @@
- (void)didFindValidUpdate
{
assert(self.updateItem);
// Handle the case where the update indicates that an automatic update is only available for specific versions
if ([self itemPreventsAutoupdate:self.updateItem]) {
[self.updater setAutomaticallyDownloadsUpdates:NO]; // This call will persist this setting (automatic downloads will be permanently deactivated), but that is probably OK after the rare case of a non-automatically updateable update - the user can always reactivate this in the settings or when the update information window appears for the next time.
[self.updater checkForUpdatesInBackground]; // Will end up in SUUIBasedUpdateDriver instead of here
return;
}
id<SUUpdaterPrivate> updater = self.updater;
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
@@ -222,7 +295,7 @@
- (void)didNotFindUpdate
{
id<SUUpdaterPrivate> updater = self.updater;
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
[[updater delegate] updaterDidNotFindUpdate:self.updater];
}
@@ -247,12 +320,12 @@
SULog(SULogLevelError, @"Failed to find user's cache directory! Using system default");
cachePath = NSTemporaryDirectory();
}
NSString *name = [self.host.bundle bundleIdentifier];
if (!name) {
name = [self.host name];
}
cachePath = [cachePath stringByAppendingPathComponent:name];
cachePath = [cachePath stringByAppendingPathComponent:@SPARKLE_BUNDLE_IDENTIFIER];
return cachePath;
@@ -262,13 +335,16 @@
{
NSString *bundleIdentifier = self.host.bundle.bundleIdentifier;
assert(bundleIdentifier != nil);
// Clear cache directory so that downloads can't possibly accumulate inside
NSString *appCachePath = [self appCachePath];
if ([[NSFileManager defaultManager] fileExistsAtPath:appCachePath]) {
[[NSFileManager defaultManager] removeItemAtPath:appCachePath error:NULL];
}
// Ensure no other thirdparty app-updater is concurrently updating this app.
[[SUGlobalUpdateLock sharedLock] lock];
id<SUUpdaterPrivate> updater = self.updater;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[self.updateItem fileURL]];
@@ -276,22 +352,27 @@
request.networkServiceType = NSURLNetworkServiceTypeBackground;
}
[request setValue:[updater userAgentString] forHTTPHeaderField:@"User-Agent"];
NSString *userAgentString = [updater userAgentString];
if (userAgentString) {
[request setValue:userAgentString forHTTPHeaderField:@"User-Agent"];
}
NSDictionary<NSString *, NSString *> *httpHeaders = [updater httpHeaders];
if (httpHeaders) {
for (NSString *key in httpHeaders) {
NSString *value = [httpHeaders objectForKey:key];
[request setValue:value forHTTPHeaderField:key];
}
}
if ([[updater delegate] respondsToSelector:@selector(updater:willDownloadUpdate:withRequest:)]) {
[[updater delegate] updater:self.updater
willDownloadUpdate:self.updateItem
withRequest:request];
}
if ([SUOperatingSystem isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 9, 0}]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
self.download = [[SPUDownloaderSession alloc] initWithDelegate:self];
#pragma clang diagnostic pop
}
else {
self.download = [[SPUDownloaderDeprecated alloc] initWithDelegate:self];
}
self.download = [[SPUDownloaderSession alloc] initWithDelegate:self];
SPUURLRequest *urlRequest = [SPUURLRequest URLRequestWithRequest:request];
NSString *desiredFilename = [NSString stringWithFormat:@"%@ %@", [self.host name], [self.updateItem versionString]];
[self.download startPersistentDownloadWithRequest:urlRequest bundleIdentifier:bundleIdentifier desiredFilename:desiredFilename];
@@ -318,11 +399,17 @@
{
// finished. downloadData should be nil as this was a permanent download
assert(self.updateItem);
if (self.updateItem.phasedRolloutInterval != nil) {
// use new update group next time, even if the driver doesn't usesPhasedRollout
[SUSystemUpdateInfo setNewUpdateGroupIdentifierForHost:self.host];
}
id<SUUpdaterPrivate> updater = self.updater;
if ([[updater delegate] respondsToSelector:@selector(updater:didDownloadUpdate:)]) {
[[updater delegate] updater:self.updater didDownloadUpdate:self.updateItem];
}
[self extractUpdate];
}
@@ -332,15 +419,15 @@
if (!failingUrl) {
failingUrl = [self.updateItem fileURL];
}
id<SUUpdaterPrivate> updater = self.updater;
if ([[updater delegate] respondsToSelector:@selector(updater:failedToDownloadUpdate:error:)]) {
[[updater delegate] updater:self.updater
failedToDownloadUpdate:self.updateItem
error:error];
}
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{
NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while downloading the update. Please try again later.", nil),
NSUnderlyingErrorKey: error,
@@ -348,7 +435,7 @@
if (failingUrl) {
[userInfo setObject:failingUrl forKey:NSURLErrorFailingURLErrorKey];
}
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUDownloadError userInfo:userInfo]];
}
@@ -356,7 +443,7 @@
{
id<SUUpdaterPrivate> updater = self.updater;
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:self.downloadPath updatingHostBundlePath:self.host.bundlePath decryptionPassword:updater.decryptionPassword];
BOOL success = NO;
if (!unarchiver) {
SULog(SULogLevelError, @"Error: No valid unarchiver for %@!", self.downloadPath);
@@ -372,7 +459,7 @@
success = YES;
}
}
if (!success) {
NSError *reason = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{NSLocalizedDescriptionKey: @"Failed to extract update."}];
[self unarchiverDidFailWithError:reason];
@@ -380,7 +467,7 @@
if ([[updater delegate] respondsToSelector:@selector(updater:willExtractUpdate:)]) {
[[updater delegate] updater:self.updater willExtractUpdate:self.updateItem];
}
[unarchiver unarchiveWithCompletionBlock:^(NSError *err){
if (err) {
[self unarchiverDidFailWithError:err];
@@ -389,7 +476,7 @@
if ([[updater delegate] respondsToSelector:@selector(updater:didExtractUpdate:)]) {
[[updater delegate] updater:self.updater didExtractUpdate:self.updateItem];
}
[self performSelectorOnMainThread:@selector(unarchiverDidFinish:) withObject:nil waitUntilDone:NO];
} progressBlock:^(double progress) {
[self unarchiver:nil extractedProgress:progress];
@@ -415,7 +502,7 @@
- (void)unarchiverDidFinish:(id)__unused ua
{
assert(self.updateItem);
[self installWithToolAndRelaunch:YES];
}
@@ -423,12 +510,12 @@
{
// No longer needed
self.updateValidator = nil;
if ([self.updateItem isDeltaUpdate]) {
[self failedToApplyDeltaUpdate];
return;
}
[self abortUpdateWithError:err];
}
@@ -473,7 +560,7 @@
{
assert(self.updateItem);
assert(self.updateValidator);
BOOL validationCheckSuccess = [self.updateValidator validateWithUpdateDirectory:self.tempDir];
if (!validationCheckSuccess) {
NSDictionary *userInfo = @{
@@ -494,19 +581,24 @@
id<SUUpdaterPrivate> updater = self.updater;
static BOOL postponedOnce = NO;
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
if (!postponedOnce && [updaterDelegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
{
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:)]];
[invocation setSelector:@selector(installWithToolAndRelaunch:)];
[invocation setArgument:&relaunch atIndex:2];
[invocation setTarget:self];
postponedOnce = YES;
if ([updaterDelegate updater:self.updater shouldPostponeRelaunchForUpdate:self.updateItem untilInvoking:invocation]) {
return;
if (!postponedOnce) {
if ([updaterDelegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)]) {
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:)]];
[invocation setSelector:@selector(installWithToolAndRelaunch:)];
[invocation setArgument:&relaunch atIndex:2];
[invocation setTarget:self];
postponedOnce = YES;
if ([updaterDelegate updater:self.updater shouldPostponeRelaunchForUpdate:self.updateItem untilInvoking:invocation]) {
return;
}
} else if ([updaterDelegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:)]) {
postponedOnce = YES;
if ([updaterDelegate updater:self.updater shouldPostponeRelaunchForUpdate:self.updateItem]) {
return;
}
}
}
if ([updaterDelegate respondsToSelector:@selector(updater:willInstallUpdate:)]) {
[updaterDelegate updater:self.updater willInstallUpdate:self.updateItem];
}
@@ -557,7 +649,7 @@
// Perhaps in a sandboxed environment this matters more. Note that this may not be a fatal error.
NSError *quarantineError = nil;
if (![fileManager releaseItemFromQuarantineAtRootURL:relaunchCopyTargetURL error:&quarantineError]) {
SULog(SULogLevelError, @"Failed to release quarantine on %@ with error %@", relaunchCopyTargetPath, quarantineError);
SULog(SULogLevelDefault, @"Warning: could not remove quarantine metadata from %@: %@. This may not be a problem, the update process will continue.", relaunchCopyTargetPath, quarantineError);
}
}
}
@@ -593,10 +685,10 @@
pathToRelaunch = delegateRelaunchPath;
}
}
//Set relaunching flag.
[self.host setBool:YES forUserDefaultsKey:SUUpdateRelaunchingMarkerKey];
[NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath],
pathToRelaunch,
[NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]],
@@ -640,6 +732,9 @@
- (void)abortUpdate
{
// Remove lockfile to prevent 3rd party updaters from updating this app if the update is not going to happen anyway
[[SUGlobalUpdateLock sharedLock] unlock];
[self cleanUpDownload];
[[NSNotificationCenter defaultCenter] removeObserver:self];
self.updateItem = nil;
+3 -6
View File
@@ -381,13 +381,10 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
mode_t permissions = [info[INFO_PERMISSIONS_KEY] unsignedShortValue];
if (!isSymLink(ent) && !IS_VALID_PERMISSIONS(permissions)) {
permissions = 0755;
if (verbose) {
fprintf(stderr, "\n");
fprintf(stderr, "\nwarning: file permissions %o of '%s' won't be preserved in the delta update (only permissions with modes 0755 and 0644 are supported).\n", permissions & PERMISSION_FLAGS, ent->fts_path);
}
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Invalid file permissions after-tree on file %@ (only permissions with modes 0755 and 0644 are supported)", @(ent->fts_path)] }];
}
return NO;
}
if (aclExists(ent)) {
@@ -588,7 +585,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
NSFileManager *filemgr;
filemgr = [NSFileManager defaultManager];
[filemgr removeItemAtPath: patchFile error: NULL];
if ([filemgr moveItemAtPath: temporaryFile toPath: patchFile error: NULL] != YES)
{
+11 -11
View File
@@ -30,14 +30,14 @@ static void printUsage(NSString *programName)
fprintf(stderr, "%s version [<patch-file>]\n", [programName UTF8String]);
}
static BOOL runCreateCommand(NSString *programName, NSArray *args)
static BOOL runCreateCommand(NSString *programName, NSArray<NSString *> *args)
{
if (args.count < 3 || args.count > 5) {
printUsage(programName);
return NO;
}
NSUInteger numberOflagsFound = 0;
NSUInteger numberOfFlagsFound = 0;
NSUInteger verboseIndex = [args indexOfObject:VERBOSE_FLAG];
NSUInteger versionIndex = NSNotFound;
for (NSUInteger argumentIndex = 0; argumentIndex < args.count; ++argumentIndex) {
@@ -48,13 +48,13 @@ static BOOL runCreateCommand(NSString *programName, NSArray *args)
}
if (verboseIndex != NSNotFound) {
++numberOflagsFound;
++numberOfFlagsFound;
}
if (versionIndex != NSNotFound) {
++numberOflagsFound;
++numberOfFlagsFound;
}
if (args.count - numberOflagsFound < 3) {
if (args.count - numberOfFlagsFound < 3) {
printUsage(programName);
return NO;
}
@@ -62,7 +62,7 @@ static BOOL runCreateCommand(NSString *programName, NSArray *args)
BOOL verbose = (verboseIndex != NSNotFound);
NSString *versionField = (versionIndex != NSNotFound) ? args[versionIndex] : nil;
NSArray *versionComponents = nil;
NSArray<NSString *> *versionComponents = nil;
if (versionField) {
versionComponents = [versionField componentsSeparatedByString:@"="];
if (versionComponents.count != 2) {
@@ -124,7 +124,7 @@ static BOOL runCreateCommand(NSString *programName, NSArray *args)
return YES;
}
static BOOL runApplyCommand(NSString *programName, NSArray *args)
static BOOL runApplyCommand(NSString *programName, NSArray<NSString *> *args)
{
if (args.count < 3 || args.count > 4) {
printUsage(programName);
@@ -138,7 +138,7 @@ static BOOL runApplyCommand(NSString *programName, NSArray *args)
return NO;
}
NSMutableArray *fileArgs = [NSMutableArray array];
NSMutableArray<NSString *> *fileArgs = [NSMutableArray array];
for (NSString *argument in args) {
if (![argument isEqualToString:VERBOSE_FLAG]) {
[fileArgs addObject:argument];
@@ -172,7 +172,7 @@ static BOOL runApplyCommand(NSString *programName, NSArray *args)
return YES;
}
static BOOL runVersionCommand(NSString *programName, NSArray *args)
static BOOL runVersionCommand(NSString *programName, NSArray<NSString *> *args)
{
if (args.count > 1) {
printUsage(programName);
@@ -218,7 +218,7 @@ static BOOL runVersionCommand(NSString *programName, NSArray *args)
int main(int __unused argc, char __unused *argv[])
{
@autoreleasepool {
NSArray *args = [[NSProcessInfo processInfo] arguments];
NSArray<NSString *> *args = [[NSProcessInfo processInfo] arguments];
NSString *programName = [args[0] lastPathComponent];
if (args.count < 2) {
@@ -227,7 +227,7 @@ int main(int __unused argc, char __unused *argv[])
}
NSString *command = args[1];
NSArray *commandArguments = [args subarrayWithRange:NSMakeRange(2, args.count - 2)];
NSArray<NSString *> *commandArguments = [args subarrayWithRange:NSMakeRange(2, args.count - 2)];
BOOL result;
if ([command isEqualToString:CREATE_COMMAND]) {
+4
View File
@@ -9,7 +9,11 @@
#ifndef SUCODESIGNINGVERIFIER_H
#define SUCODESIGNINGVERIFIER_H
#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"
SU_EXPORT @interface SUCodeSigningVerifier : NSObject
+9 -6
View File
@@ -13,7 +13,7 @@
#import <Foundation/Foundation.h>
// -----------------------------------------------------------------------------
// Misc:
// Misc:
// -----------------------------------------------------------------------------
extern const NSTimeInterval SUMinimumUpdateCheckInterval;
@@ -24,13 +24,13 @@ extern NSString *const SUBundleIdentifier;
extern NSString *const SUAppcastAttributeValueMacOS;
// -----------------------------------------------------------------------------
// Notifications:
// Notifications:
// -----------------------------------------------------------------------------
extern NSString *const SUTechnicalErrorInformationKey;
// -----------------------------------------------------------------------------
// PList keys::
// PList keys::
// -----------------------------------------------------------------------------
extern NSString *const SUFeedURLKey;
@@ -50,6 +50,7 @@ extern NSString *const SUAllowsAutomaticUpdatesKey;
extern NSString *const SUEnableAutomaticChecksKey;
extern NSString *const SUEnableSystemProfilingKey;
extern NSString *const SUSendProfileInfoKey;
extern NSString *const SUUpdateGroupIdentifierKey;
extern NSString *const SULastProfileSubmitDateKey;
extern NSString *const SUPromptUserOnFirstLaunchKey;
extern NSString *const SUDefaultsDomainKey;
@@ -61,7 +62,7 @@ extern NSString *const SUNormalizeInstalledApplicationNameKey __attribute__((dep
extern NSString *const SURelaunchToolNameKey __attribute__((deprecated("This key is obsolete. SPARKLE_RELAUNCH_TOOL_NAME.")));
// -----------------------------------------------------------------------------
// Appcast keys::
// Appcast keys::
// -----------------------------------------------------------------------------
extern NSString *const SUAppcastAttributeDeltaFrom;
@@ -71,14 +72,14 @@ extern NSString *const SUAppcastAttributeShortVersionString;
extern NSString *const SUAppcastAttributeVersion;
extern NSString *const SUAppcastAttributeOsType;
extern NSString *const SUAppcastElementCriticalUpdate;
extern NSString *const SUAppcastElementDeltas;
extern NSString *const SUAppcastElementMinimumAutoupdateVersion;
extern NSString *const SUAppcastElementMinimumSystemVersion;
extern NSString *const SUAppcastElementMaximumSystemVersion;
extern NSString *const SUAppcastElementReleaseNotesLink;
extern NSString *const SUAppcastElementTags;
extern NSString *const SUAppcastElementPhasedRolloutInterval;
extern NSString *const SURSSAttributeURL;
extern NSString *const SURSSAttributeLength;
@@ -89,4 +90,6 @@ extern NSString *const SURSSElementLink;
extern NSString *const SURSSElementPubDate;
extern NSString *const SURSSElementTitle;
extern NSString *const SUXMLLanguage;
#endif
+5
View File
@@ -42,6 +42,7 @@ NSString *const SUAllowsAutomaticUpdatesKey = @"SUAllowsAutomaticUpdates";
NSString *const SUEnableSystemProfilingKey = @"SUEnableSystemProfiling";
NSString *const SUEnableAutomaticChecksKey = @"SUEnableAutomaticChecks";
NSString *const SUSendProfileInfoKey = @"SUSendProfileInfo";
NSString *const SUUpdateGroupIdentifierKey = @"SUUpdateGroupIdentifier";
NSString *const SULastProfileSubmitDateKey = @"SULastProfileSubmissionDate";
NSString *const SUPromptUserOnFirstLaunchKey = @"SUPromptUserOnFirstLaunch";
NSString *const SUEnableJavaScriptKey = @"SUEnableJavaScript";
@@ -63,10 +64,12 @@ NSString *const SUAppcastAttributeOsType = @"sparkle:os";
NSString *const SUAppcastElementCriticalUpdate = @"sparkle:criticalUpdate";
NSString *const SUAppcastElementDeltas = @"sparkle:deltas";
NSString *const SUAppcastElementMinimumAutoupdateVersion = @"sparkle:minimumAutoupdateVersion";
NSString *const SUAppcastElementMinimumSystemVersion = @"sparkle:minimumSystemVersion";
NSString *const SUAppcastElementMaximumSystemVersion = @"sparkle:maximumSystemVersion";
NSString *const SUAppcastElementReleaseNotesLink = @"sparkle:releaseNotesLink";
NSString *const SUAppcastElementTags = @"sparkle:tags";
NSString *const SUAppcastElementPhasedRolloutInterval = @"sparkle:phasedRolloutInterval";
NSString *const SURSSAttributeURL = @"url";
NSString *const SURSSAttributeLength = @"length";
@@ -76,3 +79,5 @@ NSString *const SURSSElementEnclosure = @"enclosure";
NSString *const SURSSElementLink = @"link";
NSString *const SURSSElementPubDate = @"pubDate";
NSString *const SURSSElementTitle = @"title";
NSString *const SUXMLLanguage = @"xml:lang";
+8 -8
View File
@@ -56,7 +56,7 @@
// Called on a non-main thread.
- (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier
{
@autoreleasepool {
@autoreleasepool {
BOOL mountedSuccessfully = NO;
// get a unique mount point path
@@ -65,7 +65,7 @@
NSError *error;
NSArray *contents;
do
{
{
// Using NSUUID would make creating UUIDs be done in Cocoa,
// and thus managed under ARC. Sadly, the class is in 10.8 and later.
CFUUIDRef uuid = CFUUIDCreate(NULL);
@@ -135,8 +135,8 @@
[notifier notifyProgress:0.5];
if (taskResult != 0)
{
if (taskResult != 0)
{
NSString *resultStr = output ? [[NSString alloc] initWithData:output encoding:NSUTF8StringEncoding] : nil;
SULog(SULogLevelError, @"hdiutil failed with code: %ld data: <<%@>>", (long)taskResult, resultStr);
goto reportError;
@@ -155,8 +155,8 @@
double itemsCopied = 0;
double totalItems = [contents count];
for (NSString *item in contents)
{
for (NSString *item in contents)
{
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
NSString *toPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
@@ -169,8 +169,8 @@
[notifier notifyProgress:0.5 + itemsCopied/(totalItems*2.0)];
SULog(SULogLevelDefault, @"copyItemAtPath:%@ toPath:%@", fromPath, toPath);
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
{
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
{
goto reportError;
}
}
+2
View File
@@ -29,6 +29,8 @@ typedef NS_ENUM(OSStatus, SUError) {
SUNoUpdateError = 1001,
SUAppcastError = 1002,
SURunningFromDiskImageError = 1003,
SURunningTranslocated = 1004,
SUWebKitTerminationError = 1005,
// Download phase errors.
SUTemporaryDirectoryError = 2000,
+11 -9
View File
@@ -7,10 +7,12 @@
//
#import "SUFileManager.h"
#import "SUErrors.h"
#import "SUOperatingSystem.h"
#import "SUFileOperationConstants.h"
#import "SULog.h"
#import "SUErrors.h"
#include <sys/xattr.h>
#include <sys/errno.h>
#include <sys/time.h>
@@ -319,7 +321,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
return NO;
}
NSLog(@"Sparkle: Authorization required to remove quarantine %@", rootURL);
SULog(SULogLevelDefault, @"Sparkle: Authorization required to remove quarantine: %@", rootURL);
NSError *executeError = nil;
BOOL success = [self _authorizeAndExecuteCommand:SUFileOpRemoveQuarantineCommand sourcePath:path destinationPath:NULL error:&executeError];
@@ -519,7 +521,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
return NO;
}
NSLog(@"Sparkle: Authorization required to copy %@ to %@", sourceURL, destinationURL);
SULog(SULogLevelDefault, @"Sparkle: Authorization required to copy %@ to %@", sourceURL, destinationURL);
NSError *executeError = nil;
if (![self _authorizeAndExecuteCommand:SUFileOpCopyCommand sourcePath:sourcePath destinationPath:destinationPath error:&executeError]) {
@@ -613,7 +615,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
return NO;
}
NSLog(@"Sparkle: Authorization required to move %@ to %@", sourceURL, destinationURL);
SULog(SULogLevelDefault, @"Sparkle: Authorization required to move %@ to %@", sourceURL, destinationURL);
char sourcePath[PATH_MAX] = {0};
if (![sourceURL.path getFileSystemRepresentation:sourcePath maxLength:sizeof(sourcePath)]) {
@@ -784,7 +786,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
return NO;
}
NSLog(@"Sparkle: Authorization required to change permissions of %@ to match %@", targetURL, matchURL);
SULog(SULogLevelDefault, @"Sparkle: Authorization required to change permissions of %@ to match %@", targetURL, matchURL);
NSError *executeError = nil;
BOOL success = [self _authorizeAndExecuteCommand:SUFileOpChangeOwnerAndGroupCommand sourcePath:targetPath destinationPath:matchPath error:&executeError];
@@ -843,7 +845,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
return NO;
}
NSLog(@"Sparkle: Authorization required to update timestamp of %@", targetURL);
SULog(SULogLevelDefault, @"Sparkle: Authorization required to update timestamp of %@", targetURL);
NSError *executeError = nil;
BOOL success = [self _authorizeAndExecuteCommand:SUFileOpUpdateModificationAndAccessTimeCommand sourcePath:path destinationPath:NULL error:&executeError];
@@ -887,7 +889,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
return NO;
}
NSLog(@"Sparkle: Authorization required to make directory %@", url);
SULog(SULogLevelDefault, @"Sparkle: Authorization required to make directory %@", url);
char path[PATH_MAX] = {0};
if (![url.path getFileSystemRepresentation:path maxLength:sizeof(path)]) {
@@ -951,7 +953,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
return NO;
}
NSLog(@"Sparkle: Authorization required to delete %@", url);
SULog(SULogLevelDefault, @"Sparkle: Authorization required to delete %@", url);
char path[PATH_MAX] = {0};
if (![url.path getFileSystemRepresentation:path maxLength:sizeof(path)]) {
@@ -989,7 +991,7 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) {
return NO;
}
NSLog(@"Sparkle: Authorization required to run pkg installer %@", packageURL);
SULog(SULogLevelDefault, @"Sparkle: Authorization required to run pkg installer %@", packageURL);
NSError *executeError = nil;
BOOL success = [self _authorizeAndExecuteCommand:SUFileOpInstallCommand sourcePath:path destinationPath:NULL lineCallback:^(NSString *line){
+21
View File
@@ -0,0 +1,21 @@
//
// SUFlatPackageUnarchiver.h
// Autoupdate
//
// Created by Mayur Pawashe on 1/30/21.
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SUUnarchiverProtocol.h"
NS_ASSUME_NONNULL_BEGIN
// An unarchiver for flat packages that doesn't really do any unarchiving
@interface SUFlatPackageUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath;
@end
NS_ASSUME_NONNULL_END
+64
View File
@@ -0,0 +1,64 @@
//
// SUFlatPackageUnarchiver.m
// Autoupdate
//
// Created by Mayur Pawashe on 1/30/21.
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#import "SUFlatPackageUnarchiver.h"
#import "SUUnarchiverNotifier.h"
#import "SUErrors.h"
#include "AppKitPrevention.h"
@interface SUFlatPackageUnarchiver ()
@property (nonatomic, readonly) NSString *flatPackagePath;
@end
@implementation SUFlatPackageUnarchiver
@synthesize flatPackagePath = _flatPackagePath;
+ (BOOL)canUnarchivePath:(NSString *)path
{
return [path.pathExtension isEqualToString:@"pkg"] || [path.pathExtension isEqualToString:@"mpkg"];
}
// Note in 2.x this method returns YES, but 1.x does not support pre-validation of pkgs
+ (BOOL)mustValidateBeforeExtraction
{
return NO;
}
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath;
{
self = [super init];
if (self != nil) {
_flatPackagePath = [flatPackagePath copy];
}
return self;
}
- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock
{
SUUnarchiverNotifier *notifier = [[SUUnarchiverNotifier alloc] initWithCompletionBlock:completionBlock progressBlock:progressBlock];
// Flat packages must use guided package installs, not interactive
BOOL isDirectory = NO;
if ([[[self.flatPackagePath stringByDeletingPathExtension] pathExtension] isEqualToString:@"sparkle_interactive"]) {
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat packages can not be installed interactively with 'sparkle_interactive' and must instead be guided"]}]];
} else if (![[NSFileManager defaultManager] fileExistsAtPath:self.flatPackagePath isDirectory:&isDirectory] || isDirectory) {
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package does not exist at %@", self.flatPackagePath]}]];
} else {
[notifier notifyProgress:1.0];
[notifier notifySuccess];
}
}
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], self.flatPackagePath]; }
@end
+26
View File
@@ -0,0 +1,26 @@
//
// SUGlobalUpdateLock.h
// Sparkle
//
// Created by Bibhas Acharya on 7/12/20.
// Copyright © 2020 Sparkle Project. All rights reserved.
//
#ifndef SUGLOBALUPDATELOCK_H
#define SUGLOBALUPDATELOCK_H
#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
@interface SUGlobalUpdateLock : NSObject
+ (SUGlobalUpdateLock *)sharedLock;
- (void)lock;
- (void)unlock;
@end
#endif
+65
View File
@@ -0,0 +1,65 @@
//
// SUGlobalUpdateFileLock.m
// Sparkle
//
// Created by Bibhas Acharya on 7/12/20.
// Copyright © 2020 Sparkle Project. All rights reserved.
//
#import "SUGlobalUpdateLock.h"
#import "SULog.h"
@implementation SUGlobalUpdateLock
+ (SUGlobalUpdateLock *)sharedLock
{
static dispatch_once_t once;
static SUGlobalUpdateLock *sharedInstance = nil;
dispatch_once(&once, ^{
sharedInstance = [self new];
});
return sharedInstance;
}
- (void)lock
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *fileLockPath = [self fileLockPath];
BOOL success = [fileManager createFileAtPath:fileLockPath contents:nil attributes:nil];
if (!success) {
SULog(SULogLevelDefault, @"Couldn't create lockfile at: %@", fileLockPath);
}
}
- (void)unlock
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *fileLockPath = [self fileLockPath];
if ([fileManager fileExistsAtPath:fileLockPath]) {
NSError *error = nil;
[fileManager removeItemAtPath:fileLockPath error:&error];
if (error != nil) {
SULog(SULogLevelError, @"Couldn't remove lockfile at: %@ [%@]", fileLockPath, [error localizedDescription]);
}
}
}
- (NSString *)identifier
{
NSString *resp = [[NSBundle mainBundle] bundleIdentifier];
if (resp == nil) {
// If there's no bundle identifier, use the executable path
resp = [[[NSBundle mainBundle] executablePath] stringByReplacingOccurrencesOfString:@"/" withString:@"."];
}
return resp;
}
- (NSString *)fileLockPath
{
return [NSString stringWithFormat:@"/private/tmp/%@.Sparkle.pid", [self identifier]];
}
@end
+7
View File
@@ -54,4 +54,11 @@
return YES;
}
// We used to, but it broke due to fragile text processing
// Maybe one day someone will fix it, but until then.
- (BOOL)supportsDeterminateProgress
{
return NO;
}
@end
+10 -5
View File
@@ -7,6 +7,8 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class SUPublicKeys;
@interface SUHost : NSObject
@@ -21,14 +23,17 @@
@property (readonly) SUPublicKeys *publicKeys;
@property (getter=isRunningOnReadOnlyVolume, readonly) BOOL runningOnReadOnlyVolume;
@property (readonly, nonatomic, copy) NSString *publicDSAKeyFileKey;
@property (getter=isRunningTranslocated, readonly) BOOL runningTranslocated;
@property (readonly, nonatomic, copy, nullable) NSString *publicDSAKeyFileKey;
- (id)objectForInfoDictionaryKey:(NSString *)key;
- (nullable id)objectForInfoDictionaryKey:(NSString *)key;
- (BOOL)boolForInfoDictionaryKey:(NSString *)key;
- (id)objectForUserDefaultsKey:(NSString *)defaultName;
- (void)setObject:(id)value forUserDefaultsKey:(NSString *)defaultName;
- (nullable id)objectForUserDefaultsKey:(NSString *)defaultName;
- (void)setObject:(nullable id)value forUserDefaultsKey:(NSString *)defaultName;
- (BOOL)boolForUserDefaultsKey:(NSString *)defaultName;
- (void)setBool:(BOOL)value forUserDefaultsKey:(NSString *)defaultName;
- (id)objectForKey:(NSString *)key;
- (nullable id)objectForKey:(NSString *)key;
- (BOOL)boolForKey:(NSString *)key;
@end
NS_ASSUME_NONNULL_END
+40 -29
View File
@@ -14,6 +14,8 @@
#include "AppKitPrevention.h"
NS_ASSUME_NONNULL_BEGIN
// This class should not rely on AppKit and should also be process independent
// For example, it should not have code that tests writabilty to somewhere on disk,
// as that may depend on the privileges of the process owner. Or code that depends on
@@ -24,9 +26,9 @@
@property (strong, readwrite) NSBundle *bundle;
@property (nonatomic, readonly) BOOL isMainBundle;
@property (copy) NSString *defaultsDomain;
@property (copy, nullable) NSString *defaultsDomain;
@property (assign) BOOL usesStandardUserDefaults;
@property (readonly, copy) NSString *publicDSAKey;
@property (readonly, copy, nullable) NSString *publicDSAKey;
@end
@@ -39,8 +41,8 @@
- (instancetype)initWithBundle:(NSBundle *)aBundle
{
if ((self = [super init]))
{
if ((self = [super init]))
{
NSParameterAssert(aBundle);
self.bundle = aBundle;
if (![self.bundle bundleIdentifier]) {
@@ -69,7 +71,7 @@
return [self.bundle bundlePath];
}
- (NSString *__nonnull)name
- (NSString *)name
{
NSString *name;
@@ -78,15 +80,15 @@
if (name && name.length > 0) return name;
name = [self objectForInfoDictionaryKey:@"CFBundleDisplayName"];
if (name && name.length > 0) return name;
if (name && name.length > 0) return name;
name = [self objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey];
if (name && name.length > 0) return name;
if (name && name.length > 0) return name;
return [[[NSFileManager defaultManager] displayNameAtPath:[self bundlePath]] stringByDeletingPathExtension];
}
- (NSString *__nonnull)version
- (NSString *)version
{
NSString *version = [self objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey];
if (!version || [version isEqualToString:@""])
@@ -94,7 +96,7 @@
return version;
}
- (NSString *__nonnull)displayVersion
- (NSString *)displayVersion
{
NSString *shortVersionString = [self objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
if (shortVersionString)
@@ -110,6 +112,13 @@
return (statfs_info.f_flags & MNT_RDONLY) != 0;
}
- (BOOL)isRunningTranslocated
{
NSString *path = [self.bundle bundlePath];
return [path rangeOfString:@"/AppTranslocation/"].location != NSNotFound;
}
- (NSString *__nullable)publicEDKey
{
return [self objectForInfoDictionaryKey:SUPublicEDKeyKey];
@@ -119,13 +128,13 @@
{
// Maybe the key is just a string in the Info.plist.
NSString *key = [self objectForInfoDictionaryKey:SUPublicDSAKeyKey];
if (key) {
if (key) {
return key;
}
// More likely, we've got a reference to a Resources file by filename:
NSString *keyFilename = [self publicDSAKeyFileKey];
if (!keyFilename) {
if (!keyFilename) {
return nil;
}
@@ -151,7 +160,7 @@
return [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey];
}
- (id)objectForInfoDictionaryKey:(NSString *)key
- (nullable id)objectForInfoDictionaryKey:(NSString *)key
{
if (self.isMainBundle) {
// Common fast path - if we're updating the main bundle, that means our updater and host bundle's lifetime is the same
@@ -175,7 +184,7 @@
return [(NSNumber *)[self objectForInfoDictionaryKey:key] boolValue];
}
- (id)objectForUserDefaultsKey:(NSString *)defaultName
- (nullable id)objectForUserDefaultsKey:(NSString *)defaultName
{
if (!defaultName || !self.defaultsDomain) {
return nil;
@@ -193,14 +202,14 @@
}
// Note this handles nil being passed for defaultName, in which case the user default will be removed
- (void)setObject:(id)value forUserDefaultsKey:(NSString *)defaultName
- (void)setObject:(nullable id)value forUserDefaultsKey:(NSString *)defaultName
{
if (self.usesStandardUserDefaults)
{
if (self.usesStandardUserDefaults)
{
[[NSUserDefaults standardUserDefaults] setObject:value forKey:defaultName];
}
else
{
}
else
{
CFPreferencesSetValue((__bridge CFStringRef)defaultName, (__bridge CFPropertyListRef)(value), (__bridge CFStringRef)self.defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
CFPreferencesSynchronize((__bridge CFStringRef)self.defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
}
@@ -216,10 +225,10 @@
CFPropertyListRef plr = CFPreferencesCopyAppValue((__bridge CFStringRef)defaultName, (__bridge CFStringRef)self.defaultsDomain);
if (plr == NULL) {
value = NO;
}
else
{
value = (BOOL)CFBooleanGetValue((CFBooleanRef)plr);
}
else
{
value = CFBooleanGetValue((CFBooleanRef)plr) ? YES : NO;
CFRelease(plr);
}
return value;
@@ -227,18 +236,18 @@
- (void)setBool:(BOOL)value forUserDefaultsKey:(NSString *)defaultName
{
if (self.usesStandardUserDefaults)
{
if (self.usesStandardUserDefaults)
{
[[NSUserDefaults standardUserDefaults] setBool:value forKey:defaultName];
}
else
{
}
else
{
CFPreferencesSetValue((__bridge CFStringRef)defaultName, (__bridge CFBooleanRef) @(value), (__bridge CFStringRef)self.defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
CFPreferencesSynchronize((__bridge CFStringRef)self.defaultsDomain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
}
}
- (id)objectForKey:(NSString *)key {
- (nullable id)objectForKey:(NSString *)key {
return [self objectForUserDefaultsKey:key] ? [self objectForUserDefaultsKey:key] : [self objectForInfoDictionaryKey:key];
}
@@ -247,3 +256,5 @@
}
@end
NS_ASSUME_NONNULL_END
+8 -2
View File
@@ -152,8 +152,14 @@
{
NSBundle *bundle = host.bundle;
assert(bundle != nil);
NSString *normalizedAppPath = [[[bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", [host objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [[bundle bundlePath] pathExtension]]];
NSString * baseBundleName = [host objectForInfoDictionaryKey:@"SUBundleName"];
if (baseBundleName == nil) {
baseBundleName = [host objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey];
}
NSString *normalizedAppPath = [[[bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", baseBundleName, [[bundle bundlePath] pathExtension]]];
// Roundtrip string through fileSystemRepresentation to ensure it uses filesystem's Unicode normalization
// rather than arbitrary Unicode form from Info.plist - #1017
+2
View File
@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
// Should be thread safe
- (NSString *)installationPath;
- (BOOL)supportsDeterminateProgress;
@end
NS_ASSUME_NONNULL_END
+20
View File
@@ -0,0 +1,20 @@
//
// SULegacyWebView.h
// Sparkle
//
// Created by Mayur Pawashe on 12/30/20.
// Copyright © 2020 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SUWebView.h"
NS_ASSUME_NONNULL_BEGIN
@interface SULegacyWebView : NSObject <SUWebView>
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled;
@end
NS_ASSUME_NONNULL_END
+178
View File
@@ -0,0 +1,178 @@
//
// SULegacyWebView.m
// Sparkle
//
// Created by Mayur Pawashe on 12/30/20.
// Copyright © 2020 Sparkle Project. All rights reserved.
//
#import "SULegacyWebView.h"
#import "SUWebViewCommon.h"
#import "SULog.h"
#import <WebKit/WebKit.h>
// WebKit protocols are not explicitly declared until 10.11 SDK, so
// declare dummy protocols to keep the build working on earlier SDKs.
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101100
@protocol WebFrameLoadDelegate <NSObject>
@end
@protocol WebPolicyDelegate <NSObject>
@end
@protocol WebUIDelegate <NSObject>
@end
#endif
@interface SULegacyWebView () <WebPolicyDelegate, WebFrameLoadDelegate, WebUIDelegate>
@property (nonatomic, readonly) WebView *webView;
@property (nonatomic) void (^completionHandler)(NSError * _Nullable);
@end
@implementation SULegacyWebView
@synthesize webView = _webView;
@synthesize completionHandler = _completionHandler;
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled
{
self = [super init];
if (self != nil) {
_webView = [[WebView alloc] initWithFrame:NSZeroRect];
WebPreferences *preferences = _webView.preferences;
preferences.javaScriptEnabled = javaScriptEnabled;
preferences.javaEnabled = NO;
preferences.plugInsEnabled = NO;
// Mimicking settings when WebView used to be in SUUpdateAlert nib
preferences.loadsImagesAutomatically = YES;
preferences.allowsAnimatedImages = YES;
preferences.allowsAnimatedImageLooping = YES;
// Settings for default style
preferences.userStyleSheetEnabled = YES;
preferences.userStyleSheetLocation = colorStyleSheetLocation;
preferences.standardFontFamily = fontFamily;
preferences.defaultFontSize = fontPointSize;
_webView.preferences = preferences;
_webView.policyDelegate = self;
_webView.frameLoadDelegate = self;
_webView.UIDelegate = self;
}
return self;
}
- (NSView *)view
{
return self.webView;
}
- (void)loadHTMLString:(NSString *)htmlString baseURL:(NSURL * _Nullable)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler
{
self.completionHandler = [completionHandler copy];
[[self.webView mainFrame] loadHTMLString:htmlString baseURL:baseURL];
}
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName baseURL:(NSURL *)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler
{
self.completionHandler = [completionHandler copy];
[[self.webView mainFrame] loadData:data MIMEType:MIMEType textEncodingName:textEncodingName baseURL:baseURL];
}
- (void)loadRequest:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSError * _Nullable))completionHandler
{
self.completionHandler = [completionHandler copy];
[[self.webView mainFrame] loadRequest:urlRequest];
}
- (void)stopLoading
{
self.completionHandler = nil;
[self.webView stopLoading:self];
}
- (void)setDrawsBackground:(BOOL)drawsBackground
{
self.webView.drawsBackground = drawsBackground;
}
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
if ([frame parentFrame] == nil) {
if (self.completionHandler != nil) {
self.completionHandler(nil);
self.completionHandler = nil;
}
[sender display]; // necessary to prevent weird scroll bar artifacting
}
}
- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
{
if ([frame parentFrame] == nil) {
if (self.completionHandler != nil) {
self.completionHandler(error);
self.completionHandler = nil;
}
}
}
- (void)webView:(WebView *)__unused sender decidePolicyForNavigationAction:(NSDictionary *)__unused actionInformation request:(NSURLRequest *)request frame:(WebFrame *)__unused frame decisionListener:(id<WebPolicyDecisionListener>)listener
{
NSURL *requestURL = request.URL;
BOOL isAboutBlank = NO;
BOOL safeURL = SUWebViewIsSafeURL(requestURL, &isAboutBlank);
// Do not allow redirects to dangerous protocols such as file://
if (!safeURL) {
SULog(SULogLevelDefault, @"Blocked display of %@ URL which may be dangerous", requestURL.scheme);
[listener ignore];
return;
}
// Ensure we are finished loading
if (self.completionHandler == nil) {
if (requestURL && !isAboutBlank) {
[[NSWorkspace sharedWorkspace] openURL:requestURL];
}
[listener ignore];
}
else {
[listener use];
}
}
// Clean up the contextual menu.
- (NSArray *)webView:(WebView *)__unused sender contextMenuItemsForElement:(NSDictionary *)__unused element defaultMenuItems:(NSArray *)defaultMenuItems
{
NSMutableArray *webViewMenuItems = [defaultMenuItems mutableCopy];
if (webViewMenuItems)
{
for (NSMenuItem *menuItem in defaultMenuItems)
{
NSInteger tag = [menuItem tag];
switch (tag)
{
case WebMenuItemTagOpenLinkInNewWindow:
case WebMenuItemTagDownloadLinkToDisk:
case WebMenuItemTagOpenImageInNewWindow:
case WebMenuItemTagDownloadImageToDisk:
case WebMenuItemTagOpenFrameInNewWindow:
case WebMenuItemTagGoBack:
case WebMenuItemTagGoForward:
case WebMenuItemTagStop:
case WebMenuItemTagReload:
[webViewMenuItems removeObjectIdenticalTo:menuItem];
}
}
}
return webViewMenuItems;
}
@end
+6
View File
@@ -22,3 +22,9 @@ typedef struct {
+ (NSString *)systemVersionString;
@end
#if defined(__clang_major__) && __clang_major__ >= 9
#define SUAVAILABLE(major, minor) @available(macOS major##.##minor, *)
#else
#define SUAVAILABLE(major, minor) [SUOperatingSystem isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){major, minor, 0}]
#endif
+6 -1
View File
@@ -55,7 +55,7 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open";
// -W = wait until the app has quit.
// -n = Open another instance if already open.
// -b = app bundle identifier
NSArray *args = @[@"-W", @"-n", @"-b", @"com.apple.installer", self.packagePath];
NSArray<NSString *> *args = @[@"-W", @"-n", @"-b", @"com.apple.installer", self.packagePath];
// Known bug: if the installation fails or is canceled, Sparkle goes ahead and restarts, thinking everything is fine.
@try {
@@ -78,4 +78,9 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open";
return NO;
}
- (BOOL)supportsDeterminateProgress
{
return NO;
}
@end
+35 -29
View File
@@ -92,7 +92,7 @@
- (void)extractArchivePipingDataToCommand:(NSString *)command arguments:(NSArray*)args notifier:(SUUnarchiverNotifier *)notifier
{
// *** GETS CALLED ON NON-MAIN THREAD!!!
@autoreleasepool {
@autoreleasepool {
NSError *error = nil;
NSString *destination = [self.archivePath stringByDeletingLastPathComponent];
@@ -105,43 +105,49 @@
NSFileHandle *archiveInput = [NSFileHandle fileHandleForReadingAtPath:self.archivePath];
NSPipe *pipe = [NSPipe pipe];
NSFileHandle *archiveOutput = [pipe fileHandleForWriting];
NSTask *task = [[NSTask alloc] init];
[task setStandardInput:[pipe fileHandleForReading]];
[task setStandardError:[NSFileHandle fileHandleWithStandardError]];
[task setStandardOutput:[NSFileHandle fileHandleWithStandardOutput]];
[task setLaunchPath:command];
[task setArguments:[args arrayByAddingObject:destination]];
[task launch];
NSUInteger bytesRead = 0;
do {
NSData *data = [archiveInput readDataOfLength:256*1024];
NSUInteger len = [data length];
if (!len) {
break;
}
bytesRead += len;
[archiveOutput writeData:data];
[notifier notifyProgress:(double)bytesRead / (double)expectedLength];
@try {
[task launch];
}
@catch (NSException *e) {
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, -[NSTask launch] threw exception '%@'", e.description]}];
}
while(bytesRead < expectedLength);
[archiveOutput closeFile];
[task waitUntilExit];
if ([task terminationStatus] == 0) {
if (bytesRead == expectedLength) {
[notifier notifySuccess];
return;
} else {
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' got only %ld of %ld bytes", command, (long)bytesRead, (long)expectedLength]}];
if (!error) {
NSFileHandle *archiveOutput = [pipe fileHandleForWriting];
NSUInteger bytesRead = 0;
do {
NSData *data = [archiveInput readDataOfLength:256*1024];
NSUInteger len = [data length];
if (!len) {
break;
}
bytesRead += len;
[archiveOutput writeData:data];
[notifier notifyProgress:(double)bytesRead / (double)expectedLength];
}
while(bytesRead < expectedLength);
[archiveOutput closeFile];
[task waitUntilExit];
if ([task terminationStatus] == 0) {
if (bytesRead == expectedLength) {
[notifier notifySuccess];
return;
} else {
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' got only %ld of %ld bytes", command, (long)bytesRead, (long)expectedLength]}];
}
} else {
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' returned %d", command, [task terminationStatus]]}];
}
} else {
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' returned %d", command, [task terminationStatus]]}];
}
} else {
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, archive '%@' is empty", self.archivePath]}];
+13
View File
@@ -13,6 +13,7 @@
#import "SUHost.h"
#import "SULog.h"
#import "SUErrors.h"
#import "SUOperatingSystem.h"
#include "AppKitPrevention.h"
@@ -208,6 +209,13 @@
progress(9/10.0);
}
// Try to preserve Finder tags. Failure can be accepted without complaint as previous Sparkle versions did not do this at all
NSArray *resourceTags;
BOOL success = [oldTempURL getResourceValue:&resourceTags forKey:NSURLTagNamesKey error:NULL];
if (success && resourceTags.count) {
[installationURL setResourceValue:resourceTags forKey:NSURLTagNamesKey error:NULL];
}
// From here on out, we don't really need to bring up authorization if we haven't done so prior
SUFileManager *constrainedFileManager = [fileManager fileManagerByPreservingAuthorizationRights];
@@ -257,4 +265,9 @@
return YES;
}
- (BOOL)supportsDeterminateProgress
{
return YES;
}
@end
+17 -3
View File
@@ -10,9 +10,7 @@
#import "SUUpdaterPrivate.h"
#import "SUUpdaterDelegate.h"
@interface SUScheduledUpdateDriver ()
@end
#import "SUAppcastItem.h"
@implementation SUScheduledUpdateDriver
@@ -24,6 +22,11 @@
return self;
}
- (BOOL)usesPhasedRollout
{
return YES;
}
- (void)didFindValidUpdate
{
self.showErrors = YES; // We only start showing errors after we present the UI for the first time.
@@ -47,4 +50,15 @@
return YES;
}
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)item {
id<SUUpdaterPrivate> updater = self.updater;
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
if ([updaterDelegate respondsToSelector:@selector(updaterShouldShowUpdateAlertForScheduledUpdate:forItem:)]) {
return [updaterDelegate updaterShouldShowUpdateAlertForScheduledUpdate:self.updater forItem:item];
}
return [super shouldShowUpdateAlertForItem:item];
}
@end
+7 -7
View File
@@ -16,7 +16,7 @@
#import "SULog.h"
#import "SUSignatures.h"
#include <CommonCrypto/CommonDigest.h>
#import "../ed25519/src/ed25519.h" // run `git submodule update --init` if you get an erorr here
#import "ed25519.h" // Run `git submodule update --init` if you get an error here
#include "AppKitPrevention.h"
@@ -159,13 +159,13 @@
__block CFErrorRef error = NULL;
BOOL (^cleanup)(void) = ^{
if (group) CFRelease(group);
if (dataReadTransform) CFRelease(dataReadTransform);
if (dataDigestTransform) CFRelease(dataDigestTransform);
if (dataVerifyTransform) CFRelease(dataVerifyTransform);
if (error) CFRelease(error);
if (group) CFRelease(group);
if (dataReadTransform) CFRelease(dataReadTransform);
if (dataDigestTransform) CFRelease(dataDigestTransform);
if (dataVerifyTransform) CFRelease(dataVerifyTransform);
if (error) CFRelease(error);
if (dsaPubKeySecKey) CFRelease(dsaPubKeySecKey);
return NO;
return NO;
};
dataReadTransform = SecTransformCreateReadTransformWithReadStream((__bridge CFReadStreamRef)stream);
+9 -3
View File
@@ -33,12 +33,15 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
kNumberType,
kStringType,
kSeparatorType,
kDashType,
};
- (SUCharacterType)typeOfCharacter:(NSString *)character
{
if ([character isEqualToString:@"."]) {
return kSeparatorType;
} else if ([character isEqualToString:@"-"]) {
return kDashType;
} else if ([[NSCharacterSet decimalDigitCharacterSet] characterIsMember:[character characterAtIndex:0]]) {
return kNumberType;
} else if ([[NSCharacterSet whitespaceAndNewlineCharacterSet] characterIsMember:[character characterAtIndex:0]]) {
@@ -50,7 +53,7 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
}
}
- (NSArray *)splitVersionString:(NSString *)version
- (NSArray<NSString *> *)splitVersionString:(NSString *)version
{
NSString *character;
NSMutableString *s;
@@ -67,6 +70,9 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
for (i = 1; i <= n; ++i) {
character = [version substringWithRange:NSMakeRange(i, 1)];
newType = [self typeOfCharacter:character];
if (newType == kDashType) {
break;
}
if (oldType != newType || oldType == kSeparatorType) {
// We've reached a new segment
NSString *aPart = [[NSString alloc] initWithString:s];
@@ -86,8 +92,8 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB
{
NSArray *partsA = [self splitVersionString:versionA];
NSArray *partsB = [self splitVersionString:versionB];
NSArray<NSString *> *partsA = [self splitVersionString:versionA];
NSArray<NSString *> *partsB = [self splitVersionString:versionB];
NSString *partA, *partB;
NSUInteger i, n;
+11 -10
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SUStatusController">
@@ -20,13 +20,13 @@
<windowStyleMask key="styleMask" titled="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="200" y="222" width="400" height="107"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<value key="minSize" type="size" width="213" height="107"/>
<view key="contentView" id="6">
<rect key="frame" x="0.0" y="0.0" width="400" height="107"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView id="7">
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7">
<rect key="frame" x="24" y="28" width="64" height="64"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="NSApplicationIcon" id="53"/>
@@ -34,7 +34,7 @@
<binding destination="-2" name="value" keyPath="applicationIcon" id="9"/>
</connections>
</imageView>
<textField verticalHuggingPriority="750" id="8">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8">
<rect key="frame" x="106" y="75" width="277" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Status Text (set by loc. string in code)" id="54">
@@ -46,7 +46,7 @@
<binding destination="-2" name="value" keyPath="title" id="26"/>
</connections>
</textField>
<progressIndicator verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" id="11">
<progressIndicator verticalHuggingPriority="750" fixedFrame="YES" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="11">
<rect key="frame" x="107" y="47" width="275" height="20"/>
<autoresizingMask key="autoresizingMask"/>
<connections>
@@ -54,7 +54,7 @@
<binding destination="-2" name="value" keyPath="progressValue" previousBinding="13" id="27"/>
</connections>
</progressIndicator>
<button verticalHuggingPriority="750" id="12">
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="12">
<rect key="frame" x="272" y="12" width="114" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES"/>
<buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="55">
@@ -65,7 +65,7 @@
<binding destination="-2" name="title" keyPath="buttonTitle" id="21"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="16">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="16">
<rect key="frame" x="106" y="22" width="167" height="17"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Small System Font Text" id="56">
@@ -87,9 +87,10 @@
<connections>
<binding destination="-2" name="title" keyPath="windowTitle" id="24"/>
</connections>
<point key="canvasLocation" x="-158" y="132"/>
</window>
</objects>
<resources>
<image name="NSApplicationIcon" width="128" height="128"/>
<image name="NSApplicationIcon" width="32" height="32"/>
</resources>
</document>
+4 -4
View File
@@ -37,8 +37,8 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL
- (instancetype)initWithHost:(SUHost *)aHost
{
self = [super initWithWindowNibName:@"SUStatus"];
if (self)
{
if (self)
{
self.host = aHost;
[self setShouldCascadeWindows:NO];
}
@@ -57,7 +57,7 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL
[[self window] setFrameAutosaveName:@"SUStatusFrame"];
[self.progressBar setUsesThreadedAnimation:YES];
if ([SUOperatingSystem isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 11, 0}]) {
if (SUAVAILABLE(10, 11)) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
[self.statusTextField setFont:[NSFont monospacedDigitSystemFontOfSize:0 weight:NSFontWeightRegular]];
@@ -125,7 +125,7 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL
- (void)setMaxProgressValue:(double)value
{
if (value < 0.0) value = 0.0;
if (value < 0.0) value = 0.0;
maxProgressValue = value;
[self setProgressValue:0.0];
[self.progressBar setIndeterminate:(value == 0.0)];
+18 -12
View File
@@ -43,7 +43,7 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
// Gather profile information and append it to the URL.
NSMutableArray<NSDictionary<NSString *, NSString *> *> *profileArray = [NSMutableArray array];
NSArray *profileDictKeys = @[@"key", @"displayKey", @"value", @"displayValue"];
NSArray<NSString *> *profileDictKeys = @[@"key", @"displayKey", @"value", @"displayValue"];
int error = 0;
int value = 0;
size_t length = sizeof(value);
@@ -58,13 +58,14 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
error = sysctlbyname("hw.cputype", &value, &length, NULL, 0);
int cpuType = -1;
if (error == 0) {
cpuType = value;
// Only the lower 24 bits of sysctl hw.cputype values contain the CPU type. On Macs with ARM processor, one of the top eight bits may be set.
cpuType = value & (int)~CPU_ARCH_MASK;
NSString *visibleCPUType;
switch (value) {
switch (cpuType) {
case CPU_TYPE_ARM: visibleCPUType = @"ARM"; break;
case CPU_TYPE_X86: visibleCPUType = @"Intel"; break;
case CPU_TYPE_POWERPC: visibleCPUType = @"PowerPC"; break;
default: visibleCPUType = @"Unknown"; break;
case CPU_TYPE_X86: visibleCPUType = @"Intel"; break;
case CPU_TYPE_POWERPC: visibleCPUType = @"PowerPC"; break;
default: visibleCPUType = @"Other"; break;
}
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUTypeKey, @"CPU Type", @(value), visibleCPUType] forKeys:profileDictKeys]];
}
@@ -85,17 +86,22 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
if (error == 0) {
NSString *visibleCPUSubType;
if (cpuType == 7) {
if (cpuType == CPU_TYPE_X86) {
// Intel
// TODO: other Intel processors, like Core i7, i5, i3, Xeon?
visibleCPUSubType = is64bit ? @"Intel Core 2" : @"Intel Core"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
} else if (cpuType == 18) {
} else if (cpuType == CPU_TYPE_POWERPC) {
// PowerPC
switch (value) {
case 9: visibleCPUSubType=@"G3"; break;
case 10: case 11: visibleCPUSubType=@"G4"; break;
case 100: visibleCPUSubType=@"G5"; break;
default: visibleCPUSubType=@"Other"; break;
case CPU_SUBTYPE_POWERPC_750: visibleCPUSubType=@"G3"; break;
case CPU_SUBTYPE_POWERPC_7400: case CPU_SUBTYPE_POWERPC_7450: visibleCPUSubType=@"G4"; break;
case CPU_SUBTYPE_POWERPC_970: visibleCPUSubType=@"G5"; break;
default: visibleCPUSubType=@"Other"; break;
}
} else if (cpuType == CPU_TYPE_ARM) {
switch (value) {
case CPU_SUBTYPE_ARM64E: visibleCPUSubType=@"ARM64E"; break;
default: visibleCPUSubType = @"Other"; break;
}
} else {
visibleCPUSubType = @"Other";
+4
View File
@@ -16,6 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
+ (BOOL)systemAllowsAutomaticUpdatesForHost:(SUHost *)host;
+ (NSUInteger)updateGroupForHost:(SUHost*)host;
+ (NSNumber*)updateGroupIdentifierForHost:(SUHost*)host;
+ (NSNumber*)setNewUpdateGroupIdentifierForHost:(SUHost*)host;
@end
NS_ASSUME_NONNULL_END
+24
View File
@@ -58,4 +58,28 @@
return changeOwnerAndGroupSuccess;
}
#define NUM_UPDATE_GROUPS 7
+ (NSUInteger)updateGroupForHost:(SUHost*)host {
NSNumber* updateGroupIdentifier = [self updateGroupIdentifierForHost:host];
return ([updateGroupIdentifier unsignedIntValue] % NUM_UPDATE_GROUPS);
}
+ (NSNumber*)updateGroupIdentifierForHost:(SUHost*)host {
NSNumber* updateGroupIdentifier = [host objectForUserDefaultsKey:SUUpdateGroupIdentifierKey];
if(updateGroupIdentifier == nil) {
updateGroupIdentifier = [self setNewUpdateGroupIdentifierForHost:host];
}
return updateGroupIdentifier;
}
+ (NSNumber*)setNewUpdateGroupIdentifierForHost:(SUHost*)host {
unsigned int r = arc4random_uniform(UINT_MAX);
NSNumber* updateGroupIdentifier = @(r);
[host setObject:updateGroupIdentifier forUserDefaultsKey:SUUpdateGroupIdentifierKey];
return updateGroupIdentifier;
}
@end
+1
View File
@@ -20,6 +20,7 @@
- (void)showAlert:(NSAlert *)alert;
- (IBAction)cancelDownload:(id)sender;
- (void)installAndRestart:(id)sender;
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)item;
@end
+59 -10
View File
@@ -56,20 +56,35 @@
return self;
}
- (BOOL)shouldShowUpdateAlertForItem:(SUAppcastItem *)__unused item {
return YES;
}
- (void)didFindValidUpdate
{
id<SUUpdaterPrivate> updater = self.updater;
SUAppcastItem *updateItem = self.updateItem;
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
[[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
[[updater delegate] updater:self.updater didFindValidUpdate:updateItem];
}
// Handle the case where the update indicates that an automatic update is only available for specific versions
if ([self itemPreventsAutoupdate:self.updateItem]) {
self.automaticallyInstallUpdates = NO;
}
if (self.automaticallyInstallUpdates) {
[self updateAlertFinishedWithChoice:SUInstallUpdateChoice];
[self updateAlertFinishedWithChoice:SUInstallUpdateChoice forItem:nil];
return;
}
self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:self.updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) {
[self updateAlertFinishedWithChoice:choice];
if (![self shouldShowUpdateAlertForItem:updateItem]) {
[self abortUpdate];
return;
}
self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) {
[self updateAlertFinishedWithChoice:choice forItem:updateItem];
}];
id<SUVersionDisplay> versDisp = nil;
@@ -110,9 +125,25 @@
if (!self.automaticallyInstallUpdates) {
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = 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.");
alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [self.host name], [self.host displayVersion]];
[alert addButtonWithTitle:SULocalizedString(@"OK", nil)];
if (self.latestAppcastItem) // if the appcast was successfully loaded
{
alert.messageText = 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.");
if (self.latestAppcastItemComparisonResult == 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.
alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.\n(You are currently running version %@.)", nil), [self.host name], self.latestAppcastItem.displayVersionString, [self.host displayVersion]];
}
else {
alert.informativeText = [NSString stringWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [self.host name], [self.host displayVersion]];
}
[alert addButtonWithTitle:SULocalizedString(@"OK", nil)];
}
else {
alert.messageText = SULocalizedString(@"Update Error!", nil);
alert.informativeText = SULocalizedString(@"No valid update information could be loaded.", nil);
[alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)];
}
[self showAlert:alert];
}
@@ -125,26 +156,44 @@
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationDidBecomeActiveNotification object:NSApp];
}
- (void)updateAlertFinishedWithChoice:(SUUpdateAlertChoice)choice
- (void)didDismissAlertPermanently:(BOOL)permanently forItem:(SUAppcastItem *)item {
if (item == nil) {
return;
}
id<SUUpdaterPrivate> updater = self.updater;
if ([updater.delegate respondsToSelector:@selector(updater:didDismissUpdateAlertPermanently:forItem:)]) {
[updater.delegate updater:self.updater didDismissUpdateAlertPermanently:permanently forItem:item];
}
}
- (void)updateAlertFinishedWithChoice:(SUUpdateAlertChoice)choice forItem:(SUAppcastItem *)item
{
self.updateAlert = nil;
[self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey];
id<SUUpdaterPrivate> updater = self.updater;
switch (choice) {
case SUInstallUpdateChoice:
[self didDismissAlertPermanently:NO forItem:item];
[self downloadUpdate];
break;
case SUOpenInfoURLChoice:
[self didDismissAlertPermanently:NO forItem:item];
[[NSWorkspace sharedWorkspace] openURL:[self.updateItem infoURL]];
[self abortUpdate];
break;
case SUSkipThisVersionChoice:
if ([[updater delegate] respondsToSelector:@selector(updater:userDidSkipThisVersion:)]) {
[[updater delegate] updater:self.updater userDidSkipThisVersion:self.updateItem];
}
[self didDismissAlertPermanently:YES forItem:item];
[self.host setObject:[self.updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey];
[self abortUpdate];
break;
case SURemindMeLaterChoice:
[self didDismissAlertPermanently:NO forItem:item];
[self abortUpdate];
break;
}
@@ -329,8 +378,8 @@
- (void)abortUpdate
{
if (self.statusController)
{
if (self.statusController)
{
[self.statusController close];
self.statusController = nil;
}
+4
View File
@@ -11,6 +11,7 @@
#import "SUPipedUnarchiver.h"
#import "SUDiskImageUnarchiver.h"
#import "SUBinaryDeltaUnarchiver.h"
#import "SUFlatPackageUnarchiver.h"
#include "AppKitPrevention.h"
@@ -29,6 +30,9 @@
assert(hostPath != nil);
NSString *nonNullHostPath = hostPath;
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path updateHostBundlePath:nonNullHostPath];
} else if ([SUFlatPackageUnarchiver canUnarchivePath:path]) {
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path];
}
return nil;
}
Loaded 100 of 426 files, more files were not shown because too many files have changed in this diff. Show more