Compare commits

...
Author SHA1 Message Date
Zorg 4fa9cd9619 Ensure analyze step is only ran during pull requests 2021-11-06 18:09:31 -07:00
Zorg c5334963bb Post analyzer warnings in CI (#2010) 2021-11-06 18:03:12 -07:00
Zorg 08932966b2 Disable hide on deactivate for update window (1.x) (#2008)
This is a backport of #1804 to 1.x
2021-11-06 15:43:03 -07:00
Zorg d80ad46c4f Whitelist about:srcdoc as a safe web URL (#2007)
The document I tested (after enabling javascript) was:

<description>
          <![CDATA[
              <p>Hello</p>
              <script>
              var iframe = document.createElement("iframe");
              iframe.srcdoc = `<!DOCTYPE html><p>Hello World!</p>`;
              document.body.appendChild(iframe);
              </script>
          ]]>
</description>
2021-11-06 14:52:25 -07:00
Zorg 4a00b97592 Add project version inputs to create-draft-release workflow (1.x) (#1999) 2021-10-30 22:55:50 -07:00
Sparkle-Bot a319cb2c90 Update Package.swift and Sparkle.podspec for version 1.27.1-rc.1 2021-10-30 23:40:31 +00:00
Zorg 43596bbc5e Update changelog and version for 1.27.1-rc.1 (#1996) 2021-10-30 12:21:57 -07:00
Zorg 3ed77f975a Don't use current date unless necessary when scheduling next update (1.x) (#1991) 2021-10-30 11:03:37 -07:00
Zorg c64d0467b2 Revert "Set CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO for release (#1974)" (#1995)
This reverts commit f601a7a3df.

For development we should include task-get-allow entitlements. For distribution if people use custom workflows, they need to properly re-sign the app without preserving this entitlement.
2021-10-29 23:10:21 -07:00
Zorg 7b109be51d Add safer handling for applying binary delta files (1.x) (#1990) 2021-10-29 12:15:45 -07:00
Zorg c427650ed8 Update create-draft-release to use Xcode 13.1 too 2021-10-28 23:19:14 -07:00
Zorg 70f58b515d Fix Xcode version in CI 2021-10-28 23:18:11 -07:00
Zorg 65900a1aea Update Xcode 13 to 13.1 in CI 2021-10-28 23:15:09 -07:00
Zorg f601a7a3df Set CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO for release (#1974)
This removes the com.apple.security.get-task-allow entitlement on helper executable tools and XPC Services. While this is not a big deal, I don't think we should distribute executables with this entitlement which allows debugging them (with SIP / hardened runtime on). Note notarization ought to reject this entitlement with library validation enabled, so people must be getting around this anyway (either by using Xcode's Archive / Export which automatically strips this entitlement, or re-signing Sparkle tools without preserving entitlements).
2021-10-17 23:31:07 -07:00
Daniel Jalkut 1ede0bc994 When applying the system font size to the baseline CSS for the web view, use px instead of pt to specify the font size. This is consistent with best practices for web content, and alleviates a problem wherein the text in the web view, if not based on a full-fledged release notes HTML document, appears too large. (#1962) 2021-09-22 22:24:11 -07:00
Daniel Jalkut 5b8ab1b919 Don't manipulate the default WebView preferences, which at least on Monterey beta returns a preferences instance with nil identifier and with autosaves set to YES. This has the unfortunate effect of causing Sparkle, when it uses SULegacyWebView, to pollute the host app's user defaults with high level WebKit defaults for user style sheet, font sizes, etc. Specifying a unique identifier as well as turning autosaves off should both ensure Sparkle doesn't impose app-wide defaults on the host app, and also avoid littering the host app's preference file with identifier-prefixed defaults. (#1961) 2021-09-22 19:15:22 -07:00
Sparkle-Bot 99dbdcbd96 Update Package.swift and Sparkle.podspec for version 1.27.0 2021-09-18 00:14:10 +00:00
Zorg d18ccf12f3 Update changelog and final version for 1.27 (#1954) 2021-09-17 17:09:50 -07:00
ZorgandKonstantin Zamyakin a6ff74889e update some russian translates (#1947) (#1949)
Co-authored-by: Konstantin Zamyakin <dev@weblab.pro>
2021-09-12 00:07:00 -07:00
ZorgandVojtěch Koňařík a1d0e036fb Another localization update. (#1943) (#1950)
Co-authored-by: Vojtěch Koňařík <vojtakonarik@pm.me>
2021-09-12 00:05:11 -07:00
Sparkle-Bot 09ab0a5138 Update Package.swift and Sparkle.podspec for version 1.27.0-rc.1 2021-09-04 02:28:33 +00:00
Mayur Pawashe 1c55a7e7fc Update changelog and project version for 1.x (#1937) 2021-09-03 10:49:05 -07:00
Mayur Pawashe 1d9125f8a2 Update podspec to use https URLs (#1936) 2021-09-03 10:16:49 -07:00
J-rg bf3c932844 Fix German localization (#1932) 2021-09-03 08:41:44 -07:00
Mayur Pawashe b5755d41cb Use a custom bot personal access token (#1930) (#1934)
This bot has owner access to the repo and should be able to push changes to protected branches, as long as the workflows are being ran from trusted branches / remotes.

Also extract changelog and use it for the draft.
2021-09-02 23:54:20 -07:00
Mayur Pawashe 8f7fad4d3a Port versioning changes back to 1.x (#1928) 2021-08-29 23:02:46 -07:00
Zorg 3d4e4494ad Bump version to 1.27.0
Also remove old DSA generation script in 1.x too.
2021-08-21 12:34:42 +01:00
Mayur Pawashe f7d830d9ad Update change log for 1.x (#1898) 2021-07-24 13:53:46 -07:00
Mayur Pawashe f3db8fb959 Create valid xar files (#1906)
* Create xar files with valid directory/filename structure

* Don't use file hash for determining if files are equal or not
2021-07-24 09:08:35 -07:00
Sungbin Jo 55394e1359 Fix appcast pubDate tag generation in different locales
Fixes #1900
2021-07-21 18:42:40 -07:00
Mayur Pawashe ea14942643 Fix project warnings (#1893)
Port changes from 2.x to fix some project warnings in master branch:

* Copy phase strip warning on binaries when building Distribution
* No app category set on Autoupdate
* -Watimport-in-framework-header warnings
* id messaging warnings
* -Wcompletion-handler warnings
* Some deprecated base64 APIs
* Explicit SDK and adhoc signing identity
* Upgrade project last update check
* Don't use manual ordering for building targets and set Sparkle.framework as dependency to XCFrameworks aggregate target
* Silenced WKWebView deprecation warning
* Fixed no output node warning in git config script by removing input node like in 2.x
2021-07-19 08:07:06 -07:00
Mayur Pawashe a2adcd8407 Sync Sample Appcast from 2.x (#1895)
Plus made changes to use https://
2021-07-18 13:08:09 -07:00
Mayur Pawashe 2929333b49 Backport security and DSA changes to 1.x (#1892)
* Avoid DSA verification if EdDSA verification passes

This ports #1888 over to 1.x.

* Log error if app is using DSA public key only

* Log error if app is not using EdDSA key
2021-07-16 00:09:07 -07:00
Mayur Pawashe c4fcf17050 Merge pull request #1873 from sparkle-project/http-headers-releasenotes-1x
Pass http headers and user agent when downloading release notes (1.x)
2021-06-20 14:54:59 -07:00
Zorg 99785ceebb Pass http headers and user agent when downloading release notes 2021-06-17 22:38:19 -07:00
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
Kornel a5b23cdbee Bump 2018-12-18 21:59:38 +00:00
Kornel b19120f5cd Allow EdDSA for delta updates, too 2018-12-16 03:03:23 +00:00
Kornel 4b0a037685 Merge pull request #1331 from ProsoftEngineering/fix-xcode-10-warnings
Fix xcode 10 warnings
2018-12-13 21:05:20 +00:00
Brian Bergstrand 8dadd0003e Fix DEBUG -Wundef warning 2018-12-13 14:39:24 -06:00
Brian Bergstrand 457319f217 Suppress 'direct-ivar-access' warning for property ivar 2018-12-13 14:36:28 -06:00
Kornel 0480b9bb25 Merge pull request #1329 from Bi11/master
Fix release note web view's contextual menu
2018-12-13 19:23:21 +00:00
Bi11 4390eb9eb2 Fix release note web view's contextual menu
Code added in 8ff6c147f2 does not take effect nowadays due to missing assignment of UIDelegate.
2018-12-14 03:05:41 +08:00
Kornel f5c8314c88 Merge pull request #1328 from Bi11/dark-mode
Fix release note WebView's appearance in dark mode
2018-12-13 13:51:25 +00:00
Bi11 1b209e6726 Add a test link in test app 2018-12-13 17:35:49 +08:00
Bi11 a4373e4e0f Fix release note WebView's appearance in dark mode
Referenced commits:
502378553e (PR #1280)
7e351b52c7 (PR #1288)
2018-12-13 17:35:49 +08:00
Kornel d430c33bf4 Merge pull request #1325 from Bi11/master
Fix compile of TestApplication
2018-12-11 02:07:32 +00:00
Bi11 7ef4635d8c Fix compile of TestApplication 2018-12-11 04:16:10 +08:00
Kornel deb4be7a1b Bump 2018-12-10 12:48:46 +00:00
Kornel 5f1bc6b612 Sign appcast tools 2018-12-10 12:47:28 +00:00
Kornel 1cde8110df Explain error 25308 2018-12-10 12:45:40 +00:00
Kornel 1926b7bfa6 1.21.0 2018-11-25 16:01:20 +00:00
Kornel f80907fa2c Check if public key is configured correctly 2018-11-25 15:54:14 +00:00
Kornel 091a86f672 Merge pull request #1317 from HofiOne/2-tiny-issues
2 tiny fixes
2018-11-20 12:50:04 +00:00
Hofi 208b0dc49a 2 tiny fixes
- bogus debug build warning fixed
- fixed docs build warning message to prevent execution of  embedded shell script line
2018-11-20 05:55:17 +01:00
Kornel 5acf3989d2 Make legacy script use a smaller DSA key that macOS still supports
Sizes below 2048 get SHA-1.
2018-11-13 13:36:35 +00:00
Kornel Lesiński 5529a3610d Troubleshooting help 2018-11-12 19:38:17 +00:00
milotype 920ff7f83f Croatian localization added 2018-11-10 18:07:07 +00:00
Kornel 5ff1488f0c Bump 2018-10-31 01:00:16 +00:00
Kornel c0c1c51d8d Ignore symlink permissions in binary deltas
Fixes #1301
2018-10-31 01:00:16 +00:00
Kornel 5139179487 Refactored signature check logic 2018-10-31 01:00:16 +00:00
Kornel f50cbce0e8 Add EdDSA files to tests 2018-10-31 01:00:16 +00:00
Kornel 14f1d3520a Update signing self-check to look for EdDSA 2018-10-31 01:00:16 +00:00
Kornel 9c4729ed4a Use EdDSA keys in test app 2018-10-31 01:00:16 +00:00
Kornel f04a61e159 Sparkle version in logs 2018-10-31 00:50:41 +00:00
Kornel 80d8758fc2 Merge pull request #1302 from elgatosf/master
SPUDownloaderSession leaked because the NSURLSession wasn’t invalidated
2018-10-30 02:38:34 +00:00
Michael Ehrmann 081301d590 SPUDownloaderSession leaked because the NSURLSession wasn’t invalidated 2018-10-29 17:52:48 +01:00
Kornel 397370297b Update README.markdown 2018-09-30 01:01:16 +09:00
Kornel b30dcd979f EdDSA spelling 2018-09-17 13:44:05 +01:00
Kornel ee123edd74 Changelog 2018-09-16 21:12:11 +01:00
Kornel 984625cc7e Build new scripts 2018-09-16 20:55:32 +01:00
Kornel 7b6e7957c6 sign_update tool 2018-09-16 20:55:32 +01:00
Kornel 2815514c23 Bump 2018-09-16 20:55:32 +01:00
Kornel 49eaa4c5cc Objc bugs 2018-09-16 15:57:19 +01:00
Kornel 09bcee7280 Don't re-create unnecessary delta files 2018-09-16 15:19:43 +01:00
Kornel 49ea08b284 Sort project file 2018-09-16 15:07:53 +01:00
Kornel f9dc70ade2 Use proper Caches directory 2018-09-16 15:07:46 +01:00
Kornel 6fb3eee91b Constants for element names 2018-09-16 11:23:27 +01:00
Kornel 19be83b15f Emit edSignature in the appcast 2018-09-16 11:19:28 +01:00
Kornel d90529ccaa Fixed check for supported signatures 2018-09-16 11:19:15 +01:00
Kornel 623b7b6bda ed25519 keys in generate_* tools 2018-09-16 00:40:42 +01:00
Kornel 65bcb3815e Deprecate old DSA scripts 2018-09-16 00:40:42 +01:00
Kornel d5cd95e0ef ed25519 signature verification 2018-09-16 00:40:42 +01:00
Kornel b9150d2938 Rename method 2018-09-16 00:40:42 +01:00
Kornel 1006326157 Make SecKeyRef as needed 2018-09-16 00:40:42 +01:00
Kornel 68856e074b Ed25519 public key in Info.plist 2018-09-16 00:40:42 +01:00
Kornel a86bdb2fa8 ed25519 submodule 2018-09-16 00:40:42 +01:00
Kornel 92e00baafb Don't perform heavy work in constructor 2018-09-15 17:04:05 +01:00
Kornel 98ea3e3d57 Rename 2018-09-15 17:04:05 +01:00
Kornel c094a38231 Wrapper for public keys 2018-09-15 15:54:08 +01:00
Kornel 6df898f9b7 Use signatures object 2018-09-15 15:54:08 +01:00
Kornel 7f51a4e344 Read ed25519 signature from appcast 2018-09-15 15:54:08 +01:00
Kornel 8ad1f57672 SUSignatures 2018-09-15 15:54:08 +01:00
Kornel 8b88183c7d Merge pull request #1278 from tempelmann/master-origin
Make "sign_update" work on pre-10.13 system
2018-08-19 14:45:43 +01:00
Thomas Tempelmann d036d3e3ae Make "sign_update" work on pre-10.13 system by checking the OpenSSL version, using the older "-dss1" digest option again in that case. See ticket 1227 and commit 0cb0b2f 2018-08-19 15:28:03 +02:00
Kornel 8b13eb5dcf Merge pull request #1270 from shayr1/patch-1
Fixed some typos
2018-07-18 18:55:20 +01:00
Shay ba5b7341fa Fixed some typos
Fixed typos in the following keys:
"An error occurred during installation. Please try again later."
"An error occurred in retrieving update information. Please try again later."
Added missing key that fell back to English:
"Cancel Update" = "בטל עדכון"; (Inside alert when using a button to let user check for updates)
2018-07-18 19:16:05 +03: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
459 changed files with 12073 additions and 19421 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]
+99
View File
@@ -0,0 +1,99 @@
name: Build & Tests
on:
push:
branches: [ 2.x, master ]
pull_request:
branches: [ 2.x, master ]
jobs:
build:
strategy:
matrix:
xcode: ['xcode12.5.1', 'xcode13.1']
include:
- xcode: 'xcode12.5.1'
xcode-path: '/Applications/Xcode_12.5.1.app/Contents/Developer'
upload-dist: false
run-analyzer: false
- xcode: 'xcode13.1'
xcode-path: '/Applications/Xcode_13.1.app/Contents/Developer'
upload-dist: true
run-analyzer: true
name: Build and Test Sparkle
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Build Unit Tests
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
run: |
xcodebuild build-for-testing -project Sparkle.xcodeproj -scheme Distribution -enableCodeCoverage YES -derivedDataPath build
- name: Run Unit Tests
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
run: |
xcodebuild test-without-building -project Sparkle.xcodeproj -scheme Distribution -enableCodeCoverage YES -derivedDataPath build
- name: Build UI Tests
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
run: |
xcodebuild build-for-testing -project Sparkle.xcodeproj -scheme UITests -configuration Debug -derivedDataPath build
- name: Run UI Tests
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
run: |
xcodebuild test-without-building -project Sparkle.xcodeproj -scheme UITests -configuration Debug -derivedDataPath build
- name: Analyze Sparkle
if: ${{ matrix.run-analyzer && github.event_name == 'pull_request' }}
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
run: |
xcodebuild analyze -project Sparkle.xcodeproj -quiet -scheme Sparkle -configuration Release -derivedDataPath analyze > anaylze_output.txt
- name: Find Analyzed Warnings
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' }}
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
run: |
grep -q "warning:" anaylze_output.txt
- name: Extract Analyzed Warnings
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' }}
id: warnings
run: |
echo ::set-output name=content::$(cat anaylze_output.txt)
- name: Post Analyzed Warnings
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' }}
uses: mshick/add-pr-comment@v1
with:
allow-repeats: true
repo-token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
repo-token-user-login: 'Sparkle-Bot'
message: "``` ${{ steps.warnings.outputs.content }} ```"
- name: Build Release Distribution
env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}
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
- name: Upload Distribution
if: ${{ success() && matrix.upload-dist }}
uses: actions/upload-artifact@v2
with:
name: Sparkle-distribution-${{ matrix.xcode }}.tar.xz
path: build/Build/Products/Release/sparkle-dist.tar.xz
+100
View File
@@ -0,0 +1,100 @@
name: "Create Draft Release"
env:
BUILDDIR: "build"
DEVELOPER_DIR: "/Applications/Xcode_13.1.app/Contents/Developer"
on:
workflow_dispatch:
inputs:
marketingVersion:
description: "Marketing Version"
required: true
default: ""
prereleaseSuffix:
description: "Pre-release Suffix"
required: false
default: ""
buildVersion:
description: "Product Build"
required: true
default: ""
concurrency:
group: publish-release-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: "Publish binaries for release"
runs-on: macos-11
steps:
- name: "Checkout sources"
uses: actions/checkout@v2
with:
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
submodules: true
fetch-depth: 0
- name: "Extract latest changes from CHANGELOG"
run: |
./Configurations/generate_latest_changes.py > latest-changes.txt
- name: "Overwrite project versions in project"
run: |
IFS='.' read major minor patch <<< "${{ github.event.inputs.marketingVersion }}"
sed -E -i '' "s/SPARKLE_VERSION_MAJOR =.+/SPARKLE_VERSION_MAJOR = $major/g" ./Configurations/ConfigCommon.xcconfig
sed -E -i '' "s/SPARKLE_VERSION_MINOR =.+/SPARKLE_VERSION_MINOR = $minor/g" ./Configurations/ConfigCommon.xcconfig
sed -E -i '' "s/SPARKLE_VERSION_PATCH =.+/SPARKLE_VERSION_PATCH = $patch/g" ./Configurations/ConfigCommon.xcconfig
if [[ ! -z "${{ github.event.inputs.prereleaseSuffix }}" ]]; then
sed -E -i '' "s/SPARKLE_VERSION_SUFFIX =.*/SPARKLE_VERSION_SUFFIX = ${{ github.event.inputs.prereleaseSuffix }}/g" ./Configurations/ConfigCommon.xcconfig
else
sed -E -i '' "s/SPARKLE_VERSION_SUFFIX =.*/SPARKLE_VERSION_SUFFIX =/g" ./Configurations/ConfigCommon.xcconfig
fi
sed -E -i '' "s/CURRENT_PROJECT_VERSION =.+/CURRENT_PROJECT_VERSION = ${{ github.event.inputs.buildVersion }}/g" ./Configurations/ConfigCommon.xcconfig
git add ./Configurations/ConfigCommon.xcconfig
- name: "Determine if this is a pre-release version"
run: |
if [[ ! -z "${{ github.event.inputs.prereleaseSuffix }}" ]]; then
echo "PRERELEASE_VERSION=true" >> $GITHUB_ENV
else
echo "PRERELEASE_VERSION=false" >> $GITHUB_ENV
fi
- name: "Set up git and create tag"
run: |
git config user.name Sparkle-Bot
git config user.email sparkle.project.bot@gmail.com
git tag "${{ github.event.inputs.marketingVersion }}"
- name: "Build release distribution"
run: make release
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
- name: "Push the updated Swift package description"
env:
GITHUB_TOKEN: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
run: git push
- name: "Draft a release"
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: ${{ env.PRERELEASE_VERSION }}
name: "Sparkle ${{ github.event.inputs.marketingVersion }}"
tag_name: ${{ github.event.inputs.marketingVersion }}
fail_on_unmatched_files: true
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
body_path: latest-changes.txt
files: |
build/Build/Products/Release/Sparkle-*.tar.xz
build/Build/Products/Release/Sparkle-for-Swift-Package-Manager.zip
+4
View File
@@ -41,3 +41,7 @@ Carthage/Build
Network Trash Folder
Temporary Items
.apdisk
# Swift Package Manager
/.build
.swiftpm
+3
View File
@@ -0,0 +1,3 @@
[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
+153
View File
@@ -1,3 +1,156 @@
# 1.27.1
* Use px instead of pt when specifying font size to fix default font size in WebView from #1962 (regressed in 1.25.0 with WKWebView adoption) (Daniel Jalkut)
* Fix to prevent Sparkle manipulating the host app's high level WebView defaults from #1961 (affecting only macOS versions before 10.11 in 1.x branch) (Daniel Jalkut)
* Add safer handling of applying binary delta files from #1990 (Zorg)
* Don't use current date unless necessary when scheduling next update to be more resilient against rapid polling from #1991 (Zorg)
# 1.27.0
* Deprecate not using EdDSA and skip DSA verification when possible in #1892 (Zorg)
* Pass http headers and user agent when downloading release notes from #1873 (Zorg)
* Fix project warnings from #1893 (Zorg)
* Update sample appcast from #1895 (Zorg)
* Fix appcast pubDate tag generation in different locales from #1898 (Sungbin Jo)
* Create valid xar archives for generating binary delta files from #1906 (Zorg)
* Fix a few issues with German localization from #1931 (J-rg)
* Fix issues with Russian localizations from #1947 (Konstantin Zamyakin)
* Fix issues with Czech localizations from #1943 (Vojtěch Koňařík)
* Add an automated workflow that builds and publishes official Sparkle releases (Tony Arnold, Zorg)
# 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)
* Warning fixes (Brian Bergstrand)
* Improvements to release notes view context menu and dark mode (Bi11)
# 1.21.0
* Added support EdDSA (ed25519) signatures (Kornel)
* DSA signatures are considered outdated, and Apple's `Security.framework` only supports weaker SHA-1-based DSA.
* Both old DSA and new EdDSA are still supported (and one app can use both), but new applications should use EdDSA only, and we recommend migrating away from DSA signatures.
* `generate_keys` is now a Swift tool that stores EdDSA private keys in the Keychain
* Existing apps can continue using their old DSA keys, but we've dropped support for generation of old DSA keys
* `sign_update` is now a Swift tool that signs using EdDSA from private keys in the Keychain
* The old DSA-based signing script has been moved to `bin/old_dsa_scripts`
* The old DSA-based signing script has been fixed to work on pre-10.13 systems (Thomas Tempelmann)
* `generate_appcast` has been updated to support EdDSA signatures
* It can sign both DSA (if `dsa_priv.pem` file is specified) and EdDSA (from Keychain)
* The tool now uses Caches directory and doesn't generate unnecessary delta files
* Fixed verification of delta updates on filesystems that change permissions of symlinks
* Fixed `NSURLSession` leak (Michael Ehrmann)
# 1.20.0
* `generate_appcast` option to read private key directly from the keychain (Tamás Lustyik)
+19 -11
View File
@@ -15,23 +15,34 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0
// following on to always reset the name back to "MyApp":
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
// These variables must have a space after the '=' too
SPARKLE_VERSION_MAJOR = 1
SPARKLE_VERSION_MINOR = 20
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
SPARKLE_VERSION_MINOR = 27
SPARKLE_VERSION_PATCH = 1
// This should be in SemVer format or empty, ie. "-rc.1"
// These variables must have a space after the '=' too
SPARKLE_VERSION_SUFFIX = -rc.1
// This is now a monotonically increasing ID number, even across prereleases, but let's keep this below 2.0
CURRENT_PROJECT_VERSION = 1.103
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
ALWAYS_SEARCH_USER_PATHS = NO
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)\"
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)\" MARKETING_VERSION=\"$(MARKETING_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_FILEOP_TOOL_NAME=\"$(SPARKLE_FILEOP_TOOL_NAME)\"
CODE_SIGN_IDENTITY = -
SDKROOT = macosx
ENABLE_HARDENED_RUNTIME = YES;
CLANG_ENABLE_OBJC_ARC = YES
GCC_ENABLE_PASCAL_STRINGS = NO
GCC_NO_COMMON_BLOCKS = YES;
@@ -54,6 +65,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 +92,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
@@ -15,3 +15,4 @@ GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_COMMON)
DEAD_CODE_STRIPPING = YES
GCC_TREAT_WARNINGS_AS_ERRORS = NO
GCC_WARN_UNINITIALIZED_AUTOS = YES
COPY_PHASE_STRIP = NO
@@ -0,0 +1,7 @@
// Generate Appcast only
#include "ConfigSwift.xcconfig"
SWIFT_OBJC_BRIDGING_HEADER = generate_keys/Bridging-Header.h
MACOSX_DEPLOYMENT_TARGET = 10.11
PRODUCT_NAME = generate_keys
@@ -0,0 +1,4 @@
// Generate Appcast Debug
#include "ConfigGenerateKeys.xcconfig"
#include "ConfigSwiftDebug.xcconfig"
@@ -0,0 +1,4 @@
// Generate Appcast Release
#include "ConfigGenerateKeys.xcconfig"
#include "ConfigSwiftRelease.xcconfig"
+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
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
import os, sys
# Ignore the first version line starting with # x.y.z..
# and print everything until the second version line starting with # x.y.z..
hit_first_changelog_note = False
with open("CHANGELOG", "r") as changelog_file:
for line in changelog_file:
if line.startswith("#"):
if hit_first_changelog_note:
# We are done with printing changes
break
else:
# We haven't hit an important changelog line yet, so continue
continue
if not hit_first_changelog_note and len(line.strip()) == 0:
continue
hit_first_changelog_note = True
sys.stdout.write(line)
+119 -10
View File
@@ -1,38 +1,147 @@
#!/bin/bash
set -e
if [ "$ACTION" = "" ] ; then
# If using cocoapods, sanity check that the Podspec version matches the Sparkle version
if [ -x "$(command -v pod)" ]; then
spec_version=$(printf "require 'cocoapods'\nspec = %s\nprint spec.version" "$(cat "$SRCROOT/Sparkle.podspec")" | LANG=en_US.UTF-8 ruby)
if [ "$spec_version" != "$CURRENT_PROJECT_VERSION" ] ; then
echo "podspec version '$spec_version' does not match the current project version '$CURRENT_PROJECT_VERSION'" >&2
exit 1
fi
# Tests the code signing validity of the extracted products within the provided path.
# This guards against our archives being corrupt / created incorrectly.
function verify_code_signatures() {
verification_directory="$1"
if [[ -z "$verification_directory" ]]; then
echo "Provided verification directory does not exist" >&2
exit 1
fi
# Search the current directory for all instances of the framework to verify them (XCFrameworks can have multiple copies of a framework for different platforms).
find "${verification_directory}" -name "Sparkle.framework" -type d -exec codesign --verify -vvv --deep {} \;
codesign --verify -vvv --deep "${verification_directory}/Sparkle Test App.app"
codesign --verify -vvv --deep "${verification_directory}/bin/BinaryDelta"
codesign --verify -vvv --deep "${verification_directory}/bin/generate_appcast"
codesign --verify -vvv --deep "${verification_directory}/bin/sign_update"
codesign --verify -vvv --deep "${verification_directory}/bin/generate_keys"
}
if [ "$ACTION" = "" ] ; then
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2"
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
rm -f "Sparkle-$MARKETING_VERSION.tar.xz"
rm -f "Sparkle-$MARKETING_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
if [ "$CONFIGURATION" = "Release" ] ; then
cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/generate_appcast.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
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
rm -rf "/tmp/sparkle-extract"
mkdir -p "/tmp/sparkle-extract"
# 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-$MARKETING_VERSION.tar.xz"
# Copy archived distribution for CI
cp -f "../Sparkle-$MARKETING_VERSION.tar.xz" "../sparkle-dist.tar.xz"
# Extract archive for testing binary validity
tar -xf "../Sparkle-$MARKETING_VERSION.tar.xz" -C "/tmp/sparkle-extract"
else
# Fallback to bz2 compression if xz utility is not available
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$MARKETING_VERSION.tar.bz2" --files-from=-
# Extract archive for testing binary validity
tar -xf "../Sparkle-$MARKETING_VERSION.tar.bz2" -C "/tmp/sparkle-extract"
fi
# Test code signing validity of the extracted products
# This guards against our archives being corrupt / created incorrectly
verify_code_signatures "/tmp/sparkle-extract"
rm -rf "/tmp/sparkle-extract"
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
# Generate zip containing the xcframework for SPM
rm -rf "/tmp/sparkle-spm-extract"
mkdir -p "/tmp/sparkle-spm-extract"
cd "$CONFIGURATION_BUILD_DIR/staging-spm"
# rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive"
ditto -c -k --zlibCompressionLevel 9 --rsrc . "../Sparkle-for-Swift-Package-Manager.zip"
# Test code signing validity of the extracted Swift package
# This guards against our archives being corrupt / created incorrectly
ditto -x -k "../Sparkle-for-Swift-Package-Manager.zip" "/tmp/sparkle-spm-extract"
verify_code_signatures "/tmp/sparkle-spm-extract"
rm -rf "/tmp/sparkle-spm-extract"
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
# Get latest git tag
cd "$SRCROOT"
latest_git_tag=$(git describe --tags --abbrev=0)
# Check semantic versioning
if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
echo "Tag $latest_git_tag follows semantic versioning"
else
echo "ERROR: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" >&2
exit 1
fi
# Generate new Package manifest and podspec
cd "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Sparkle.podspec" "$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/\".+\"/\"$MARKETING_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: $MARKETING_VERSION"
echo "Tag: $latest_git_tag"
echo "Checksum: $spm_checksum"
sed -E -i '' -e "/s\.version.+=/ s/\".+\"/\"$MARKETING_VERSION\"/" "Sparkle.podspec"
cp "Sparkle.podspec" "$SRCROOT"
echo "Sparkle.podspec updated with following values:"
echo "Version: $MARKETING_VERSION"
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
+33
View File
@@ -0,0 +1,33 @@
#!/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 --tags --abbrev=0) # gets the latest tag name
commits_since_tag=$(git rev-list ${latest_git_tag}.. --count)
function move_tag() {
long_message=$(git tag -n99 -l $latest_git_tag) # gets corresponding message
long_message=${long_message/$latest_git_tag} # trims tag name
long_message="$(echo -e "${long_message}" | sed -e 's/^[[:space:]]*//')" # trim leading whitespace
git add Package.swift Sparkle.podspec
git commit -m "Update Package.swift and Sparkle.podspec for version ${latest_git_tag}"
git tag -fa $latest_git_tag -m "${long_message}"
echo "Package.swift and Sparkle.podspec committed and tag '$latest_git_tag' moved."
}
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."
elif [ "$CI" == true ]; then
move_tag
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 Sparkle.podspec, and force move tag '$latest_git_tag'? (required for official release) [Y/n]" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
move_tag
else
echo "Package.swift and Sparkle.podspec have not been committed and tag has not been moved."
fi
fi
+6 -6
View File
@@ -8,12 +8,12 @@ fi
if [ -z "$SRCROOT" ] || \
[ -z "$BUILT_PRODUCTS_DIR" ] || \
[ -z "$INFOPLIST_PATH" ] || \
[ -z "$CURRENT_PROJECT_VERSION" ]; then
echo "$0: Must be run from Xcode!" 1>&2
[ -z "$MARKETING_VERSION" ]; then
echo "$0: Must be run from Xcode!" 1>&2
exit 1
fi
version="$CURRENT_PROJECT_VERSION"
version="$MARKETING_VERSION"
# Get version in format 1.x.x-commits-hash
gitversion=$( cd "$SRCROOT"; git describe --tags --match '[12].*' || true )
@@ -22,10 +22,10 @@ if [ -z "$gitversion" ] ; then
exit 0
fi
# remove everything before the first "-" to keep the hash part only
versionsuffix=${gitversion#*-};
# remove everything before the second last "-" to keep the hash part only
versionsuffix=$( echo "${gitversion}" | sed -E 's/.+((-[^.]+){2})$/\1/' )
if [ "$versionsuffix" != "$gitversion" ]; then
version="$version $versionsuffix"
version="$version$versionsuffix"
fi
# and use it to set the CFBundleShortVersionString value
+1 -1
View File
@@ -5,7 +5,7 @@ if [ "$ACTION" = "" ] ; then
doxygen Documentation/Doxyfile
else
echo "warning: Doxygen not found in PATH"
echo "open Terminal and type this command `brew install doxygen` then click `enter/return` key. finally build this target again"
echo "open Terminal and type this command 'brew install doxygen' then click 'enter/return' key. finally build this target again"
fi
elif [ "$ACTION" = "clean" ] ; then
rm -rf "$SRCROOT/Documentation/html"
+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.27.1-rc.1"
// 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.27.1-rc.1"
let checksum = "29ea21aff129265413ca48785eacd4823cea89670299675069d36c41fd0a33e9"
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
)
]
)
+23 -14
View File
@@ -1,37 +1,32 @@
# 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.
* Secure. Updates are verified using DSA signatures and Apple Code Signing.
* Secure. Updates are verified using EdDSA signatures and Apple Code Signing.
* Fast. Supports delta updates which only patch files that have changed.
* Easy to install. Sparkle requires no code in your app, and only needs static files on a web server.
* 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.
* Up-to-date with 10.12 SDK and Xcode 8 (supports macOS 10.7+).
* Important security fixes.
* 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 7 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. However, [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
## Usage
@@ -39,6 +34,20 @@ 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.
* Use the `generate_appcast` tool which creates appcast files, correct signatures, and delta updates automatically.
* Make sure the URL specified in [`SUFeedURL`](https://sparkle-project.org/documentation/customization/) is valid (typos/404s are a common error!), and that it uses modern TLS ([test it](https://www.ssllabs.com/ssltest/)).
* Delete your app's preferences (in `~/Library/Preferences/<your bundle id>`) if you've set another feed URL programmatically via Sparkle's Objective-C interface.
### API symbols
Sparkle is built with `-fvisibility=hidden -fvisibility-inlines-hidden` which means no symbols are exported by default.
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;
}
}
+16 -9
View File
@@ -6,33 +6,40 @@
<language>en</language>
<item>
<title>Version 2.0 (2 bugs fixed; 3 new features)</title>
<link>https://sparkle-project.org</link>
<sparkle:version>2.0</sparkle:version>
<sparkle:releaseNotesLink>
http://you.com/app/2.0.html
https://you.com/app/2.0.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
<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>
<enclosure url="https://you.com/app/Your%20Great%20App%202.0.zip" length="1623481" type="application/octet-stream" sparkle:edSignature="WVyVJpOx+a5+vNWJVY79TRjFKveNk+VhGJf2iti4CZtJsJewIUGvh/1AKKEAFbH1qUwx+vro1ECuzOsMmumoBA==" />
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
</item>
<item>
<title>Version 1.5 (8 bugs fixed; 2 new features)</title>
<link>https://sparkle-project.org</link>
<sparkle:version>1.5</sparkle:version>
<sparkle:releaseNotesLink>
http://you.com/app/1.5.html
https://you.com/app/1.5.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
<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>
<enclosure url="https://you.com/app/Your%20Great%20App%201.5.zip" length="1472893" type="application/octet-stream" sparkle:edSignature="pNFd7KbcQSu+Mq7UYrbQXTPq82luht2ACXm/r2utp1u/Uv/5hWqctdT2jwQgMejW7DRoeV/hVr6J4VdZYdwWDw==" />
<sparkle:minimumSystemVersion>10.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. -->
<item>
<title>Version 1.4 (5 bugs fixed; 2 new features)</title>
<link>https://sparkle-project.org</link>
<sparkle:releaseNotesLink>
http://you.com/app/1.4.html
https://you.com/app/1.4.html
</sparkle:releaseNotesLink>
<sparkle:version>241</sparkle:version>
<sparkle:shortVersionString>1.4</sparkle:shortVersionString>
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
<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>
<enclosure url="https://you.com/app/Your%20Great%20App%201.4.zip" sparkle:edSignature="Ody3D/ybSMH4T+P/oNj3LN4F0SA8RJGLEr1TI4UemrBAiJ9aEcDnYV3u58P75AbcFjI13jPYmHDUHXMSTFQbDw==" length="1472349" type="application/octet-stream" />
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 100 KiB

+6 -6
View File
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "1.20.0"
s.version = "1.27.1-rc.1"
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"
s.documentation_url = "http://sparkle-project.org/documentation/"
s.screenshot = "http://sparkle-project.org/images/screenshot-noshadow@2x.png"
s.homepage = "https://sparkle-project.org"
s.documentation_url = "https://sparkle-project.org/documentation/"
s.screenshot = "https://sparkle-project.org/images/screenshot-noshadow@2x.png"
s.license = {
:type => 'MIT',
:file => 'LICENSE'
@@ -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
@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:Sparkle.xcodeproj">
location = "self:">
</FileRef>
</Workspace>
@@ -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>
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D06E8CF0FD68C7C005AE3F6"
BuildableName = "BinaryDelta"
BlueprintName = "BinaryDelta"
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 = "5D06E8CF0FD68C7C005AE3F6"
BuildableName = "BinaryDelta"
BlueprintName = "BinaryDelta"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5D06E8CF0FD68C7C005AE3F6"
BuildableName = "BinaryDelta"
BlueprintName = "BinaryDelta"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,8 +26,16 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "14732BC51960F69300593899"
BuildableName = "Distribution"
BlueprintName = "Distribution"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@@ -40,23 +48,11 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "14732BC51960F69300593899"
BuildableName = "Distribution"
BlueprintName = "Distribution"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -72,8 +68,6 @@
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
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>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "1300"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,8 +26,16 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
BuildableName = "Sparkle.framework"
BlueprintName = "Sparkle"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@@ -40,23 +48,11 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
BuildableName = "Sparkle.framework"
BlueprintName = "Sparkle"
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -73,8 +69,6 @@
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -10,7 +10,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -24,22 +23,17 @@
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
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>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,10 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@@ -39,14 +36,13 @@
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -63,8 +59,6 @@
ReferencedContainer = "container:Sparkle.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
+3 -1
View File
@@ -13,7 +13,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<string>${MARKETING_VERSION}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -28,6 +28,8 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}.icns</string>
</dict>
+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="19455" 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="19455"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SUUpdateAlert">
@@ -15,21 +12,21 @@
<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>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="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
}
+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
+1
View File
@@ -150,6 +150,7 @@
-(void)cleanup
{
[self.download cancel];
[self.downloadSession invalidateAndCancel];
self.download = nil;
self.downloadSession = nil;
[super cleanup];
+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
+8 -1
View File
@@ -10,18 +10,23 @@
#define SUAPPCASTITEM_H
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"
@class SUSignatures;
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 (copy, readonly) NSString *DSASignature;
@property (strong, readonly) SUSignatures *signatures;
@property (copy, readonly) NSString *minimumSystemVersion;
@property (copy, readonly) NSString *maximumSystemVersion;
@property (strong, readonly) NSURL *fileURL;
@@ -31,6 +36,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;
+30 -7
View File
@@ -9,7 +9,7 @@
#import "SUAppcastItem.h"
#import "SULog.h"
#import "SUConstants.h"
#import "SUSignatures.h"
#include "AppKitPrevention.h"
@@ -18,7 +18,7 @@
@property (copy, readwrite) NSString *dateString;
@property (copy, readwrite) NSString *itemDescription;
@property (strong, readwrite) NSURL *releaseNotesURL;
@property (copy, readwrite) NSString *DSASignature;
@property (strong, readwrite) SUSignatures *signatures;
@property (copy, readwrite) NSString *minimumSystemVersion;
@property (copy, readwrite) NSString *maximumSystemVersion;
@property (strong, readwrite) NSURL *fileURL;
@@ -28,13 +28,15 @@
@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
@synthesize dateString;
@synthesize deltaUpdates;
@synthesize displayVersionString;
@synthesize DSASignature;
@synthesize signatures;
@synthesize fileURL;
@synthesize contentLength = _contentLength;
@synthesize infoURL;
@@ -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;
@@ -156,10 +172,10 @@
self.fileURL = [NSURL URLWithString:fileURLString];
}
if (enclosure) {
self.DSASignature = [enclosure objectForKey:SUAppcastAttributeDSASignature];
self.signatures = [[SUSignatures alloc] initWithDsa:[enclosure objectForKey:SUAppcastAttributeDSASignature] ed:[enclosure objectForKey:SUAppcastAttributeEDSignature]];
self.osString = [enclosure objectForKey:SUAppcastAttributeOsType];
}
self.versionString = newVersion;
self.minimumSystemVersion = [dict objectForKey:SUAppcastElementMinimumSystemVersion];
self.maximumSystemVersion = [dict objectForKey:SUAppcastElementMaximumSystemVersion];
@@ -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 -3
View File
@@ -61,7 +61,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
// update prompt to behave like a normal window. Otherwise if the window were hidden
// there may be no way for the application to be activated to make it visible again.
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
[[self.alert window] setHidesOnDeactivate:NO];
[NSApp activateIgnoringOtherApps:YES];
}
@@ -96,6 +95,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 +178,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 +233,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;
+165 -68
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,21 +443,23 @@
{
id<SUUpdaterPrivate> updater = self.updater;
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:self.downloadPath updatingHostBundlePath:self.host.bundlePath decryptionPassword:updater.decryptionPassword];
BOOL success;
BOOL success = NO;
if (!unarchiver) {
SULog(SULogLevelError, @"Error: No valid unarchiver for %@!", self.downloadPath);
success = NO;
} else {
self.updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:self.downloadPath signatures:self.updateItem.signatures host:self.host];
// Currently unsafe archives are the only case where we can prevalidate before extraction, but that could change in the future
BOOL needsPrevalidation = [[unarchiver class] unsafeIfArchiveIsNotValidated];
self.updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:self.downloadPath dsaSignature:self.updateItem.DSASignature host:self.host performingPrevalidation:needsPrevalidation];
success = self.updateValidator.canValidate;
BOOL needsPrevalidation = [[unarchiver class] mustValidateBeforeExtraction];
if (needsPrevalidation) {
success = [self.updateValidator validateDownloadPath];
} else {
success = YES;
}
}
if (!success) {
NSError *reason = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{NSLocalizedDescriptionKey: @"Failed to extract update."}];
[self unarchiverDidFailWithError:reason];
@@ -378,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];
@@ -387,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];
@@ -413,7 +502,7 @@
- (void)unarchiverDidFinish:(id)__unused ua
{
assert(self.updateItem);
[self installWithToolAndRelaunch:YES];
}
@@ -421,12 +510,12 @@
{
// No longer needed
self.updateValidator = nil;
if ([self.updateItem isDeltaUpdate]) {
[self failedToApplyDeltaUpdate];
return;
}
[self abortUpdateWithError:err];
}
@@ -471,7 +560,7 @@
{
assert(self.updateItem);
assert(self.updateValidator);
BOOL validationCheckSuccess = [self.updateValidator validateWithUpdateDirectory:self.tempDir];
if (!validationCheckSuccess) {
NSDictionary *userInfo = @{
@@ -492,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];
}
@@ -555,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);
}
}
}
@@ -591,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]],
@@ -638,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;
+99 -3
View File
@@ -14,9 +14,22 @@
#include <stdio.h>
#include <stdlib.h>
#include <xar/xar.h>
#include <Availability.h>
#include "AppKitPrevention.h"
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
#define HAS_XAR_GET_SAFE_PATH 1
#else
#define HAS_XAR_GET_SAFE_PATH 0
#endif
#if HAS_XAR_GET_SAFE_PATH
// This is preferred over xar_get_path (which is deprecated) when it's available
// Don't use OS availability for this API
extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
#endif
static BOOL applyBinaryDeltaToFile(xar_t x, xar_file_t file, NSString *sourceFilePath, NSString *destinationFilePath)
{
NSString *patchFile = temporaryFilename(@"apply-binary-delta");
@@ -86,6 +99,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
}
if (majorDiffVersion < FIRST_DELTA_DIFF_MAJOR_VERSION) {
xar_close(x);
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadCorruptFileError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Unable to identify diff-version %u in delta. Giving up.", majorDiffVersion] }];
}
@@ -93,18 +108,36 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
}
if (majorDiffVersion > LATEST_DELTA_DIFF_MAJOR_VERSION) {
xar_close(x);
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"A later version is needed to apply this patch (on major version %u, but patch requests version %u).", LATEST_DELTA_DIFF_MAJOR_VERSION, majorDiffVersion] }];
}
return NO;
}
#if HAS_XAR_GET_SAFE_PATH
// Reject patches that did not generate valid hierarchical xar container paths
// These will not succeed to patch using recent versions of BinaryDelta
if ((majorDiffVersion == SUBinaryDeltaMajorVersion2 && minorDiffVersion < 3) || (majorDiffVersion == SUBinaryDeltaMajorVersion1 && minorDiffVersion < 2)) {
xar_close(x);
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadCorruptFileError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"This patch version (%u.%u) is too old and potentially unsafe to apply. Please re-generate the patch using the latest version of BinaryDelta or generate_appcast. New version %u.%u patches will still be compatible with older versions of Sparkle.", majorDiffVersion, minorDiffVersion, majorDiffVersion, latestMinorVersionForMajorVersion(majorDiffVersion)] }];
}
return NO;
}
#endif
BOOL usesNewTreeHash = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBeigeMajorVersion);
BOOL usesNewTreeHash = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBinaryDeltaMajorVersion2);
NSString *expectedBeforeHash = usesNewTreeHash ? expectedNewBeforeHash : expectedBeforeHashv1;
NSString *expectedAfterHash = usesNewTreeHash ? expectedNewAfterHash : expectedAfterHashv1;
if (!expectedBeforeHash || !expectedAfterHash) {
xar_close(x);
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadCorruptFileError userInfo:@{ NSLocalizedDescriptionKey: @"Unable to find before-sha1 or after-sha1 metadata in delta. Giving up." }];
}
@@ -120,6 +153,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
NSString *beforeHash = hashOfTreeWithVersion(source, majorDiffVersion);
if (!beforeHash) {
xar_close(x);
if (verbose) {
fprintf(stderr, "\n");
}
@@ -130,6 +165,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
}
if (![beforeHash isEqualToString:expectedBeforeHash]) {
xar_close(x);
if (verbose) {
fprintf(stderr, "\n");
}
@@ -146,6 +183,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
progressCallback(2/6.0);
if (!removeTree(destination)) {
xar_close(x);
if (verbose) {
fprintf(stderr, "\n");
}
@@ -158,6 +197,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
progressCallback(3/6.0);
if (!copyTree(source, destination)) {
xar_close(x);
if (verbose) {
fprintf(stderr, "\n");
}
@@ -169,7 +210,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
progressCallback(4/6.0);
BOOL hasExtractKeyAvailable = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBeigeMajorVersion);
BOOL hasExtractKeyAvailable = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBinaryDeltaMajorVersion2);
if (verbose) {
fprintf(stderr, "\nPatching...");
@@ -178,17 +219,65 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
xar_file_t file;
xar_iter_t iter = xar_iter_new();
for (file = xar_file_first(x, iter); file; file = xar_file_next(iter)) {
NSString *path = @(xar_get_path(file));
char *pathCString;
#if HAS_XAR_GET_SAFE_PATH
if (xar_get_safe_path != NULL) {
pathCString = xar_get_safe_path(file);
}
else
#endif
{
pathCString = xar_get_path(file);
}
if (pathCString == NULL) {
continue;
}
NSString *path = @(pathCString);
if ([path.pathComponents containsObject:@".."]) {
xar_close(x);
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Relative path '%@' contains '..' path component", path] }];
}
return NO;
}
NSString *sourceFilePath = [source stringByAppendingPathComponent:path];
NSString *destinationFilePath = [destination stringByAppendingPathComponent:path];
{
NSString *destinationParentDirectory = destinationFilePath.stringByDeletingLastPathComponent;
NSDictionary<NSFileAttributeKey, id> *destinationParentDirectoryAttributes = [fileManager attributesOfItemAtPath:destinationParentDirectory error:NULL];
// It is OK for the directory parent to not exist if it has already been removed
if (destinationParentDirectoryAttributes != nil) {
// But if it does exist, make sure the entry in the parent directory we're looking at is good
// If it's inside a symlink, this is not good in any circumstance
NSString *fileType = destinationParentDirectoryAttributes[NSFileType];
if ([fileType isEqualToString:NSFileTypeSymbolicLink]) {
xar_close(x);
if (error != NULL) {
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to create patch because '%@' cannot be a symbolic link.", destinationParentDirectory] }];
}
return NO;
}
}
}
// Don't use -[NSFileManager fileExistsAtPath:] because it will follow symbolic links
BOOL fileExisted = verbose && [fileManager attributesOfItemAtPath:destinationFilePath error:nil];
BOOL removedFile = NO;
// Files that have no property set that we check for will get ignored
// This is important because they aren't part of the delta, just part of the directory structure
const char *value;
if (!xar_prop_get(file, DELETE_KEY, &value) || (!hasExtractKeyAvailable && !xar_prop_get(file, DELETE_THEN_EXTRACT_OLD_KEY, &value))) {
if (!removeTree(destinationFilePath)) {
xar_close(x);
if (verbose) {
fprintf(stderr, "\n");
}
@@ -209,6 +298,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
if (!xar_prop_get(file, BINARY_DELTA_KEY, &value)) {
if (!applyBinaryDeltaToFile(x, file, sourceFilePath, destinationFilePath)) {
xar_close(x);
if (verbose) {
fprintf(stderr, "\n");
}
@@ -224,6 +315,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
} else if ((hasExtractKeyAvailable && !xar_prop_get(file, EXTRACT_KEY, &value)) || (!hasExtractKeyAvailable && xar_prop_get(file, MODIFY_PERMISSIONS_KEY, &value))) { // extract and permission modifications don't coexist
if (xar_extract_tofile(x, file, [destinationFilePath fileSystemRepresentation]) != 0) {
xar_close(x);
if (verbose) {
fprintf(stderr, "\n");
}
@@ -247,6 +340,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
if (!xar_prop_get(file, MODIFY_PERMISSIONS_KEY, &value)) {
mode_t mode = (mode_t)[[NSString stringWithUTF8String:value] intValue];
if (!modifyPermissions(destinationFilePath, mode)) {
xar_close(x);
if (verbose) {
fprintf(stderr, "\n");
}
@@ -261,6 +356,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
}
}
}
xar_close(x);
progressCallback(5/6.0);
+4 -5
View File
@@ -53,15 +53,14 @@
typedef NS_ENUM(uint16_t, SUBinaryDeltaMajorVersion)
{
SUAzureMajorVersion = 1,
SUBeigeMajorVersion = 2
SUBinaryDeltaMajorVersion1 = 1,
SUBinaryDeltaMajorVersion2 = 2
};
#define FIRST_DELTA_DIFF_MAJOR_VERSION SUAzureMajorVersion
#define LATEST_DELTA_DIFF_MAJOR_VERSION SUBeigeMajorVersion
#define FIRST_DELTA_DIFF_MAJOR_VERSION SUBinaryDeltaMajorVersion1
#define LATEST_DELTA_DIFF_MAJOR_VERSION SUBinaryDeltaMajorVersion2
extern int compareFiles(const FTSENT **a, const FTSENT **b);
extern NSData *hashOfFileContents(FTSENT *ent);
extern NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion);
extern NSString *hashOfTree(NSString *path);
extern BOOL removeTree(NSString *path);
+10 -14
View File
@@ -42,10 +42,10 @@ NSString *stringWithFileSystemRepresentation(const char *input)
int latestMinorVersionForMajorVersion(SUBinaryDeltaMajorVersion majorVersion)
{
switch (majorVersion) {
case SUAzureMajorVersion:
return 1;
case SUBeigeMajorVersion:
case SUBinaryDeltaMajorVersion1:
return 2;
case SUBinaryDeltaMajorVersion2:
return 3;
}
return 0;
}
@@ -137,15 +137,6 @@ static BOOL _hashOfFileContents(unsigned char *hash, FTSENT *ent)
return YES;
}
NSData *hashOfFileContents(FTSENT *ent)
{
unsigned char fileHash[CC_SHA1_DIGEST_LENGTH];
if (!_hashOfFileContents(fileHash, ent)) {
return nil;
}
return [NSData dataWithBytes:fileHash length:CC_SHA1_DIGEST_LENGTH];
}
NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion)
{
char pathBuffer[PATH_MAX] = { 0 };
@@ -171,7 +162,7 @@ NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion)
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D)
continue;
if (ent->fts_info == FTS_D && !MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
if (ent->fts_info == FTS_D && !MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2)) {
continue;
}
@@ -188,8 +179,13 @@ NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion)
const char *relativePathBytes = [relativePath fileSystemRepresentation];
CC_SHA1_Update(&hashContext, relativePathBytes, (CC_LONG)strlen(relativePathBytes));
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2)) {
uint16_t mode = ent->fts_statp->st_mode;
// permission of symlinks is irrelevant and can't be changed.
// hardcoding a value helps avoid differences between filesystems.
if (ent->fts_info == FTS_SL) {
mode = 0755;
}
uint16_t type = ent->fts_info;
uint16_t permissions = mode & PERMISSION_FLAGS;
+98 -38
View File
@@ -66,25 +66,23 @@ extern int bsdiff(int argc, const char **argv);
@end
#define INFO_HASH_KEY @"hash"
#define INFO_PATH_KEY @"path"
#define INFO_TYPE_KEY @"type"
#define INFO_PERMISSIONS_KEY @"permissions"
#define INFO_SIZE_KEY @"size"
static NSDictionary *infoForFile(FTSENT *ent)
{
NSData *hash = hashOfFileContents(ent);
if (!hash) {
return nil;
}
off_t size = (ent->fts_info != FTS_D) ? ent->fts_statp->st_size : 0;
assert(ent->fts_statp != NULL);
mode_t permissions = ent->fts_statp->st_mode & PERMISSION_FLAGS;
return @{ INFO_HASH_KEY: hash,
NSString *path = @(ent->fts_path);
assert(path != nil);
return @{ INFO_PATH_KEY: path != nil ? path : @"",
INFO_TYPE_KEY: @(ent->fts_info),
INFO_PERMISSIONS_KEY: @(permissions),
INFO_SIZE_KEY: @(size) };
@@ -165,7 +163,7 @@ static NSString *temporaryPatchFile(NSString *patchFile)
static BOOL shouldSkipDeltaCompression(NSDictionary *originalInfo, NSDictionary *newInfo)
{
unsigned long long fileSize = [newInfo[INFO_SIZE_KEY] unsignedLongLongValue];
unsigned long long fileSize = [(NSNumber *)newInfo[INFO_SIZE_KEY] unsignedLongLongValue];
if (fileSize < MIN_FILE_SIZE_FOR_CREATING_DELTA) {
return YES;
}
@@ -174,12 +172,19 @@ static BOOL shouldSkipDeltaCompression(NSDictionary *originalInfo, NSDictionary
return YES;
}
if ([originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
unsigned short originalInfoType = [(NSNumber *)originalInfo[INFO_TYPE_KEY] unsignedShortValue];
unsigned short newInfoType = [(NSNumber *)newInfo[INFO_TYPE_KEY] unsignedShortValue];
if (originalInfoType != newInfoType) {
// File types are different
return YES;
}
if ([originalInfo[INFO_HASH_KEY] isEqual:newInfo[INFO_HASH_KEY]]) {
// this is possible if just the permissions have changed
NSString *originalPath = originalInfo[INFO_PATH_KEY];
NSString *newPath = newInfo[INFO_PATH_KEY];
// Skip delta if both entries are directories, or if the files/symlinks are equal in content
if (originalInfoType == FTS_D || [[NSFileManager defaultManager] contentsEqualAtPath:originalPath andPath:newPath]) {
// this is possible if just the permissions have changed but contents have not
return YES;
}
@@ -192,7 +197,7 @@ static BOOL shouldDeleteThenExtract(NSDictionary *originalInfo, NSDictionary *ne
return NO;
}
if ([originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
if ([(NSNumber *)originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [(NSNumber *)newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
return YES;
}
@@ -205,11 +210,20 @@ static BOOL shouldSkipExtracting(NSDictionary *originalInfo, NSDictionary *newIn
return NO;
}
if ([originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
unsigned short originalInfoType = [(NSNumber *)originalInfo[INFO_TYPE_KEY] unsignedShortValue];
unsigned short newInfoType = [(NSNumber *)newInfo[INFO_TYPE_KEY] unsignedShortValue];
if (originalInfoType != newInfoType) {
// File types are different
return NO;
}
if (![originalInfo[INFO_HASH_KEY] isEqual:newInfo[INFO_HASH_KEY]]) {
NSString *originalPath = originalInfo[INFO_PATH_KEY];
NSString *newPath = newInfo[INFO_PATH_KEY];
// Don't skip extract if files/symlinks entries are not equal in content
// (note if the entries are directories, they are equal)
if (originalInfoType != FTS_D && ![[NSFileManager defaultManager] contentsEqualAtPath:originalPath andPath:newPath]) {
return NO;
}
@@ -222,17 +236,63 @@ static BOOL shouldChangePermissions(NSDictionary *originalInfo, NSDictionary *ne
return NO;
}
if ([originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
if ([(NSNumber *)originalInfo[INFO_TYPE_KEY] unsignedShortValue] != [(NSNumber *)newInfo[INFO_TYPE_KEY] unsignedShortValue]) {
return NO;
}
if ([originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue] == [newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]) {
if ([(NSNumber *)originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue] == [(NSNumber *)newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]) {
return NO;
}
return YES;
}
static xar_file_t _xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTable, xar_t x, NSString *relativePath, NSString *filePath)
{
NSArray<NSString *> *rootRelativePathComponents = relativePath.pathComponents;
// Relative path must at least have starting "/" component and one more path component
if (rootRelativePathComponents.count < 2) {
return NULL;
}
NSArray<NSString *> *relativePathComponents = [rootRelativePathComponents subarrayWithRange:NSMakeRange(1, rootRelativePathComponents.count - 1)];
NSUInteger relativePathComponentsCount = relativePathComponents.count;
// Build parent files as needed until we get to our final file we want to add
// So if we get "Contents/Resources/foo.txt", we will first add "Contents" parent,
// then "Resources" parent, then "foo.txt" as the final entry we want to add
// We store every file we add into a fileTable for easy referencing
// Note if a diff has Contents/Resources/foo/ and Contents/Resources/foo/bar.txt,
// due to sorting order we will add the foo directory first and won't end up with
// mis-ordering bugs
xar_file_t lastParent = NULL;
for (NSUInteger componentIndex = 0; componentIndex < relativePathComponentsCount; componentIndex++) {
NSArray<NSString *> *subpathComponents = [relativePathComponents subarrayWithRange:NSMakeRange(0, componentIndex + 1)];
NSString *subpathKey = [subpathComponents componentsJoinedByString:@"/"];
xar_file_t cachedFile = [fileTable[subpathKey] pointerValue];
if (cachedFile != NULL) {
lastParent = cachedFile;
} else {
xar_file_t newParent;
BOOL atLastIndex = (componentIndex == relativePathComponentsCount - 1);
NSString *lastPathComponent = subpathComponents.lastObject;
if (atLastIndex && filePath != nil) {
newParent = xar_add_frompath(x, lastParent, lastPathComponent.fileSystemRepresentation, filePath.fileSystemRepresentation);
} else {
newParent = xar_add_frombuffer(x, lastParent, lastPathComponent.fileSystemRepresentation, "", 1);
}
lastParent = newParent;
fileTable[subpathKey] = [NSValue valueWithPointer:newParent];
}
}
return lastParent;
}
BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchFile, SUBinaryDeltaMajorVersion majorVersion, BOOL verbose, NSError *__autoreleasing *error)
{
assert(source);
@@ -379,15 +439,12 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
// We should also not allow files with code signed extended attributes since Apple doesn't recommend inserting these
// inside an application, and since we don't preserve extended attribitutes anyway
mode_t permissions = [info[INFO_PERMISSIONS_KEY] unsignedShortValue];
mode_t permissions = [(NSNumber *)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)) {
@@ -417,7 +474,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
} else {
newTreeState[key] = info;
if (oldInfo && [oldInfo[INFO_TYPE_KEY] unsignedShortValue] == FTS_D && [info[INFO_TYPE_KEY] unsignedShortValue] != FTS_D) {
if (oldInfo && [(NSNumber *)oldInfo[INFO_TYPE_KEY] unsignedShortValue] == FTS_D && [(NSNumber *)info[INFO_TYPE_KEY] unsignedShortValue] != FTS_D) {
NSArray *parentPathComponents = key.pathComponents;
for (NSString *childPath in originalTreeState) {
@@ -470,8 +527,8 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
xar_subdoc_prop_set(attributes, MINOR_DIFF_VERSION_KEY, [[NSString stringWithFormat:@"%u", minorVersion] UTF8String]);
// Version 1 patches don't have a major or minor version field, so we need to differentiate between the hash keys
const char *beforeHashKey = MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) ? BEFORE_TREE_SHA1_KEY : BEFORE_TREE_SHA1_OLD_KEY;
const char *afterHashKey = MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) ? AFTER_TREE_SHA1_KEY : AFTER_TREE_SHA1_OLD_KEY;
const char *beforeHashKey = MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2) ? BEFORE_TREE_SHA1_KEY : BEFORE_TREE_SHA1_OLD_KEY;
const char *afterHashKey = MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2) ? AFTER_TREE_SHA1_KEY : AFTER_TREE_SHA1_OLD_KEY;
xar_subdoc_prop_set(attributes, beforeHashKey, [beforeHash UTF8String]);
xar_subdoc_prop_set(attributes, afterHashKey, [afterHash UTF8String]);
@@ -489,11 +546,14 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
return originalTreeState[key1] ? NSOrderedAscending : NSOrderedDescending;
}];
NSMutableDictionary<NSString *, NSValue *> *fileTable = [NSMutableDictionary dictionary];
for (NSString *key in keys) {
id value = [newTreeState valueForKey:key];
if ([value isEqual:[NSNull null]]) {
xar_file_t newFile = xar_add_frombuffer(x, 0, [key fileSystemRepresentation], (char *)"", 1);
if ([(NSObject *)value isEqual:[NSNull null]]) {
xar_file_t newFile = _xarAddFile(fileTable, x, key, NULL);
assert(newFile);
xar_prop_set(newFile, DELETE_KEY, "true");
@@ -506,30 +566,30 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
NSDictionary *originalInfo = originalTreeState[key];
NSDictionary *newInfo = newTreeState[key];
if (shouldSkipDeltaCompression(originalInfo, newInfo)) {
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) && shouldSkipExtracting(originalInfo, newInfo)) {
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2) && shouldSkipExtracting(originalInfo, newInfo)) {
if (shouldChangePermissions(originalInfo, newInfo)) {
xar_file_t newFile = xar_add_frombuffer(x, 0, [key fileSystemRepresentation], (char *)"", 1);
xar_file_t newFile = _xarAddFile(fileTable, x, key, NULL);
assert(newFile);
xar_prop_set(newFile, MODIFY_PERMISSIONS_KEY, [[NSString stringWithFormat:@"%u", [newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]] UTF8String]);
xar_prop_set(newFile, MODIFY_PERMISSIONS_KEY, [[NSString stringWithFormat:@"%u", [(NSNumber *)newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]] UTF8String]);
if (verbose) {
fprintf(stderr, "\n👮 %s %s (0%o -> 0%o)", VERBOSE_MODIFIED, [key fileSystemRepresentation], [originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue], [newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]);
fprintf(stderr, "\n👮 %s %s (0%o -> 0%o)", VERBOSE_MODIFIED, [key fileSystemRepresentation], [(NSNumber *)originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue], [(NSNumber *)newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]);
}
}
} else {
NSString *path = [destination stringByAppendingPathComponent:key];
xar_file_t newFile = xar_add_frompath(x, 0, [key fileSystemRepresentation], [path fileSystemRepresentation]);
xar_file_t newFile = _xarAddFile(fileTable, x, key, path);
assert(newFile);
if (shouldDeleteThenExtract(originalInfo, newInfo)) {
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2)) {
xar_prop_set(newFile, DELETE_KEY, "true");
} else {
xar_prop_set(newFile, DELETE_THEN_EXTRACT_OLD_KEY, "true");
}
}
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2)) {
xar_prop_set(newFile, EXTRACT_KEY, "true");
}
@@ -543,7 +603,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
}
} else {
NSNumber *permissions =
(MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) && shouldChangePermissions(originalInfo, newInfo)) ?
(MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2) && shouldChangePermissions(originalInfo, newInfo)) ?
newInfo[INFO_PERMISSIONS_KEY] :
nil;
CreateBinaryDeltaOperation *operation = [[CreateBinaryDeltaOperation alloc] initWithRelativePath:key oldTree:source newTree:destination oldPermissions:originalInfo[INFO_PERMISSIONS_KEY] newPermissions:permissions];
@@ -570,7 +630,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
fprintf(stderr, "\n🔨 %s %s", VERBOSE_DIFFED, [[operation relativePath] fileSystemRepresentation]);
}
xar_file_t newFile = xar_add_frompath(x, 0, [[operation relativePath] fileSystemRepresentation], [resultPath fileSystemRepresentation]);
xar_file_t newFile = _xarAddFile(fileTable, x, [operation relativePath], resultPath);
assert(newFile);
xar_prop_set(newFile, BINARY_DELTA_KEY, "true");
unlink([resultPath fileSystemRepresentation]);
@@ -588,7 +648,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]) {
+1 -1
View File
@@ -33,7 +33,7 @@
return [[path pathExtension] isEqualToString:@"delta"];
}
+ (BOOL)unsafeIfArchiveIsNotValidated
+ (BOOL)mustValidateBeforeExtraction
{
return YES;
}
+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
+12 -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;
@@ -41,6 +41,8 @@ extern NSString *const SUSkippedVersionKey;
extern NSString *const SUScheduledCheckIntervalKey;
extern NSString *const SULastCheckTimeKey;
extern NSString *const SUExpectsDSASignatureKey;
extern NSString *const SUExpectsEDSignatureKey;
extern NSString *const SUPublicEDKeyKey;
extern NSString *const SUPublicDSAKeyKey;
extern NSString *const SUPublicDSAKeyFileKey;
extern NSString *const SUAutomaticallyUpdateKey;
@@ -48,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;
@@ -59,23 +62,24 @@ 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;
extern NSString *const SUAppcastAttributeDSASignature;
extern NSString *const SUAppcastAttributeEDSignature;
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;
@@ -86,4 +90,6 @@ extern NSString *const SURSSElementLink;
extern NSString *const SURSSElementPubDate;
extern NSString *const SURSSElementTitle;
extern NSString *const SUXMLLanguage;
#endif
+8
View File
@@ -33,6 +33,8 @@ NSString *const SUSkippedVersionKey = @"SUSkippedVersion";
NSString *const SUScheduledCheckIntervalKey = @"SUScheduledCheckInterval";
NSString *const SULastCheckTimeKey = @"SULastCheckTime";
NSString *const SUExpectsDSASignatureKey = @"SUExpectsDSASignature";
NSString *const SUExpectsEDSignatureKey = @"SUExpectsEDSignatureKey";
NSString *const SUPublicEDKeyKey = @"SUPublicEDKey";
NSString *const SUPublicDSAKeyKey = @"SUPublicDSAKey";
NSString *const SUPublicDSAKeyFileKey = @"SUPublicDSAKeyFile";
NSString *const SUAutomaticallyUpdateKey = @"SUAutomaticallyUpdate";
@@ -40,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";
@@ -54,16 +57,19 @@ NSString *const SURelaunchToolNameKey = @"SURelaunchToolName";
NSString *const SUAppcastAttributeDeltaFrom = @"sparkle:deltaFrom";
NSString *const SUAppcastAttributeDSASignature = @"sparkle:dsaSignature";
NSString *const SUAppcastAttributeEDSignature = @"sparkle:edSignature";
NSString *const SUAppcastAttributeShortVersionString = @"sparkle:shortVersionString";
NSString *const SUAppcastAttributeVersion = @"sparkle:version";
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";
@@ -73,3 +79,5 @@ NSString *const SURSSElementEnclosure = @"enclosure";
NSString *const SURSSElementLink = @"link";
NSString *const SURSSElementPubDate = @"pubDate";
NSString *const SURSSElementTitle = @"title";
NSString *const SUXMLLanguage = @"xml:lang";
-37
View File
@@ -1,37 +0,0 @@
//
// SUDSAVerifier.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
// Includes code by Zach Waldowski on 10/18/13.
// Copyright 2014 Big Nerd Ranch. Licensed under MIT.
//
// Includes code from Plop by Mark Hamlin.
// Copyright 2011 Mark Hamlin. Licensed under BSD.
//
#ifndef SUDSAVERIFIER_H
#define SUDSAVERIFIER_H
#import <Foundation/Foundation.h>
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1090
@interface NSData (SUDSAVerifier)
- (id)initWithBase64Encoding:(NSString *)base64String;
@end
#endif
@interface SUDSAVerifier : NSObject
+ (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString;
- (instancetype)initWithPublicKeyData:(NSData *)data;
- (BOOL)verifyFileAtPath:(NSString *)path signature:(NSData *)signature;
- (BOOL)verifyStream:(NSInputStream *)stream signature:(NSData *)signature;
@end
#endif
-168
View File
@@ -1,168 +0,0 @@
//
// SUDSAVerifier.m
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
// Includes code by Zach Waldowski on 10/18/13.
// Copyright 2014 Big Nerd Ranch. Licensed under MIT.
//
// Includes code from Plop by Mark Hamlin.
// Copyright 2011 Mark Hamlin. Licensed under BSD.
//
#import "SUDSAVerifier.h"
#import "SULog.h"
#include <CommonCrypto/CommonDigest.h>
#include "AppKitPrevention.h"
@implementation SUDSAVerifier {
SecKeyRef _secKey;
}
+ (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString
{
if (!encodedSignature) {
SULog(SULogLevelError, @"There is no DSA signature to check");
return NO;
}
if (!path) {
return NO;
}
SUDSAVerifier *verifier = [(SUDSAVerifier *)[self alloc] initWithPublicKeyData:[pkeyString dataUsingEncoding:NSUTF8StringEncoding]];
if (!verifier) {
return NO;
}
NSString *strippedSignature = [encodedSignature stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
NSData *signature = [[NSData alloc] initWithBase64Encoding:strippedSignature];
return [verifier verifyFileAtPath:path signature:signature];
}
- (instancetype)initWithPublicKeyData:(NSData *)data
{
self = [super init];
if (!self || !data.length) {
SULog(SULogLevelError, @"Could not read public DSA key");
return nil;
}
SecExternalFormat format = kSecFormatOpenSSL;
SecExternalItemType itemType = kSecItemTypePublicKey;
CFArrayRef items = NULL;
OSStatus status = SecItemImport((__bridge CFDataRef)data, NULL, &format, &itemType, (SecItemImportExportFlags)0, NULL, NULL, &items);
if (status != errSecSuccess || !items) {
if (items) {
CFRelease(items);
}
SULog(SULogLevelError, @"Public DSA key could not be imported: %d", status);
return nil;
}
if (format == kSecFormatOpenSSL && itemType == kSecItemTypePublicKey && CFArrayGetCount(items) == 1) {
// Seems silly, but we can't quiet the warning about dropping CFTypeRef's const qualifier through
// any manner of casting I've tried, including interim explicit cast to void*. The -Wcast-qual
// warning is on by default with -Weverything and apparently became more noisy as of Xcode 7.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
_secKey = (SecKeyRef)CFRetain(CFArrayGetValueAtIndex(items, 0));
#pragma clang diagnostic pop
}
CFRelease(items);
return self;
}
- (void)dealloc
{
if (_secKey) {
CFRelease(_secKey);
}
}
- (BOOL)verifyFileAtPath:(NSString *)path signature:(NSData *)signature
{
if (!path.length) {
return NO;
}
NSInputStream *dataInputStream = [NSInputStream inputStreamWithFileAtPath:path];
return [self verifyStream:dataInputStream signature:signature];
}
- (BOOL)verifyStream:(NSInputStream *)stream signature:(NSData *)signature
{
if (!stream || !signature) {
return NO;
}
__block SecGroupTransformRef group = SecTransformCreateGroupTransform();
__block SecTransformRef dataReadTransform = NULL;
__block SecTransformRef dataDigestTransform = NULL;
__block SecTransformRef dataVerifyTransform = NULL;
__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);
return NO;
};
dataReadTransform = SecTransformCreateReadTransformWithReadStream((__bridge CFReadStreamRef)stream);
if (!dataReadTransform) {
SULog(SULogLevelError, @"File containing update archive could not be read (failed to create SecTransform for input stream)");
return cleanup();
}
dataDigestTransform = SecDigestTransformCreate(kSecDigestSHA1, CC_SHA1_DIGEST_LENGTH, NULL);
if (!dataDigestTransform) {
return cleanup();
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdirect-ivar-access"
dataVerifyTransform = SecVerifyTransformCreate(_secKey, (__bridge CFDataRef)signature, &error);
#pragma clang diagnostic pop
if (!dataVerifyTransform || error) {
SULog(SULogLevelError, @"Could not understand format of the signature: %@; Signature data: %@", error, signature);
return cleanup();
}
SecTransformConnectTransforms(dataReadTransform, kSecTransformOutputAttributeName, dataDigestTransform, kSecTransformInputAttributeName, group, &error);
if (error) {
SULog(SULogLevelError, @"%@", error);
return cleanup();
}
SecTransformConnectTransforms(dataDigestTransform, kSecTransformOutputAttributeName, dataVerifyTransform, kSecTransformInputAttributeName, group, &error);
if (error) {
SULog(SULogLevelError, @"%@", error);
return cleanup();
}
NSNumber *result = CFBridgingRelease(SecTransformExecute(group, &error));
if (error) {
SULog(SULogLevelError, @"DSA signature verification failed: %@", error);
return cleanup();
}
if (!result.boolValue) {
SULog(SULogLevelError, @"DSA signature does not match. Data of the update file being checked is different than data that has been signed, or the public key and the private key are not from the same set.");
}
cleanup();
return result.boolValue;
}
@end
+9 -9
View File
@@ -30,7 +30,7 @@
return [[path pathExtension] isEqualToString:@"dmg"];
}
+ (BOOL)unsafeIfArchiveIsNotValidated
+ (BOOL)mustValidateBeforeExtraction
{
return NO;
}
@@ -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
+15 -7
View File
@@ -7,6 +7,10 @@
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class SUPublicKeys;
@interface SUHost : NSObject
@property (strong, readonly) NSBundle *bundle;
@@ -16,16 +20,20 @@
@property (readonly, copy) NSString *name;
@property (readonly, copy) NSString *version;
@property (readonly, copy) NSString *displayVersion;
@property (getter=isRunningOnReadOnlyVolume, readonly) BOOL runningOnReadOnlyVolume;
@property (readonly, copy) NSString *publicDSAKey;
@property (readonly, nonatomic, copy) NSString *publicDSAKeyFileKey;
@property (readonly) SUPublicKeys *publicKeys;
- (id)objectForInfoDictionaryKey:(NSString *)key;
@property (getter=isRunningOnReadOnlyVolume, readonly) BOOL runningOnReadOnlyVolume;
@property (getter=isRunningTranslocated, readonly) BOOL runningTranslocated;
@property (readonly, nonatomic, copy, nullable) NSString *publicDSAKeyFileKey;
- (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
+51 -29
View File
@@ -10,10 +10,12 @@
#import "SUConstants.h"
#include <sys/mount.h> // For statfs for isRunningOnReadOnlyVolume
#import "SULog.h"
#import "SUSignatures.h"
#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,8 +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, nullable) NSString *publicDSAKey;
@end
@@ -38,8 +41,8 @@
- (instancetype)initWithBundle:(NSBundle *)aBundle
{
if ((self = [super init]))
{
if ((self = [super init]))
{
NSParameterAssert(aBundle);
self.bundle = aBundle;
if (![self.bundle bundleIdentifier]) {
@@ -68,7 +71,7 @@
return [self.bundle bundlePath];
}
- (NSString *__nonnull)name
- (NSString *)name
{
NSString *name;
@@ -77,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:@""])
@@ -93,7 +96,7 @@
return version;
}
- (NSString *__nonnull)displayVersion
- (NSString *)displayVersion
{
NSString *shortVersionString = [self objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
if (shortVersionString)
@@ -109,17 +112,29 @@
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];
}
- (NSString *__nullable)publicDSAKey
{
// 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;
}
@@ -135,12 +150,17 @@
return key;
}
- (SUPublicKeys *)publicKeys
{
return [[SUPublicKeys alloc] initWithDsa:[self publicDSAKey] ed:[self publicEDKey]];
}
- (NSString * __nullable)publicDSAKeyFileKey
{
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
@@ -164,7 +184,7 @@
return [(NSNumber *)[self objectForInfoDictionaryKey:key] boolValue];
}
- (id)objectForUserDefaultsKey:(NSString *)defaultName
- (nullable id)objectForUserDefaultsKey:(NSString *)defaultName
{
if (!defaultName || !self.defaultsDomain) {
return nil;
@@ -182,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);
}
@@ -205,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;
@@ -216,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];
}
@@ -236,3 +256,5 @@
}
@end
NS_ASSUME_NONNULL_END
Loaded 100 of 459 files, more files were not shown because too many files have changed in this diff. Show more