Compare commits

...
255 Commits
Author SHA1 Message Date
Sparkle-Bot 10d96f2b9b Update Package.swift and Sparkle.podspec for version 1.27.3 2024-05-12 23:43:54 +00:00
Zorg a9f370460a Update CHANGELOG for 1.27.3 2024-05-12 16:39:23 -07:00
Zorg d7db589432 Revert unarchiver code to how it used to work in generate_appcast (#2556)
Also remove temp directory before extraction.
2024-05-05 21:50:25 -07:00
Sparkle-Bot 56ad4aa3c8 Update Package.swift and Sparkle.podspec for version 1.27.2 2024-05-02 21:18:49 +00:00
Zorg b5350bf58f Update CHANGELOG for 1.27.2 2024-05-02 23:11:05 +02:00
Zorg bbe887e160 Extract archives in a separate directory from the input archive
This is ported from the 2.x branch.
2024-05-02 16:11:13 +02:00
trss f453625573 Fix incorrect xz log warning in make release (#2044) 2021-12-25 00:57:13 -08:00
Sparkle-Bot 7918c1c8fc Update Package.swift and Sparkle.podspec for version 1.27.1 2021-11-13 05:29:24 +00:00
Zorg 4875f83bea Update CHANGELOG 2021-11-12 21:17:23 -08:00
Zorg 43403a5068 Revert monotonic timer (1.x) (#2019) 2021-11-12 15:14:23 -08:00
Sparkle-Bot 4222fd6179 Update Package.swift and Sparkle.podspec for version 1.27.1-rc.2 2021-11-08 07:16:11 +00:00
Zorg 16c2f9b78b Fix create-draft-release not including pre-release suffix 2021-11-07 23:10:01 -08:00
Sparkle-Bot 26d30d7c2b Update Package.swift and Sparkle.podspec for version 1.27.1 2021-11-08 06:53:54 +00:00
Zorg b3b5f5f246 Update 1.27.1 Changelog 2021-11-07 20:12:23 -08:00
Zorg a49d83dc22 Prevent potential rapid update checks from sleep/wake events (#2000) 2021-11-07 17:16:09 -08: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
392 changed files with 9744 additions and 19627 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]
-10
View File
@@ -1,10 +0,0 @@
---
name: Other issues
about: Found a bug? Want to implement a new feature?
title: ''
labels: '1.x'
assignees: ''
---
-10
View File
@@ -1,10 +0,0 @@
---
name: Other issues related to Sparkle 2.x
about: Found a bug? Want to implement a new feature?
title: ''
labels: '2.x'
assignees: ''
---
+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]
+67
View File
@@ -0,0 +1,67 @@
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
- xcode: 'xcode13.1'
xcode-path: '/Applications/Xcode_13.1.app/Contents/Developer'
upload-dist: 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: 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 }}${{ github.event.inputs.prereleaseSuffix }}"
- 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 }}${{ github.event.inputs.prereleaseSuffix }}"
tag_name: "${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
fail_on_unmatched_files: true
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
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
+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
+98
View File
@@ -1,3 +1,101 @@
# 1.27.3
* Create and use temp extraction directory in generate_appcast again (#2556) (Zorg)
# 1.27.2
* Extract archives in a separate directory from the input archive (#2552) (Zorg)
* Fix incorrect xz log warning in make release (#2044) (trss)
# 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 from #1991 (Zorg)
* Whitelist about:srcdoc as a safe web URL from #1938, #2007 (Louis Pontoise, Zorg)
* Backport not hiding update window on deactivation from #2008 (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)
+18 -11
View File
@@ -15,23 +15,33 @@ 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 = 23
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
SPARKLE_VERSION_MINOR = 27
SPARKLE_VERSION_PATCH = 3
// This should be in SemVer format or empty, ie. "-rc.1"
// These variables must have a space after the '=' too
SPARKLE_VERSION_SUFFIX =
// This is now a monotonically increasing ID number, even across prereleases, but let's keep this below 2.0
CURRENT_PROJECT_VERSION = 1.108
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
@@ -55,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
@@ -81,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
+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
+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)
+115 -10
View File
@@ -1,28 +1,45 @@
#!/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
@@ -32,11 +49,99 @@ if [ "$ACTION" = "" ] ; then
cp -R "$CONFIGURATION_BUILD_DIR/generate_keys.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/sign_update.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
fi
cp -R "$CONFIGURATION_BUILD_DIR/staging/bin" "$CONFIGURATION_BUILD_DIR/staging-spm"
cd "$CONFIGURATION_BUILD_DIR/staging"
if [ -x "$(command -v xz)" ]; then
XZ_EXISTS=1
else
XZ_EXISTS=0
fi
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" -ne 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
+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.3"
// 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.3"
let checksum = "f0c6b4e6ffc6269a67b0d4ff254e3e8acfc6b3852db7b9957d4c0a5b39044446"
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
)
]
)
+5 -5
View File
@@ -1,10 +1,10 @@
# Sparkle 1.x [![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.
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
@@ -23,10 +23,10 @@ The upcoming Sparkle 2 (currently in beta) can be found in the [2.x branch](http
## Requirements
* Runtime: macOS 10.7 or greater
* Build: Xcode 9 and 10.11 SDK or greater
* Runtime: macOS 10.9 or greater
* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less; at least Xcode 12 if using Swift Package Manager.
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
* No sandboxing. Sparkle 1.x can't update sandboxed apps. [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
* No sandboxing. Sparkle 1.x can't update sandboxed apps. However, [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
## Usage
+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 -12
View File
@@ -6,36 +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>
<!-- Sparkle 1.21+ uses sparkle::edSignature="ed25519" instead of sparkle::dsaSignature="deprecated DSA" -->
<enclosure url="http://you.com/app/Your%20Great%20App%202.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<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>
<!-- Sparkle 1.21+ uses sparkle::edSignature="ed25519" instead of sparkle::dsaSignature="deprecated DSA" -->
<enclosure url="http://you.com/app/Your%20Great%20App%201.5.zip" sparkle:version="1.5" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<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>
<!-- Sparkle 1.21+ uses sparkle::edSignature="ed25519" instead of sparkle::dsaSignature="deprecated DSA" -->
<enclosure url="http://you.com/app/Your%20Great%20App%201.4.zip" sparkle:version="241" sparkle:shortVersionString="1.4" sparkle:dsaSignature="MC0CFBfeCa1JyW30nbkBwainOzrN6EQuAh=" length="1472349" type="application/octet-stream" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<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>
+6 -6
View File
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "1.22.0"
s.version = "1.27.3"
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,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>
@@ -94,4 +94,4 @@
"You already have the newest version of %@." = "You already have the newest version of %@.";
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
"You're up-to-date!" = "You’re up-to-date!";
"You're up-to-date!" = "You’re up to date!";
+2 -2
View File
@@ -21,7 +21,7 @@ if sparkleRoot == nil || htmlPath == nil {
die("Missing arguments")
}
let enStringsPath = sparkleRoot! + "/Sparkle/en.lproj/Sparkle.strings"
let enStringsPath = sparkleRoot! + "/Sparkle/Base.lproj/Sparkle.strings"
let enStringsDict = NSDictionary(contentsOfFile: enStringsPath)
if enStringsDict == nil {
die("Invalid English strings")
@@ -51,7 +51,7 @@ head.addChild(XMLElement(name: "style", stringValue: css))
let locale = Locale.current
for dirEntry in dirContents {
if NSString(string: dirEntry).pathExtension != "lproj" || dirEntry == "en.lproj" {
if NSString(string: dirEntry).pathExtension != "lproj" || dirEntry == "Base.lproj" || dirEntry == "en.lproj" {
continue
}
-9
View File
@@ -1,9 +0,0 @@
html {
color: #FFFFFFD8;
}
:link {
color: #419CFF;
}
:link:active {
color: #FF1919;
}
-7
View File
@@ -53,9 +53,6 @@ static NSString *SPUDownloadMIMETypeKey = @"SPUDownloadMIMEType";
- (nullable instancetype)initWithCoder:(NSCoder *)decoder
{
if (SUAVAILABLE(10, 8)) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
NSData *data = [decoder decodeObjectOfClass:[NSData class] forKey:SPUDownloadDataKey];
if (data == nil) {
return nil;
@@ -64,12 +61,8 @@ static NSString *SPUDownloadMIMETypeKey = @"SPUDownloadMIMEType";
NSString *textEncodingName = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadTextEncodingKey];
NSString *MIMEType = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadMIMETypeKey];
#pragma clang diagnostic pop
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
-168
View File
@@ -1,168 +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];
[self cleanup];
}
- (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
-7
View File
@@ -73,20 +73,13 @@ static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServ
- (instancetype)initWithCoder:(NSCoder *)decoder
{
if (SUAVAILABLE(10, 8)) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
NSURL *url = [decoder decodeObjectOfClass:[NSURL class] forKey:SPUURLRequestURLKey];
NSURLRequestCachePolicy cachePolicy = (NSURLRequestCachePolicy)[decoder decodeIntegerForKey:SPUURLRequestCachePolicyKey];
NSTimeInterval timeoutInterval = [decoder decodeDoubleForKey:SPUURLRequestTimeoutIntervalKey];
NSDictionary<NSString *, NSString *> *httpHeaderFields = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class]]] forKey:SPUURLRequestHttpHeaderFieldsKey];
#pragma clang diagnostic pop
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 (SUAVAILABLE(10, 9)) {
#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
+4
View File
@@ -10,6 +10,9 @@
#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>
@@ -34,6 +37,7 @@ SU_EXPORT @interface SUAppcastItem : NSObject
@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;
+7 -3
View File
@@ -29,6 +29,7 @@
@property (strong, readwrite) NSURL *infoURL;
@property (readwrite, copy) NSDictionary *propertiesDictionary;
@property (copy, readwrite) NSNumber* phasedRolloutInterval;
@property (copy, readwrite) NSString *minimumAutoupdateVersion;
@end
@implementation SUAppcastItem
@@ -48,6 +49,7 @@
@synthesize osString;
@synthesize propertiesDictionary;
@synthesize phasedRolloutInterval;
@synthesize minimumAutoupdateVersion;
- (BOOL)isDeltaUpdate
{
@@ -139,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";
@@ -154,7 +156,7 @@
}
return nil;
}
if (enclosureURLString) {
NSString *enclosureLengthString = [enclosure objectForKey:SURSSAttributeLength];
long long contentLength = 0;
@@ -189,7 +191,7 @@
self.displayVersionString = self.versionString;
}
NSString* enclosureRolloutIntervalString = [enclosure objectForKey:SUAppcastAttributePhasedRolloutInterval];
NSString* enclosureRolloutIntervalString = [dict objectForKey:SUAppcastElementPhasedRolloutInterval];
if(enclosureRolloutIntervalString) {
self.phasedRolloutInterval = @(enclosureRolloutIntervalString.integerValue);
}
@@ -225,6 +227,8 @@
}
self.deltaUpdates = deltas;
}
self.minimumAutoupdateVersion = [dict objectForKey:SUAppcastElementMinimumAutoupdateVersion];
}
return self;
}
+7 -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];
}
@@ -179,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];
@@ -234,4 +233,9 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
}
}
- (BOOL)usesPhasedRollout
{
return YES;
}
@end
+2
View File
@@ -25,7 +25,9 @@
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
- (BOOL)isItemNewer:(SUAppcastItem *)ui;
- (BOOL)itemPreventsAutoupdate:(SUAppcastItem *)ui;
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui;
- (BOOL)usesPhasedRollout;
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui;
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui;
- (void)appcastDidFinishLoading:(SUAppcast *)ac;
+108 -33
View File
@@ -25,10 +25,12 @@
#import "SUUpdater.h"
#import "SUAppcast.h"
#import "SUAppcastItem.h"
#import "SUGlobalUpdateLock.h"
#import "SUSystemUpdateInfo.h"
#import "SPUURLRequest.h"
#import "SPUDownloaderDeprecated.h"
#import "SPUDownloaderSession.h"
#import "SPULocalCacheDirectory.h"
@interface SUBasicUpdateDriver ()
@@ -37,6 +39,7 @@
@property (assign) NSComparisonResult latestAppcastItemComparisonResult;
@property (strong) SPUDownloader *download;
@property (copy) NSString *downloadPath;
@property (copy) NSString *extractionDirectory;
@property (strong) SUAppcastItem *nonDeltaUpdateItem;
@property (copy) NSString *tempDir;
@@ -53,6 +56,7 @@
@synthesize latestAppcastItemComparisonResult;
@synthesize download;
@synthesize downloadPath;
@synthesize extractionDirectory = _extractionDirectory;
@synthesize nonDeltaUpdateItem;
@synthesize tempDir;
@@ -63,8 +67,8 @@
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
{
[super checkForUpdatesAtURL:URL host:aHost];
if ([aHost isRunningOnReadOnlyVolume])
{
if ([aHost isRunningOnReadOnlyVolume])
{
NSString *hostName = [aHost name];
if ([aHost isRunningTranslocated])
{
@@ -118,13 +122,17 @@
- (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 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 || (
[item.date compare:candidate.date] == NSOrderedAscending &&
[comparator compareVersion:item.versionString toVersion:candidate.versionString] != NSOrderedDescending
)
!item
|| (order = [comparator compareVersion:item.versionString toVersion:candidate.versionString]) == NSOrderedAscending
|| (order == NSOrderedSame && [item.date compare:candidate.date] != NSOrderedDescending)
) {
item = candidate;
}
@@ -141,10 +149,38 @@
return item;
}
- (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;
}
@@ -170,10 +206,15 @@
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;
}
@@ -235,6 +276,13 @@
{
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:)]) {
@@ -297,6 +345,9 @@
[[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]];
@@ -304,22 +355,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 (SUAVAILABLE(10, 9)) {
#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];
@@ -330,6 +386,7 @@
{
self.tempDir = temporaryDirectory;
self.downloadPath = [temporaryDirectory stringByAppendingPathComponent:destinationName];
self.extractionDirectory = [SPULocalCacheDirectory createUniqueDirectoryInDirectory:temporaryDirectory];
}
- (void)downloaderDidReceiveExpectedContentLength:(int64_t)__unused expectedContentLength
@@ -346,6 +403,12 @@
{
// 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];
@@ -382,22 +445,30 @@
- (void)extractUpdate
{
id<SUUpdaterPrivate> updater = self.updater;
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:self.downloadPath updatingHostBundlePath:self.host.bundlePath decryptionPassword:updater.decryptionPassword];
BOOL success = NO;
if (!unarchiver) {
SULog(SULogLevelError, @"Error: No valid unarchiver for %@!", self.downloadPath);
id<SUUpdaterPrivate> updater = self.updater;
id<SUUnarchiverProtocol> unarchiver;
if (self.extractionDirectory == nil) {
SULog(SULogLevelError, @"Error: Failed to create temporary extraction directory for %@!", self.downloadPath);
unarchiver = nil;
} 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] mustValidateBeforeExtraction];
if (needsPrevalidation) {
success = [self.updateValidator validateDownloadPath];
unarchiver = [SUUnarchiver unarchiverForPath:self.downloadPath extractionDirectory:self.extractionDirectory updatingHostBundlePath:self.host.bundlePath decryptionPassword:updater.decryptionPassword];
if (!unarchiver) {
SULog(SULogLevelError, @"Error: No valid unarchiver for %@!", self.downloadPath);
} else {
success = YES;
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] mustValidateBeforeExtraction];
if (needsPrevalidation) {
success = [self.updateValidator validateDownloadPath];
} else {
success = YES;
}
}
}
@@ -501,8 +572,9 @@
{
assert(self.updateItem);
assert(self.updateValidator);
assert(self.extractionDirectory);
BOOL validationCheckSuccess = [self.updateValidator validateWithUpdateDirectory:self.tempDir];
BOOL validationCheckSuccess = [self.updateValidator validateWithUpdateDirectory:self.extractionDirectory];
if (!validationCheckSuccess) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil),
@@ -673,6 +745,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);
+5 -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,7 +179,7 @@ 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.
+95 -32
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,7 +439,7 @@ 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) {
@@ -414,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) {
@@ -467,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]);
@@ -486,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");
@@ -503,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");
}
@@ -540,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];
@@ -567,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]);
+1 -1
View File
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUBinaryDeltaUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath;
@end
+5 -2
View File
@@ -20,6 +20,7 @@
@property (nonatomic, copy, readonly) NSString *archivePath;
@property (nonatomic, copy, readonly) NSString *updateHostBundlePath;
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
@end
@@ -27,6 +28,7 @@
@synthesize archivePath = _archivePath;
@synthesize updateHostBundlePath = _updateHostBundlePath;
@synthesize extractionDirectory = _extractionDirectory;
+ (BOOL)canUnarchivePath:(NSString *)path
{
@@ -73,12 +75,13 @@
}
}
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_updateHostBundlePath = [updateHostBundlePath copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -96,7 +99,7 @@
- (void)extractDeltaWithNotifier:(SUUnarchiverNotifier *)notifier
{
NSString *sourcePath = self.updateHostBundlePath;
NSString *targetPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
NSString *targetPath = [self.extractionDirectory stringByAppendingPathComponent:[sourcePath lastPathComponent]];
NSError *applyDiffError = nil;
BOOL success = applyBinaryDelta(sourcePath, targetPath, self.archivePath, NO, ^(double progress){
+6 -5
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;
@@ -62,7 +62,7 @@ extern NSString *const SUNormalizeInstalledApplicationNameKey __attribute__((dep
extern NSString *const SURelaunchToolNameKey __attribute__((deprecated("This key is obsolete. SPARKLE_RELAUNCH_TOOL_NAME.")));
// -----------------------------------------------------------------------------
// Appcast keys::
// Appcast keys::
// -----------------------------------------------------------------------------
extern NSString *const SUAppcastAttributeDeltaFrom;
@@ -71,14 +71,15 @@ extern NSString *const SUAppcastAttributeEDSignature;
extern NSString *const SUAppcastAttributeShortVersionString;
extern NSString *const SUAppcastAttributeVersion;
extern NSString *const SUAppcastAttributeOsType;
extern NSString *const SUAppcastAttributePhasedRolloutInterval;
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;
+2 -1
View File
@@ -61,14 +61,15 @@ NSString *const SUAppcastAttributeEDSignature = @"sparkle:edSignature";
NSString *const SUAppcastAttributeShortVersionString = @"sparkle:shortVersionString";
NSString *const SUAppcastAttributeVersion = @"sparkle:version";
NSString *const SUAppcastAttributeOsType = @"sparkle:os";
NSString *const SUAppcastAttributePhasedRolloutInterval = @"sparkle:phasedRolloutInterval";
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";
+1 -1
View File
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUDiskImageUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword;
@end
+13 -10
View File
@@ -17,6 +17,7 @@
@property (nonatomic, copy, readonly) NSString *archivePath;
@property (nullable, nonatomic, copy, readonly) NSString *decryptionPassword;
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
@end
@@ -24,6 +25,7 @@
@synthesize archivePath = _archivePath;
@synthesize decryptionPassword = _decryptionPassword;
@synthesize extractionDirectory = _extractionDirectory;
+ (BOOL)canUnarchivePath:(NSString *)path
{
@@ -35,12 +37,13 @@
return NO;
}
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_decryptionPassword = [decryptionPassword copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -56,7 +59,7 @@
// Called on a non-main thread.
- (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier
{
@autoreleasepool {
@autoreleasepool {
BOOL mountedSuccessfully = NO;
// get a unique mount point path
@@ -65,7 +68,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 +138,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,10 +158,10 @@
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];
NSString *toPath = [self.extractionDirectory stringByAppendingPathComponent:item];
// We skip any files in the DMG which are not readable.
if (![manager isReadableFileAtPath:fromPath]) {
@@ -169,8 +172,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;
}
}
+1
View File
@@ -30,6 +30,7 @@ typedef NS_ENUM(OSStatus, SUError) {
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 extractionDirectory:(NSString *)extractionDirectory;
@end
NS_ASSUME_NONNULL_END
+79
View File
@@ -0,0 +1,79 @@
//
// 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;
@property (nonatomic, readonly, copy) NSString *extractionDirectory;
@end
@implementation SUFlatPackageUnarchiver
@synthesize flatPackagePath = _flatPackagePath;
@synthesize extractionDirectory = _extractionDirectory;
+ (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 extractionDirectory:(NSString *)extractionDirectory
{
self = [super init];
if (self != nil) {
_flatPackagePath = [flatPackagePath copy];
_extractionDirectory = [extractionDirectory 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 {
// Copying the flat package should be very fast, especially on APFS
NSError *copyError = nil;
if (![[NSFileManager defaultManager] copyItemAtPath:self.flatPackagePath toPath:[self.extractionDirectory stringByAppendingPathComponent:self.flatPackagePath.lastPathComponent] error:&copyError]) {
NSMutableDictionary *userInfoDictionary = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package (%@) cannot be copied to extraction directory (%@)", self.flatPackagePath, self.extractionDirectory]}];
if (copyError != nil) {
userInfoDictionary[NSUnderlyingErrorKey] = copyError;
}
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:userInfoDictionary]];
} 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
+20 -20
View File
@@ -41,8 +41,8 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithBundle:(NSBundle *)aBundle
{
if ((self = [super init]))
{
if ((self = [super init]))
{
NSParameterAssert(aBundle);
self.bundle = aBundle;
if (![self.bundle bundleIdentifier]) {
@@ -80,10 +80,10 @@ NS_ASSUME_NONNULL_BEGIN
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];
}
@@ -128,13 +128,13 @@ NS_ASSUME_NONNULL_BEGIN
{
// 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;
}
@@ -204,12 +204,12 @@ NS_ASSUME_NONNULL_BEGIN
// Note this handles nil being passed for defaultName, in which case the user default will be removed
- (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);
}
@@ -225,10 +225,10 @@ NS_ASSUME_NONNULL_BEGIN
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;
@@ -236,12 +236,12 @@ NS_ASSUME_NONNULL_BEGIN
- (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);
}
+28 -13
View File
@@ -20,15 +20,6 @@
@implementation SUInstaller
+ (BOOL)isAliasFolderAtPath:(NSString *)path
{
NSNumber *aliasFlag = nil;
[[NSURL fileURLWithPath:path] getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:nil];
NSNumber *directoryFlag = nil;
[[NSURL fileURLWithPath:path] getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:nil];
return aliasFlag.boolValue && directoryFlag.boolValue;
}
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(nullable BOOL *)isGuidedPtr
{
NSParameterAssert(inUpdateFolder);
@@ -47,6 +38,34 @@
while ((currentFile = [dirEnum nextObject])) {
NSString *currentPath = [inUpdateFolder stringByAppendingPathComponent:currentFile];
// Ignore all symbolic links and aliases
{
NSURL *currentPathURL = [NSURL fileURLWithPath:currentPath];
NSNumber *symbolicLinkFlag = nil;
[currentPathURL getResourceValue:&symbolicLinkFlag forKey:NSURLIsSymbolicLinkKey error:NULL];
if (symbolicLinkFlag.boolValue) {
// NSDirectoryEnumerator won't recurse into symlinked directories
continue;
}
NSNumber *aliasFlag = nil;
[currentPathURL getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:NULL];
if (aliasFlag.boolValue) {
NSNumber *directoryFlag = nil;
[currentPathURL getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:NULL];
// Some DMGs have symlinks into /Applications! That's no good!
if (directoryFlag.boolValue) {
[dirEnum skipDescendents];
}
continue;
}
}
NSString *currentFilename = [currentFile lastPathComponent];
NSString *currentExtension = [currentFile pathExtension];
NSString *currentFilenameNoExtension = [currentFilename stringByDeletingPathExtension];
@@ -76,10 +95,6 @@
break;
}
}
// Some DMGs have symlinks into /Applications! That's no good!
if ([self isAliasFolderAtPath:currentPath])
[dirEnum skipDescendents];
}
// We don't have a valid path. Try to use the fallback package.
+2
View File
@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
// Should be thread safe
- (NSString *)installationPath;
- (BOOL)supportsDeterminateProgress;
@end
NS_ASSUME_NONNULL_END
+20
View File
@@ -0,0 +1,20 @@
//
// SULegacyWebView.h
// Sparkle
//
// Created by Mayur Pawashe on 12/30/20.
// Copyright © 2020 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SUWebView.h"
NS_ASSUME_NONNULL_BEGIN
@interface SULegacyWebView : NSObject <SUWebView>
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled;
@end
NS_ASSUME_NONNULL_END
+179
View File
@@ -0,0 +1,179 @@
//
// SULegacyWebView.m
// Sparkle
//
// Created by Mayur Pawashe on 12/30/20.
// Copyright © 2020 Sparkle Project. All rights reserved.
//
#import "SULegacyWebView.h"
#import "SUWebViewCommon.h"
#import "SULog.h"
#import <WebKit/WebKit.h>
// WebKit protocols are not explicitly declared until 10.11 SDK, so
// declare dummy protocols to keep the build working on earlier SDKs.
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101100
@protocol WebFrameLoadDelegate <NSObject>
@end
@protocol WebPolicyDelegate <NSObject>
@end
@protocol WebUIDelegate <NSObject>
@end
#endif
@interface SULegacyWebView () <WebPolicyDelegate, WebFrameLoadDelegate, WebUIDelegate>
@property (nonatomic, readonly) WebView *webView;
@property (nonatomic) void (^completionHandler)(NSError * _Nullable);
@end
@implementation SULegacyWebView
@synthesize webView = _webView;
@synthesize completionHandler = _completionHandler;
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled
{
self = [super init];
if (self != nil) {
_webView = [[WebView alloc] initWithFrame:NSZeroRect];
WebPreferences *preferences = [[WebPreferences alloc] initWithIdentifier:@"sparkle-project.org.legacy-web-view"];
preferences.autosaves = NO;
preferences.javaScriptEnabled = javaScriptEnabled;
preferences.javaEnabled = NO;
preferences.plugInsEnabled = NO;
// Mimicking settings when WebView used to be in SUUpdateAlert nib
preferences.loadsImagesAutomatically = YES;
preferences.allowsAnimatedImages = YES;
preferences.allowsAnimatedImageLooping = YES;
// Settings for default style
preferences.userStyleSheetEnabled = YES;
preferences.userStyleSheetLocation = colorStyleSheetLocation;
preferences.standardFontFamily = fontFamily;
preferences.defaultFontSize = fontPointSize;
_webView.preferences = preferences;
_webView.policyDelegate = self;
_webView.frameLoadDelegate = self;
_webView.UIDelegate = self;
}
return self;
}
- (NSView *)view
{
return self.webView;
}
- (void)loadHTMLString:(NSString *)htmlString baseURL:(NSURL * _Nullable)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler
{
self.completionHandler = [completionHandler copy];
[[self.webView mainFrame] loadHTMLString:htmlString baseURL:baseURL];
}
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName baseURL:(NSURL *)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler
{
self.completionHandler = [completionHandler copy];
[[self.webView mainFrame] loadData:data MIMEType:MIMEType textEncodingName:textEncodingName baseURL:baseURL];
}
- (void)loadRequest:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSError * _Nullable))completionHandler
{
self.completionHandler = [completionHandler copy];
[[self.webView mainFrame] loadRequest:urlRequest];
}
- (void)stopLoading
{
self.completionHandler = nil;
[self.webView stopLoading:self];
}
- (void)setDrawsBackground:(BOOL)drawsBackground
{
self.webView.drawsBackground = drawsBackground;
}
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
if ([frame parentFrame] == nil) {
if (self.completionHandler != nil) {
self.completionHandler(nil);
self.completionHandler = nil;
}
[sender display]; // necessary to prevent weird scroll bar artifacting
}
}
- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
{
if ([frame parentFrame] == nil) {
if (self.completionHandler != nil) {
self.completionHandler(error);
self.completionHandler = nil;
}
}
}
- (void)webView:(WebView *)__unused sender decidePolicyForNavigationAction:(NSDictionary *)__unused actionInformation request:(NSURLRequest *)request frame:(WebFrame *)__unused frame decisionListener:(id<WebPolicyDecisionListener>)listener
{
NSURL *requestURL = request.URL;
BOOL isAboutBlank = NO;
BOOL safeURL = SUWebViewIsSafeURL(requestURL, &isAboutBlank);
// Do not allow redirects to dangerous protocols such as file://
if (!safeURL) {
SULog(SULogLevelDefault, @"Blocked display of %@ URL which may be dangerous", requestURL.scheme);
[listener ignore];
return;
}
// Ensure we are finished loading
if (self.completionHandler == nil) {
if (requestURL && !isAboutBlank) {
[[NSWorkspace sharedWorkspace] openURL:requestURL];
}
[listener ignore];
}
else {
[listener use];
}
}
// Clean up the contextual menu.
- (NSArray *)webView:(WebView *)__unused sender contextMenuItemsForElement:(NSDictionary *)__unused element defaultMenuItems:(NSArray *)defaultMenuItems
{
NSMutableArray *webViewMenuItems = [defaultMenuItems mutableCopy];
if (webViewMenuItems)
{
for (NSMenuItem *menuItem in defaultMenuItems)
{
NSInteger tag = [menuItem tag];
switch (tag)
{
case WebMenuItemTagOpenLinkInNewWindow:
case WebMenuItemTagDownloadLinkToDisk:
case WebMenuItemTagOpenImageInNewWindow:
case WebMenuItemTagDownloadImageToDisk:
case WebMenuItemTagOpenFrameInNewWindow:
case WebMenuItemTagGoBack:
case WebMenuItemTagGoForward:
case WebMenuItemTagStop:
case WebMenuItemTagReload:
[webViewMenuItems removeObjectIdenticalTo:menuItem];
}
}
}
return webViewMenuItems;
}
@end
+1 -1
View File
@@ -63,7 +63,7 @@ void SULog(SULogLevel level, NSString *format, ...)
}
NSString *displayName = [[NSFileManager defaultManager] displayNameAtPath:mainBundle.bundlePath];
client = asl_open([displayName stringByAppendingString:@" [Sparkle " TO_STRING(SPARKLE_VERSION) "]"].UTF8String, SPARKLE_BUNDLE_IDENTIFIER, options);
client = asl_open([displayName stringByAppendingString:@" [Sparkle " TO_STRING(MARKETING_VERSION) "]"].UTF8String, SPARKLE_BUNDLE_IDENTIFIER, options);
queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
}
});
+5
View File
@@ -78,4 +78,9 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open";
return NO;
}
- (BOOL)supportsDeterminateProgress
{
return NO;
}
@end
+1 -1
View File
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUPipedUnarchiver : NSObject <SUUnarchiverProtocol>
- (instancetype)initWithArchivePath:(NSString *)archivePath;
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory;
@end
+6 -3
View File
@@ -17,12 +17,14 @@
@interface SUPipedUnarchiver ()
@property (nonatomic, copy, readonly) NSString *archivePath;
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
@end
@implementation SUPipedUnarchiver
@synthesize archivePath = _archivePath;
@synthesize extractionDirectory = _extractionDirectory;
+ (nullable NSArray <NSString *> *)commandAndArgumentsConformingToTypeOfPath:(NSString *)path
{
@@ -63,11 +65,12 @@
return NO;
}
- (instancetype)initWithArchivePath:(NSString *)archivePath
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory
{
self = [super init];
if (self != nil) {
_archivePath = [archivePath copy];
_extractionDirectory = [extractionDirectory copy];
}
return self;
}
@@ -92,9 +95,9 @@
- (void)extractArchivePipingDataToCommand:(NSString *)command arguments:(NSArray*)args notifier:(SUUnarchiverNotifier *)notifier
{
// *** GETS CALLED ON NON-MAIN THREAD!!!
@autoreleasepool {
@autoreleasepool {
NSError *error = nil;
NSString *destination = [self.archivePath stringByDeletingLastPathComponent];
NSString *destination = self.extractionDirectory;
SULog(SULogLevelDefault, @"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], self.archivePath, destination);
+6 -3
View File
@@ -208,15 +208,13 @@
if (progress) {
progress(9/10.0);
}
// Try to preserve Finder tags. Failure can be accepted without complaint as previous Sparkle versions did not do this at all
if (SUAVAILABLE(10, 9)) {
NSArray *resourceTags;
BOOL success = [oldTempURL getResourceValue:&resourceTags forKey:NSURLTagNamesKey error:NULL];
if (success && resourceTags.count) {
[installationURL setResourceValue:resourceTags forKey:NSURLTagNamesKey error:NULL];
}
}
// From here on out, we don't really need to bring up authorization if we haven't done so prior
SUFileManager *constrainedFileManager = [fileManager fileManagerByPreservingAuthorizationRights];
@@ -267,4 +265,9 @@
return YES;
}
- (BOOL)supportsDeterminateProgress
{
return YES;
}
@end
+3 -30
View File
@@ -10,13 +10,8 @@
#import "SUUpdaterPrivate.h"
#import "SUUpdaterDelegate.h"
#import "SUSystemUpdateInfo.h"
#import "SUAppcastItem.h"
@interface SUScheduledUpdateDriver ()
- (BOOL)isItemReadyForPhasedRollout:(SUAppcastItem *)ui;
@end
@implementation SUScheduledUpdateDriver
- (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)anUpdater
@@ -27,26 +22,9 @@
return self;
}
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui {
return [super hostSupportsItem:ui] && [self isItemReadyForPhasedRollout:ui];
}
- (BOOL)isItemReadyForPhasedRollout:(SUAppcastItem *)ui {
if([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)usesPhasedRollout
{
return YES;
}
- (void)didFindValidUpdate
@@ -83,9 +61,4 @@
return [super shouldShowUpdateAlertForItem:item];
}
- (void)downloaderDidFinishWithTemporaryDownloadData:(SPUDownloadData * _Nullable) downloadData {
[SUSystemUpdateInfo setNewUpdateGroupIdentifierForHost:self.host]; // use new update group next time
[super downloaderDidFinishWithTemporaryDownloadData:downloadData];
}
@end
+10 -12
View File
@@ -103,7 +103,8 @@
const unsigned char *edPubKey = self.pubKeys.ed25519PubKey;
if (edPubKey && !edSignature) {
SULog(SULogLevelDefault, @"There is no EdDSA signature in the update, but the app is capable of verifying them");
SULog(SULogLevelError, @"The app has an EdDSA public key, but there is no EdDSA signature in the update, so the update will be rejected.");
return NO;
} if (!edPubKey && edSignature) {
SULog(SULogLevelDefault, @"The update has an EdDSA signature, but it won't be used, because the old app doesn't have an EdDSA public key");
} else if (edPubKey && edSignature) {
@@ -114,12 +115,9 @@
return NO;
}
if (ed25519_verify(edSignature, data.bytes, data.length, edPubKey)) {
// No need to check DSA when EdDSA verification succeeded
SULog(SULogLevelDefault, @"OK: EdDSA signature is correct");
if (!dsaPubKey) {
return YES;
} else {
SULog(SULogLevelDefault, @"This app has a DSA public key, so a DSA signature is required too");
}
return YES;
} else {
SULog(SULogLevelError, @"EdDSA 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.");
if (dsaSignature) {
@@ -159,13 +157,13 @@
__block CFErrorRef error = NULL;
BOOL (^cleanup)(void) = ^{
if (group) CFRelease(group);
if (dataReadTransform) CFRelease(dataReadTransform);
if (dataDigestTransform) CFRelease(dataDigestTransform);
if (dataVerifyTransform) CFRelease(dataVerifyTransform);
if (error) CFRelease(error);
if (group) CFRelease(group);
if (dataReadTransform) CFRelease(dataReadTransform);
if (dataDigestTransform) CFRelease(dataDigestTransform);
if (dataVerifyTransform) CFRelease(dataVerifyTransform);
if (error) CFRelease(error);
if (dsaPubKeySecKey) CFRelease(dsaPubKeySecKey);
return NO;
return NO;
};
dataReadTransform = SecTransformCreateReadTransformWithReadStream((__bridge CFReadStreamRef)stream);
+1 -1
View File
@@ -19,7 +19,7 @@ static NSData *decode(NSString *str) {
}
NSString *stripped = [str stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
return [[NSData alloc] initWithBase64Encoding:stripped];
return [[NSData alloc] initWithBase64EncodedString:stripped options:0];
}
- (instancetype)initWithDsa:(NSString * _Nullable)maybeDsa ed:(NSString * _Nullable)maybeEd25519
+12 -11
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19455" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19455"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SUStatusController">
@@ -20,13 +20,13 @@
<windowStyleMask key="styleMask" titled="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="200" y="222" width="400" height="107"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
<value key="minSize" type="size" width="213" height="107"/>
<view key="contentView" id="6">
<rect key="frame" x="0.0" y="0.0" width="400" height="107"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView id="7">
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7">
<rect key="frame" x="24" y="28" width="64" height="64"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="NSApplicationIcon" id="53"/>
@@ -34,7 +34,7 @@
<binding destination="-2" name="value" keyPath="applicationIcon" id="9"/>
</connections>
</imageView>
<textField verticalHuggingPriority="750" id="8">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8">
<rect key="frame" x="106" y="75" width="277" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Status Text (set by loc. string in code)" id="54">
@@ -46,7 +46,7 @@
<binding destination="-2" name="value" keyPath="title" id="26"/>
</connections>
</textField>
<progressIndicator verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" id="11">
<progressIndicator verticalHuggingPriority="750" fixedFrame="YES" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="11">
<rect key="frame" x="107" y="47" width="275" height="20"/>
<autoresizingMask key="autoresizingMask"/>
<connections>
@@ -54,8 +54,8 @@
<binding destination="-2" name="value" keyPath="progressValue" previousBinding="13" id="27"/>
</connections>
</progressIndicator>
<button verticalHuggingPriority="750" id="12">
<rect key="frame" x="272" y="12" width="114" height="32"/>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="12">
<rect key="frame" x="272" y="12" width="113" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES"/>
<buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="55">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -65,7 +65,7 @@
<binding destination="-2" name="title" keyPath="buttonTitle" id="21"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="16">
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="16">
<rect key="frame" x="106" y="22" width="167" height="17"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Small System Font Text" id="56">
@@ -87,9 +87,10 @@
<connections>
<binding destination="-2" name="title" keyPath="windowTitle" id="24"/>
</connections>
<point key="canvasLocation" x="-158" y="132"/>
</window>
</objects>
<resources>
<image name="NSApplicationIcon" width="128" height="128"/>
<image name="NSApplicationIcon" width="32" height="32"/>
</resources>
</document>
+3 -3
View File
@@ -37,8 +37,8 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL
- (instancetype)initWithHost:(SUHost *)aHost
{
self = [super initWithWindowNibName:@"SUStatus"];
if (self)
{
if (self)
{
self.host = aHost;
[self setShouldCascadeWindows:NO];
}
@@ -125,7 +125,7 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL
- (void)setMaxProgressValue:(double)value
{
if (value < 0.0) value = 0.0;
if (value < 0.0) value = 0.0;
maxProgressValue = value;
[self setProgressValue:0.0];
[self.progressBar setIndeterminate:(value == 0.0)];
+17 -11
View File
@@ -58,13 +58,14 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
error = sysctlbyname("hw.cputype", &value, &length, NULL, 0);
int cpuType = -1;
if (error == 0) {
cpuType = value;
// Only the lower 24 bits of sysctl hw.cputype values contain the CPU type. On Macs with ARM processor, one of the top eight bits may be set.
cpuType = value & (int)~CPU_ARCH_MASK;
NSString *visibleCPUType;
switch (value) {
switch (cpuType) {
case CPU_TYPE_ARM: visibleCPUType = @"ARM"; break;
case CPU_TYPE_X86: visibleCPUType = @"Intel"; break;
case CPU_TYPE_POWERPC: visibleCPUType = @"PowerPC"; break;
default: visibleCPUType = @"Unknown"; break;
case CPU_TYPE_X86: visibleCPUType = @"Intel"; break;
case CPU_TYPE_POWERPC: visibleCPUType = @"PowerPC"; break;
default: visibleCPUType = @"Other"; break;
}
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUTypeKey, @"CPU Type", @(value), visibleCPUType] forKeys:profileDictKeys]];
}
@@ -85,17 +86,22 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
if (error == 0) {
NSString *visibleCPUSubType;
if (cpuType == 7) {
if (cpuType == CPU_TYPE_X86) {
// Intel
// TODO: other Intel processors, like Core i7, i5, i3, Xeon?
visibleCPUSubType = is64bit ? @"Intel Core 2" : @"Intel Core"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
} else if (cpuType == 18) {
} else if (cpuType == CPU_TYPE_POWERPC) {
// PowerPC
switch (value) {
case 9: visibleCPUSubType=@"G3"; break;
case 10: case 11: visibleCPUSubType=@"G4"; break;
case 100: visibleCPUSubType=@"G5"; break;
default: visibleCPUSubType=@"Other"; break;
case CPU_SUBTYPE_POWERPC_750: visibleCPUSubType=@"G3"; break;
case CPU_SUBTYPE_POWERPC_7400: case CPU_SUBTYPE_POWERPC_7450: visibleCPUSubType=@"G4"; break;
case CPU_SUBTYPE_POWERPC_970: visibleCPUSubType=@"G5"; break;
default: visibleCPUSubType=@"Other"; break;
}
} else if (cpuType == CPU_TYPE_ARM) {
switch (value) {
case CPU_SUBTYPE_ARM64E: visibleCPUSubType=@"ARM64E"; break;
default: visibleCPUSubType = @"Other"; break;
}
} else {
visibleCPUSubType = @"Other";
+1 -1
View File
@@ -65,7 +65,7 @@
}
+ (NSNumber*)updateGroupIdentifierForHost:(SUHost*)host {
NSNumber* updateGroupIdentifier = [host objectForInfoDictionaryKey:SUUpdateGroupIdentifierKey];
NSNumber* updateGroupIdentifier = [host objectForUserDefaultsKey:SUUpdateGroupIdentifierKey];
if(updateGroupIdentifier == nil) {
updateGroupIdentifier = [self setNewUpdateGroupIdentifierForHost:host];
}
+11 -7
View File
@@ -63,8 +63,14 @@
- (void)didFindValidUpdate
{
id<SUUpdaterPrivate> updater = self.updater;
SUAppcastItem *updateItem = self.updateItem;
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
[[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
[[updater delegate] updater:self.updater didFindValidUpdate:updateItem];
}
// Handle the case where the update indicates that an automatic update is only available for specific versions
if ([self itemPreventsAutoupdate:self.updateItem]) {
self.automaticallyInstallUpdates = NO;
}
if (self.automaticallyInstallUpdates) {
@@ -72,13 +78,12 @@
return;
}
SUAppcastItem *updateItem = self.updateItem;
if (![self shouldShowUpdateAlertForItem:updateItem]) {
[self abortUpdate];
return;
}
self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem host:self.host completionBlock:^(SUUpdateAlertChoice choice) {
self.updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem httpHeaders:updater.httpHeaders userAgent:updater.userAgentString host:self.host completionBlock:^(SUUpdateAlertChoice choice) {
[self updateAlertFinishedWithChoice:choice forItem:updateItem];
}];
@@ -92,7 +97,6 @@
// 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.updateAlert window] setHidesOnDeactivate:NO];
[NSApp activateIgnoringOtherApps:YES];
}
@@ -138,7 +142,7 @@
alert.informativeText = SULocalizedString(@"No valid update information could be loaded.", nil);
[alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)];
}
[self showAlert:alert];
}
@@ -373,8 +377,8 @@
- (void)abortUpdate
{
if (self.statusController)
{
if (self.statusController)
{
[self.statusController close];
self.statusController = nil;
}
+1 -1
View File
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SUUnarchiver : NSObject
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword;
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword;
@end
+8 -5
View File
@@ -11,24 +11,27 @@
#import "SUPipedUnarchiver.h"
#import "SUDiskImageUnarchiver.h"
#import "SUBinaryDeltaUnarchiver.h"
#import "SUFlatPackageUnarchiver.h"
#include "AppKitPrevention.h"
@implementation SUUnarchiver
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword
{
if ([SUPipedUnarchiver canUnarchivePath:path]) {
return [[SUPipedUnarchiver alloc] initWithArchivePath:path];
return [[SUPipedUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory];
} else if ([SUDiskImageUnarchiver canUnarchivePath:path]) {
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path decryptionPassword:decryptionPassword];
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory decryptionPassword:decryptionPassword];
} else if ([SUBinaryDeltaUnarchiver canUnarchivePath:path]) {
assert(hostPath != nil);
NSString *nonNullHostPath = hostPath;
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path updateHostBundlePath:nonNullHostPath];
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory updateHostBundlePath:nonNullHostPath];
} else if ([SUFlatPackageUnarchiver canUnarchivePath:path]) {
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path extractionDirectory:extractionDirectory];
}
return nil;
}
+2
View File
@@ -31,6 +31,8 @@
if (self != nil) {
_completionBlock = [completionBlock copy];
_progressBlock = [progressBlock copy];
} else {
assert(false);
}
return self;
}
+1 -1
View File
@@ -26,7 +26,7 @@ typedef NS_ENUM(NSInteger, SUUpdateAlertChoice) {
@property (weak) id<SUVersionDisplay> versionDisplayer;
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)host completionBlock:(void(^)(SUUpdateAlertChoice))c;
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item httpHeaders:(NSDictionary *)httpHeaders userAgent:(NSString *)userAgent host:(SUHost *)host completionBlock:(void(^)(SUUpdateAlertChoice))c;
- (IBAction)installUpdate:sender;
- (IBAction)skipThisVersion:sender;
+187 -191
View File
@@ -7,13 +7,15 @@
//
// -----------------------------------------------------------------------------
// Headers:
// Headers:
// -----------------------------------------------------------------------------
#import "SUUpdateAlert.h"
#import "SUHost.h"
#import <WebKit/WebKit.h>
#import "SUWebView.h"
#import "SUWKWebView.h"
#import "SULegacyWebView.h"
#import "SUConstants.h"
#import "SULog.h"
@@ -27,35 +29,29 @@
static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdateAlert";
// WebKit protocols are not explicitly declared until 10.11 SDK, so
// declare dummy protocols to keep the build working on earlier SDKs.
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101100
@protocol WebFrameLoadDelegate <NSObject>
@end
@protocol WebPolicyDelegate <NSObject>
@end
@protocol WebUIDelegate <NSObject>
@end
#endif
@interface SUUpdateAlert () <WebFrameLoadDelegate, WebPolicyDelegate, WebUIDelegate, NSTouchBarDelegate>
@interface SUUpdateAlert () <NSTouchBarDelegate>
@property (strong) SUAppcastItem *updateItem;
@property (strong) SUHost *host;
@property (strong) void(^completionBlock)(SUUpdateAlertChoice);
@property (strong) NSProgressIndicator *releaseNotesSpinner;
@property (assign) BOOL webViewFinishedLoading;
@property (assign) BOOL observingAppearance;
@property (weak) IBOutlet WebView *releaseNotesView;
@property (weak) IBOutlet NSView *releaseNotesContainerView;
@property (weak) IBOutlet NSBox *releaseNotesBoxView;
@property (weak) IBOutlet NSTextField *descriptionField;
@property (weak) IBOutlet NSButton *automaticallyInstallUpdatesButton;
@property (weak) IBOutlet NSButton *installButton;
@property (weak) IBOutlet NSButton *skipButton;
@property (weak) IBOutlet NSButton *laterButton;
@property (strong) NSBox *darkBackgroundView;
@property (nonatomic) id<SUWebView> webView;
@property (nonatomic) NSDictionary *httpHeaders;
@property (nonatomic) NSString *userAgent;
@end
@implementation SUUpdateAlert
@@ -67,52 +63,38 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
@synthesize host;
@synthesize releaseNotesSpinner;
@synthesize webViewFinishedLoading;
@synthesize observingAppearance;
@synthesize releaseNotesView;
@synthesize releaseNotesContainerView;
@synthesize releaseNotesBoxView = _releaseNotesBoxView;
@synthesize descriptionField;
@synthesize automaticallyInstallUpdatesButton;
@synthesize installButton;
@synthesize skipButton;
@synthesize laterButton;
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost completionBlock:(void (^)(SUUpdateAlertChoice))block
@synthesize darkBackgroundView = _darkBackgroundView;
@synthesize webView = _webView;
@synthesize httpHeaders = _httpHeaders;
@synthesize userAgent = _userAgent;
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item httpHeaders:(NSDictionary *)httpHeaders userAgent:(NSString *)userAgent host:(SUHost *)aHost completionBlock:(void (^)(SUUpdateAlertChoice))block
{
self = [super initWithWindowNibName:@"SUUpdateAlert"];
if (self)
{
if (self)
{
self.completionBlock = block;
host = aHost;
updateItem = item;
_httpHeaders = httpHeaders;
_userAgent = userAgent;
[self setShouldCascadeWindows:NO];
// Alex: This dummy line makes sure that the binary is linked against WebKit.
// The SUUpdateAlert.xib file contains a WebView and if we don't link against WebKit,
// we will get a runtime crash when decoding the NIB. It is better to get a link error.
[WebView MIMETypesShownAsHTML];
}
return self;
}
- (void)dealloc {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (SUAVAILABLE(10, 14)) {
if (self.observingAppearance) {
[self.window removeObserver:self forKeyPath:@"effectiveAppearance"];
self.observingAppearance = NO;
}
}
#endif
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(__attribute__((unused)) NSDictionary<NSKeyValueChangeKey,id> *)change context:(__attribute__((unused)) void *)context {
if (object == self.window && [keyPath isEqualToString:@"effectiveAppearance"]) {
[self adaptReleaseNotesAppearance];
}
}
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self.host bundlePath]]; }
- (void)disableKeyboardShortcutForInstallButton {
@@ -121,11 +103,8 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
- (void)endWithSelection:(SUUpdateAlertChoice)choice
{
[self.releaseNotesView stopLoading:self];
self.releaseNotesView.frameLoadDelegate = nil;
self.releaseNotesView.policyDelegate = nil;
self.releaseNotesView.UIDelegate = nil;
[self.releaseNotesView removeFromSuperview]; // Otherwise it gets sent Esc presses (why?!) and gets very confused.
[self.webView stopLoading];
[self.webView.view removeFromSuperview]; // Otherwise it gets sent Esc presses (why?!) and gets very confused.
[self close];
self.completionBlock(choice);
self.completionBlock = nil;
@@ -153,69 +132,135 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
- (void)displayReleaseNotes
{
self.releaseNotesView.preferencesIdentifier = SUBundleIdentifier;
WebPreferences *prefs = [self.releaseNotesView preferences];
prefs.plugInsEnabled = NO;
prefs.javaEnabled = NO;
prefs.javaScriptEnabled = [self.host boolForInfoDictionaryKey:SUEnableJavaScriptKey];
self.releaseNotesView.frameLoadDelegate = self;
self.releaseNotesView.policyDelegate = self;
self.releaseNotesView.UIDelegate = self;
[self adaptReleaseNotesAppearance];
// Set the default font
// "-apple-system-font" is a reference to the system UI font. "-apple-system" is the new recommended token, but for backward compatibility we can't use it.
prefs.standardFontFamily = @"-apple-system-font";
prefs.defaultFontSize = (int)[NSFont systemFontSize];
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (SUAVAILABLE(10, 14))
{
NSBox *darkBackgroundView = [[NSBox alloc] initWithFrame:self.releaseNotesView.frame];
darkBackgroundView.boxType = NSBoxCustom;
darkBackgroundView.fillColor = [NSColor textBackgroundColor];
darkBackgroundView.borderColor = [NSColor clearColor];
// Using auto-resizing mask instead of contraints works well enough
darkBackgroundView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
[self.releaseNotesView.superview addSubview:darkBackgroundView positioned:NSWindowBelow relativeTo:self.releaseNotesView];
self.releaseNotesView.drawsBackground = NO;
prefs.userStyleSheetLocation = [[NSBundle bundleForClass:[self class]] URLForResource:@"DarkAqua" withExtension:@"css"];
if (@available(macOS 10.14, *)) {
if (!self.observingAppearance) {
[self.window addObserver:self forKeyPath:@"effectiveAppearance" options:NSKeyValueObservingOptionInitial context:nil];
[self.webView.view addObserver:self forKeyPath:@"effectiveAppearance" options:0 context:nil];
self.observingAppearance = YES;
}
}
#endif
// Stick a nice big spinner in the middle of the web view until the page is loaded.
NSRect frame = [[self.releaseNotesView superview] frame];
NSRect frame = [[self.webView.view superview] frame];
self.releaseNotesSpinner = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(NSMidX(frame) - 16, NSMidY(frame) - 16, 32, 32)];
[self.releaseNotesSpinner setStyle:NSProgressIndicatorSpinningStyle];
[self.releaseNotesSpinner startAnimation:self];
self.webViewFinishedLoading = NO;
[[self.releaseNotesView superview] addSubview:self.releaseNotesSpinner];
[[self.webView.view superview] addSubview:self.releaseNotesSpinner];
// If there's a release notes URL, load it; otherwise, just stick the contents of the description into the web view.
if ([self.updateItem releaseNotesURL])
{
[[self.releaseNotesView mainFrame] loadRequest:[NSURLRequest requestWithURL:[self.updateItem releaseNotesURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30]];
}
else
{
[[self.releaseNotesView mainFrame] loadHTMLString:[self.updateItem itemDescription] baseURL:nil];
if ([self.updateItem releaseNotesURL])
{
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[self.updateItem releaseNotesURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];
if (self.userAgent) {
[request setValue:self.userAgent forHTTPHeaderField:@"User-Agent"];
}
if (self.httpHeaders) {
for (NSString *key in self.httpHeaders) {
NSString *value = [self.httpHeaders objectForKey:key];
[request setValue:value forHTTPHeaderField:key];
}
}
__weak __typeof__(self) weakSelf = self;
[self.webView loadRequest:request completionHandler:^(NSError * _Nullable error) {
if (error != nil) {
SULog(SULogLevelError, @"Failed to load URL request from web view: %@", error);
}
[weakSelf stopReleaseNotesSpinner];
}];
}
else
{
__weak __typeof__(self) weakSelf = self;
[self.webView loadHTMLString:[self.updateItem itemDescription] baseURL:nil completionHandler:^(NSError * _Nullable error) {
if (error != nil) {
SULog(SULogLevelError, @"Failed to load HTML string from web view: %@", error);
}
[weakSelf stopReleaseNotesSpinner];
}];
}
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(__attribute__((unused)) NSDictionary<NSKeyValueChangeKey,id> *)change context:(__attribute__((unused)) void *)context {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *)) {
if (object == self.webView.view && [keyPath isEqualToString:@"effectiveAppearance"]) {
[self adaptReleaseNotesAppearance];
}
}
#endif
}
- (void)dealloc {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *)) {
if (self.observingAppearance) {
[self.webView.view removeObserver:self forKeyPath:@"effectiveAppearance"];
self.observingAppearance = NO;
}
}
#endif
}
- (void)adaptReleaseNotesAppearance
{
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *))
{
NSAppearanceName bestAppearance = [self.webView.view.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
if ([bestAppearance isEqualToString:NSAppearanceNameDarkAqua])
{
// Remove web view background...
[self.webView setDrawsBackground:NO];
// ... and use NSBox to get the dynamically colored background
if (self.darkBackgroundView == nil)
{
self.darkBackgroundView = [[NSBox alloc] initWithFrame:self.webView.view.frame];
self.darkBackgroundView.boxType = NSBoxCustom;
self.darkBackgroundView.fillColor = [NSColor textBackgroundColor];
self.darkBackgroundView.borderColor = [NSColor clearColor];
// Using auto-resizing mask instead of contraints works well enough
self.darkBackgroundView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
[self.webView.view.superview addSubview:self.darkBackgroundView positioned:NSWindowBelow relativeTo:self.webView.view];
// The release note user stylesheet will not adjust to the user changing the theme until adaptReleaseNoteAppearance is called again.
// So lock the appearance of the background to keep the text readable if the system theme changes.
self.darkBackgroundView.appearance = self.darkBackgroundView.effectiveAppearance;
}
}
else
{
// Restore standard dark on light appearance
[self.darkBackgroundView removeFromSuperview];
self.darkBackgroundView = nil;
[self.webView setDrawsBackground:YES];
}
}
#endif
}
- (void)stopReleaseNotesSpinner
{
[self.releaseNotesSpinner stopAnimation:self];
[self.releaseNotesSpinner setHidden:YES];
}
- (BOOL)showsReleaseNotes
{
NSNumber *shouldShowReleaseNotes = [self.host objectForInfoDictionaryKey:SUShowReleaseNotesKey];
if (shouldShowReleaseNotes == nil)
{
if (shouldShowReleaseNotes == nil)
{
// Don't show release notes if RSS item contains no description and no release notes URL:
return (([self.updateItem itemDescription] != nil
&& [[[self.updateItem itemDescription] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] > 0)
|| [self.updateItem releaseNotesURL] != nil);
}
else
}
else
return [shouldShowReleaseNotes boolValue];
}
@@ -228,6 +273,37 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
- (void)windowDidLoad
{
BOOL showReleaseNotes = [self showsReleaseNotes];
if (showReleaseNotes) {
NSURL *colorStyleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"ReleaseNotesColorStyle" withExtension:@"css"];
// "-apple-system-font" is a reference to the system UI font. "-apple-system" is the new recommended token, but for backward compatibility we can't use it.
NSString *defaultFontFamily = @"-apple-system-font";
int defaultFontSize = (int)[NSFont systemFontSize];
BOOL javaScriptEnabled = [self.host boolForInfoDictionaryKey:SUEnableJavaScriptKey];
BOOL useWKWebView;
if (@available(macOS 10.11, *)) {
useWKWebView = YES;
} else {
// Never use WKWebView prior to macOS 10.11. Details are in SUWKWebView.m
// Note: 2.x has another case where we fall back to using legacy WKWebView due to certain sandboxing issues.
useWKWebView = NO;
}
if (useWKWebView) {
self.webView = [[SUWKWebView alloc] initWithColorStyleSheetLocation:colorStyleURL fontFamily:defaultFontFamily fontPointSize:defaultFontSize javaScriptEnabled:javaScriptEnabled];
} else {
self.webView = [[SULegacyWebView alloc] initWithColorStyleSheetLocation:colorStyleURL fontFamily:defaultFontFamily fontPointSize:defaultFontSize javaScriptEnabled:javaScriptEnabled];
}
NSView *boxContentView = self.releaseNotesBoxView.contentView;
[boxContentView addSubview:self.webView.view];
self.webView.view.frame = boxContentView.bounds;
self.webView.view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
}
[self.window setFrameAutosaveName: showReleaseNotes ? @"SUUpdateAlert" : @"SUUpdateAlertSmall" ];
@@ -250,45 +326,44 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
[self.releaseNotesContainerView removeFromSuperview];
}
// NOTE: The code below for deciding what buttons to hide is complex! Due to array of feature configurations :)
// When we show release notes, it looks ugly if the install buttons are not closer to the release notes view
// However when we don't show release notes, it looks ugly if the install buttons are too close to the description field. Shrugs.
if (showReleaseNotes && ![self allowsAutomaticUpdates]) {
NSLayoutConstraint *skipButtonToReleaseNotesContainerConstraint = [NSLayoutConstraint constraintWithItem:self.skipButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.releaseNotesContainerView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12.0];
[self.window.contentView addConstraint:skipButtonToReleaseNotesContainerConstraint];
[self.automaticallyInstallUpdatesButton removeFromSuperview];
BOOL allowsAutomaticUpdates = [self allowsAutomaticUpdates];
// Automatic downloads is enabled by developer if they set SUAutomaticallyUpdateKey in Info.plist,
// rather than the user toggling the setting
BOOL automaticDownloadsEnabledByDeveloper = [self.host boolForInfoDictionaryKey:SUAutomaticallyUpdateKey];
if (!allowsAutomaticUpdates || automaticDownloadsEnabledByDeveloper) {
if (showReleaseNotes) {
// Fix constraints so that buttons aren't far away from web view when we hide the automatic updates check box
NSLayoutConstraint *skipButtonToReleaseNotesContainerConstraint = [NSLayoutConstraint constraintWithItem:self.skipButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.releaseNotesContainerView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12.0];
[self.window.contentView addConstraint:skipButtonToReleaseNotesContainerConstraint];
[self.automaticallyInstallUpdatesButton removeFromSuperview];
} else {
self.automaticallyInstallUpdatesButton.enabled = NO;
}
}
if ([self.updateItem isCriticalUpdate]) {
self.skipButton.enabled = NO;
self.skipButton.hidden = YES;
self.laterButton.enabled = NO;
self.laterButton.hidden = YES;
}
if (![self automaticChecksEnabled]) {
self.laterButton.enabled = NO;
// Reminding user later doesn't make sense when automatic update checks are off
if (![self.host boolForKey:SUEnableAutomaticChecksKey]) {
self.laterButton.hidden = YES;
}
[self.window center];
}
- (BOOL)automaticChecksEnabled {
NSNumber *automaticChecksEnabled = [self.host objectForInfoDictionaryKey:SUEnableAutomaticChecksKey];
if (automaticChecksEnabled == nil)
{
return false;
}
return [automaticChecksEnabled boolValue];
}
- (BOOL)windowShouldClose:(NSNotification *) __unused note
{
[self endWithSelection:SURemindMeLaterChoice];
return YES;
[self endWithSelection:SURemindMeLaterChoice];
return YES;
}
- (NSImage *)applicationIcon
@@ -324,85 +399,6 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
return finalString;
}
- (void)adaptReleaseNotesAppearance
{
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (SUAVAILABLE(10, 14))
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
NSAppearanceName bestAppearance = [self.window.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
BOOL isDarkAqua = ([bestAppearance isEqualToString:NSAppearanceNameDarkAqua]);
self.releaseNotesView.preferences.userStyleSheetEnabled = isDarkAqua;
#pragma clang diagnostic pop
}
#endif
}
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
if ([frame parentFrame] == nil) {
self.webViewFinishedLoading = YES;
[self.releaseNotesSpinner setHidden:YES];
[sender display]; // necessary to prevent weird scroll bar artifacting
}
}
- (void)webView:(WebView *)__unused sender decidePolicyForNavigationAction:(NSDictionary *)__unused actionInformation request:(NSURLRequest *)request frame:(WebFrame *)__unused frame decisionListener:(id<WebPolicyDecisionListener>)listener
{
NSURL *requestURL = request.URL;
NSString *scheme = requestURL.scheme;
BOOL whitelistedSafe = [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [requestURL.absoluteString isEqualToString:@"about:blank"];
// Do not allow redirects to dangerous protocols such as file://
if (!whitelistedSafe) {
SULog(SULogLevelDefault, @"Blocked display of %@ URL which may be dangerous", scheme);
[listener ignore];
return;
}
if (self.webViewFinishedLoading) {
if (requestURL) {
[[NSWorkspace sharedWorkspace] openURL:requestURL];
}
[listener ignore];
}
else {
[listener use];
}
}
// Clean up the contextual menu.
- (NSArray<NSMenuItem *> *)webView:(WebView *)__unused sender contextMenuItemsForElement:(NSDictionary *)__unused element defaultMenuItems:(NSArray<NSMenuItem *> *)defaultMenuItems
{
NSMutableArray<NSMenuItem *> *webViewMenuItems = [defaultMenuItems mutableCopy];
if (webViewMenuItems)
{
for (NSMenuItem *menuItem in defaultMenuItems)
{
NSInteger tag = [menuItem tag];
switch (tag)
{
case WebMenuItemTagOpenLinkInNewWindow:
case WebMenuItemTagDownloadLinkToDisk:
case WebMenuItemTagOpenImageInNewWindow:
case WebMenuItemTagDownloadImageToDisk:
case WebMenuItemTagOpenFrameInNewWindow:
case WebMenuItemTagGoBack:
case WebMenuItemTagGoForward:
case WebMenuItemTagStop:
case WebMenuItemTagReload:
[webViewMenuItems removeObjectIdenticalTo:menuItem];
}
}
}
return webViewMenuItems;
}
- (NSTouchBar *)makeTouchBar
{
NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init];
+16 -7
View File
@@ -58,8 +58,8 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
- (instancetype)initWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile reply:(void (^)(SUUpdatePermissionResponse *))reply
{
self = [super initWithWindowNibName:@"SUUpdatePermissionPrompt"];
if (self)
{
if (self)
{
_reply = reply;
host = aHost;
self.isShowingMoreInfo = NO;
@@ -67,6 +67,10 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
systemProfileInformationArray = profile;
[self setShouldCascadeWindows:NO];
}
else
{
assert(false);
}
return self;
}
@@ -75,11 +79,16 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
// If this is a background application we need to focus it in order to bring the prompt
// to the user's attention. Otherwise the prompt would be hidden behind other applications and
// the user would not know why the application was paused.
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
}
#pragma clang diagnostic push
#if __has_warning("-Wcompletion-handler")
#pragma clang diagnostic ignored "-Wcompletion-handler"
#endif
if (![NSApp modalWindow]) { // do not prompt if there is is another modal window on screen
#pragma clang diagnostic pop
SUUpdatePermissionPrompt *prompt = [(SUUpdatePermissionPrompt *)[[self class] alloc] initWithHost:host systemProfile:profile reply:reply];
NSWindow *window = [prompt window];
if (window) {
@@ -92,8 +101,8 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
- (void)windowDidLoad
{
if (![self shouldAskAboutProfile])
{
if (![self shouldAskAboutProfile])
{
NSRect frame = [[self window] frame];
frame.size.height -= [self.moreInfoButton frame].size.height;
[[self window] setFrame:frame display:YES];
@@ -128,8 +137,8 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
NSRect profileMoreInfoButtonFrame = [self.moreInfoButton frame];
NSRect descriptionFrame = [self.descriptionTextField frame];
if (self.isShowingMoreInfo)
{
if (self.isShowingMoreInfo)
{
// Add the subview
contentViewFrame.size.height += profileMoreInfoViewFrame.size.height;
profileMoreInfoViewFrame.origin.y = profileMoreInfoButtonFrame.origin.y - profileMoreInfoViewFrame.size.height;
+3 -3
View File
@@ -149,14 +149,14 @@ SU_EXPORT @interface SUUpdater : NSObject
@property (strong, readonly) NSBundle *sparkleBundle;
/*!
The user agent used when checking for updates.
The user agent used when checking for and downloading updates.
The default implementation can be overrided.
*/
@property (nonatomic, copy) NSString *userAgentString;
/*!
The HTTP headers used when checking for updates.
The HTTP headers used when checking for and downloading updates.
The keys of this dictionary are HTTP header fields (NSString) and values are corresponding values (NSString)
*/
@@ -202,7 +202,7 @@ SU_EXPORT @interface SUUpdater : NSObject
You may want to respond to the userDidCancelDownload delegate method in case
the user clicks the "Cancel" button while the update is downloading.
*/
- (void)installUpdatesIfAvailable;
- (void)installUpdatesIfAvailable __attribute__((deprecated("This method is deprecated. Please set SUAutomaticallyUpdate in your Info.plist or use automaticallyDownloadsUpdates property instead.")));
/*!
Returns the date of last update check.
+65 -52
View File
@@ -27,6 +27,7 @@
#import "SUSystemUpdateInfo.h"
#import "SUSignatures.h"
#import "SUOperatingSystem.h"
#import "SUGlobalUpdateLock.h"
NSString *const SUUpdaterDidFinishLoadingAppCastNotification = @"SUUpdaterDidFinishLoadingAppCastNotification";
NSString *const SUUpdaterDidFindValidUpdateNotification = @"SUUpdaterDidFindValidUpdateNotification";
@@ -39,11 +40,12 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
@property (strong) NSTimer *checkTimer;
@property (assign) BOOL shouldRescheduleOnWake;
@property (strong) NSBundle *sparkleBundle;
@property (nonatomic) BOOL loggedNoSecureKeyWarning;
- (instancetype)initForBundle:(NSBundle *)bundle;
- (void)startUpdateCycle;
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)updateDriver;
- (void)scheduleNextUpdateCheck;
- (void)scheduleNextUpdateCheckUsingCurrentDate:(BOOL)usingCurrentDate;
- (void)registerAsObserver;
- (void)unregisterAsObserver;
- (void)updateDriverDidFinish:(NSNotification *)note;
@@ -68,6 +70,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
@synthesize sparkleBundle;
@synthesize decryptionPassword;
@synthesize updateLastCheckedDate;
@synthesize loggedNoSecureKeyWarning = _loggedNoSecureKeyWarning;
static NSMutableDictionary *sharedUpdaters = nil;
static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaultsObservationContext";
@@ -121,11 +124,11 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]];
if (updater)
{
{
self = updater;
}
else if (self)
{
}
else if (self)
{
if (sharedUpdaters == nil) {
sharedUpdaters = [[NSMutableDictionary alloc] init];
}
@@ -146,7 +149,9 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
}
-(void)checkIfConfiguredProperly {
BOOL hasPublicKey = self.host.publicKeys.dsaPubKey != nil || self.host.publicKeys.ed25519PubKey != nil;
BOOL hasDSAPublicKey = (self.host.publicKeys.dsaPubKey != nil);
BOOL hasEdDSAPublicKey = (self.host.publicKeys.ed25519PubKey != nil);
BOOL hasPublicKey = (hasDSAPublicKey || hasEdDSAPublicKey);
BOOL isMainBundle = [self.host.bundle isEqualTo:[NSBundle mainBundle]];
BOOL hostIsCodeSigned = [SUCodeSigningVerifier bundleAtURLIsCodeSigned:self.host.bundle.bundleURL];
NSURL *feedURL = [self feedURL];
@@ -164,8 +169,20 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
} else if (!servingOverHttps) {
[self showAlertText:SULocalizedString(@"Auto-update not configured", nil)
informativeText:[NSString stringWithFormat:SULocalizedString(@"For security reasons, updates to %@ need to be served over HTTPS and/or signed with an EdDSA key. See https://sparkle-project.org/documentation/ for more information.", nil), name]];
} else {
if (!self.loggedNoSecureKeyWarning) {
SULog(SULogLevelError, @"Error: Serving updates without an EdDSA key and only using Apple Code Signing is deprecated and may be unsupported in a future release. Visit Sparkle's documentation for more information: https://sparkle-project.org/documentation/#3-segue-for-security-concerns");
self.loggedNoSecureKeyWarning = YES;
}
}
}
} else if (!hasEdDSAPublicKey) {
if (!self.loggedNoSecureKeyWarning) {
SULog(SULogLevelError, @"Error: Serving updates without an EdDSA key is insecure and deprecated. DSA support may be removed in a future Sparkle release. Please migrate to using EdDSA (ed25519). Visit Sparkle's documentation for migration information: https://sparkle-project.org/documentation/#3-segue-for-security-concerns");
self.loggedNoSecureKeyWarning = YES;
}
}
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100
@@ -222,6 +239,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
[self.host setBool:NO forUserDefaultsKey:SUUpdateRelaunchingMarkerKey];
}
[[SUGlobalUpdateLock sharedLock] unlock]; // For safety, remove active lock if present in any case and not just when relaunching from an app update
if (shouldPrompt) {
NSArray<NSDictionary<NSString *, NSString *> *> *profileInfo = [SUSystemProfiler systemProfileArrayForHost:self.host];
// Always say we're sending the system profile here so that the delegate displays the parameters it would send.
@@ -236,7 +255,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
// We start the update checks and register as observer for changes after the prompt finishes
} else {
// We check if the user's said they want updates, or they haven't said anything, and the default is set to checking.
[self scheduleNextUpdateCheck];
[self scheduleNextUpdateCheckUsingCurrentDate:YES];
}
}
@@ -248,11 +267,11 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)updateDriverDidFinish:(NSNotification *)note
{
if ([note object] == self.driver && [self.driver finished])
{
if ([note object] == self.driver && [self.driver finished])
{
self.driver = nil;
[self updateLastUpdateCheckDate];
[self scheduleNextUpdateCheck];
[self scheduleNextUpdateCheckUsingCurrentDate:NO];
}
}
@@ -274,19 +293,30 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
[self didChangeValueForKey:@"lastUpdateCheckDate"];
}
- (void)scheduleNextUpdateCheck
- (void)scheduleNextUpdateCheckUsingCurrentDate:(BOOL)usingCurrentDate
{
if (self.checkTimer)
{
if (self.checkTimer)
{
[self.checkTimer invalidate];
self.checkTimer = nil; // Timer is non-repeating, may have invalidated itself, so we had to retain it.
}
if (![self automaticallyChecksForUpdates]) return;
if (![self automaticallyChecksForUpdates]) return;
// How long has it been since last we checked for an update?
NSDate *lastCheckDate = [self lastUpdateCheckDate];
if (!lastCheckDate) { lastCheckDate = [NSDate distantPast]; }
NSTimeInterval intervalSinceCheck = [[NSDate date] timeIntervalSinceDate:lastCheckDate];
NSTimeInterval intervalSinceCheck;
if (usingCurrentDate) {
NSDate *lastCheckDate = [self lastUpdateCheckDate];
if (!lastCheckDate) { lastCheckDate = [NSDate distantPast]; }
intervalSinceCheck = [[NSDate date] timeIntervalSinceDate:lastCheckDate];
if (intervalSinceCheck < 0) {
// Last update check date is in the future and bogus, so reset it to current date
[self updateLastUpdateCheckDate];
intervalSinceCheck = 0;
}
} else {
intervalSinceCheck = 0;
}
// Now we want to figure out how long until we check again.
NSTimeInterval delayUntilCheck, updateCheckInterval = [self updateCheckInterval];
@@ -314,29 +344,13 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)receiveWakeNote
{
if (self.shouldRescheduleOnWake) // the reason for rescheduling the update-check timer is that NSTimer does behave as if the time the Mac spends asleep did not exist at all, which can significantly prolong the time between update checks
[self scheduleNextUpdateCheck];
[self scheduleNextUpdateCheckUsingCurrentDate:YES];
}
- (void)checkForUpdatesInBackground
{
BOOL automatic = [self automaticallyDownloadsUpdates];
if (!automatic) {
if (SUAVAILABLE(10, 9)) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:@"com.apple.notificationcenterui"];
#pragma clang diagnostic pop
BOOL dnd = [defaults boolForKey:@"doNotDisturb"];
if (dnd) {
SULog(SULogLevelDefault, @"Delayed update, because Do Not Disturb is on");
[self updateLastUpdateCheckDate];
[self scheduleNextUpdateCheck];
return;
}
}
}
// Do not use reachability for a preflight check. This can be deceptive and a bad idea. Apple does not recommend doing it.
SUUpdateDriver *theUpdateDriver = [(SUBasicUpdateDriver *)[(automatic ? [SUAutomaticUpdateDriver class] : [SUScheduledUpdateDriver class])alloc] initWithUpdater:self];
@@ -376,14 +390,14 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)d
{
if ([self updateInProgress]) { return; }
if (self.checkTimer) { [self.checkTimer invalidate]; self.checkTimer = nil; } // Timer is non-repeating, may have invalidated itself, so we had to retain it.
if ([self updateInProgress]) { return; }
if (self.checkTimer) { [self.checkTimer invalidate]; self.checkTimer = nil; } // Timer is non-repeating, may have invalidated itself, so we had to retain it.
[self updateLastUpdateCheckDate];
if( [self.delegate respondsToSelector: @selector(updaterMayCheckForUpdates:)] && ![self.delegate updaterMayCheckForUpdates: self] )
{
[self scheduleNextUpdateCheck];
{
[self scheduleNextUpdateCheckUsingCurrentDate:NO];
return;
}
@@ -392,7 +406,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
// If we're not given a driver at all, just schedule the next update check and bail.
if (!self.driver)
{
[self scheduleNextUpdateCheck];
[self scheduleNextUpdateCheckUsingCurrentDate:NO];
return;
}
@@ -414,8 +428,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)unregisterAsObserver
{
@try
{
@try
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeyPath:[@"values." stringByAppendingString:SUScheduledCheckIntervalKey]];
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeyPath:[@"values." stringByAppendingString:SUEnableAutomaticChecksKey]];
@@ -428,7 +442,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if (context == (__bridge void *)(SUUpdaterDefaultsObservationContext))
if (context == (__bridge void *)(SUUpdaterDefaultsObservationContext))
{
// Allow a small delay, because perhaps the user or developer wants to change both preferences. This allows the developer to interpret a zero check interval as a sign to disable automatic checking.
// Or we may get this from the developer and from our own KVO observation, this will effectively coalesce them.
@@ -444,7 +458,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
- (void)resetUpdateCycle
{
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(resetUpdateCycle) object:nil];
[self scheduleNextUpdateCheck];
[self scheduleNextUpdateCheckUsingCurrentDate:YES];
}
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyCheckForUpdates
@@ -482,7 +496,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
}
// Otherwise, automatically downloading updates is allowed. Does the user want it?
return [self.host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
return [self.host boolForKey:SUAutomaticallyUpdateKey];
}
- (void)setFeedURL:(NSURL *)feedURL
@@ -521,9 +535,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
if (customUserAgentString) {
return customUserAgentString;
}
NSString *version = [self.sparkleBundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey];
NSString *userAgent = [NSString stringWithFormat:@"%@/%@ Sparkle/%@", [self.host name], [self.host displayVersion], version ? version : @"?"];
NSString *userAgent = [NSString stringWithFormat:@"%@/%@ Sparkle/%@", [self.host name], [self.host displayVersion], @""MARKETING_VERSION];
NSData *cleanedAgent = [userAgent dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
return [[NSString alloc] initWithData:cleanedAgent encoding:NSASCIIStringEncoding];
}
@@ -564,12 +577,12 @@ static NSString *escapeURLComponent(NSString *str) {
if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
parameters = [parameters arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile]];
}
if (sendingSystemProfile)
{
if (sendingSystemProfile)
{
parameters = [parameters arrayByAddingObjectsFromArray:[SUSystemProfiler systemProfileArrayForHost:self.host]];
[self.host setObject:[NSDate date] forUserDefaultsKey:SULastProfileSubmitDateKey];
}
if ([parameters count] == 0) { return baseFeedURL; }
if ([parameters count] == 0) { return baseFeedURL; }
// Build up the parameterized URL.
NSMutableArray *parameterStrings = [NSMutableArray array];
@@ -612,7 +625,7 @@ static NSString *escapeURLComponent(NSString *str) {
- (void)dealloc
{
[self unregisterAsObserver];
if (checkTimer) { [checkTimer invalidate]; } // Timer is non-repeating, may have invalidated itself, so we had to retain it.
if (checkTimer) { [checkTimer invalidate]; } // Timer is non-repeating, may have invalidated itself, so we had to retain it.
}
- (BOOL)validateMenuItem:(NSMenuItem *)item
+1 -1
View File
@@ -36,7 +36,7 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastItemNotificationKey;
SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
// -----------------------------------------------------------------------------
// SUUpdater Delegate:
// SUUpdater Delegate:
// -----------------------------------------------------------------------------
/*!
+6 -6
View File
@@ -33,8 +33,8 @@
});
return;
}
if (self.checkingController)
{
if (self.checkingController)
{
[[self.checkingController window] close];
self.checkingController = nil;
}
@@ -57,16 +57,16 @@
// For background applications, obtain focus.
// Useful if the update check is requested from another app like System Preferences.
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]])
{
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]])
{
[NSApp activateIgnoringOtherApps:YES];
}
}
- (void)appcastDidFinishLoading:(SUAppcast *)ac
{
if (self.isCanceled)
{
if (self.isCanceled)
{
[self abortUpdate];
return;
}
Loaded 100 of 392 files, more files were not shown because too many files have changed in this diff. Show more