mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99dbdcbd96 | ||
|
|
d18ccf12f3 | ||
|
|
a6ff74889e | ||
|
|
a1d0e036fb | ||
|
|
09ab0a5138 | ||
|
|
1c55a7e7fc | ||
|
|
1d9125f8a2 | ||
|
|
bf3c932844 | ||
|
|
b5755d41cb | ||
|
|
8f7fad4d3a | ||
|
|
3d4e4494ad | ||
|
|
f7d830d9ad | ||
|
|
f3db8fb959 | ||
|
|
55394e1359 | ||
|
|
ea14942643 | ||
|
|
a2adcd8407 | ||
|
|
2929333b49 | ||
|
|
c4fcf17050 | ||
|
|
99785ceebb | ||
|
|
c0933a516b | ||
|
|
490f8aa71a | ||
|
|
2931c3f8aa | ||
|
|
b5c9539f16 | ||
|
|
9d9205851d | ||
|
|
22c15e8d79 | ||
|
|
056d84eaca | ||
|
|
252cfc32e1 | ||
|
|
cde2af9c7f | ||
|
|
741bb2825d | ||
|
|
1a52f7df98 | ||
|
|
26882d4ed4 | ||
|
|
1b926c85f5 | ||
|
|
4853c187ae | ||
|
|
8409cbb9f6 | ||
|
|
126f9d214a | ||
|
|
c7b1d221b9 | ||
|
|
1013c5076d | ||
|
|
a1133829e4 | ||
|
|
7980c4dfdc | ||
|
|
acd22dda12 | ||
|
|
9f5dd63697 | ||
|
|
28a4d70aa0 | ||
|
|
abe6b493f8 | ||
|
|
d5e80b56d6 | ||
|
|
eee82a9b5c | ||
|
|
cdd1392362 | ||
|
|
a8be860ed9 | ||
|
|
6d392e6800 | ||
|
|
bf30749aa3 | ||
|
|
eb2b818c35 | ||
|
|
057e15e5f2 | ||
|
|
6673fc18e2 | ||
|
|
c7c90d4d1d | ||
|
|
8ffb4956de | ||
|
|
e1c565f6ce | ||
|
|
5a2bd7421a | ||
|
|
07b044dd8f | ||
|
|
cd9495214d | ||
|
|
be3fb5caf2 | ||
|
|
3b500aeaa3 | ||
|
|
cc1e43c115 | ||
|
|
07dfc86c47 | ||
|
|
22e130d10b | ||
|
|
75dfdd8279 | ||
|
|
27448add37 | ||
|
|
067eedbb7a | ||
|
|
a841415046 | ||
|
|
3b78c78702 | ||
|
|
a8ec752c51 | ||
|
|
464142c73d | ||
|
|
baa26a1b19 | ||
|
|
513158dfcc | ||
|
|
901683d837 | ||
|
|
10d24078cc | ||
|
|
9944f000f8 | ||
|
|
bf96a6e066 | ||
|
|
8fb9c83adf | ||
|
|
d662b67a58 | ||
|
|
0b682d3349 | ||
|
|
9561d522e3 | ||
|
|
f60b60b08f | ||
|
|
a85db747f1 | ||
|
|
9cc9f51d7c | ||
|
|
bb9ee3c59b | ||
|
|
4cb4ab8954 | ||
|
|
ab82c70aef | ||
|
|
eb9f4c303a | ||
|
|
e3c4a702f4 | ||
|
|
039a46c96a | ||
|
|
f711abe9de | ||
|
|
dfecd4d2fa | ||
|
|
fddbadb114 | ||
|
|
bfdce8d232 | ||
|
|
3111483cb2 | ||
|
|
f5282705b4 | ||
|
|
4c9397d752 | ||
|
|
43184ea0bf | ||
|
|
866bb8245f | ||
|
|
65f473b237 | ||
|
|
0c8b7f1d25 | ||
|
|
06520272ee | ||
|
|
602ac871b8 | ||
|
|
1b5e938423 | ||
|
|
d21a303b2e | ||
|
|
2e048a8601 | ||
|
|
da1748f7bd | ||
|
|
54bbaee7f5 | ||
|
|
8bba4d21fc | ||
|
|
6283992215 | ||
|
|
dfff98d19e | ||
|
|
0ca9d34f42 | ||
|
|
5f47ce3dea | ||
|
|
470e3734b9 | ||
|
|
397467e6d7 | ||
|
|
3695ae6059 | ||
|
|
544df06b72 | ||
|
|
239693a91b | ||
|
|
4022e128d3 | ||
|
|
6bdaeab2c6 | ||
|
|
82718ca77f | ||
|
|
84c442c3eb | ||
|
|
848eb7955e | ||
|
|
d7cead40be | ||
|
|
eac1a41dba | ||
|
|
4bde9854f7 | ||
|
|
0909f0db81 | ||
|
|
cdd373b800 | ||
|
|
66589042db | ||
|
|
6b715b7c37 | ||
|
|
0a5add74f8 | ||
|
|
02d0d749a0 | ||
|
|
65eb63f1d7 | ||
|
|
d4d4c68ad2 | ||
|
|
1c32cc7fcb | ||
|
|
79589c3e2b | ||
|
|
d39fc1d75e | ||
|
|
a38e8c4607 | ||
|
|
d5b0804b4a | ||
|
|
c3c1b1af99 | ||
|
|
4aff5912a5 | ||
|
|
3d0e7a26f1 | ||
|
|
891afd44c7 | ||
|
|
489ae19e74 | ||
|
|
0e162c98be | ||
|
|
cf8e5163b6 | ||
|
|
c8f6eca09a | ||
|
|
dbfb300931 | ||
|
|
eeab95936a | ||
|
|
04dbde7b8d | ||
|
|
c1e7c09886 | ||
|
|
c15b9da2a7 | ||
|
|
80264da368 | ||
|
|
a5725cf443 | ||
|
|
22bc73be59 | ||
|
|
989589524b | ||
|
|
dcf59b1f8a | ||
|
|
a64af3517c | ||
|
|
cfd963002f | ||
|
|
7233bb93e7 | ||
|
|
f2fc729b69 | ||
|
|
7c7e924ed4 | ||
|
|
640ba1b737 | ||
|
|
215b7db5a1 | ||
|
|
4fec1b7301 | ||
|
|
7c84c537a5 | ||
|
|
a3a0ec7e2f | ||
|
|
7ea72a2af4 | ||
|
|
752849d727 | ||
|
|
360575c611 | ||
|
|
bfccdabfa2 | ||
|
|
4f47fb02db | ||
|
|
7962e95fd9 | ||
|
|
2629a05e48 | ||
|
|
a56ca505ea | ||
|
|
17d78dfc0f | ||
|
|
23a24f17ec | ||
|
|
1ac42dcd5b | ||
|
|
8199aee292 | ||
|
|
b3e5f7b000 | ||
|
|
dd12653c29 | ||
|
|
c7f1a75f95 | ||
|
|
7c5adb11ac | ||
|
|
cae2068a44 | ||
|
|
d95a0d5c92 | ||
|
|
1ff3ed7fad | ||
|
|
b7793249e0 | ||
|
|
e26f1dab23 | ||
|
|
8a9963bf04 | ||
|
|
0b14472ede | ||
|
|
d0e054fc54 | ||
|
|
df718b0c4c | ||
|
|
1690ce6cbc | ||
|
|
a746675f53 | ||
|
|
13cadf0118 | ||
|
|
6c3ce5cb97 | ||
|
|
372d75cc09 | ||
|
|
6468ea2bb5 | ||
|
|
c49df15f13 | ||
|
|
0090aa227b | ||
|
|
e9ab9d09a5 | ||
|
|
9c13919fd8 | ||
|
|
6d7753ea66 | ||
|
|
b9fa2f43b7 | ||
|
|
2c1125a86a | ||
|
|
d37d85b812 | ||
|
|
388915c8d0 | ||
|
|
e33a10638d | ||
|
|
d1d71dc127 | ||
|
|
4ed56d5961 | ||
|
|
1ab5ad82b5 | ||
|
|
d01298c9ce | ||
|
|
a242035c74 | ||
|
|
8f19f6a8cc | ||
|
|
9568732f78 | ||
|
|
f49295b054 | ||
|
|
aff67ceda8 | ||
|
|
c8d5d18ce0 | ||
|
|
f1167b3649 | ||
|
|
3077864a3e | ||
|
|
2db0d8cb37 | ||
|
|
0d16b459a5 | ||
|
|
4c3e202d2e | ||
|
|
96d162c7e5 | ||
|
|
01b48d44e8 | ||
|
|
c39f7df513 | ||
|
|
ec15362770 | ||
|
|
962878b843 | ||
|
|
9d8909c38d | ||
|
|
99a00a2c17 | ||
|
|
1d2b74e39d | ||
|
|
b097e64b56 | ||
|
|
28a245dd53 | ||
|
|
4eabf002c5 | ||
|
|
ae4af4d61f | ||
|
|
dd9c7d0e1c | ||
|
|
7ab8823757 | ||
|
|
dd287029db | ||
|
|
6ec6007091 | ||
|
|
985be854c4 | ||
|
|
8129cc1c03 | ||
|
|
dddba708d2 | ||
|
|
2596a54935 | ||
|
|
794a90a5e2 | ||
|
|
9e7c3463e0 | ||
|
|
ed40ef1267 | ||
|
|
b9a4917f81 | ||
|
|
1081dcdda1 | ||
|
|
3a497ddcbd | ||
|
|
8f6c7ccdeb | ||
|
|
0e9d96a303 | ||
|
|
531b767c0b | ||
|
|
0cfedd4516 | ||
|
|
8f01babdd3 | ||
|
|
5dab9c40ab | ||
|
|
f2dd8fe371 | ||
|
|
5d0e5dd407 | ||
|
|
39fb433131 | ||
|
|
e68a2621ed | ||
|
|
cb6545d601 | ||
|
|
6dbbf08654 |
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]
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
name: Other issues
|
||||
about: Found a bug? Want to implement a new feature?
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
---
|
||||
name: Sparkle doesn't work in my app
|
||||
name: Sparkle 1.x doesn't work in my app
|
||||
about: Problems with integration, unexpected errors
|
||||
title: ''
|
||||
labels: ''
|
||||
labels: '1.x'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Sparkle 2.x doesn't work in my app
|
||||
about: Problems with using the beta version of Sparkle 2
|
||||
title: ''
|
||||
labels: '2.x'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
The answer to your issue is probably already in Console.app on your computer.
|
||||
Please use Console.app and search for Sparkle.
|
||||
|
||||
Please try troubleshooting steps:
|
||||
https://github.com/sparkle-project/Sparkle#troubleshooting
|
||||
|
||||
-->
|
||||
|
||||
### Description of the problem
|
||||
|
||||
|
||||
### Do you use Sandboxing in your app?
|
||||
|
||||
### Version of `Sparkle.framework` in the latest version of your app
|
||||
|
||||
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
|
||||
|
||||
### Sparkle's output from Console.app
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### Steps to reproduce the behavior
|
||||
@@ -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]
|
||||
@@ -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', 'xcode13']
|
||||
include:
|
||||
- xcode: 'xcode12.5'
|
||||
xcode-path: '/Applications/Xcode_12.5.app/Contents/Developer'
|
||||
upload-dist: true
|
||||
- xcode: 'xcode13'
|
||||
xcode-path: '/Applications/Xcode_13.0.app/Contents/Developer'
|
||||
upload-dist: false # In Beta, so no upload
|
||||
|
||||
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
|
||||
@@ -0,0 +1,75 @@
|
||||
name: "Create Draft Release"
|
||||
|
||||
env:
|
||||
BUILDDIR: "build"
|
||||
DEVELOPER_DIR: "/Applications/Xcode_12.5.1.app/Contents/Developer"
|
||||
|
||||
on:
|
||||
workflow_dispatch
|
||||
|
||||
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: "Extract version information from project"
|
||||
run: |
|
||||
MARKETING_VERSION=$(xcrun xcodebuild -showBuildSettings -project Sparkle.xcodeproj | grep -m 1 '^[[:space:]]*MARKETING_VERSION' | sed -E 's/.+=[[:space:]]+(.*)$/\1/')
|
||||
echo "MARKETING_VERSION=${MARKETING_VERSION}" >> $GITHUB_ENV
|
||||
|
||||
- name: "Determine if this is a pre-release version"
|
||||
run: |
|
||||
SPARKLE_VERSION_SUFFIX=$(xcrun xcodebuild -showBuildSettings -project Sparkle.xcodeproj | grep -m 1 '^[[:space:]]*SPARKLE_VERSION_SUFFIX' | sed -E 's/.+=[[:space:]]+(.*)$/\1/')
|
||||
if [[ ! -z "$SPARKLE_VERSION_SUFFIX" ]]; 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 "${{ env.MARKETING_VERSION }}"
|
||||
|
||||
- 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 ${{ env.MARKETING_VERSION }}"
|
||||
tag_name: ${{ env.MARKETING_VERSION }}
|
||||
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
|
||||
@@ -41,3 +41,7 @@ Carthage/Build
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# Swift Package Manager
|
||||
/.build
|
||||
.swiftpm
|
||||
@@ -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
|
||||
@@ -1,5 +0,0 @@
|
||||
language: objective-c
|
||||
osx_image: xcode9
|
||||
before_install:
|
||||
- brew update
|
||||
script: make ci
|
||||
@@ -1,3 +1,96 @@
|
||||
# 1.27.0
|
||||
|
||||
* Deprecate not using EdDSA and skip DSA verification when possible in #1892 (Zorg)
|
||||
* Pass http headers and user agent when downloading release notes from #1873 (Zorg)
|
||||
* Fix project warnings from #1893 (Zorg)
|
||||
* Update sample appcast from #1895 (Zorg)
|
||||
* Fix appcast pubDate tag generation in different locales from #1898 (Sungbin Jo)
|
||||
* Create valid xar archives for generating binary delta files from #1906 (Zorg)
|
||||
* Fix a few issues with German localization from #1931 (J-rg)
|
||||
* Fix issues with Russian localizations from #1947 (Konstantin Zamyakin)
|
||||
* Fix issues with Czech localizations from #1943 (Vojtěch Koňařík)
|
||||
* Add an automated workflow that builds and publishes official Sparkle releases (Tony Arnold, Zorg)
|
||||
|
||||
# 1.26.0
|
||||
|
||||
* Flat package support from #1745 (Zorg)
|
||||
* Correct generate_appcast -s command line argument usage help (Lance Lovette)
|
||||
* Fix -f command line argument handling (Lance Lovette)
|
||||
* Fix progress for guided pkg install (Zorg)
|
||||
* Fix XQuartz update failing because NSLog caused issues (Zorg)
|
||||
* Update localization (Vojtěch Koňařík)
|
||||
* Various fixes to SPM logic (Jonas Zaugg)
|
||||
|
||||
# 1.25.0
|
||||
|
||||
* Raise minimum system version to 10.9 (Kornel)
|
||||
* Allow an appcast to prevent the new version from being installed automatically (#1688) (pierswalter)
|
||||
* UI fixes
|
||||
* Show check for updates button only when automatic updates are enabled (Lorena Rangel)
|
||||
* Don't initialize the webview if we don't show release notes (Tobias Fonfara)
|
||||
* Keep skip button available if there is a minimum autoupdate version (Zorg)
|
||||
* Fix automatic updates checkbox state when not showing release notes (Zorg)
|
||||
* Fix edge cases with hiding alert buttons and using "Install Later" (Zorg)
|
||||
* Re-add setting WebUIDelegate fix for legacy web view (Zorg)
|
||||
* Adopt WKWebView for 1.x (Zorg)
|
||||
* Add auto layout constraints to SUAutomaticUpdateAlert window (Zorg)
|
||||
* Made buttons wide enough to display the full text. Made window wide enough to display the widened buttons (el, fi, ru, uk) (Piers Uso Walter)
|
||||
* Remove max size from update alert. (George Nachman)
|
||||
* Integrate generate_keys export/import options changes from #1730 (Zorg)
|
||||
* Add `—release-notes-url-prefix` support to localized release notes (Adam Tharani)
|
||||
* Translations
|
||||
* Enable base internalization for alert xibs (Zorg)
|
||||
* Capitalizes french translation of "Vous utilisez actuellement..." ("You are currently running...") (Micah Moore)
|
||||
* Fix and cleanup Hebrew, Catalan, Finnish localizations (Zorg)
|
||||
* Remove non-english localizations from TestApplication (Zorg)
|
||||
* Fix catch-22 Swift Package Manager binary target (Jonas Zaugg)
|
||||
* Add explicit dependencies to fix Xcode linking errors (Kornel)
|
||||
* Add phased rollouts feature to automatic update driver too (Zorg)
|
||||
* Remove hiding skip button and retitling later button (Zorg)
|
||||
* Deprecate installUpdatesIfAvailable (Zorg)
|
||||
* Apply custom headers to app download (Geraint White)
|
||||
|
||||
# 1.24.0
|
||||
|
||||
* Prioritize UserDefaults when fetching value for EnableAutomaticChecks (Nicolas Bosi)
|
||||
* Improve best appcast item selection handling (Ian Bytchek)
|
||||
* Create lockfile for improved compatibility with 3rd party updaters (CoreCode)
|
||||
* Enable SPM support via binary target (Jonas Zaugg)
|
||||
* `generate_appcast` improvements:
|
||||
* follow symbolic links (Denis Dzyubenko)
|
||||
* update the release notes element’s URL when required (Brad Andalman)
|
||||
* Added output filename option to generate_appcast (Brad Andalman)
|
||||
* Added —release-notes-url-prefix to generate_appcast (Brad Andalman)
|
||||
* Command line option to provide a download url prefix is now parsed and set on each archive item (Dominik H)
|
||||
* Added help command line option (Dominik H)
|
||||
* Locale updates:
|
||||
* Update zh_CN localization (柳东原 · Dongyuan Liu)
|
||||
* Update Sparkle.strings (Vojtěch Koňařík)
|
||||
* Update Croatian (#1603) (milotype)
|
||||
* Update SUUpdateAlert.xib (DanielFirlej)
|
||||
* fix: read SUAutomaticallyUpdate from Info.plist (Trevor DeVore)
|
||||
* Fix casting Boolean to BOOL on Apple Silicon (Kevin Wojniak)
|
||||
* Use build matrix to test on multiple Xcode versions (Rajiv Shah)
|
||||
* Set UpdateAlert and AutomaticUpdateAlert window's fullscreen collectionBehavior to NSWindowCollectionBehaviorFullScreenAuxiliary to allow them to present on top of the Main App's window if it's fullscreen. (Micah Moore)
|
||||
* Fixed error about "about:blank" release notes (Louis Pontoise)
|
||||
* Support App Store URL scheme in release note webview (Bi11)
|
||||
* Use the SHA-256 hash of the archive as the cache path (Nate Weaver)
|
||||
* Don't return an optional from the FileHandle method (Nate Weaver)
|
||||
* Added URL+Hashing (Nate Weaver)
|
||||
|
||||
# 1.23.0
|
||||
|
||||
* Support generating appcast with localizations (#1499) (Alik Vovkotrub)
|
||||
* Support versions with git commit SHA (#1504) (Alec Larson)
|
||||
* Hide "Skip..." and "Remind..." buttons when they're not relevant (#1480) (Kenneth Johnsen)
|
||||
* Preserve Finder tags while updating apps (#1512) (CoreCode)
|
||||
* Read-only update alert dialog formatting improvements (#1515) (Quinn Taylor)
|
||||
* Check if `SUBundleName` is set before normalizing (Jake Fenton)
|
||||
* `NSInteger` cast warning on Xcode 11 (Marga Keuvelaar)
|
||||
* Correct appcast file extension (Tom Vos)
|
||||
* Update Sparkle.strings (Emir Sarı)
|
||||
* Fix spelling (#1508) (Frank Chiarulli Jr)
|
||||
|
||||
# 1.22.0
|
||||
|
||||
* Enabled "Hardened Runtime" build option for Apple's notarization requirement
|
||||
@@ -6,15 +99,21 @@
|
||||
* Add phased rollout feature (#1381) (Fabian Jäger)
|
||||
* Ignore non-standard permissions in delta updates instead of failing the build (Kornel Lesiński)
|
||||
* Notify user when installed version is newer than the latest in the appcast (CoreCode)
|
||||
* Reset timers after computer sleep (CoreCode)
|
||||
* Block-based alternatives to `NSInvocation`-based delegate methods (Fabian Jäger)
|
||||
* Add delegate `userDidSkipThisVersion` (BobZombie, Leo Natan, bono yusuke)
|
||||
* Pass item to updaterShouldShowUpdateAlertForScheduledUpdate delegate method (George Nachman)
|
||||
* Support providing private key as argument in `generate_appcast` (Yakuhzi, marchyang)
|
||||
* Separate the ed25519 sources into a new static library (Tony Arnold)
|
||||
* Correction of Czech localization inconsistency (#1403) (vojtakonarik)
|
||||
* Disambiguate signing error messages (Nate Weaver)
|
||||
* Use `XMLNode.Options.nodePrettyPrint` in `generate_appcast` instead of trying to add whitespace manually (fumoboy007)
|
||||
* Annotate SUHost for nullability (Michael Buckley)
|
||||
* Use SUAVAILABLE macro (Christiaan Hofman)
|
||||
* Fix warnings when using modules (nivekkagicom)
|
||||
* Correction of Czech localization inconsistency (#1403) (vojtakonarik)
|
||||
* BR locale fix (BR Lingo)
|
||||
* Update Japanese localization (fujisoft)
|
||||
* French Sparkle.strings (Jean-Baptiste)
|
||||
|
||||
# 1.21.3
|
||||
|
||||
|
||||
@@ -15,23 +15,31 @@ 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
|
||||
SPARKLE_VERSION_MAJOR = 1
|
||||
SPARKLE_VERSION_MINOR = 22
|
||||
SPARKLE_VERSION_MINOR = 27
|
||||
SPARKLE_VERSION_PATCH = 0
|
||||
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
|
||||
|
||||
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
|
||||
// This should be in SemVer format or empty, ie. "-rc.1"
|
||||
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.102
|
||||
|
||||
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
||||
|
||||
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 +63,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 +90,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
|
||||
@@ -1,2 +1,2 @@
|
||||
SWIFT_VERSION = 4.0
|
||||
SWIFT_VERSION = 4.2
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
|
||||
@@ -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 = -
|
||||
@@ -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
|
||||
Executable
+23
@@ -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)
|
||||
@@ -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" -eq 1 ] ; then
|
||||
echo "WARNING: xz compression is used for official releases but bz2 is being used instead because xz tool is not installed on your system."
|
||||
fi
|
||||
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
fi
|
||||
Executable
+33
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.0"
|
||||
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
|
||||
let tag = "1.27.0"
|
||||
let checksum = "4f9e6c1bda2b7ba7bc3dfc5aeb1a3f7f236e03d413f3d485fadde776459ff4fd"
|
||||
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
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
+7
-4
@@ -1,9 +1,12 @@
|
||||
# Sparkle [](https://travis-ci.org/sparkle-project/Sparkle) [](https://github.com/Carthage/Carthage) []() <a href="https://www.stackpath.com/?utm_source=sparkle-github&utm_medium=badge&utm_campaign=readme"><img src="https://img.shields.io/badge/sponsored%20by-StackPath-orange.svg" alt="sponsored by: StackPath"></a>
|
||||
# Sparkle 1.x  [](https://github.com/Carthage/Carthage) []() <a href="https://www.stackpath.com/?utm_source=sparkle-github&utm_medium=badge&utm_campaign=readme"><img src="https://img.shields.io/badge/sponsored%20by-StackPath-orange.svg" alt="sponsored by: StackPath"></a>
|
||||
|
||||
Secure and reliable software update framework for Cocoa developers.
|
||||
|
||||
<img src="Resources/Screenshot.png" width="732" alt="Sparkle shows familiar update window with release notes">
|
||||
|
||||
This branch is the production ready, battle-tested version of Sparkle used by thousands of Mac apps.
|
||||
The upcoming Sparkle 2 (currently in beta) can be found in the [2.x branch](https://github.com/sparkle-project/Sparkle/tree/2.x).
|
||||
|
||||
## Features
|
||||
|
||||
* Seamless. There's no mention of Sparkle; your icons and app name are used.
|
||||
@@ -20,10 +23,10 @@ Secure and reliable software update framework for Cocoa developers.
|
||||
|
||||
## 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.0 (alpha) can.
|
||||
* No sandboxing. Sparkle 1.x can't update sandboxed apps. However, [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
color: white;
|
||||
background: transparent;
|
||||
}
|
||||
:link {
|
||||
color: #419CFF;
|
||||
}
|
||||
:link:active {
|
||||
color: #FF1919;
|
||||
}
|
||||
}
|
||||
+16
-12
@@ -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
@@ -1,11 +1,11 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Sparkle"
|
||||
s.version = "1.22.0"
|
||||
s.version = "1.27.0"
|
||||
s.summary = "A software update framework for macOS"
|
||||
s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers."
|
||||
s.homepage = "http://sparkle-project.org"
|
||||
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/*'
|
||||
|
||||
+553
-513
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>
|
||||
@@ -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
@@ -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>
|
||||
|
||||
Vendored
+10
-8
@@ -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;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Vendored
+47
-25
@@ -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>
|
||||
+16
-43
@@ -1,12 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<development version="7000" identifier="xcode"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
|
||||
<plugIn identifier="com.apple.WebKitIBPlugin" version="11542"/>
|
||||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
<capability name="box content view" minToolsVersion="7.0"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SUUpdateAlert">
|
||||
@@ -15,8 +12,8 @@
|
||||
<outlet property="descriptionField" destination="101" id="9oA-2S-eXN"/>
|
||||
<outlet property="installButton" destination="76" id="176"/>
|
||||
<outlet property="laterButton" destination="22" id="177"/>
|
||||
<outlet property="releaseNotesBoxView" destination="89" id="FhX-K4-uzH"/>
|
||||
<outlet property="releaseNotesContainerView" destination="fKC-QA-GZa" id="BYw-MA-Z5h"/>
|
||||
<outlet property="releaseNotesView" destination="18" id="32"/>
|
||||
<outlet property="skipButton" destination="23" id="178"/>
|
||||
<outlet property="window" destination="5" id="69"/>
|
||||
</connections>
|
||||
@@ -25,11 +22,11 @@
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowCollectionBehavior key="collectionBehavior" fullScreenAuxiliary="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="746" y="229" width="620" height="370"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
|
||||
<value key="minSize" type="size" width="550" height="150"/>
|
||||
<value key="maxSize" type="size" width="700" height="600"/>
|
||||
<view key="contentView" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="620" height="370"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
@@ -76,34 +73,15 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="fKC-QA-GZa" userLabel="Container to hide release notes">
|
||||
<rect key="frame" x="108" y="74" width="492" height="234"/>
|
||||
<rect key="frame" x="108" y="73" width="492" height="235"/>
|
||||
<subviews>
|
||||
<box boxType="oldStyle" borderType="line" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="89">
|
||||
<rect key="frame" x="0.0" y="0.0" width="492" height="214"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="492" height="215"/>
|
||||
<view key="contentView" id="hbB-V1-Bf6">
|
||||
<rect key="frame" x="1" y="1" width="490" height="212"/>
|
||||
<rect key="frame" x="1" y="1" width="490" height="213"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<webView maintainsBackForwardList="NO" translatesAutoresizingMaskIntoConstraints="NO" id="18">
|
||||
<rect key="frame" x="0.0" y="-2" width="492" height="214"/>
|
||||
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12" minimumFontSize="7" plugInsEnabled="NO" javaEnabled="NO" javaScriptCanOpenWindowsAutomatically="NO">
|
||||
<nil key="identifier"/>
|
||||
</webPreferences>
|
||||
<connections>
|
||||
<binding destination="-2" name="hidden" keyPath="showsReleaseNotes" id="161">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</webView>
|
||||
</subviews>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstItem="18" firstAttribute="top" secondItem="89" secondAttribute="top" constant="1" id="3ps-Yo-uZA"/>
|
||||
<constraint firstAttribute="trailing" secondItem="18" secondAttribute="trailing" constant="-1" id="5W0-Eb-Snn"/>
|
||||
<constraint firstAttribute="bottom" secondItem="18" secondAttribute="bottom" constant="-1" id="NOY-VJ-z4I"/>
|
||||
<constraint firstItem="18" firstAttribute="leading" secondItem="89" secondAttribute="leading" constant="1" id="kSE-Xj-CRB"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="100" id="pvn-8k-9Ev"/>
|
||||
</constraints>
|
||||
<font key="titleFont" size="11" name="LucidaGrande"/>
|
||||
@@ -116,7 +94,7 @@
|
||||
</connections>
|
||||
</box>
|
||||
<textField verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="17">
|
||||
<rect key="frame" x="-2" y="220" width="88" height="14"/>
|
||||
<rect key="frame" x="-2" y="221" width="88" height="14"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" priority="100" constant="100" id="gkn-FW-9aC"/>
|
||||
</constraints>
|
||||
@@ -144,7 +122,7 @@
|
||||
</constraints>
|
||||
</customView>
|
||||
<button horizontalHuggingPriority="150" verticalHuggingPriority="750" horizontalCompressionResistancePriority="997" translatesAutoresizingMaskIntoConstraints="NO" id="22">
|
||||
<rect key="frame" x="331" y="12" width="143" height="32"/>
|
||||
<rect key="frame" x="338" y="12" width="137" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" priority="222" constant="90" id="2Zy-5G-GBj"/>
|
||||
</constraints>
|
||||
@@ -160,7 +138,7 @@ Gw
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" horizontalCompressionResistancePriority="998" translatesAutoresizingMaskIntoConstraints="NO" id="23">
|
||||
<rect key="frame" x="103" y="12" width="145" height="32"/>
|
||||
<rect key="frame" x="102" y="12" width="139" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Skip This Version" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="172">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -170,7 +148,7 @@ Gw
|
||||
</connections>
|
||||
</button>
|
||||
<button horizontalHuggingPriority="20" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="76">
|
||||
<rect key="frame" x="474" y="12" width="132" height="32"/>
|
||||
<rect key="frame" x="473" y="12" width="134" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" priority="222" constant="120" id="N94-uf-6oP"/>
|
||||
</constraints>
|
||||
@@ -186,7 +164,7 @@ DQ
|
||||
</connections>
|
||||
</button>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="117">
|
||||
<rect key="frame" x="106" y="49" width="495" height="20"/>
|
||||
<rect key="frame" x="108" y="50" width="491" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="28" id="0AI-ue-a0r"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="14" id="yM1-TA-HfP"/>
|
||||
@@ -196,11 +174,6 @@ DQ
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="hidden" keyPath="allowsAutomaticUpdates" id="141">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
<binding destination="93" name="value" keyPath="values.SUAutomaticallyUpdate" id="135"/>
|
||||
</connections>
|
||||
</button>
|
||||
@@ -242,6 +215,6 @@ DQ
|
||||
<userDefaultsController representsSharedInstance="YES" id="93" userLabel="Shared Defaults"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
<image name="NSApplicationIcon" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
Vendored
+20
-20
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<development version="7000" identifier="xcode"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SUUpdatePermissionPrompt">
|
||||
@@ -22,13 +23,13 @@
|
||||
<windowStyleMask key="styleMask" titled="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="83" y="492" width="438" height="168"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1418"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
|
||||
<value key="minSize" type="size" width="213" height="107"/>
|
||||
<view key="contentView" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="438" height="168"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" tag="1" id="13">
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="13">
|
||||
<rect key="frame" x="260" y="12" width="164" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Check Automatically" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" tag="1" inset="2" id="176">
|
||||
@@ -42,7 +43,7 @@ DQ
|
||||
<action selector="finishPrompt:" target="-2" id="144"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" id="14">
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="14">
|
||||
<rect key="frame" x="145" y="12" width="115" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Don’t Check" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="177">
|
||||
@@ -56,7 +57,7 @@ Gw
|
||||
<action selector="finishPrompt:" target="-2" id="145"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" id="32">
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="32">
|
||||
<rect key="frame" x="104" y="114" width="289" height="34"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Check for updates automatically?" id="178">
|
||||
@@ -65,7 +66,7 @@ Gw
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" id="33">
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="33">
|
||||
<rect key="frame" x="104" y="81" width="315" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="DO NOT LOCALIZE" id="179">
|
||||
@@ -77,7 +78,7 @@ Gw
|
||||
<binding destination="-2" name="value" keyPath="promptDescription" id="161"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<button focusRingType="none" id="34">
|
||||
<button focusRingType="none" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="34">
|
||||
<rect key="frame" x="104" y="53" width="278" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Include anonymous system profile" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" focusRingType="none" inset="2" id="180">
|
||||
@@ -98,7 +99,7 @@ Gw
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<imageView id="37">
|
||||
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="37">
|
||||
<rect key="frame" x="23" y="84" width="64" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="axesIndependently" image="NSApplicationIcon" id="181"/>
|
||||
@@ -106,7 +107,7 @@ Gw
|
||||
<binding destination="-2" name="value" keyPath="icon" id="130"/>
|
||||
</connections>
|
||||
</imageView>
|
||||
<button focusRingType="none" horizontalHuggingPriority="750" verticalHuggingPriority="750" id="71">
|
||||
<button focusRingType="none" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="71">
|
||||
<rect key="frame" x="80" y="50" width="27" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="disclosureTriangle" bezelStyle="disclosure" imagePosition="overlaps" alignment="center" borderStyle="border" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="182">
|
||||
@@ -124,6 +125,7 @@ Gw
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<point key="canvasLocation" x="13" y="131"/>
|
||||
</window>
|
||||
<arrayController editable="NO" preservesSelection="NO" selectsInsertedObjects="NO" avoidsEmptySelection="NO" id="24" userLabel="Array Controller">
|
||||
<declaredKeys>
|
||||
@@ -140,7 +142,7 @@ Gw
|
||||
<rect key="frame" x="0.0" y="0.0" width="362" height="205"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" id="46">
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="46">
|
||||
<rect key="frame" x="1" y="128" width="358" height="70"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="183">
|
||||
@@ -152,7 +154,7 @@ This is the information that would be sent:</string>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<scrollView autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="0.0" verticalLineScroll="16" verticalPageScroll="0.0" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="40">
|
||||
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="0.0" verticalLineScroll="16" verticalPageScroll="0.0" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="40">
|
||||
<rect key="frame" x="4" y="5" width="355" height="115"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" id="sbp-rk-wxX">
|
||||
@@ -161,14 +163,13 @@ This is the information that would be sent:</string>
|
||||
<subviews>
|
||||
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="14" id="41">
|
||||
<rect key="frame" x="0.0" y="0.0" width="353" height="113"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn editable="NO" width="128" minWidth="40" maxWidth="1000" id="42">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</tableHeaderCell>
|
||||
@@ -182,9 +183,8 @@ This is the information that would be sent:</string>
|
||||
<binding destination="24" name="value" keyPath="arrangedObjects.displayKey" id="174"/>
|
||||
</connections>
|
||||
</tableColumn>
|
||||
<tableColumn editable="NO" width="219" minWidth="40" maxWidth="1000" id="44">
|
||||
<tableColumn editable="NO" width="210" minWidth="40" maxWidth="1000" id="44">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</tableHeaderCell>
|
||||
@@ -202,11 +202,11 @@ This is the information that would be sent:</string>
|
||||
</tableView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="185">
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" controlSize="small" horizontal="YES" id="185">
|
||||
<rect key="frame" x="-100" y="-100" width="345" height="11"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" controlSize="small" horizontal="NO" id="184">
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" controlSize="small" horizontal="NO" id="184">
|
||||
<rect key="frame" x="-22" y="1" width="11" height="125"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
@@ -221,6 +221,6 @@ This is the information that would be sent:</string>
|
||||
</userDefaultsController>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
<image name="NSApplicationIcon" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -2,9 +2,13 @@
|
||||
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?";
|
||||
|
||||
"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.";
|
||||
"%1$@ can't be updated, because it was opened from a read-only or a temporary location." = "%1$@ can't be updated, because it was opened from a read-only or a temporary location.";
|
||||
|
||||
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again. %2$@ can’t be updated if it’s running from the location it was downloaded to." = "Quit %1$@, move it into your Applications folder, relaunch it from there and try again. %2$@ can’t be updated if it’s running from the location it was downloaded to.";
|
||||
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.";
|
||||
|
||||
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "Quit %1$@, move it into your Applications folder, relaunch it from there and try again.";
|
||||
|
||||
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ can’t be updated if it’s running from the location it was downloaded to.";
|
||||
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";
|
||||
|
||||
@@ -90,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!";
|
||||
Vendored
+2
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
html {
|
||||
color: #FFFFFFD8;
|
||||
}
|
||||
:link {
|
||||
color: #419CFF;
|
||||
}
|
||||
:link:active {
|
||||
color: #FF1919;
|
||||
}
|
||||
Vendored
-7
@@ -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
|
||||
Vendored
-13
@@ -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
|
||||
Vendored
-168
@@ -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
|
||||
Vendored
-7
@@ -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
|
||||
|
||||
Vendored
-4
@@ -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
|
||||
|
||||
Vendored
+9
-19
@@ -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
|
||||
|
||||
Vendored
+4
@@ -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;
|
||||
|
||||
Vendored
+7
-3
@@ -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;
|
||||
}
|
||||
|
||||
Vendored
+7
-2
@@ -179,8 +179,8 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
- (void)automaticUpdateAlertFinishedWithChoice:(SUAutomaticInstallationChoice)choice
|
||||
{
|
||||
self.alert = nil;
|
||||
switch (choice)
|
||||
{
|
||||
switch (choice)
|
||||
{
|
||||
case SUInstallNowChoice:
|
||||
[self stopUpdatingOnTermination];
|
||||
[self installWithToolAndRelaunch:YES];
|
||||
@@ -234,4 +234,9 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)usesPhasedRollout
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+2
@@ -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;
|
||||
|
||||
Vendored
+86
-18
@@ -25,9 +25,10 @@
|
||||
#import "SUUpdater.h"
|
||||
#import "SUAppcast.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUGlobalUpdateLock.h"
|
||||
#import "SUSystemUpdateInfo.h"
|
||||
|
||||
#import "SPUURLRequest.h"
|
||||
#import "SPUDownloaderDeprecated.h"
|
||||
#import "SPUDownloaderSession.h"
|
||||
|
||||
@interface SUBasicUpdateDriver ()
|
||||
@@ -63,15 +64,16 @@
|
||||
- (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])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningTranslocated userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"Quit %1$@, move it into your Applications folder, relaunch it from there and try again. %2$@ can’t be updated if it’s running from the location it was downloaded to.", nil), [aHost name], [aHost name]] }]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningTranslocated userInfo:@{ NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedString(@"Quit %1$@, move it into your Applications folder, relaunch it from there and try again.", nil), hostName], NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can’t be updated if it’s running from the location it was downloaded to.", nil), hostName], }]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated, because it was opened from a read-only or a temporary location. Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.", nil), [aHost name]] }]];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated, because it was opened from a read-only or a temporary location.", nil), hostName], NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedString(@"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.", nil), hostName] }]];
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -117,9 +119,18 @@
|
||||
- (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]) {
|
||||
if (!item || [comparator compareVersion:item.versionString toVersion:candidate.versionString] == NSOrderedAscending) {
|
||||
// Pick this item if nothing is picked yet. Always pick an item with a higher version. Only if versions are the same
|
||||
// compare their dates and pick this item if its date is not lower – this covers cases when no date is available
|
||||
// and picks items at the end of the appcast list as they are more likely to be the most recent releases.
|
||||
if (
|
||||
!item
|
||||
|| (order = [comparator compareVersion:item.versionString toVersion:candidate.versionString]) == NSOrderedAscending
|
||||
|| (order == NSOrderedSame && [item.date compare:candidate.date] != NSOrderedDescending)
|
||||
) {
|
||||
item = candidate;
|
||||
}
|
||||
}
|
||||
@@ -135,10 +146,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;
|
||||
}
|
||||
@@ -164,10 +203,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;
|
||||
}
|
||||
|
||||
@@ -229,6 +273,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:)]) {
|
||||
@@ -291,6 +342,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]];
|
||||
@@ -298,22 +352,27 @@
|
||||
request.networkServiceType = NSURLNetworkServiceTypeBackground;
|
||||
}
|
||||
|
||||
[request setValue:[updater userAgentString] forHTTPHeaderField:@"User-Agent"];
|
||||
NSString *userAgentString = [updater userAgentString];
|
||||
if (userAgentString) {
|
||||
[request setValue:userAgentString forHTTPHeaderField:@"User-Agent"];
|
||||
}
|
||||
|
||||
NSDictionary<NSString *, NSString *> *httpHeaders = [updater httpHeaders];
|
||||
if (httpHeaders) {
|
||||
for (NSString *key in httpHeaders) {
|
||||
NSString *value = [httpHeaders objectForKey:key];
|
||||
[request setValue:value forHTTPHeaderField:key];
|
||||
}
|
||||
}
|
||||
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:willDownloadUpdate:withRequest:)]) {
|
||||
[[updater delegate] updater:self.updater
|
||||
willDownloadUpdate:self.updateItem
|
||||
withRequest:request];
|
||||
}
|
||||
|
||||
if (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];
|
||||
@@ -340,6 +399,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];
|
||||
@@ -667,6 +732,9 @@
|
||||
|
||||
- (void)abortUpdate
|
||||
{
|
||||
// Remove lockfile to prevent 3rd party updaters from updating this app if the update is not going to happen anyway
|
||||
[[SUGlobalUpdateLock sharedLock] unlock];
|
||||
|
||||
[self cleanUpDownload];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
self.updateItem = nil;
|
||||
|
||||
Vendored
+3
@@ -185,6 +185,9 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
// 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))) {
|
||||
|
||||
Vendored
-1
@@ -61,7 +61,6 @@ typedef NS_ENUM(uint16_t, SUBinaryDeltaMajorVersion)
|
||||
#define LATEST_DELTA_DIFF_MAJOR_VERSION SUBeigeMajorVersion
|
||||
|
||||
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);
|
||||
|
||||
Vendored
+1
-10
@@ -45,7 +45,7 @@ int latestMinorVersionForMajorVersion(SUBinaryDeltaMajorVersion majorVersion)
|
||||
case SUAzureMajorVersion:
|
||||
return 1;
|
||||
case SUBeigeMajorVersion:
|
||||
return 2;
|
||||
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 };
|
||||
|
||||
Vendored
+89
-26
@@ -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) {
|
||||
@@ -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");
|
||||
|
||||
@@ -505,17 +568,17 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
if (shouldSkipDeltaCompression(originalInfo, newInfo)) {
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) && 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)) {
|
||||
@@ -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]);
|
||||
|
||||
Vendored
+11
-11
@@ -30,14 +30,14 @@ static void printUsage(NSString *programName)
|
||||
fprintf(stderr, "%s version [<patch-file>]\n", [programName UTF8String]);
|
||||
}
|
||||
|
||||
static BOOL runCreateCommand(NSString *programName, NSArray *args)
|
||||
static BOOL runCreateCommand(NSString *programName, NSArray<NSString *> *args)
|
||||
{
|
||||
if (args.count < 3 || args.count > 5) {
|
||||
printUsage(programName);
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSUInteger numberOflagsFound = 0;
|
||||
NSUInteger numberOfFlagsFound = 0;
|
||||
NSUInteger verboseIndex = [args indexOfObject:VERBOSE_FLAG];
|
||||
NSUInteger versionIndex = NSNotFound;
|
||||
for (NSUInteger argumentIndex = 0; argumentIndex < args.count; ++argumentIndex) {
|
||||
@@ -48,13 +48,13 @@ static BOOL runCreateCommand(NSString *programName, NSArray *args)
|
||||
}
|
||||
|
||||
if (verboseIndex != NSNotFound) {
|
||||
++numberOflagsFound;
|
||||
++numberOfFlagsFound;
|
||||
}
|
||||
if (versionIndex != NSNotFound) {
|
||||
++numberOflagsFound;
|
||||
++numberOfFlagsFound;
|
||||
}
|
||||
|
||||
if (args.count - numberOflagsFound < 3) {
|
||||
if (args.count - numberOfFlagsFound < 3) {
|
||||
printUsage(programName);
|
||||
return NO;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ static BOOL runCreateCommand(NSString *programName, NSArray *args)
|
||||
BOOL verbose = (verboseIndex != NSNotFound);
|
||||
NSString *versionField = (versionIndex != NSNotFound) ? args[versionIndex] : nil;
|
||||
|
||||
NSArray *versionComponents = nil;
|
||||
NSArray<NSString *> *versionComponents = nil;
|
||||
if (versionField) {
|
||||
versionComponents = [versionField componentsSeparatedByString:@"="];
|
||||
if (versionComponents.count != 2) {
|
||||
@@ -124,7 +124,7 @@ static BOOL runCreateCommand(NSString *programName, NSArray *args)
|
||||
return YES;
|
||||
}
|
||||
|
||||
static BOOL runApplyCommand(NSString *programName, NSArray *args)
|
||||
static BOOL runApplyCommand(NSString *programName, NSArray<NSString *> *args)
|
||||
{
|
||||
if (args.count < 3 || args.count > 4) {
|
||||
printUsage(programName);
|
||||
@@ -138,7 +138,7 @@ static BOOL runApplyCommand(NSString *programName, NSArray *args)
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSMutableArray *fileArgs = [NSMutableArray array];
|
||||
NSMutableArray<NSString *> *fileArgs = [NSMutableArray array];
|
||||
for (NSString *argument in args) {
|
||||
if (![argument isEqualToString:VERBOSE_FLAG]) {
|
||||
[fileArgs addObject:argument];
|
||||
@@ -172,7 +172,7 @@ static BOOL runApplyCommand(NSString *programName, NSArray *args)
|
||||
return YES;
|
||||
}
|
||||
|
||||
static BOOL runVersionCommand(NSString *programName, NSArray *args)
|
||||
static BOOL runVersionCommand(NSString *programName, NSArray<NSString *> *args)
|
||||
{
|
||||
if (args.count > 1) {
|
||||
printUsage(programName);
|
||||
@@ -218,7 +218,7 @@ static BOOL runVersionCommand(NSString *programName, NSArray *args)
|
||||
int main(int __unused argc, char __unused *argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSArray *args = [[NSProcessInfo processInfo] arguments];
|
||||
NSArray<NSString *> *args = [[NSProcessInfo processInfo] arguments];
|
||||
NSString *programName = [args[0] lastPathComponent];
|
||||
|
||||
if (args.count < 2) {
|
||||
@@ -227,7 +227,7 @@ int main(int __unused argc, char __unused *argv[])
|
||||
}
|
||||
|
||||
NSString *command = args[1];
|
||||
NSArray *commandArguments = [args subarrayWithRange:NSMakeRange(2, args.count - 2)];
|
||||
NSArray<NSString *> *commandArguments = [args subarrayWithRange:NSMakeRange(2, args.count - 2)];
|
||||
|
||||
BOOL result;
|
||||
if ([command isEqualToString:CREATE_COMMAND]) {
|
||||
|
||||
Vendored
+8
-5
@@ -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;
|
||||
@@ -89,4 +90,6 @@ extern NSString *const SURSSElementLink;
|
||||
extern NSString *const SURSSElementPubDate;
|
||||
extern NSString *const SURSSElementTitle;
|
||||
|
||||
extern NSString *const SUXMLLanguage;
|
||||
|
||||
#endif
|
||||
Vendored
+4
-1
@@ -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";
|
||||
@@ -78,3 +79,5 @@ NSString *const SURSSElementEnclosure = @"enclosure";
|
||||
NSString *const SURSSElementLink = @"link";
|
||||
NSString *const SURSSElementPubDate = @"pubDate";
|
||||
NSString *const SURSSElementTitle = @"title";
|
||||
|
||||
NSString *const SUXMLLanguage = @"xml:lang";
|
||||
Vendored
+8
-8
@@ -56,7 +56,7 @@
|
||||
// Called on a non-main thread.
|
||||
- (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier
|
||||
{
|
||||
@autoreleasepool {
|
||||
@autoreleasepool {
|
||||
BOOL mountedSuccessfully = NO;
|
||||
|
||||
// get a unique mount point path
|
||||
@@ -65,7 +65,7 @@
|
||||
NSError *error;
|
||||
NSArray *contents;
|
||||
do
|
||||
{
|
||||
{
|
||||
// Using NSUUID would make creating UUIDs be done in Cocoa,
|
||||
// and thus managed under ARC. Sadly, the class is in 10.8 and later.
|
||||
CFUUIDRef uuid = CFUUIDCreate(NULL);
|
||||
@@ -135,8 +135,8 @@
|
||||
|
||||
[notifier notifyProgress:0.5];
|
||||
|
||||
if (taskResult != 0)
|
||||
{
|
||||
if (taskResult != 0)
|
||||
{
|
||||
NSString *resultStr = output ? [[NSString alloc] initWithData:output encoding:NSUTF8StringEncoding] : nil;
|
||||
SULog(SULogLevelError, @"hdiutil failed with code: %ld data: <<%@>>", (long)taskResult, resultStr);
|
||||
goto reportError;
|
||||
@@ -155,8 +155,8 @@
|
||||
double itemsCopied = 0;
|
||||
double totalItems = [contents count];
|
||||
|
||||
for (NSString *item in contents)
|
||||
{
|
||||
for (NSString *item in contents)
|
||||
{
|
||||
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
|
||||
NSString *toPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
|
||||
|
||||
@@ -169,8 +169,8 @@
|
||||
[notifier notifyProgress:0.5 + itemsCopied/(totalItems*2.0)];
|
||||
SULog(SULogLevelDefault, @"copyItemAtPath:%@ toPath:%@", fromPath, toPath);
|
||||
|
||||
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
|
||||
{
|
||||
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
|
||||
{
|
||||
goto reportError;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -30,6 +30,7 @@ typedef NS_ENUM(OSStatus, SUError) {
|
||||
SUAppcastError = 1002,
|
||||
SURunningFromDiskImageError = 1003,
|
||||
SURunningTranslocated = 1004,
|
||||
SUWebKitTerminationError = 1005,
|
||||
|
||||
// Download phase errors.
|
||||
SUTemporaryDirectoryError = 2000,
|
||||
|
||||
Vendored
+11
-9
@@ -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){
|
||||
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// SUFlatPackageUnarchiver.h
|
||||
// Autoupdate
|
||||
//
|
||||
// Created by Mayur Pawashe on 1/30/21.
|
||||
// Copyright © 2021 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SUUnarchiverProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// An unarchiver for flat packages that doesn't really do any unarchiving
|
||||
@interface SUFlatPackageUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||
|
||||
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Vendored
+64
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// SUFlatPackageUnarchiver.m
|
||||
// Autoupdate
|
||||
//
|
||||
// Created by Mayur Pawashe on 1/30/21.
|
||||
// Copyright © 2021 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUFlatPackageUnarchiver.h"
|
||||
#import "SUUnarchiverNotifier.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SUFlatPackageUnarchiver ()
|
||||
|
||||
@property (nonatomic, readonly) NSString *flatPackagePath;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SUFlatPackageUnarchiver
|
||||
|
||||
@synthesize flatPackagePath = _flatPackagePath;
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||
{
|
||||
return [path.pathExtension isEqualToString:@"pkg"] || [path.pathExtension isEqualToString:@"mpkg"];
|
||||
}
|
||||
|
||||
// Note in 2.x this method returns YES, but 1.x does not support pre-validation of pkgs
|
||||
+ (BOOL)mustValidateBeforeExtraction
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath;
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_flatPackagePath = [flatPackagePath copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock
|
||||
{
|
||||
SUUnarchiverNotifier *notifier = [[SUUnarchiverNotifier alloc] initWithCompletionBlock:completionBlock progressBlock:progressBlock];
|
||||
|
||||
// Flat packages must use guided package installs, not interactive
|
||||
BOOL isDirectory = NO;
|
||||
if ([[[self.flatPackagePath stringByDeletingPathExtension] pathExtension] isEqualToString:@"sparkle_interactive"]) {
|
||||
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat packages can not be installed interactively with 'sparkle_interactive' and must instead be guided"]}]];
|
||||
} else if (![[NSFileManager defaultManager] fileExistsAtPath:self.flatPackagePath isDirectory:&isDirectory] || isDirectory) {
|
||||
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package does not exist at %@", self.flatPackagePath]}]];
|
||||
} else {
|
||||
[notifier notifyProgress:1.0];
|
||||
[notifier notifySuccess];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], self.flatPackagePath]; }
|
||||
|
||||
@end
|
||||
Vendored
+26
@@ -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
|
||||
Vendored
+65
@@ -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
|
||||
Vendored
+7
@@ -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
|
||||
Vendored
+20
-20
@@ -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);
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
// Should be thread safe
|
||||
- (NSString *)installationPath;
|
||||
|
||||
- (BOOL)supportsDeterminateProgress;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Vendored
+20
@@ -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
|
||||
Vendored
+178
@@ -0,0 +1,178 @@
|
||||
//
|
||||
// SULegacyWebView.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 12/30/20.
|
||||
// Copyright © 2020 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SULegacyWebView.h"
|
||||
#import "SUWebViewCommon.h"
|
||||
#import "SULog.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
// WebKit protocols are not explicitly declared until 10.11 SDK, so
|
||||
// declare dummy protocols to keep the build working on earlier SDKs.
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101100
|
||||
@protocol WebFrameLoadDelegate <NSObject>
|
||||
@end
|
||||
@protocol WebPolicyDelegate <NSObject>
|
||||
@end
|
||||
@protocol WebUIDelegate <NSObject>
|
||||
@end
|
||||
#endif
|
||||
|
||||
@interface SULegacyWebView () <WebPolicyDelegate, WebFrameLoadDelegate, WebUIDelegate>
|
||||
|
||||
@property (nonatomic, readonly) WebView *webView;
|
||||
@property (nonatomic) void (^completionHandler)(NSError * _Nullable);
|
||||
|
||||
@end
|
||||
|
||||
@implementation SULegacyWebView
|
||||
|
||||
@synthesize webView = _webView;
|
||||
@synthesize completionHandler = _completionHandler;
|
||||
|
||||
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_webView = [[WebView alloc] initWithFrame:NSZeroRect];
|
||||
|
||||
WebPreferences *preferences = _webView.preferences;
|
||||
preferences.javaScriptEnabled = javaScriptEnabled;
|
||||
preferences.javaEnabled = NO;
|
||||
preferences.plugInsEnabled = NO;
|
||||
|
||||
// Mimicking settings when WebView used to be in SUUpdateAlert nib
|
||||
preferences.loadsImagesAutomatically = YES;
|
||||
preferences.allowsAnimatedImages = YES;
|
||||
preferences.allowsAnimatedImageLooping = YES;
|
||||
|
||||
// Settings for default style
|
||||
preferences.userStyleSheetEnabled = YES;
|
||||
preferences.userStyleSheetLocation = colorStyleSheetLocation;
|
||||
preferences.standardFontFamily = fontFamily;
|
||||
preferences.defaultFontSize = fontPointSize;
|
||||
|
||||
_webView.preferences = preferences;
|
||||
_webView.policyDelegate = self;
|
||||
_webView.frameLoadDelegate = self;
|
||||
_webView.UIDelegate = self;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSView *)view
|
||||
{
|
||||
return self.webView;
|
||||
}
|
||||
|
||||
- (void)loadHTMLString:(NSString *)htmlString baseURL:(NSURL * _Nullable)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler
|
||||
{
|
||||
self.completionHandler = [completionHandler copy];
|
||||
[[self.webView mainFrame] loadHTMLString:htmlString baseURL:baseURL];
|
||||
}
|
||||
|
||||
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName baseURL:(NSURL *)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler
|
||||
{
|
||||
self.completionHandler = [completionHandler copy];
|
||||
[[self.webView mainFrame] loadData:data MIMEType:MIMEType textEncodingName:textEncodingName baseURL:baseURL];
|
||||
}
|
||||
|
||||
- (void)loadRequest:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSError * _Nullable))completionHandler
|
||||
{
|
||||
self.completionHandler = [completionHandler copy];
|
||||
[[self.webView mainFrame] loadRequest:urlRequest];
|
||||
}
|
||||
|
||||
- (void)stopLoading
|
||||
{
|
||||
self.completionHandler = nil;
|
||||
[self.webView stopLoading:self];
|
||||
}
|
||||
|
||||
- (void)setDrawsBackground:(BOOL)drawsBackground
|
||||
{
|
||||
self.webView.drawsBackground = drawsBackground;
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
|
||||
{
|
||||
if ([frame parentFrame] == nil) {
|
||||
if (self.completionHandler != nil) {
|
||||
self.completionHandler(nil);
|
||||
self.completionHandler = nil;
|
||||
}
|
||||
[sender display]; // necessary to prevent weird scroll bar artifacting
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
|
||||
{
|
||||
if ([frame parentFrame] == nil) {
|
||||
if (self.completionHandler != nil) {
|
||||
self.completionHandler(error);
|
||||
self.completionHandler = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)__unused sender decidePolicyForNavigationAction:(NSDictionary *)__unused actionInformation request:(NSURLRequest *)request frame:(WebFrame *)__unused frame decisionListener:(id<WebPolicyDecisionListener>)listener
|
||||
{
|
||||
NSURL *requestURL = request.URL;
|
||||
BOOL isAboutBlank = NO;
|
||||
BOOL safeURL = SUWebViewIsSafeURL(requestURL, &isAboutBlank);
|
||||
|
||||
// Do not allow redirects to dangerous protocols such as file://
|
||||
if (!safeURL) {
|
||||
SULog(SULogLevelDefault, @"Blocked display of %@ URL which may be dangerous", requestURL.scheme);
|
||||
[listener ignore];
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure we are finished loading
|
||||
if (self.completionHandler == nil) {
|
||||
if (requestURL && !isAboutBlank) {
|
||||
[[NSWorkspace sharedWorkspace] openURL:requestURL];
|
||||
}
|
||||
|
||||
[listener ignore];
|
||||
}
|
||||
else {
|
||||
[listener use];
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up the contextual menu.
|
||||
- (NSArray *)webView:(WebView *)__unused sender contextMenuItemsForElement:(NSDictionary *)__unused element defaultMenuItems:(NSArray *)defaultMenuItems
|
||||
{
|
||||
NSMutableArray *webViewMenuItems = [defaultMenuItems mutableCopy];
|
||||
|
||||
if (webViewMenuItems)
|
||||
{
|
||||
for (NSMenuItem *menuItem in defaultMenuItems)
|
||||
{
|
||||
NSInteger tag = [menuItem tag];
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case WebMenuItemTagOpenLinkInNewWindow:
|
||||
case WebMenuItemTagDownloadLinkToDisk:
|
||||
case WebMenuItemTagOpenImageInNewWindow:
|
||||
case WebMenuItemTagDownloadImageToDisk:
|
||||
case WebMenuItemTagOpenFrameInNewWindow:
|
||||
case WebMenuItemTagGoBack:
|
||||
case WebMenuItemTagGoForward:
|
||||
case WebMenuItemTagStop:
|
||||
case WebMenuItemTagReload:
|
||||
[webViewMenuItems removeObjectIdenticalTo:menuItem];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return webViewMenuItems;
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+1
-1
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+6
-1
@@ -55,7 +55,7 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open";
|
||||
// -W = wait until the app has quit.
|
||||
// -n = Open another instance if already open.
|
||||
// -b = app bundle identifier
|
||||
NSArray *args = @[@"-W", @"-n", @"-b", @"com.apple.installer", self.packagePath];
|
||||
NSArray<NSString *> *args = @[@"-W", @"-n", @"-b", @"com.apple.installer", self.packagePath];
|
||||
|
||||
// Known bug: if the installation fails or is canceled, Sparkle goes ahead and restarts, thinking everything is fine.
|
||||
@try {
|
||||
@@ -78,4 +78,9 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open";
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)supportsDeterminateProgress
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+1
-1
@@ -92,7 +92,7 @@
|
||||
- (void)extractArchivePipingDataToCommand:(NSString *)command arguments:(NSArray*)args notifier:(SUUnarchiverNotifier *)notifier
|
||||
{
|
||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
||||
@autoreleasepool {
|
||||
@autoreleasepool {
|
||||
NSError *error = nil;
|
||||
NSString *destination = [self.archivePath stringByDeletingLastPathComponent];
|
||||
|
||||
|
||||
Vendored
+13
@@ -13,6 +13,7 @@
|
||||
#import "SUHost.h"
|
||||
#import "SULog.h"
|
||||
#import "SUErrors.h"
|
||||
#import "SUOperatingSystem.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
@@ -208,6 +209,13 @@
|
||||
progress(9/10.0);
|
||||
}
|
||||
|
||||
// Try to preserve Finder tags. Failure can be accepted without complaint as previous Sparkle versions did not do this at all
|
||||
NSArray *resourceTags;
|
||||
BOOL success = [oldTempURL getResourceValue:&resourceTags forKey:NSURLTagNamesKey error:NULL];
|
||||
if (success && resourceTags.count) {
|
||||
[installationURL setResourceValue:resourceTags forKey:NSURLTagNamesKey error:NULL];
|
||||
}
|
||||
|
||||
// From here on out, we don't really need to bring up authorization if we haven't done so prior
|
||||
SUFileManager *constrainedFileManager = [fileManager fileManagerByPreservingAuthorizationRights];
|
||||
|
||||
@@ -257,4 +265,9 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)supportsDeterminateProgress
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
Vendored
+3
-30
@@ -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
|
||||
Vendored
+10
-12
@@ -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);
|
||||
|
||||
Vendored
+1
-1
@@ -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
|
||||
|
||||
+9
-3
@@ -33,12 +33,15 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
|
||||
kNumberType,
|
||||
kStringType,
|
||||
kSeparatorType,
|
||||
kDashType,
|
||||
};
|
||||
|
||||
- (SUCharacterType)typeOfCharacter:(NSString *)character
|
||||
{
|
||||
if ([character isEqualToString:@"."]) {
|
||||
return kSeparatorType;
|
||||
} else if ([character isEqualToString:@"-"]) {
|
||||
return kDashType;
|
||||
} else if ([[NSCharacterSet decimalDigitCharacterSet] characterIsMember:[character characterAtIndex:0]]) {
|
||||
return kNumberType;
|
||||
} else if ([[NSCharacterSet whitespaceAndNewlineCharacterSet] characterIsMember:[character characterAtIndex:0]]) {
|
||||
@@ -50,7 +53,7 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray *)splitVersionString:(NSString *)version
|
||||
- (NSArray<NSString *> *)splitVersionString:(NSString *)version
|
||||
{
|
||||
NSString *character;
|
||||
NSMutableString *s;
|
||||
@@ -67,6 +70,9 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
|
||||
for (i = 1; i <= n; ++i) {
|
||||
character = [version substringWithRange:NSMakeRange(i, 1)];
|
||||
newType = [self typeOfCharacter:character];
|
||||
if (newType == kDashType) {
|
||||
break;
|
||||
}
|
||||
if (oldType != newType || oldType == kSeparatorType) {
|
||||
// We've reached a new segment
|
||||
NSString *aPart = [[NSString alloc] initWithString:s];
|
||||
@@ -86,8 +92,8 @@ typedef NS_ENUM(NSInteger, SUCharacterType) {
|
||||
|
||||
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB
|
||||
{
|
||||
NSArray *partsA = [self splitVersionString:versionA];
|
||||
NSArray *partsB = [self splitVersionString:versionB];
|
||||
NSArray<NSString *> *partsA = [self splitVersionString:versionA];
|
||||
NSArray<NSString *> *partsB = [self splitVersionString:versionB];
|
||||
|
||||
NSString *partA, *partB;
|
||||
NSUInteger i, n;
|
||||
|
||||
Vendored
+11
-10
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<development version="7000" identifier="xcode"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SUStatusController">
|
||||
@@ -20,13 +20,13 @@
|
||||
<windowStyleMask key="styleMask" titled="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="200" y="222" width="400" height="107"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
|
||||
<value key="minSize" type="size" width="213" height="107"/>
|
||||
<view key="contentView" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="107"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView id="7">
|
||||
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7">
|
||||
<rect key="frame" x="24" y="28" width="64" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="NSApplicationIcon" id="53"/>
|
||||
@@ -34,7 +34,7 @@
|
||||
<binding destination="-2" name="value" keyPath="applicationIcon" id="9"/>
|
||||
</connections>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" id="8">
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8">
|
||||
<rect key="frame" x="106" y="75" width="277" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Status Text (set by loc. string in code)" id="54">
|
||||
@@ -46,7 +46,7 @@
|
||||
<binding destination="-2" name="value" keyPath="title" id="26"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<progressIndicator verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" id="11">
|
||||
<progressIndicator verticalHuggingPriority="750" fixedFrame="YES" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="11">
|
||||
<rect key="frame" x="107" y="47" width="275" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<connections>
|
||||
@@ -54,7 +54,7 @@
|
||||
<binding destination="-2" name="value" keyPath="progressValue" previousBinding="13" id="27"/>
|
||||
</connections>
|
||||
</progressIndicator>
|
||||
<button verticalHuggingPriority="750" id="12">
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="12">
|
||||
<rect key="frame" x="272" y="12" width="114" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Button" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="55">
|
||||
@@ -65,7 +65,7 @@
|
||||
<binding destination="-2" name="title" keyPath="buttonTitle" id="21"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" id="16">
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="16">
|
||||
<rect key="frame" x="106" y="22" width="167" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Small System Font Text" id="56">
|
||||
@@ -87,9 +87,10 @@
|
||||
<connections>
|
||||
<binding destination="-2" name="title" keyPath="windowTitle" id="24"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-158" y="132"/>
|
||||
</window>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
<image name="NSApplicationIcon" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
Vendored
+3
-3
@@ -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)];
|
||||
|
||||
Vendored
+18
-12
@@ -43,7 +43,7 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
|
||||
// Gather profile information and append it to the URL.
|
||||
NSMutableArray<NSDictionary<NSString *, NSString *> *> *profileArray = [NSMutableArray array];
|
||||
NSArray *profileDictKeys = @[@"key", @"displayKey", @"value", @"displayValue"];
|
||||
NSArray<NSString *> *profileDictKeys = @[@"key", @"displayKey", @"value", @"displayValue"];
|
||||
int error = 0;
|
||||
int value = 0;
|
||||
size_t length = sizeof(value);
|
||||
@@ -58,13 +58,14 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
error = sysctlbyname("hw.cputype", &value, &length, NULL, 0);
|
||||
int cpuType = -1;
|
||||
if (error == 0) {
|
||||
cpuType = value;
|
||||
// Only the lower 24 bits of sysctl hw.cputype values contain the CPU type. On Macs with ARM processor, one of the top eight bits may be set.
|
||||
cpuType = value & (int)~CPU_ARCH_MASK;
|
||||
NSString *visibleCPUType;
|
||||
switch (value) {
|
||||
switch (cpuType) {
|
||||
case CPU_TYPE_ARM: visibleCPUType = @"ARM"; break;
|
||||
case CPU_TYPE_X86: visibleCPUType = @"Intel"; break;
|
||||
case CPU_TYPE_POWERPC: visibleCPUType = @"PowerPC"; break;
|
||||
default: visibleCPUType = @"Unknown"; break;
|
||||
case CPU_TYPE_X86: visibleCPUType = @"Intel"; break;
|
||||
case CPU_TYPE_POWERPC: visibleCPUType = @"PowerPC"; break;
|
||||
default: visibleCPUType = @"Other"; break;
|
||||
}
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUTypeKey, @"CPU Type", @(value), visibleCPUType] forKeys:profileDictKeys]];
|
||||
}
|
||||
@@ -85,17 +86,22 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
|
||||
if (error == 0) {
|
||||
NSString *visibleCPUSubType;
|
||||
if (cpuType == 7) {
|
||||
if (cpuType == CPU_TYPE_X86) {
|
||||
// Intel
|
||||
// TODO: other Intel processors, like Core i7, i5, i3, Xeon?
|
||||
visibleCPUSubType = is64bit ? @"Intel Core 2" : @"Intel Core"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
|
||||
} else if (cpuType == 18) {
|
||||
} else if (cpuType == CPU_TYPE_POWERPC) {
|
||||
// PowerPC
|
||||
switch (value) {
|
||||
case 9: visibleCPUSubType=@"G3"; break;
|
||||
case 10: case 11: visibleCPUSubType=@"G4"; break;
|
||||
case 100: visibleCPUSubType=@"G5"; break;
|
||||
default: visibleCPUSubType=@"Other"; break;
|
||||
case CPU_SUBTYPE_POWERPC_750: visibleCPUSubType=@"G3"; break;
|
||||
case CPU_SUBTYPE_POWERPC_7400: case CPU_SUBTYPE_POWERPC_7450: visibleCPUSubType=@"G4"; break;
|
||||
case CPU_SUBTYPE_POWERPC_970: visibleCPUSubType=@"G5"; break;
|
||||
default: visibleCPUSubType=@"Other"; break;
|
||||
}
|
||||
} else if (cpuType == CPU_TYPE_ARM) {
|
||||
switch (value) {
|
||||
case CPU_SUBTYPE_ARM64E: visibleCPUSubType=@"ARM64E"; break;
|
||||
default: visibleCPUSubType = @"Other"; break;
|
||||
}
|
||||
} else {
|
||||
visibleCPUSubType = @"Other";
|
||||
|
||||
Vendored
+1
-1
@@ -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];
|
||||
}
|
||||
|
||||
Vendored
+11
-6
@@ -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];
|
||||
}];
|
||||
|
||||
@@ -138,7 +143,7 @@
|
||||
alert.informativeText = SULocalizedString(@"No valid update information could be loaded.", nil);
|
||||
[alert addButtonWithTitle:SULocalizedString(@"Cancel Update", nil)];
|
||||
}
|
||||
|
||||
|
||||
[self showAlert:alert];
|
||||
}
|
||||
|
||||
@@ -373,8 +378,8 @@
|
||||
|
||||
- (void)abortUpdate
|
||||
{
|
||||
if (self.statusController)
|
||||
{
|
||||
if (self.statusController)
|
||||
{
|
||||
[self.statusController close];
|
||||
self.statusController = nil;
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -11,6 +11,7 @@
|
||||
#import "SUPipedUnarchiver.h"
|
||||
#import "SUDiskImageUnarchiver.h"
|
||||
#import "SUBinaryDeltaUnarchiver.h"
|
||||
#import "SUFlatPackageUnarchiver.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
@@ -29,6 +30,9 @@
|
||||
assert(hostPath != nil);
|
||||
NSString *nonNullHostPath = hostPath;
|
||||
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path updateHostBundlePath:nonNullHostPath];
|
||||
|
||||
} else if ([SUFlatPackageUnarchiver canUnarchivePath:path]) {
|
||||
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -31,6 +31,8 @@
|
||||
if (self != nil) {
|
||||
_completionBlock = [completionBlock copy];
|
||||
_progressBlock = [progressBlock copy];
|
||||
} else {
|
||||
assert(false);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Vendored
+191
-177
@@ -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,18 +326,35 @@ 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.hidden = YES;
|
||||
}
|
||||
|
||||
// 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];
|
||||
@@ -269,8 +362,8 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
|
||||
- (BOOL)windowShouldClose:(NSNotification *) __unused note
|
||||
{
|
||||
[self endWithSelection:SURemindMeLaterChoice];
|
||||
return YES;
|
||||
[self endWithSelection:SURemindMeLaterChoice];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSImage *)applicationIcon
|
||||
@@ -306,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 *)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;
|
||||
}
|
||||
|
||||
- (NSTouchBar *)makeTouchBar
|
||||
{
|
||||
NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
|
||||
Vendored
+16
-7
@@ -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;
|
||||
|
||||
Vendored
+3
-3
@@ -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.
|
||||
|
||||
Vendored
+43
-31
@@ -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,6 +40,7 @@ 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;
|
||||
@@ -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.
|
||||
@@ -248,8 +267,8 @@ 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];
|
||||
@@ -276,16 +295,16 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
|
||||
- (void)scheduleNextUpdateCheck
|
||||
{
|
||||
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]; }
|
||||
if (!lastCheckDate) { lastCheckDate = [NSDate distantPast]; }
|
||||
NSTimeInterval intervalSinceCheck = [[NSDate date] timeIntervalSinceDate:lastCheckDate];
|
||||
|
||||
// Now we want to figure out how long until we check again.
|
||||
@@ -320,13 +339,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
- (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");
|
||||
@@ -334,7 +348,6 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
[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.
|
||||
@@ -376,13 +389,13 @@ 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];
|
||||
return;
|
||||
}
|
||||
@@ -414,8 +427,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 +441,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.
|
||||
@@ -482,7 +495,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 +534,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 +576,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 +624,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
|
||||
|
||||
Vendored
+1
-1
@@ -36,7 +36,7 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastItemNotificationKey;
|
||||
SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// SUUpdater Delegate:
|
||||
// SUUpdater Delegate:
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/*!
|
||||
|
||||
+6
-6
@@ -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;
|
||||
}
|
||||
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// SUWKWebView.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
|
||||
|
||||
// Only use this class on macOS 10.11 or later (see implementation for rationale)
|
||||
@interface SUWKWebView : NSObject <SUWebView>
|
||||
|
||||
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Vendored
+252
@@ -0,0 +1,252 @@
|
||||
//
|
||||
// SUWKWebView.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 12/30/20.
|
||||
// Copyright © 2020 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUWKWebView.h"
|
||||
#import "SUWebViewCommon.h"
|
||||
#import "SULog.h"
|
||||
#import "SUErrors.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
|
||||
@interface WKWebView (Private)
|
||||
|
||||
- (void)_setDrawsBackground:(BOOL)drawsBackground;
|
||||
- (void)_setDrawsTransparentBackground:(BOOL)drawsTransparentBackground;
|
||||
|
||||
@end
|
||||
|
||||
@interface SUWKWebView () <WKNavigationDelegate>
|
||||
|
||||
// Remove when minimum system requirement is 10.10+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
@property (nonatomic, readonly) WKWebView *webView;
|
||||
@property (nonatomic) WKNavigation *currentNavigation;
|
||||
#pragma clang diagnostic pop
|
||||
@property (nonatomic) void (^completionHandler)(NSError * _Nullable);
|
||||
@property (nonatomic) BOOL drawsWebViewBackground;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SUWKWebView
|
||||
|
||||
@synthesize webView = _webView;
|
||||
@synthesize currentNavigation = _currentNavigation;
|
||||
@synthesize completionHandler = _completionHandler;
|
||||
@synthesize drawsWebViewBackground = _drawsWebViewBackground;
|
||||
|
||||
// Remove when minimum system requirement is 10.10+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
static WKUserScript *_userScriptWithInjectedStyleSource(NSString *styleSource)
|
||||
{
|
||||
// We must remove newlines when inserting the style source in this interpolated string below
|
||||
NSString *strippedStyleSource = [styleSource stringByReplacingOccurrencesOfString:@"\n" withString:@""];
|
||||
|
||||
NSString *scriptSource = [NSString stringWithFormat:
|
||||
@"var style = document.createElement('style');\n"
|
||||
@"style.innerHTML = '%@'\n"
|
||||
@"var head = document.head;\n"
|
||||
@"if (head.firstChild) {"
|
||||
@"\tdocument.head.insertBefore(style, document.head.firstChild);\n"
|
||||
@"} else {\n"
|
||||
@"\tdocument.head.appendChild(style)\n"
|
||||
@"}", strippedStyleSource];
|
||||
|
||||
return [[WKUserScript alloc] initWithSource:scriptSource injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
// Remove when minimum system requirement is 10.10+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
- (instancetype)initWithColorStyleSheetLocation:(NSURL *)colorStyleSheetLocation fontFamily:(NSString *)fontFamily fontPointSize:(int)fontPointSize javaScriptEnabled:(BOOL)javaScriptEnabled
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
// Synchronize with web view defaulting to drawing background to avoid unnecessary invocations in -setDrawsBackground:
|
||||
_drawsWebViewBackground = YES;
|
||||
|
||||
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
|
||||
|
||||
// Note: this javaScriptEnabled property is deprecated in favor of another webpage preference property,
|
||||
// that involves implementing a delegate method that is only available on macOS 11.. to get it properly working.
|
||||
// To simplify things, just rely on deprecated property for now.
|
||||
// Future reader: if you change how JS is disabled, please be sure to test that JS code is properly disabled in HTML release notes.
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
configuration.preferences.javaScriptEnabled = javaScriptEnabled;
|
||||
#pragma clang diagnostic pop
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = NO;
|
||||
|
||||
NSError *colorStyleContentsError = nil;
|
||||
NSString *colorStyleContents = [NSString stringWithContentsOfURL:colorStyleSheetLocation encoding:NSUTF8StringEncoding error:&colorStyleContentsError];
|
||||
|
||||
WKUserContentController *userContentController = [[WKUserContentController alloc] init];
|
||||
|
||||
NSString *fontStyleContents = [NSString stringWithFormat:@"body { font-family: %@; font-size: %dpt; }", fontFamily, fontPointSize];
|
||||
|
||||
NSString *finalStyleContents;
|
||||
if (colorStyleContents == nil) {
|
||||
SULog(SULogLevelError, @"Failed to load style contents from %@ with %@", colorStyleSheetLocation, colorStyleContentsError);
|
||||
|
||||
finalStyleContents = fontStyleContents;
|
||||
} else {
|
||||
finalStyleContents = [NSString stringWithFormat:@"%@ %@", fontStyleContents, colorStyleContents];
|
||||
}
|
||||
|
||||
// Note: we can still execute javascript via WKUserScript even if javascript is otherwise disabled from the web content
|
||||
// In fact, we must execute javascript to properly inject our default CSS style into the DOM
|
||||
// Legacy WebView has exposed methods for custom stylesheets and default fonts,
|
||||
// but WKWebView seems to forgo that type of API surface in favor of user scripts like this
|
||||
[userContentController addUserScript:_userScriptWithInjectedStyleSource(finalStyleContents)];
|
||||
configuration.userContentController = userContentController;
|
||||
|
||||
_webView = [[WKWebView alloc] initWithFrame:NSZeroRect configuration:configuration];
|
||||
_webView.navigationDelegate = self;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (NSView *)view
|
||||
{
|
||||
return self.webView;
|
||||
}
|
||||
|
||||
- (void)loadHTMLString:(NSString *)htmlString baseURL:(NSURL * _Nullable)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler
|
||||
{
|
||||
self.completionHandler = [completionHandler copy];
|
||||
|
||||
self.currentNavigation = [self.webView 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];
|
||||
|
||||
// Remove when minimum system requirement is 10.11+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
// Note: This API requires macOS 10.11
|
||||
// Rather than figuring out a bad workaround for 10.10, it is simpler to just require 10.11 for this class
|
||||
self.currentNavigation = [self.webView loadData:data MIMEType:MIMEType characterEncodingName:textEncodingName baseURL:baseURL];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (void)loadRequest:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSError * _Nullable))completionHandler
|
||||
{
|
||||
self.completionHandler = [completionHandler copy];
|
||||
|
||||
// Remove when minimum system requirement is 10.10+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
self.currentNavigation = [self.webView loadRequest:urlRequest];
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (void)setDrawsBackground:(BOOL)drawsBackground
|
||||
{
|
||||
if (self.drawsWebViewBackground != drawsBackground) {
|
||||
// Unfortunately we have to rely on a private API
|
||||
// FB7539179: https://github.com/feedback-assistant/reports/issues/81 | https://bugs.webkit.org/show_bug.cgi?id=155550
|
||||
// But it seems like others are already relying on it, passed App Review, and apps couldn't be broken due to compatibility
|
||||
if (@available(macOS 10.12, *)) {
|
||||
if ([self.webView respondsToSelector:@selector(_setDrawsBackground:)]) {
|
||||
[self.webView _setDrawsBackground:drawsBackground];
|
||||
}
|
||||
} else {
|
||||
if ([self.webView respondsToSelector:@selector(_setDrawsTransparentBackground:)]) {
|
||||
[self.webView _setDrawsTransparentBackground:!drawsBackground];
|
||||
}
|
||||
}
|
||||
|
||||
self.drawsWebViewBackground = drawsBackground;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)stopLoading
|
||||
{
|
||||
self.completionHandler = nil;
|
||||
[self.webView stopLoading];
|
||||
}
|
||||
|
||||
// Remove when minimum system requirement is 10.10+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
|
||||
#pragma clang diagnostic pop
|
||||
{
|
||||
if (navigation == self.currentNavigation) {
|
||||
if (self.completionHandler != nil) {
|
||||
self.completionHandler(nil);
|
||||
self.completionHandler = nil;
|
||||
}
|
||||
self.currentNavigation = nil;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove when minimum system requirement is 10.10+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error
|
||||
#pragma clang diagnostic pop
|
||||
{
|
||||
if (navigation == self.currentNavigation) {
|
||||
if (self.completionHandler != nil) {
|
||||
self.completionHandler(error);
|
||||
self.completionHandler = nil;
|
||||
}
|
||||
self.currentNavigation = nil;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove when minimum system requirement is 10.10+
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
|
||||
#pragma clang diagnostic pop
|
||||
{
|
||||
if (self.currentNavigation != nil) {
|
||||
if (self.completionHandler != nil) {
|
||||
self.completionHandler([NSError errorWithDomain:SUSparkleErrorDomain code:SUWebKitTerminationError userInfo:nil]);
|
||||
self.completionHandler = nil;
|
||||
}
|
||||
|
||||
self.currentNavigation = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunguarded-availability"
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
|
||||
{
|
||||
NSURLRequest *request = navigationAction.request;
|
||||
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);
|
||||
decisionHandler(WKNavigationActionPolicyCancel);
|
||||
} else {
|
||||
// Ensure we're finished loading
|
||||
if (self.completionHandler == nil) {
|
||||
if (!isAboutBlank) {
|
||||
[[NSWorkspace sharedWorkspace] openURL:requestURL];
|
||||
}
|
||||
|
||||
decisionHandler(WKNavigationActionPolicyCancel);
|
||||
} else {
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
@end
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// SUWebView.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 12/30/20.
|
||||
// Copyright © 2020 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NSView;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol SUWebView <NSObject>
|
||||
|
||||
@property (nonatomic, readonly) NSView *view;
|
||||
|
||||
- (void)loadHTMLString:(NSString *)htmlString baseURL:(NSURL * _Nullable)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler;
|
||||
|
||||
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName baseURL:(NSURL *)baseURL completionHandler:(void (^)(NSError * _Nullable))completionHandler;
|
||||
|
||||
- (void)loadRequest:(NSURLRequest *)urlRequest completionHandler:(void (^)(NSError * _Nullable))completionHandler;
|
||||
|
||||
- (void)stopLoading;
|
||||
|
||||
- (void)setDrawsBackground:(BOOL)drawsBackground;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Loaded 100 of 411 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user