Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10d96f2b9b | ||
|
|
a9f370460a | ||
|
|
d7db589432 | ||
|
|
56ad4aa3c8 | ||
|
|
b5350bf58f | ||
|
|
bbe887e160 | ||
|
|
f453625573 | ||
|
|
7918c1c8fc | ||
|
|
4875f83bea | ||
|
|
43403a5068 | ||
|
|
4222fd6179 | ||
|
|
16c2f9b78b | ||
|
|
26d30d7c2b | ||
|
|
b3b5f5f246 | ||
|
|
a49d83dc22 | ||
|
|
08932966b2 | ||
|
|
d80ad46c4f | ||
|
|
4a00b97592 | ||
|
|
a319cb2c90 | ||
|
|
43596bbc5e | ||
|
|
3ed77f975a | ||
|
|
c64d0467b2 | ||
|
|
7b109be51d | ||
|
|
c427650ed8 | ||
|
|
70f58b515d | ||
|
|
65900a1aea | ||
|
|
f601a7a3df | ||
|
|
1ede0bc994 | ||
|
|
5b8ab1b919 | ||
|
|
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 | ||
|
|
d5222353e6 | ||
|
|
2657a41d55 | ||
|
|
08d3ff747d | ||
|
|
fedb22e224 | ||
|
|
8293c3c6ae | ||
|
|
181f813b01 | ||
|
|
a10a974609 | ||
|
|
f8572f79cb | ||
|
|
2b54753090 | ||
|
|
2db2fffab9 | ||
|
|
035bfc4919 | ||
|
|
48fc202f36 | ||
|
|
28ff3069ff | ||
|
|
795ce1278d | ||
|
|
6ac853271d | ||
|
|
7e5e91888f | ||
|
|
b0d29ae798 | ||
|
|
09bbf9fdc6 | ||
|
|
f2bd7ea2b2 | ||
|
|
35deefdc0c | ||
|
|
3e53979236 | ||
|
|
f8971098be | ||
|
|
efd1840f35 | ||
|
|
17dbdf98e1 | ||
|
|
79f110a17b | ||
|
|
5ab0baf84c | ||
|
|
578dac0ad7 | ||
|
|
920b5bac5e | ||
|
|
9ae7224a47 | ||
|
|
685be61bc3 | ||
|
|
9be76d3d5a | ||
|
|
fc1960966a | ||
|
|
7248e40fda | ||
|
|
b8d37346a6 | ||
|
|
2769221117 | ||
|
|
6317a6c74f | ||
|
|
f785c7177c | ||
|
|
cd78595c63 | ||
|
|
4fd2a7b15f | ||
|
|
186bbb83d5 | ||
|
|
0cc8a2f16a | ||
|
|
0eb1caeec5 | ||
|
|
7138663f86 | ||
|
|
b767285be0 | ||
|
|
5886c2b9b9 | ||
|
|
f9b534a6b6 | ||
|
|
5a586d393a | ||
|
|
b3cc7aed8a | ||
|
|
deb8ea8cc1 | ||
|
|
4a3cc18dc3 | ||
|
|
75404f6d83 | ||
|
|
954ed60ecb | ||
|
|
ecb5257b2b | ||
|
|
fb18c1e542 | ||
|
|
99f5573619 | ||
|
|
1edfcaba71 | ||
|
|
fc3221c5d2 | ||
|
|
26db6982b3 | ||
|
|
f550b92f72 | ||
|
|
5f5fe1b5f9 | ||
|
|
6027f2852a | ||
|
|
60c2f16c9d | ||
|
|
5ae7fa7212 | ||
|
|
614b2cc1f3 | ||
|
|
6500bf8c2f | ||
|
|
3e060d4a7b | ||
|
|
5286371cb7 | ||
|
|
2a802447a3 | ||
|
|
c40b42deb1 | ||
|
|
5d9f41142b | ||
|
|
d540c6a1b9 | ||
|
|
e63bcbc047 | ||
|
|
4f65e14ee8 | ||
|
|
fdca1ce6cf | ||
|
|
c3255ed3a7 | ||
|
|
9b6346516e | ||
|
|
e1f13ebcad | ||
|
|
420be06ba0 | ||
|
|
c7beba948d | ||
|
|
639b6df47b | ||
|
|
c9a9cba167 | ||
|
|
9f01fd303c | ||
|
|
1ff1577108 | ||
|
|
74f2ea540e | ||
|
|
2652be32f7 | ||
|
|
5118f2b27f | ||
|
|
b97b60b611 | ||
|
|
3c793482c8 | ||
|
|
89b4bcde61 | ||
|
|
3690dd028a | ||
|
|
52e2ef88eb | ||
|
|
d81633a7d3 | ||
|
|
a9e20c7d0a | ||
|
|
03a9f57704 | ||
|
|
2f8df626d7 | ||
|
|
f5cb6988ed | ||
|
|
2bfab80998 | ||
|
|
4fa2a37798 | ||
|
|
888a7f48a6 | ||
|
|
82726c4386 | ||
|
|
a5b23cdbee | ||
|
|
b19120f5cd | ||
|
|
4b0a037685 | ||
|
|
8dadd0003e | ||
|
|
457319f217 | ||
|
|
0480b9bb25 | ||
|
|
4390eb9eb2 | ||
|
|
f5c8314c88 | ||
|
|
1b209e6726 | ||
|
|
a4373e4e0f | ||
|
|
d430c33bf4 | ||
|
|
7ef4635d8c | ||
|
|
deb4be7a1b | ||
|
|
5f1bc6b612 | ||
|
|
1cde8110df | ||
|
|
1926b7bfa6 | ||
|
|
f80907fa2c | ||
|
|
091a86f672 | ||
|
|
208b0dc49a | ||
|
|
5acf3989d2 | ||
|
|
5529a3610d | ||
|
|
920ff7f83f | ||
|
|
5ff1488f0c | ||
|
|
c0c1c51d8d | ||
|
|
5139179487 | ||
|
|
f50cbce0e8 | ||
|
|
14f1d3520a | ||
|
|
9c4729ed4a | ||
|
|
f04a61e159 | ||
|
|
80d8758fc2 | ||
|
|
081301d590 | ||
|
|
397370297b | ||
|
|
b30dcd979f | ||
|
|
ee123edd74 | ||
|
|
984625cc7e | ||
|
|
7b6e7957c6 | ||
|
|
2815514c23 | ||
|
|
49eaa4c5cc | ||
|
|
09bcee7280 | ||
|
|
49ea08b284 | ||
|
|
f9dc70ade2 | ||
|
|
6fb3eee91b | ||
|
|
19be83b15f | ||
|
|
d90529ccaa | ||
|
|
623b7b6bda | ||
|
|
65bcb3815e | ||
|
|
d5cd95e0ef | ||
|
|
b9150d2938 | ||
|
|
1006326157 | ||
|
|
68856e074b | ||
|
|
a86bdb2fa8 | ||
|
|
92e00baafb | ||
|
|
98ea3e3d57 | ||
|
|
c094a38231 | ||
|
|
6df898f9b7 | ||
|
|
7f51a4e344 | ||
|
|
8ad1f57672 | ||
|
|
8b88183c7d | ||
|
|
d036d3e3ae | ||
|
|
8b13eb5dcf | ||
|
|
ba5b7341fa | ||
|
|
e1d4b19ce7 | ||
|
|
360c2ce7a9 | ||
|
|
f9740292d4 | ||
|
|
558be04121 | ||
|
|
b426426905 | ||
|
|
75835a5874 | ||
|
|
50c12d1c2b | ||
|
|
e452b7f6ba | ||
|
|
3034eca85b | ||
|
|
9ae41fe4ab | ||
|
|
7d931e22d7 | ||
|
|
b303ee312b | ||
|
|
9453761aef | ||
|
|
d19c98a877 | ||
|
|
7a4caad5fe | ||
|
|
8f546c93f4 | ||
|
|
1c4bcda012 | ||
|
|
a18282ec79 | ||
|
|
8a8ce49a23 | ||
|
|
2561af8270 | ||
|
|
035ad6a277 | ||
|
|
9cbae0edb6 | ||
|
|
3bbf84e332 | ||
|
|
a582d46096 | ||
|
|
3f3ace055d | ||
|
|
886e4b2c81 | ||
|
|
a418d8fe64 | ||
|
|
b48e80aa27 | ||
|
|
a19dfb2be0 | ||
|
|
7394593743 | ||
|
|
4973c0143f | ||
|
|
c171f381d4 | ||
|
|
dde4a0aae2 | ||
|
|
d5a1ba44ff | ||
|
|
0d03b4006d | ||
|
|
25993d0776 | ||
|
|
276707b3da | ||
|
|
23e88737ec | ||
|
|
d400a53ebd | ||
|
|
f39b07fd59 | ||
|
|
5bc8f3e535 | ||
|
|
503a292084 | ||
|
|
d60b16f633 | ||
|
|
de3e73b589 | ||
|
|
ad863775db | ||
|
|
79511c982a | ||
|
|
189ed9d315 | ||
|
|
ea94969188 | ||
|
|
57731f44d7 | ||
|
|
2a0514c93b | ||
|
|
467e1495c0 | ||
|
|
8ac254951a | ||
|
|
c83c9221f7 | ||
|
|
b46315df9c | ||
|
|
9c505dee2f | ||
|
|
2ed7402367 | ||
|
|
3afa47b092 | ||
|
|
874d6bce36 | ||
|
|
51a335b3fd | ||
|
|
578bb9ecb8 | ||
|
|
76e8838eb3 | ||
|
|
0a101b7902 | ||
|
|
865dd2e187 | ||
|
|
083bd9b453 | ||
|
|
b48bc4dcac | ||
|
|
bb6203f40a | ||
|
|
25204a66e0 | ||
|
|
c886947f55 | ||
|
|
f0460033ba | ||
|
|
1a71456ed9 | ||
|
|
e7cdbfc45e | ||
|
|
8b5c8b5cdf | ||
|
|
a7af48f0d1 | ||
|
|
03e28780d9 | ||
|
|
5b1c76db26 | ||
|
|
703e611eb5 | ||
|
|
6ee88124ad | ||
|
|
1cc5f230a5 | ||
|
|
429f950434 | ||
|
|
7df50ccfd3 | ||
|
|
9c301bfbf3 | ||
|
|
8a0474d644 | ||
|
|
dc85d63861 | ||
|
|
dc8e8b775a | ||
|
|
ecb608bb40 | ||
|
|
c3e546d7f8 | ||
|
|
2477a92b0f | ||
|
|
7f0bc6a244 | ||
|
|
68f62e5955 | ||
|
|
0cb0b2f2c7 | ||
|
|
b590722aad | ||
|
|
10f831fce8 | ||
|
|
a2ecdd2744 | ||
|
|
ec7f55d173 | ||
|
|
ddfc4089d2 | ||
|
|
80c34526e8 | ||
|
|
0c3994c571 | ||
|
|
fbda90ad64 | ||
|
|
40750b6f24 | ||
|
|
a7ba0bea6e | ||
|
|
558cfd2153 | ||
|
|
94074e2bdc | ||
|
|
56065fcf95 | ||
|
|
f24189e848 | ||
|
|
65b12a2be1 | ||
|
|
900de556a8 | ||
|
|
7c8ff2b969 | ||
|
|
43b4472d3c | ||
|
|
260170f372 | ||
|
|
ea85fc6442 | ||
|
|
a52604a264 | ||
|
|
39d6c616b0 | ||
|
|
043ad0464a | ||
|
|
d99339cf08 | ||
|
|
c541f95036 | ||
|
|
e678ffb3ca | ||
|
|
070ea362a2 | ||
|
|
c4db636d0b | ||
|
|
7e9f05865a | ||
|
|
3c14c950ef | ||
|
|
4438b69b50 | ||
|
|
6d0c734c26 | ||
|
|
e8805e0563 | ||
|
|
193036b2c4 | ||
|
|
33bf6732ea | ||
|
|
e94fb63ff0 | ||
|
|
84e5925578 | ||
|
|
bb83e9a0da | ||
|
|
26d4d75c36 | ||
|
|
fe5737f0b6 | ||
|
|
ac49a3b5b6 | ||
|
|
cbeaeb29ec | ||
|
|
d0a6c699da | ||
|
|
84b7e5e22f | ||
|
|
61774b3f7d | ||
|
|
55be13ca6f | ||
|
|
fc48e5e4df | ||
|
|
bfada07a2c | ||
|
|
4f965660f3 | ||
|
|
a2764158d6 | ||
|
|
60727bffa5 | ||
|
|
715163fe0d | ||
|
|
629c42d62d | ||
|
|
3e45211bbe | ||
|
|
89acca1318 | ||
|
|
4bc2e6e891 | ||
|
|
405c9fd9a1 | ||
|
|
9232316b19 | ||
|
|
0569c73391 | ||
|
|
423ee5a9d6 | ||
|
|
ac042821d8 | ||
|
|
36139c57bc | ||
|
|
662e84400a | ||
|
|
b6b5c6d927 | ||
|
|
1683d2de34 | ||
|
|
615a08bc32 | ||
|
|
c7bf998913 | ||
|
|
1dd9d93090 | ||
|
|
ac8c37096e | ||
|
|
c86e825a5f | ||
|
|
40a777f5d9 | ||
|
|
3098afc90b | ||
|
|
3809da20bf | ||
|
|
c623480f72 | ||
|
|
2a644672ca | ||
|
|
81e71844d6 | ||
|
|
e4821e0454 |
No files matched your search
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Enhancements and Bug Fixes
|
||||
about: Found a bug? Want to implement a new feature?
|
||||
title: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
[provide general summary to the issue or enhancement and its rationale]
|
||||
|
||||
## Possible Fix
|
||||
|
||||
[not obligatory, but suggest fixes or reasons for the bug]
|
||||
|
||||
## Version
|
||||
|
||||
[please specify versions of Sparkle this is applicable to; note new pull requests must be developed and landed in 2.x development branch first]
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Sparkle 1.x doesn't work in my app
|
||||
about: Problems with integration, unexpected errors
|
||||
title: ''
|
||||
labels: '1.x'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
The answer to your issue is probably already in Console.app on your computer.
|
||||
Please use Console.app and search for Sparkle.
|
||||
|
||||
Please try troubleshooting steps:
|
||||
https://github.com/sparkle-project/Sparkle#troubleshooting
|
||||
|
||||
-->
|
||||
|
||||
### Description of the problem
|
||||
|
||||
|
||||
### Do you use Sandboxing in your app?
|
||||
|
||||
### Version of `Sparkle.framework` in the latest version of your app
|
||||
|
||||
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
|
||||
|
||||
### Sparkle's output from Console.app
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### Steps to reproduce the behavior
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Sparkle 2.x doesn't work in my app
|
||||
about: Problems with using the beta version of Sparkle 2
|
||||
title: ''
|
||||
labels: '2.x'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
The answer to your issue is probably already in Console.app on your computer.
|
||||
Please use Console.app and search for Sparkle.
|
||||
|
||||
Please try troubleshooting steps:
|
||||
https://github.com/sparkle-project/Sparkle#troubleshooting
|
||||
|
||||
-->
|
||||
|
||||
### Description of the problem
|
||||
|
||||
|
||||
### Do you use Sandboxing in your app?
|
||||
|
||||
### Version of `Sparkle.framework` in the latest version of your app
|
||||
|
||||
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
|
||||
|
||||
### Sparkle's output from Console.app
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### Steps to reproduce the behavior
|
||||
@@ -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.1', 'xcode13.1']
|
||||
include:
|
||||
- xcode: 'xcode12.5.1'
|
||||
xcode-path: '/Applications/Xcode_12.5.1.app/Contents/Developer'
|
||||
upload-dist: false
|
||||
- xcode: 'xcode13.1'
|
||||
xcode-path: '/Applications/Xcode_13.1.app/Contents/Developer'
|
||||
upload-dist: true
|
||||
|
||||
name: Build and Test Sparkle
|
||||
runs-on: macos-11
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
- name: Build Unit Tests
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild build-for-testing -project Sparkle.xcodeproj -scheme Distribution -enableCodeCoverage YES -derivedDataPath build
|
||||
- name: Run Unit Tests
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild test-without-building -project Sparkle.xcodeproj -scheme Distribution -enableCodeCoverage YES -derivedDataPath build
|
||||
- name: Build UI Tests
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild build-for-testing -project Sparkle.xcodeproj -scheme UITests -configuration Debug -derivedDataPath build
|
||||
- name: Run UI Tests
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild test-without-building -project Sparkle.xcodeproj -scheme UITests -configuration Debug -derivedDataPath build
|
||||
- name: Build Release Distribution
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build
|
||||
- name: Archive Test Results
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-logs
|
||||
path: build/Logs
|
||||
- name: Upload Distribution
|
||||
if: ${{ success() && matrix.upload-dist }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Sparkle-distribution-${{ matrix.xcode }}.tar.xz
|
||||
path: build/Build/Products/Release/sparkle-dist.tar.xz
|
||||
@@ -0,0 +1,100 @@
|
||||
name: "Create Draft Release"
|
||||
|
||||
env:
|
||||
BUILDDIR: "build"
|
||||
DEVELOPER_DIR: "/Applications/Xcode_13.1.app/Contents/Developer"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
marketingVersion:
|
||||
description: "Marketing Version"
|
||||
required: true
|
||||
default: ""
|
||||
|
||||
prereleaseSuffix:
|
||||
description: "Pre-release Suffix"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
buildVersion:
|
||||
description: "Product Build"
|
||||
required: true
|
||||
default: ""
|
||||
|
||||
concurrency:
|
||||
group: publish-release-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: "Publish binaries for release"
|
||||
runs-on: macos-11
|
||||
|
||||
steps:
|
||||
- name: "Checkout sources"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "Extract latest changes from CHANGELOG"
|
||||
run: |
|
||||
./Configurations/generate_latest_changes.py > latest-changes.txt
|
||||
|
||||
- name: "Overwrite project versions in project"
|
||||
run: |
|
||||
IFS='.' read major minor patch <<< "${{ github.event.inputs.marketingVersion }}"
|
||||
sed -E -i '' "s/SPARKLE_VERSION_MAJOR =.+/SPARKLE_VERSION_MAJOR = $major/g" ./Configurations/ConfigCommon.xcconfig
|
||||
sed -E -i '' "s/SPARKLE_VERSION_MINOR =.+/SPARKLE_VERSION_MINOR = $minor/g" ./Configurations/ConfigCommon.xcconfig
|
||||
sed -E -i '' "s/SPARKLE_VERSION_PATCH =.+/SPARKLE_VERSION_PATCH = $patch/g" ./Configurations/ConfigCommon.xcconfig
|
||||
|
||||
if [[ ! -z "${{ github.event.inputs.prereleaseSuffix }}" ]]; then
|
||||
sed -E -i '' "s/SPARKLE_VERSION_SUFFIX =.*/SPARKLE_VERSION_SUFFIX = ${{ github.event.inputs.prereleaseSuffix }}/g" ./Configurations/ConfigCommon.xcconfig
|
||||
else
|
||||
sed -E -i '' "s/SPARKLE_VERSION_SUFFIX =.*/SPARKLE_VERSION_SUFFIX =/g" ./Configurations/ConfigCommon.xcconfig
|
||||
fi
|
||||
|
||||
sed -E -i '' "s/CURRENT_PROJECT_VERSION =.+/CURRENT_PROJECT_VERSION = ${{ github.event.inputs.buildVersion }}/g" ./Configurations/ConfigCommon.xcconfig
|
||||
git add ./Configurations/ConfigCommon.xcconfig
|
||||
|
||||
- name: "Determine if this is a pre-release version"
|
||||
run: |
|
||||
if [[ ! -z "${{ github.event.inputs.prereleaseSuffix }}" ]]; then
|
||||
echo "PRERELEASE_VERSION=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "PRERELEASE_VERSION=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Set up git and create tag"
|
||||
run: |
|
||||
git config user.name Sparkle-Bot
|
||||
git config user.email sparkle.project.bot@gmail.com
|
||||
git tag "${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
|
||||
|
||||
- name: "Build release distribution"
|
||||
run: make release
|
||||
env:
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
|
||||
- name: "Push the updated Swift package description"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
run: git push
|
||||
|
||||
- name: "Draft a release"
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
prerelease: ${{ env.PRERELEASE_VERSION }}
|
||||
name: "Sparkle ${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
|
||||
tag_name: "${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
|
||||
fail_on_unmatched_files: true
|
||||
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
body_path: latest-changes.txt
|
||||
files: |
|
||||
build/Build/Products/Release/Sparkle-*.tar.xz
|
||||
build/Build/Products/Release/Sparkle-for-Swift-Package-Manager.zip
|
||||
@@ -42,4 +42,6 @@ Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
.idea/
|
||||
# Swift Package Manager
|
||||
/.build
|
||||
.swiftpm
|
||||
@@ -0,0 +1,3 @@
|
||||
[submodule "Vendor/ed25519"]
|
||||
path = Vendor/ed25519
|
||||
url = https://github.com/orlp/ed25519
|
||||
@@ -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: xcode8.2
|
||||
before_install:
|
||||
- brew update
|
||||
script: make ci
|
||||
@@ -1,3 +1,221 @@
|
||||
# 1.27.3
|
||||
|
||||
* Create and use temp extraction directory in generate_appcast again (#2556) (Zorg)
|
||||
|
||||
# 1.27.2
|
||||
|
||||
* Extract archives in a separate directory from the input archive (#2552) (Zorg)
|
||||
* Fix incorrect xz log warning in make release (#2044) (trss)
|
||||
|
||||
# 1.27.1
|
||||
|
||||
* Use px instead of pt when specifying font size to fix default font size in WebView from #1962 (regressed in 1.25.0 with WKWebView adoption) (Daniel Jalkut)
|
||||
* Fix to prevent Sparkle manipulating the host app's high level WebView defaults from #1961 (affecting only macOS versions before 10.11 in 1.x branch) (Daniel Jalkut)
|
||||
* Add safer handling of applying binary delta files from #1990 (Zorg)
|
||||
* Don't use current date unless necessary when scheduling next update from #1991 (Zorg)
|
||||
* Whitelist about:srcdoc as a safe web URL from #1938, #2007 (Louis Pontoise, Zorg)
|
||||
* Backport not hiding update window on deactivation from #2008 (Zorg)
|
||||
|
||||
# 1.27.0
|
||||
|
||||
* Deprecate not using EdDSA and skip DSA verification when possible in #1892 (Zorg)
|
||||
* Pass http headers and user agent when downloading release notes from #1873 (Zorg)
|
||||
* Fix project warnings from #1893 (Zorg)
|
||||
* Update sample appcast from #1895 (Zorg)
|
||||
* Fix appcast pubDate tag generation in different locales from #1898 (Sungbin Jo)
|
||||
* Create valid xar archives for generating binary delta files from #1906 (Zorg)
|
||||
* Fix a few issues with German localization from #1931 (J-rg)
|
||||
* Fix issues with Russian localizations from #1947 (Konstantin Zamyakin)
|
||||
* Fix issues with Czech localizations from #1943 (Vojtěch Koňařík)
|
||||
* Add an automated workflow that builds and publishes official Sparkle releases (Tony Arnold, Zorg)
|
||||
|
||||
# 1.26.0
|
||||
|
||||
* Flat package support from #1745 (Zorg)
|
||||
* Correct generate_appcast -s command line argument usage help (Lance Lovette)
|
||||
* Fix -f command line argument handling (Lance Lovette)
|
||||
* Fix progress for guided pkg install (Zorg)
|
||||
* Fix XQuartz update failing because NSLog caused issues (Zorg)
|
||||
* Update localization (Vojtěch Koňařík)
|
||||
* Various fixes to SPM logic (Jonas Zaugg)
|
||||
|
||||
# 1.25.0
|
||||
|
||||
* Raise minimum system version to 10.9 (Kornel)
|
||||
* Allow an appcast to prevent the new version from being installed automatically (#1688) (pierswalter)
|
||||
* UI fixes
|
||||
* Show check for updates button only when automatic updates are enabled (Lorena Rangel)
|
||||
* Don't initialize the webview if we don't show release notes (Tobias Fonfara)
|
||||
* Keep skip button available if there is a minimum autoupdate version (Zorg)
|
||||
* Fix automatic updates checkbox state when not showing release notes (Zorg)
|
||||
* Fix edge cases with hiding alert buttons and using "Install Later" (Zorg)
|
||||
* Re-add setting WebUIDelegate fix for legacy web view (Zorg)
|
||||
* Adopt WKWebView for 1.x (Zorg)
|
||||
* Add auto layout constraints to SUAutomaticUpdateAlert window (Zorg)
|
||||
* Made buttons wide enough to display the full text. Made window wide enough to display the widened buttons (el, fi, ru, uk) (Piers Uso Walter)
|
||||
* Remove max size from update alert. (George Nachman)
|
||||
* Integrate generate_keys export/import options changes from #1730 (Zorg)
|
||||
* Add `—release-notes-url-prefix` support to localized release notes (Adam Tharani)
|
||||
* Translations
|
||||
* Enable base internalization for alert xibs (Zorg)
|
||||
* Capitalizes french translation of "Vous utilisez actuellement..." ("You are currently running...") (Micah Moore)
|
||||
* Fix and cleanup Hebrew, Catalan, Finnish localizations (Zorg)
|
||||
* Remove non-english localizations from TestApplication (Zorg)
|
||||
* Fix catch-22 Swift Package Manager binary target (Jonas Zaugg)
|
||||
* Add explicit dependencies to fix Xcode linking errors (Kornel)
|
||||
* Add phased rollouts feature to automatic update driver too (Zorg)
|
||||
* Remove hiding skip button and retitling later button (Zorg)
|
||||
* Deprecate installUpdatesIfAvailable (Zorg)
|
||||
* Apply custom headers to app download (Geraint White)
|
||||
|
||||
# 1.24.0
|
||||
|
||||
* Prioritize UserDefaults when fetching value for EnableAutomaticChecks (Nicolas Bosi)
|
||||
* Improve best appcast item selection handling (Ian Bytchek)
|
||||
* Create lockfile for improved compatibility with 3rd party updaters (CoreCode)
|
||||
* Enable SPM support via binary target (Jonas Zaugg)
|
||||
* `generate_appcast` improvements:
|
||||
* follow symbolic links (Denis Dzyubenko)
|
||||
* update the release notes element’s URL when required (Brad Andalman)
|
||||
* Added output filename option to generate_appcast (Brad Andalman)
|
||||
* Added —release-notes-url-prefix to generate_appcast (Brad Andalman)
|
||||
* Command line option to provide a download url prefix is now parsed and set on each archive item (Dominik H)
|
||||
* Added help command line option (Dominik H)
|
||||
* Locale updates:
|
||||
* Update zh_CN localization (柳东原 · Dongyuan Liu)
|
||||
* Update Sparkle.strings (Vojtěch Koňařík)
|
||||
* Update Croatian (#1603) (milotype)
|
||||
* Update SUUpdateAlert.xib (DanielFirlej)
|
||||
* fix: read SUAutomaticallyUpdate from Info.plist (Trevor DeVore)
|
||||
* Fix casting Boolean to BOOL on Apple Silicon (Kevin Wojniak)
|
||||
* Use build matrix to test on multiple Xcode versions (Rajiv Shah)
|
||||
* Set UpdateAlert and AutomaticUpdateAlert window's fullscreen collectionBehavior to NSWindowCollectionBehaviorFullScreenAuxiliary to allow them to present on top of the Main App's window if it's fullscreen. (Micah Moore)
|
||||
* Fixed error about "about:blank" release notes (Louis Pontoise)
|
||||
* Support App Store URL scheme in release note webview (Bi11)
|
||||
* Use the SHA-256 hash of the archive as the cache path (Nate Weaver)
|
||||
* Don't return an optional from the FileHandle method (Nate Weaver)
|
||||
* Added URL+Hashing (Nate Weaver)
|
||||
|
||||
# 1.23.0
|
||||
|
||||
* Support generating appcast with localizations (#1499) (Alik Vovkotrub)
|
||||
* Support versions with git commit SHA (#1504) (Alec Larson)
|
||||
* Hide "Skip..." and "Remind..." buttons when they're not relevant (#1480) (Kenneth Johnsen)
|
||||
* Preserve Finder tags while updating apps (#1512) (CoreCode)
|
||||
* Read-only update alert dialog formatting improvements (#1515) (Quinn Taylor)
|
||||
* Check if `SUBundleName` is set before normalizing (Jake Fenton)
|
||||
* `NSInteger` cast warning on Xcode 11 (Marga Keuvelaar)
|
||||
* Correct appcast file extension (Tom Vos)
|
||||
* Update Sparkle.strings (Emir Sarı)
|
||||
* Fix spelling (#1508) (Frank Chiarulli Jr)
|
||||
|
||||
# 1.22.0
|
||||
|
||||
* Enabled "Hardened Runtime" build option for Apple's notarization requirement
|
||||
* Add delegate methods to suppress update alerts (George Nachman)
|
||||
* Improved error when running from translocated location (Michael Buckley)
|
||||
* Add phased rollout feature (#1381) (Fabian Jäger)
|
||||
* Ignore non-standard permissions in delta updates instead of failing the build (Kornel Lesiński)
|
||||
* Notify user when installed version is newer than the latest in the appcast (CoreCode)
|
||||
* Reset timers after computer sleep (CoreCode)
|
||||
* Block-based alternatives to `NSInvocation`-based delegate methods (Fabian Jäger)
|
||||
* Add delegate `userDidSkipThisVersion` (BobZombie, Leo Natan, bono yusuke)
|
||||
* Pass item to updaterShouldShowUpdateAlertForScheduledUpdate delegate method (George Nachman)
|
||||
* Support providing private key as argument in `generate_appcast` (Yakuhzi, marchyang)
|
||||
* Separate the ed25519 sources into a new static library (Tony Arnold)
|
||||
* Disambiguate signing error messages (Nate Weaver)
|
||||
* Use `XMLNode.Options.nodePrettyPrint` in `generate_appcast` instead of trying to add whitespace manually (fumoboy007)
|
||||
* Annotate SUHost for nullability (Michael Buckley)
|
||||
* Use SUAVAILABLE macro (Christiaan Hofman)
|
||||
* Fix warnings when using modules (nivekkagicom)
|
||||
* Correction of Czech localization inconsistency (#1403) (vojtakonarik)
|
||||
* BR locale fix (BR Lingo)
|
||||
* Update Japanese localization (fujisoft)
|
||||
* French Sparkle.strings (Jean-Baptiste)
|
||||
|
||||
# 1.21.3
|
||||
|
||||
* Losslessly reduced the size of PNG (Barijaona Ramaholimihaso)
|
||||
* Catch exceptions from subcommands (Julian Mayer)
|
||||
* `generate_appcast` can sign any bundles instead of just apps (Nate Weaver)
|
||||
* Check that effectiveAppearance is being observed before calling removeObserver (Pierluigi)
|
||||
|
||||
# 1.21.2
|
||||
|
||||
* Allow EdDSA for delta updates, too (Kornel)
|
||||
* Warning fixes (Brian Bergstrand)
|
||||
* Improvements to release notes view context menu and dark mode (Bi11)
|
||||
|
||||
# 1.21.0
|
||||
|
||||
* Added support EdDSA (ed25519) signatures (Kornel)
|
||||
* DSA signatures are considered outdated, and Apple's `Security.framework` only supports weaker SHA-1-based DSA.
|
||||
* Both old DSA and new EdDSA are still supported (and one app can use both), but new applications should use EdDSA only, and we recommend migrating away from DSA signatures.
|
||||
* `generate_keys` is now a Swift tool that stores EdDSA private keys in the Keychain
|
||||
* Existing apps can continue using their old DSA keys, but we've dropped support for generation of old DSA keys
|
||||
* `sign_update` is now a Swift tool that signs using EdDSA from private keys in the Keychain
|
||||
* The old DSA-based signing script has been moved to `bin/old_dsa_scripts`
|
||||
* The old DSA-based signing script has been fixed to work on pre-10.13 systems (Thomas Tempelmann)
|
||||
* `generate_appcast` has been updated to support EdDSA signatures
|
||||
* It can sign both DSA (if `dsa_priv.pem` file is specified) and EdDSA (from Keychain)
|
||||
* The tool now uses Caches directory and doesn't generate unnecessary delta files
|
||||
* Fixed verification of delta updates on filesystems that change permissions of symlinks
|
||||
* Fixed `NSURLSession` leak (Michael Ehrmann)
|
||||
|
||||
# 1.20.0
|
||||
|
||||
* `generate_appcast` option to read private key directly from the keychain (Tamás Lustyik)
|
||||
* Add delegate callbacks for fininshed download and extraction related events (Csaba Horony)
|
||||
* Don't check for updates if Do Not Disturb is on (Kornel)
|
||||
* Expose `CodesigningVerifier`, add codesign info API (sunuslee)
|
||||
* Threading fixes:
|
||||
* Fix potential hang with `dispatch_sync` to main thread (Brian Bergstrand)
|
||||
* Fix closeCheckingWindow called from background thread (Alexey Martemyanov)
|
||||
* Improve 'read-only' error message (#1192) (Adrian Thomas)
|
||||
* New Spanish localisation (Ken Arroyo Ohori)
|
||||
* Updated Finnish language resources (Jason Pollack)
|
||||
* Hungarian localization (Csaba Horony)
|
||||
* Log more information about authentication requests (Kornel)
|
||||
* Explicitly specify types to silence "Messaging unqualified id" warning that's new in Xcode 10. Removed __has_feature(objc_generics) check and use generisc to help silence the warnings. (Kent Sutherland)
|
||||
* Fix binary delta creation on network drives (sagecook)
|
||||
* Fix compilation issues on Xcode 10 with new build system (Leo Natan)
|
||||
|
||||
# 1.19.0
|
||||
|
||||
* Refactoring of downloader code to avoid deprecated methods (Deadpikle)
|
||||
* Changes to which methods run on the main thread.
|
||||
Note: some delegate methods may be called on non-main thread now. (Kornel)
|
||||
* Update Japanese localization (1024jp)
|
||||
* Update Sparkle.strings (Stefan Paychère)
|
||||
* Fix Sparkle clients polling too frequently (Jonathan Bullard)
|
||||
* Handle SecTransformExecute errors (Kornel)
|
||||
* Silence Touch Bar availability warnings on Xcode 9 by using API_AVAILABLE. Disable gnu-zero-variadic-macro-arguments to prevent warnings from use of API_AVAILABLE. (Kent Sutherland)
|
||||
* 10.11 SDK compatibility (David Fuhrmann)
|
||||
|
||||
# 1.18.1
|
||||
|
||||
* Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115) (App Tyrant)
|
||||
* Implemented sparkle:os attribute as documented (Memphiz)
|
||||
* Additional termination detection in case kpoll fails. (fujisoft)
|
||||
* Included bin files in CocoaPods installation (Keith Smiley)
|
||||
* Updated Dutch localization (Eitot)
|
||||
* Updated German localization (Eitot)
|
||||
* Updated Japanese translation (1024jp)
|
||||
* Updated Portuguese translation (Victor)
|
||||
* Updated to Xcode 9/Swift 4
|
||||
|
||||
# 1.18.0
|
||||
|
||||
* Name of the host app is used in authorization prompt (the `SPARKLE_RELAUNCH_TOOL_NAME` setting is now obsolete)
|
||||
* More detailed progress bar for package installers (Kornel Lesiński)
|
||||
* Disabled the keyboard shortcut for the install button for scheduled updates to avoid accidental installs. (George Nachman)
|
||||
* generate_appcast tool adds release notes if there's an .html file with the same base name as the archive (Brett Walker)
|
||||
* Added `sparkle:shortVersionString` to the enclosure, #1032 (Brett Walker)
|
||||
* Fixed Japanese localization (1024jp)
|
||||
* Fixed escaping of system profile URLs
|
||||
* Added more logging in various failure cases (Kornel Lesiński)
|
||||
* Better error message for quarantined apps that can't be updated
|
||||
|
||||
# 1.17.0
|
||||
|
||||
* Added Touch Bar support (Bi11)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Common
|
||||
|
||||
SPARKLE_BUNDLE_IDENTIFIER = com.binaryage.sparkle
|
||||
SPARKLE_RELAUNCH_TOOL_NAME = Updater
|
||||
SPARKLE_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle
|
||||
SPARKLE_RELAUNCH_TOOL_NAME = Autoupdate
|
||||
SPARKLE_FILEOP_TOOL_NAME = fileop
|
||||
|
||||
SPARKLE_APPEND_VERSION_NUMBER = 1
|
||||
@@ -15,12 +15,20 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0
|
||||
// following on to always reset the name back to "MyApp":
|
||||
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
|
||||
|
||||
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_MAJOR = 1
|
||||
SPARKLE_VERSION_MINOR = 17
|
||||
SPARKLE_VERSION_PATCH = 0
|
||||
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
|
||||
SPARKLE_VERSION_MINOR = 27
|
||||
SPARKLE_VERSION_PATCH = 3
|
||||
|
||||
// This should be in SemVer format or empty, ie. "-rc.1"
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_SUFFIX =
|
||||
// This is now a monotonically increasing ID number, even across prereleases, but let's keep this below 2.0
|
||||
CURRENT_PROJECT_VERSION = 1.108
|
||||
|
||||
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
||||
|
||||
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES
|
||||
@@ -30,8 +38,11 @@ MACOSX_DEPLOYMENT_TARGET = 10.9
|
||||
PRODUCT_NAME = ${TARGET_NAME}
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle.${PRODUCT_NAME:rfc1034identifier}
|
||||
|
||||
GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_AUTOMATED_DOWNGRADES=$(SPARKLE_AUTOMATED_DOWNGRADES) SPARKLE_APPEND_VERSION_NUMBER=$(SPARKLE_APPEND_VERSION_NUMBER) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_FILEOP_TOOL_NAME=\"$(SPARKLE_FILEOP_TOOL_NAME)\"
|
||||
GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_AUTOMATED_DOWNGRADES=$(SPARKLE_AUTOMATED_DOWNGRADES) SPARKLE_APPEND_VERSION_NUMBER=$(SPARKLE_APPEND_VERSION_NUMBER) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" MARKETING_VERSION=\"$(MARKETING_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_FILEOP_TOOL_NAME=\"$(SPARKLE_FILEOP_TOOL_NAME)\"
|
||||
|
||||
CODE_SIGN_IDENTITY = -
|
||||
SDKROOT = macosx
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES
|
||||
GCC_ENABLE_PASCAL_STRINGS = NO
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
@@ -54,6 +65,7 @@ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
|
||||
CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES
|
||||
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES
|
||||
@@ -80,12 +92,8 @@ GCC_WARN_UNUSED_LABEL = YES
|
||||
GCC_WARN_UNUSED_PARAMETER = YES
|
||||
GCC_WARN_UNUSED_VARIABLE = YES
|
||||
|
||||
// Fixes a strange issue where the compiler thinks references to some enums are ambiguous
|
||||
CLANG_ENABLE_MODULES[sdk=macosx10.7] = NO
|
||||
CLANG_ENABLE_MODULES[sdk=macosx10.8] = NO
|
||||
|
||||
// These should be removed once the conversion to ARC is complete
|
||||
WARNING_CFLAGS_EXTRA = -Wno-custom-atomic-properties -Wno-implicit-atomic-properties
|
||||
|
||||
// Turn on all warnings, then disable a few which are almost impossible to avoid
|
||||
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-arc-repeated-use-of-weak -Wno-auto-import -Wno-partial-availability -Wno-dollar-in-identifier-extension $(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,4 +0,0 @@
|
||||
#include "ConfigCommonDebug.xcconfig"
|
||||
|
||||
GCC_GENERATE_TEST_COVERAGE_FILES = YES
|
||||
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
// Debug only
|
||||
|
||||
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_OPTIMIZATION_LEVEL = 0
|
||||
DEBUG_INFORMATION_FORMAT = dwarf
|
||||
ENABLE_TESTABILITY = YES
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
// Release only
|
||||
|
||||
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_OPTIMIZATION_LEVEL = s
|
||||
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
|
||||
@@ -9,3 +15,4 @@ GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_COMMON)
|
||||
DEAD_CODE_STRIPPING = YES
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES
|
||||
COPY_PHASE_STRIP = NO
|
||||
@@ -0,0 +1,7 @@
|
||||
// Generate Appcast only
|
||||
|
||||
#include "ConfigSwift.xcconfig"
|
||||
|
||||
SWIFT_OBJC_BRIDGING_HEADER = generate_keys/Bridging-Header.h
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11
|
||||
PRODUCT_NAME = generate_keys
|
||||
@@ -0,0 +1,4 @@
|
||||
// Generate Appcast Debug
|
||||
|
||||
#include "ConfigGenerateKeys.xcconfig"
|
||||
#include "ConfigSwiftDebug.xcconfig"
|
||||
@@ -0,0 +1,4 @@
|
||||
// Generate Appcast Release
|
||||
|
||||
#include "ConfigGenerateKeys.xcconfig"
|
||||
#include "ConfigSwiftRelease.xcconfig"
|
||||
@@ -1 +1,2 @@
|
||||
SWIFT_VERSION = 3.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
|
||||
@@ -0,0 +1,3 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
#include "bsdiff-Shared.xcconfig"
|
||||
@@ -0,0 +1,3 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
#include "bsdiff-Shared.xcconfig"
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
// Deployment
|
||||
SKIP_INSTALL = YES
|
||||
|
||||
// Packaging
|
||||
EXECUTABLE_PREFIX = lib
|
||||
PRODUCT_NAME = $(TARGET_NAME)
|
||||
|
||||
// Search Paths
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
// Disable Warnings - this is a third-party project, and we'll trust that the maintainers know what they're doing.
|
||||
WARNING_CFLAGS = $(inherited) -Wno-comma
|
||||
@@ -0,0 +1,3 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
#include "ed25519-Shared.xcconfig"
|
||||
@@ -0,0 +1,3 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
#include "ed25519-Shared.xcconfig"
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
// Deployment
|
||||
SKIP_INSTALL = YES
|
||||
|
||||
// Packaging
|
||||
EXECUTABLE_PREFIX = lib
|
||||
PRODUCT_NAME = $(TARGET_NAME)
|
||||
|
||||
// Search Paths
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
// Disable Warnings - this is a third-party project, and we'll trust that the maintainers know what they're doing.
|
||||
WARNING_CFLAGS = $(inherited) -Wno-cast-qual -Wno-conversion -Wno-sign-conversion
|
||||
@@ -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,36 +1,147 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ "$ACTION" = "" ] ; then
|
||||
# Sanity check that the Podspec version matches the Sparkle version
|
||||
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
|
||||
# Tests the code signing validity of the extracted products within the provided path.
|
||||
# This guards against our archives being corrupt / created incorrectly.
|
||||
function verify_code_signatures() {
|
||||
verification_directory="$1"
|
||||
|
||||
if [[ -z "$verification_directory" ]]; then
|
||||
echo "Provided verification directory does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Search the current directory for all instances of the framework to verify them (XCFrameworks can have multiple copies of a framework for different platforms).
|
||||
find "${verification_directory}" -name "Sparkle.framework" -type d -exec codesign --verify -vvv --deep {} \;
|
||||
codesign --verify -vvv --deep "${verification_directory}/Sparkle Test App.app"
|
||||
codesign --verify -vvv --deep "${verification_directory}/bin/BinaryDelta"
|
||||
codesign --verify -vvv --deep "${verification_directory}/bin/generate_appcast"
|
||||
codesign --verify -vvv --deep "${verification_directory}/bin/sign_update"
|
||||
codesign --verify -vvv --deep "${verification_directory}/bin/generate_keys"
|
||||
}
|
||||
|
||||
if [ "$ACTION" = "" ] ; then
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
|
||||
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2"
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
rm -f "Sparkle-$MARKETING_VERSION.tar.xz"
|
||||
rm -f "Sparkle-$MARKETING_VERSION.tar.bz2"
|
||||
rm -f "Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp "$CONFIGURATION_BUILD_DIR/generate_appcast" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp "$CONFIGURATION_BUILD_DIR/sign_update" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.xcframework" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
|
||||
# Only copy dSYMs for Release builds, but don't check for the presence of the actual files
|
||||
# because missing dSYMs in a release build SHOULD trigger a build failure
|
||||
if [ "$CONFIGURATION" = "Release" ] ; then
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/generate_appcast.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/generate_keys.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/sign_update.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
fi
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/staging/bin" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
|
||||
cd "$CONFIGURATION_BUILD_DIR/staging"
|
||||
|
||||
if [ -x "$(command -v xz)" ]; then
|
||||
XZ_EXISTS=1
|
||||
else
|
||||
XZ_EXISTS=0
|
||||
fi
|
||||
|
||||
rm -rf "/tmp/sparkle-extract"
|
||||
mkdir -p "/tmp/sparkle-extract"
|
||||
|
||||
# Sorted file list groups similar files together, which improves tar compression
|
||||
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2" --files-from=-
|
||||
if [ "$XZ_EXISTS" -eq 1 ] ; then
|
||||
find . \! -type d | rev | sort | rev | tar cv --files-from=- | xz -9 > "../Sparkle-$MARKETING_VERSION.tar.xz"
|
||||
|
||||
# Copy archived distribution for CI
|
||||
cp -f "../Sparkle-$MARKETING_VERSION.tar.xz" "../sparkle-dist.tar.xz"
|
||||
|
||||
# Extract archive for testing binary validity
|
||||
tar -xf "../Sparkle-$MARKETING_VERSION.tar.xz" -C "/tmp/sparkle-extract"
|
||||
else
|
||||
# Fallback to bz2 compression if xz utility is not available
|
||||
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$MARKETING_VERSION.tar.bz2" --files-from=-
|
||||
|
||||
# Extract archive for testing binary validity
|
||||
tar -xf "../Sparkle-$MARKETING_VERSION.tar.bz2" -C "/tmp/sparkle-extract"
|
||||
fi
|
||||
|
||||
# Test code signing validity of the extracted products
|
||||
# This guards against our archives being corrupt / created incorrectly
|
||||
verify_code_signatures "/tmp/sparkle-extract"
|
||||
|
||||
rm -rf "/tmp/sparkle-extract"
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
|
||||
|
||||
# Generate zip containing the xcframework for SPM
|
||||
rm -rf "/tmp/sparkle-spm-extract"
|
||||
mkdir -p "/tmp/sparkle-spm-extract"
|
||||
cd "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
# rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive"
|
||||
ditto -c -k --zlibCompressionLevel 9 --rsrc . "../Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
# Test code signing validity of the extracted Swift package
|
||||
# This guards against our archives being corrupt / created incorrectly
|
||||
ditto -x -k "../Sparkle-for-Swift-Package-Manager.zip" "/tmp/sparkle-spm-extract"
|
||||
verify_code_signatures "/tmp/sparkle-spm-extract"
|
||||
|
||||
rm -rf "/tmp/sparkle-spm-extract"
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
|
||||
# Get latest git tag
|
||||
cd "$SRCROOT"
|
||||
latest_git_tag=$(git describe --tags --abbrev=0)
|
||||
|
||||
# Check semantic versioning
|
||||
if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
|
||||
echo "Tag $latest_git_tag follows semantic versioning"
|
||||
else
|
||||
echo "ERROR: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate new Package manifest and podspec
|
||||
cd "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$SRCROOT/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
|
||||
if [ "$XCODE_VERSION_MAJOR" -ge "1200" ]; then
|
||||
# is equivalent to shasum -a 256 FILE
|
||||
spm_checksum=$(swift package compute-checksum "Sparkle-for-Swift-Package-Manager.zip")
|
||||
rm -rf ".build"
|
||||
sed -E -i '' -e "/let tag/ s/\".+\"/\"$latest_git_tag\"/" -e "/let version/ s/\".+\"/\"$MARKETING_VERSION\"/" -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
|
||||
cp "Package.swift" "$SRCROOT"
|
||||
echo "Package.swift updated with the following values:"
|
||||
echo "Version: $MARKETING_VERSION"
|
||||
echo "Tag: $latest_git_tag"
|
||||
echo "Checksum: $spm_checksum"
|
||||
|
||||
sed -E -i '' -e "/s\.version.+=/ s/\".+\"/\"$MARKETING_VERSION\"/" "Sparkle.podspec"
|
||||
cp "Sparkle.podspec" "$SRCROOT"
|
||||
echo "Sparkle.podspec updated with following values:"
|
||||
echo "Version: $MARKETING_VERSION"
|
||||
else
|
||||
echo "warning: Xcode version $XCODE_VERSION_ACTUAL does not support computing checksums for Swift Packages. Please update the Package manifest manually."
|
||||
fi
|
||||
|
||||
if [ "$XZ_EXISTS" -ne 1 ] ; then
|
||||
echo "WARNING: xz compression is used for official releases but bz2 is being used instead because xz tool is not installed on your system."
|
||||
fi
|
||||
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
fi
|
||||
@@ -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
|
||||
|
||||
@@ -5,6 +5,7 @@ if [ "$ACTION" = "" ] ; then
|
||||
doxygen Documentation/Doxyfile
|
||||
else
|
||||
echo "warning: Doxygen not found in PATH"
|
||||
echo "open Terminal and type this command 'brew install doxygen' then click 'enter/return' key. finally build this target again"
|
||||
fi
|
||||
elif [ "$ACTION" = "clean" ] ; then
|
||||
rm -rf "$SRCROOT/Documentation/html"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
.PHONY: all localizable-strings release build test ci
|
||||
|
||||
all: build
|
||||
|
||||
ifndef BUILDDIR
|
||||
BUILDDIR := $(shell mktemp -d "$(TMPDIR)/Sparkle.XXXXXX")
|
||||
endif
|
||||
@@ -12,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.3"
|
||||
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
|
||||
let tag = "1.27.3"
|
||||
let checksum = "f0c6b4e6ffc6269a67b0d4ff254e3e8acfc6b3852db7b9957d4c0a5b39044446"
|
||||
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
let package = Package(
|
||||
name: "Sparkle",
|
||||
platforms: [.macOS(.v10_11)],
|
||||
products: [
|
||||
.library(
|
||||
name: "Sparkle",
|
||||
targets: ["Sparkle"])
|
||||
],
|
||||
targets: [
|
||||
.binaryTarget(
|
||||
name: "Sparkle",
|
||||
url: url,
|
||||
checksum: checksum
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
@@ -1,50 +1,65 @@
|
||||
# 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.
|
||||
* Secure. Updates are verified using DSA signatures and Apple Code Signing.
|
||||
* Secure. Updates are verified using EdDSA signatures and Apple Code Signing.
|
||||
* Fast. Supports delta updates which only patch files that have changed.
|
||||
* Easy to install. Sparkle requires no code in your app, and only needs static files on a web server.
|
||||
* Supports bundles, preference panes, plugins, and other non-.app software. Can install .pkg files for more complicated products.
|
||||
* Handles permissions, quarantine and automatically asks for authentication if needed.
|
||||
* Uses RSS-based appcasts for release information. Appcasts are a de-facto standard supported by 3rd party update-tracking programs and websites.
|
||||
* Sparkle stays hidden until second launch for better first impressions.
|
||||
* Stays hidden until second launch for better first impressions.
|
||||
* Truly self-updating — the user can choose to automatically download and install all updates in the background.
|
||||
|
||||
## Changes since 1.5b
|
||||
|
||||
* Compatibilty with macOS Sierra.
|
||||
* Up-to-date with 10.12 SDK and Xcode 8 (supports macOS 10.7+).
|
||||
* Important security fixes.
|
||||
* Cleaned up and modernized code, using ARC and Autolayout.
|
||||
* Truly automatic background updates (no UI at all) when user agreed to "Automatically download and install updates in the future."
|
||||
* Upgraded and more reliable binary delta and code signing verification.
|
||||
* Ability to mark updates as critical.
|
||||
* Progress and status notifications for the host app.
|
||||
|
||||
## Requirements
|
||||
|
||||
* Runtime: macOS 10.7 or greater
|
||||
* Build: Xcode 7 and 10.8 SDK or greater
|
||||
* Runtime: macOS 10.9 or greater
|
||||
* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less; at least Xcode 12 if using Swift Package Manager.
|
||||
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
|
||||
* No sandboxing. Sparkle 1.x can't update sandboxed apps. However, [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
|
||||
|
||||
## API
|
||||
## Usage
|
||||
|
||||
See [getting started guide](https://sparkle-project.org/documentation/). No code is necessary, but a bit of Xcode configuration is required.
|
||||
|
||||
## Development
|
||||
|
||||
This repository uses git submodules, and will not build unless you clone recursively. Also, GitHub-provided ZIP/tar archives are broken due to GitHub not supporting git submodules properly.
|
||||
|
||||
git clone --recursive https://github.com/sparkle-project/Sparkle
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
* Please check **Console.app**. Sparkle prints detailed information there about all problems it encounters. It often also suggests solutions to the problems, so please read Sparkle's log messages carefully.
|
||||
|
||||
* Use the `generate_appcast` tool which creates appcast files, correct signatures, and delta updates automatically.
|
||||
|
||||
* Make sure the URL specified in [`SUFeedURL`](https://sparkle-project.org/documentation/customization/) is valid (typos/404s are a common error!), and that it uses modern TLS ([test it](https://www.ssllabs.com/ssltest/)).
|
||||
|
||||
* Delete your app's preferences (in `~/Library/Preferences/<your bundle id>`) if you've set another feed URL programmatically via Sparkle's Objective-C interface.
|
||||
|
||||
### API symbols
|
||||
|
||||
Sparkle is built with `-fvisibility=hidden -fvisibility-inlines-hidden` which means no symbols are exported by default.
|
||||
If you are adding a symbol to the public API you must decorate the declaration with the `SU_EXPORT` macro (grep the source code for examples).
|
||||
|
||||
## Building the distribution package
|
||||
### Building the distribution package
|
||||
|
||||
`cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.bz2 will be created in a temporary directory and revealed in Finder after the build has completed.
|
||||
|
||||
Alternatively, build the Distribution scheme in the Xcode UI.
|
||||
|
||||
## Code of Conduct
|
||||
### Code of Conduct
|
||||
|
||||
We pledge to have an open and welcoming environment. See our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 662 B |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 368 KiB After Width: | Height: | Size: 176 KiB |
@@ -0,0 +1,12 @@
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
color: white;
|
||||
background: transparent;
|
||||
}
|
||||
:link {
|
||||
color: #419CFF;
|
||||
}
|
||||
:link:active {
|
||||
color: #FF1919;
|
||||
}
|
||||
}
|
||||
@@ -6,33 +6,40 @@
|
||||
<language>en</language>
|
||||
<item>
|
||||
<title>Version 2.0 (2 bugs fixed; 3 new features)</title>
|
||||
<link>https://sparkle-project.org</link>
|
||||
<sparkle:version>2.0</sparkle:version>
|
||||
<sparkle:releaseNotesLink>
|
||||
http://you.com/app/2.0.html
|
||||
https://you.com/app/2.0.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
|
||||
<enclosure url="http://you.com/app/Your%20Great%20App%202.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
|
||||
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%202.0.zip" length="1623481" type="application/octet-stream" sparkle:edSignature="WVyVJpOx+a5+vNWJVY79TRjFKveNk+VhGJf2iti4CZtJsJewIUGvh/1AKKEAFbH1qUwx+vro1ECuzOsMmumoBA==" />
|
||||
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Version 1.5 (8 bugs fixed; 2 new features)</title>
|
||||
<link>https://sparkle-project.org</link>
|
||||
<sparkle:version>1.5</sparkle:version>
|
||||
<sparkle:releaseNotesLink>
|
||||
http://you.com/app/1.5.html
|
||||
https://you.com/app/1.5.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
|
||||
<enclosure url="http://you.com/app/Your%20Great%20App%201.5.zip" sparkle:version="1.5" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" />
|
||||
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%201.5.zip" length="1472893" type="application/octet-stream" sparkle:edSignature="pNFd7KbcQSu+Mq7UYrbQXTPq82luht2ACXm/r2utp1u/Uv/5hWqctdT2jwQgMejW7DRoeV/hVr6J4VdZYdwWDw==" />
|
||||
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
|
||||
<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. -->
|
||||
<item>
|
||||
<title>Version 1.4 (5 bugs fixed; 2 new features)</title>
|
||||
<link>https://sparkle-project.org</link>
|
||||
<sparkle:releaseNotesLink>
|
||||
http://you.com/app/1.4.html
|
||||
https://you.com/app/1.4.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<sparkle:version>241</sparkle:version>
|
||||
<sparkle:shortVersionString>1.4</sparkle:shortVersionString>
|
||||
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
|
||||
<enclosure url="http://you.com/app/Your%20Great%20App%201.4.zip" sparkle:version="241" sparkle:shortVersionString="1.4" sparkle:dsaSignature="MC0CFBfeCa1JyW30nbkBwainOzrN6EQuAh=" length="1472349" type="application/octet-stream" />
|
||||
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%201.4.zip" sparkle:edSignature="Ody3D/ybSMH4T+P/oNj3LN4F0SA8RJGLEr1TI4UemrBAiJ9aEcDnYV3u58P75AbcFjI13jPYmHDUHXMSTFQbDw==" length="1472349" type="application/octet-stream" />
|
||||
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 100 KiB |
@@ -1,11 +1,11 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Sparkle"
|
||||
s.version = "1.17.0"
|
||||
s.version = "1.27.3"
|
||||
s.summary = "A software update framework for macOS"
|
||||
s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers."
|
||||
s.homepage = "http://sparkle-project.org"
|
||||
s.documentation_url = "http://sparkle-project.org/documentation/"
|
||||
s.screenshot = "http://sparkle-project.org/images/screenshot-noshadow@2x.png"
|
||||
s.homepage = "https://sparkle-project.org"
|
||||
s.documentation_url = "https://sparkle-project.org/documentation/"
|
||||
s.screenshot = "https://sparkle-project.org/images/screenshot-noshadow@2x.png"
|
||||
s.license = {
|
||||
:type => 'MIT',
|
||||
:file => 'LICENSE'
|
||||
@@ -18,10 +18,11 @@ 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/*'
|
||||
s.public_header_files = 'Sparkle.framework/Versions/A/Headers/*.h'
|
||||
s.vendored_frameworks = 'Sparkle.framework'
|
||||
s.xcconfig = {
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Sparkle.xcodeproj">
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1310"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5D06E8CF0FD68C7C005AE3F6"
|
||||
BuildableName = "BinaryDelta"
|
||||
BlueprintName = "BinaryDelta"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5D06E8CF0FD68C7C005AE3F6"
|
||||
BuildableName = "BinaryDelta"
|
||||
BlueprintName = "BinaryDelta"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5D06E8CF0FD68C7C005AE3F6"
|
||||
BuildableName = "BinaryDelta"
|
||||
BlueprintName = "BinaryDelta"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?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 = "14732BC51960F69300593899"
|
||||
BuildableName = "Distribution"
|
||||
BlueprintName = "Distribution"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "14732BC51960F69300593899"
|
||||
BuildableName = "Distribution"
|
||||
BlueprintName = "Distribution"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "612279D80DB5470200AB99EA"
|
||||
BuildableName = "Sparkle Unit Tests.xctest"
|
||||
BlueprintName = "Sparkle Unit Tests"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = ""
|
||||
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "14732BC51960F69300593899"
|
||||
BuildableName = "Distribution"
|
||||
BlueprintName = "Distribution"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "14732BC51960F69300593899"
|
||||
BuildableName = "Distribution"
|
||||
BlueprintName = "Distribution"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1300"
|
||||
version = "2.0">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
|
||||
BuildableName = "Sparkle.framework"
|
||||
BlueprintName = "Sparkle"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
|
||||
BuildableName = "Sparkle.framework"
|
||||
BlueprintName = "Sparkle"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "612279D80DB5470200AB99EA"
|
||||
BuildableName = "Sparkle Unit Tests.xctest"
|
||||
BlueprintName = "Sparkle Unit Tests"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = ""
|
||||
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugXPCServices = "NO"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
|
||||
BuildableName = "Sparkle.framework"
|
||||
BlueprintName = "Sparkle"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8DC2EF4F0486A6940098B216"
|
||||
BuildableName = "Sparkle.framework"
|
||||
BlueprintName = "Sparkle"
|
||||
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 = "0820"
|
||||
LastUpgradeVersion = "1300"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -23,8 +23,6 @@
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -36,8 +34,6 @@
|
||||
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>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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 = "5AA96C541E0AE0DB00CA4346"
|
||||
BuildableName = "generate_appcast"
|
||||
BlueprintName = "generate_appcast"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5AA96C541E0AE0DB00CA4346"
|
||||
BuildableName = "generate_appcast"
|
||||
BlueprintName = "generate_appcast"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release"
|
||||
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 = "5AA96C541E0AE0DB00CA4346"
|
||||
BuildableName = "generate_appcast"
|
||||
BlueprintName = "generate_appcast"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5AA96C541E0AE0DB00CA4346"
|
||||
BuildableName = "generate_appcast"
|
||||
BlueprintName = "generate_appcast"
|
||||
ReferencedContainer = "container:Sparkle.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -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>
|
||||
|
||||
@@ -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: 0 statusText: @""];
|
||||
maxProgressValue:installer.supportsDeterminateProgress ? 100 : 0 statusText: @""];
|
||||
[self.statusController showWindow:self];
|
||||
}
|
||||
|
||||
@@ -151,8 +151,16 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5;
|
||||
return;
|
||||
}
|
||||
|
||||
void(^progressBlock)(double) = ^(double progress){
|
||||
dispatch_async(dispatch_get_main_queue(), ^(){
|
||||
if (installer.supportsDeterminateProgress) {
|
||||
self.statusController.progressValue = progress * 100.0;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
NSError *finalInstallationError = nil;
|
||||
if (![installer performFinalInstallation:&finalInstallationError]) {
|
||||
if (![installer performFinalInstallationProgressBlock:progressBlock error:&finalInstallationError]) {
|
||||
NSError *underlyingError = [finalInstallationError.userInfo objectForKey:NSUnderlyingErrorKey];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (underlyingError == nil || underlyingError.code != SUInstallationCancelledError) {
|
||||
@@ -226,7 +234,7 @@ int main(int __unused argc, const char __unused *argv[])
|
||||
{
|
||||
@autoreleasepool
|
||||
{
|
||||
NSArray *args = [[NSProcessInfo processInfo] arguments];
|
||||
NSArray<NSString *> *args = [[NSProcessInfo processInfo] arguments];
|
||||
if (args.count < 5 || args.count > 7) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -116,6 +116,11 @@
|
||||
if ([self terminated]) {
|
||||
[self invokeCompletionWithSuccess:YES];
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if ([self terminated]) {
|
||||
[self invokeCompletionWithSuccess:YES];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static void noteExitKQueueCallback(CFFileDescriptorRef file, CFOptionFlags __unused callBackTypes, void *info)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="16C68" 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>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
|
||||
<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">
|
||||
@@ -16,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"/>
|
||||
@@ -44,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"/>
|
||||
@@ -56,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"/>
|
||||
@@ -70,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"/>
|
||||
@@ -84,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"/>
|
||||
@@ -95,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"/>
|
||||
@@ -107,11 +107,34 @@ Gw
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="15" firstAttribute="leading" secondItem="16" secondAttribute="trailing" constant="14" id="1z5-yw-8XJ"/>
|
||||
<constraint firstItem="30" firstAttribute="top" secondItem="17" secondAttribute="bottom" constant="20" symbolic="YES" id="3AQ-x0-2t4"/>
|
||||
<constraint firstItem="7" firstAttribute="leading" secondItem="6" secondAttribute="leading" constant="23" id="3ak-LX-g8l"/>
|
||||
<constraint firstItem="17" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="20" id="600-33-4ZV"/>
|
||||
<constraint firstItem="16" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="30" secondAttribute="trailing" constant="100" id="86g-dm-fdN"/>
|
||||
<constraint firstItem="8" firstAttribute="top" secondItem="6" secondAttribute="top" constant="15" id="Adf-rF-bOx"/>
|
||||
<constraint firstItem="9" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="20" id="CKo-2e-9BO"/>
|
||||
<constraint firstAttribute="trailing" secondItem="17" secondAttribute="trailing" constant="21" id="Hen-8y-ckS"/>
|
||||
<constraint firstItem="30" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="20" id="T5I-iM-tWw"/>
|
||||
<constraint firstItem="17" firstAttribute="top" secondItem="9" secondAttribute="bottom" constant="24" id="eo1-MH-1S4"/>
|
||||
<constraint firstAttribute="bottom" secondItem="15" secondAttribute="bottom" constant="19" id="h6K-Du-mzi"/>
|
||||
<constraint firstAttribute="bottom" secondItem="16" secondAttribute="bottom" constant="19" id="iJb-rw-tCI"/>
|
||||
<constraint firstAttribute="trailing" secondItem="8" secondAttribute="trailing" constant="16" id="k1D-UP-haL"/>
|
||||
<constraint firstAttribute="trailing" secondItem="9" secondAttribute="trailing" constant="20" id="k4f-2L-XBk"/>
|
||||
<constraint firstItem="15" firstAttribute="top" secondItem="17" secondAttribute="bottom" constant="20" symbolic="YES" id="pU4-ge-nz4"/>
|
||||
<constraint firstItem="7" firstAttribute="top" secondItem="6" secondAttribute="top" constant="15" id="pxH-Va-6al"/>
|
||||
<constraint firstItem="9" firstAttribute="top" secondItem="8" secondAttribute="bottom" constant="8" symbolic="YES" id="qgx-nM-F29"/>
|
||||
<constraint firstItem="16" firstAttribute="top" secondItem="17" secondAttribute="bottom" constant="20" id="sTJ-dt-fNH"/>
|
||||
<constraint firstAttribute="trailing" secondItem="15" secondAttribute="trailing" constant="21" id="txY-6K-ogq"/>
|
||||
<constraint firstItem="8" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="20" id="vhw-bw-hJ4"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<point key="canvasLocation" x="117" y="124"/>
|
||||
</window>
|
||||
<userDefaultsController representsSharedInstance="YES" id="18" userLabel="Shared Defaults"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
<image name="NSApplicationIcon" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="16C68" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19455" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
|
||||
<plugIn identifier="com.apple.WebKitIBPlugin" version="11201"/>
|
||||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
<capability name="box content view" minToolsVersion="7.0"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19455"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SUUpdateAlert">
|
||||
@@ -14,21 +12,21 @@
|
||||
<outlet property="descriptionField" destination="101" id="9oA-2S-eXN"/>
|
||||
<outlet property="installButton" destination="76" id="176"/>
|
||||
<outlet property="laterButton" destination="22" id="177"/>
|
||||
<outlet property="releaseNotesBoxView" destination="89" id="FhX-K4-uzH"/>
|
||||
<outlet property="releaseNotesContainerView" destination="fKC-QA-GZa" id="BYw-MA-Z5h"/>
|
||||
<outlet property="releaseNotesView" destination="18" id="32"/>
|
||||
<outlet property="skipButton" destination="23" id="178"/>
|
||||
<outlet property="window" destination="5" id="69"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
|
||||
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowCollectionBehavior key="collectionBehavior" fullScreenAuxiliary="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="746" y="229" width="620" height="370"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1366" height="745"/>
|
||||
<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"/>
|
||||
@@ -75,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"/>
|
||||
@@ -115,7 +94,7 @@
|
||||
</connections>
|
||||
</box>
|
||||
<textField verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="17">
|
||||
<rect key="frame" x="-2" y="220" width="85" 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>
|
||||
@@ -143,7 +122,7 @@
|
||||
</constraints>
|
||||
</customView>
|
||||
<button horizontalHuggingPriority="150" verticalHuggingPriority="750" horizontalCompressionResistancePriority="997" translatesAutoresizingMaskIntoConstraints="NO" id="22">
|
||||
<rect key="frame" x="328" y="12" width="146" 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>
|
||||
@@ -159,7 +138,7 @@ Gw
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" horizontalCompressionResistancePriority="998" translatesAutoresizingMaskIntoConstraints="NO" id="23">
|
||||
<rect key="frame" x="103" y="12" width="146" 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"/>
|
||||
@@ -169,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>
|
||||
@@ -185,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"/>
|
||||
@@ -195,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>
|
||||
@@ -241,6 +215,6 @@ DQ
|
||||
<userDefaultsController representsSharedInstance="YES" id="93" userLabel="Shared Defaults"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
<image name="NSApplicationIcon" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
|
||||
<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">
|
||||
@@ -160,15 +162,14 @@ This is the information that would be sent:</string>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<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="16"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="353" height="113"/>
|
||||
<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>
|
||||
@@ -201,13 +201,12 @@ This is the information that would be sent:</string>
|
||||
</tableColumns>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</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>
|
||||
@@ -222,6 +221,6 @@ This is the information that would be sent:</string>
|
||||
</userDefaultsController>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSApplicationIcon" width="128" height="128"/>
|
||||
<image name="NSApplicationIcon" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -2,10 +2,18 @@
|
||||
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?";
|
||||
|
||||
"%1$@ can't be updated when it's running from a read-only volume like a disk image or an optical drive. Move %1$@ to your Applications folder, relaunch it from there, and try again." = "%1$@ can’t be updated when it’s running from a read-only volume like a disk image or an optical drive. Move %1$@ to your Applications folder, relaunch it from there, and try again.";
|
||||
"%1$@ can't be updated, because it was opened from a read-only or a temporary location." = "%1$@ can't be updated, because it was opened from a read-only or a temporary location.";
|
||||
|
||||
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.";
|
||||
|
||||
"Quit %1$@, move it into your Applications folder, relaunch it from there and try again." = "Quit %1$@, move it into your Applications folder, relaunch it from there and try again.";
|
||||
|
||||
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ can’t be updated if it’s running from the location it was downloaded to.";
|
||||
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";
|
||||
|
||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ is currently the newest version available.\n(You are currently running version %3$@.)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||
"%@ %@ is now available--you have %@. Would you like to download it now?" = "%1$@ %2$@ is now available—you have %3$@. Would you like to download it now?";
|
||||
|
||||
@@ -86,4 +94,4 @@
|
||||
"You already have the newest version of %@." = "You already have the newest version of %@.";
|
||||
|
||||
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
|
||||
"You're up-to-date!" = "You’re up-to-date!";
|
||||
"You're up-to-date!" = "You’re up to date!";
|
||||
@@ -2,26 +2,26 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
func die(msg: String) {
|
||||
func die(_ msg: String) {
|
||||
print("ERROR: \(msg)")
|
||||
exit(1)
|
||||
}
|
||||
|
||||
extension NSXMLElement {
|
||||
extension XMLElement {
|
||||
convenience init(name: String, attributes: [String: String], stringValue string: String? = nil) {
|
||||
self.init(name: name, stringValue: string)
|
||||
setAttributesWithDictionary(attributes)
|
||||
setAttributesWith(attributes)
|
||||
}
|
||||
}
|
||||
|
||||
let ud = NSUserDefaults.standardUserDefaults()
|
||||
let sparkleRoot = ud.objectForKey("root") as? String
|
||||
let htmlPath = ud.objectForKey("htmlPath") as? String
|
||||
let ud = UserDefaults.standard
|
||||
let sparkleRoot = ud.object(forKey: "root") as? String
|
||||
let htmlPath = ud.object(forKey: "htmlPath") as? String
|
||||
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")
|
||||
@@ -29,36 +29,36 @@ if enStringsDict == nil {
|
||||
let enStringsDictKeys = enStringsDict!.allKeys
|
||||
|
||||
let dirPath = NSString(string: sparkleRoot! + "/Sparkle")
|
||||
let dirContents = try! NSFileManager.defaultManager().contentsOfDirectoryAtPath(dirPath as String)
|
||||
let dirContents = try! FileManager.default.contentsOfDirectory(atPath: dirPath as String)
|
||||
let css =
|
||||
"body { font-family: sans-serif; font-size: 10pt; }" +
|
||||
"h1 { font-size: 12pt; }" +
|
||||
".missing { background-color: #FFBABA; color: #D6010E; white-space: pre; }" +
|
||||
".unused { background-color: #BDE5F8; color: #00529B; white-space: pre; }" +
|
||||
".unlocalized { background-color: #FEEFB3; color: #9F6000; white-space: pre; }"
|
||||
var html = NSXMLDocument(rootElement: NSXMLElement(name: "html"))
|
||||
html.DTD = NSXMLDTD()
|
||||
html.DTD!.name = html.rootElement()!.name
|
||||
var html = XMLDocument(rootElement: XMLElement(name: "html"))
|
||||
html.dtd = XMLDTD()
|
||||
html.dtd!.name = html.rootElement()!.name
|
||||
html.characterEncoding = "UTF-8"
|
||||
html.documentContentKind = NSXMLDocumentContentKind.XHTMLKind
|
||||
var body = NSXMLElement(name: "body")
|
||||
var head = NSXMLElement(name: "head")
|
||||
html.documentContentKind = XMLDocument.ContentKind.xhtml
|
||||
var body = XMLElement(name: "body")
|
||||
var head = XMLElement(name: "head")
|
||||
html.rootElement()!.addChild(head)
|
||||
html.rootElement()!.addChild(body)
|
||||
head.addChild(NSXMLElement(name: "meta", attributes: ["charset": html.characterEncoding!]))
|
||||
head.addChild(NSXMLElement(name: "title", stringValue: "Sparkle Localizations Report"))
|
||||
head.addChild(NSXMLElement(name: "style", stringValue: css))
|
||||
head.addChild(XMLElement(name: "meta", attributes: ["charset": html.characterEncoding!]))
|
||||
head.addChild(XMLElement(name: "title", stringValue: "Sparkle Localizations Report"))
|
||||
head.addChild(XMLElement(name: "style", stringValue: css))
|
||||
|
||||
let locale = NSLocale.currentLocale()
|
||||
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
|
||||
}
|
||||
|
||||
let lang = locale.displayNameForKey(NSLocaleLanguageCode, value: NSString(string: dirEntry).stringByDeletingPathExtension)
|
||||
body.addChild(NSXMLElement(name: "h1", stringValue: "\(dirEntry) (\(lang!))"))
|
||||
let lang = (locale as NSLocale).displayName(forKey: NSLocale.Key.languageCode, value: NSString(string: dirEntry).deletingPathExtension)
|
||||
body.addChild(XMLElement(name: "h1", stringValue: "\(dirEntry) (\(lang!))"))
|
||||
|
||||
let stringsPath = NSString(string: dirPath.stringByAppendingPathComponent(dirEntry)).stringByAppendingPathComponent("Sparkle.strings")
|
||||
let stringsPath = NSString(string: dirPath.appendingPathComponent(dirEntry)).appendingPathComponent("Sparkle.strings")
|
||||
let stringsDict = NSDictionary(contentsOfFile: stringsPath)
|
||||
if stringsDict == nil {
|
||||
die("Invalid strings file \(dirEntry)")
|
||||
@@ -70,10 +70,10 @@ for dirEntry in dirContents {
|
||||
var unused: [String] = []
|
||||
|
||||
for key in enStringsDictKeys {
|
||||
let str = stringsDict?.objectForKey(key) as? String
|
||||
let str = stringsDict?.object(forKey: key) as? String
|
||||
if str == nil {
|
||||
missing.append(key as! String)
|
||||
} else if let enStr = enStringsDict?.objectForKey(key) as? String {
|
||||
} else if let enStr = enStringsDict?.object(forKey: key) as? String {
|
||||
if enStr == str {
|
||||
unlocalized.append(key as! String)
|
||||
}
|
||||
@@ -82,7 +82,7 @@ for dirEntry in dirContents {
|
||||
|
||||
let stringsDictKeys = stringsDict!.allKeys
|
||||
for key in stringsDictKeys {
|
||||
if enStringsDict?.objectForKey(key) == nil {
|
||||
if enStringsDict?.object(forKey: key) == nil {
|
||||
unused.append(key as! String)
|
||||
}
|
||||
}
|
||||
@@ -90,12 +90,12 @@ for dirEntry in dirContents {
|
||||
let sorter = { (s1: String, s2: String) -> Bool in
|
||||
return s1 < s2
|
||||
}
|
||||
missing.sortInPlace(sorter)
|
||||
unlocalized.sortInPlace(sorter)
|
||||
unused.sortInPlace(sorter)
|
||||
missing.sort(by: sorter)
|
||||
unlocalized.sort(by: sorter)
|
||||
unused.sort(by: sorter)
|
||||
|
||||
let addRow = { (prefix: String, cssClass: String, key: String) -> Void in
|
||||
body.addChild(NSXMLElement(name: "span", attributes: ["class": cssClass], stringValue: [prefix, key].joinWithSeparator(" ") + "\n"))
|
||||
body.addChild(XMLElement(name: "span", attributes: ["class": cssClass], stringValue: [prefix, key].joined(separator: " ") + "\n"))
|
||||
}
|
||||
|
||||
for key in missing {
|
||||
@@ -110,6 +110,6 @@ for dirEntry in dirContents {
|
||||
}
|
||||
|
||||
var err: NSError?
|
||||
if !html.XMLData.writeToFile(htmlPath!, atomically: true) {
|
||||
die("Can't write report: \(err)")
|
||||
if !((try? html.xmlData.write(to: URL(fileURLWithPath: htmlPath!), options: [.atomic])) != nil) {
|
||||
die("Can't write report: \(err!)")
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// SPUDownloadData.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 8/10/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#if __has_feature(modules)
|
||||
@import Foundation;
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#import "SUExport.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*!
|
||||
* A class for containing downloaded data along with some information about it.
|
||||
*/
|
||||
SU_EXPORT @interface SPUDownloadData : NSObject <NSSecureCoding>
|
||||
|
||||
- (instancetype)initWithData:(NSData *)data textEncodingName:(NSString * _Nullable)textEncodingName MIMEType:(NSString * _Nullable)MIMEType;
|
||||
|
||||
/*!
|
||||
* The raw data that was downloaded.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSData *data;
|
||||
|
||||
/*!
|
||||
* The IANA charset encoding name if available. Eg: "utf-8"
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable, copy) NSString *textEncodingName;
|
||||
|
||||
/*!
|
||||
* The MIME type if available. Eg: "text/plain"
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable, copy) NSString *MIMEType;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// SPUDownloadData.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 8/10/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SPUDownloadData.h"
|
||||
|
||||
#import "SUOperatingSystem.h"
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static NSString *SPUDownloadDataKey = @"SPUDownloadData";
|
||||
static NSString *SPUDownloadTextEncodingKey = @"SPUDownloadTextEncoding";
|
||||
static NSString *SPUDownloadMIMETypeKey = @"SPUDownloadMIMEType";
|
||||
|
||||
@implementation SPUDownloadData
|
||||
|
||||
@synthesize data = _data;
|
||||
@synthesize textEncodingName = _textEncodingName;
|
||||
@synthesize MIMEType = _MIMEType;
|
||||
|
||||
+ (BOOL)supportsSecureCoding
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (instancetype)initWithData:(NSData *)data textEncodingName:(NSString * _Nullable)textEncodingName MIMEType:(NSString *)MIMEType
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_data = data;
|
||||
_textEncodingName = textEncodingName;
|
||||
_MIMEType = MIMEType;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)coder
|
||||
{
|
||||
[coder encodeObject:self.data forKey:SPUDownloadDataKey];
|
||||
|
||||
if (self.textEncodingName != nil) {
|
||||
[coder encodeObject:self.textEncodingName forKey:SPUDownloadTextEncodingKey];
|
||||
}
|
||||
|
||||
if (self.MIMEType != nil) {
|
||||
[coder encodeObject:self.MIMEType forKey:SPUDownloadMIMETypeKey];
|
||||
}
|
||||
}
|
||||
|
||||
- (nullable instancetype)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
NSData *data = [decoder decodeObjectOfClass:[NSData class] forKey:SPUDownloadDataKey];
|
||||
if (data == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString *textEncodingName = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadTextEncodingKey];
|
||||
|
||||
NSString *MIMEType = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadMIMETypeKey];
|
||||
|
||||
return [self initWithData:data textEncodingName:textEncodingName MIMEType:MIMEType];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// SPUDownloader.h
|
||||
// Downloader
|
||||
//
|
||||
// Created by Mayur Pawashe on 4/1/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#if __has_feature(modules)
|
||||
@import Foundation;
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
#import "SPUDownloaderProtocol.h"
|
||||
|
||||
@protocol SPUDownloaderDelegate;
|
||||
|
||||
// This object implements the protocol which we have defined. It provides the actual behavior for the service. It is 'exported' by the service to make it available to the process hosting the service over an NSXPCConnection.
|
||||
@interface SPUDownloader : NSObject <SPUDownloaderProtocol>
|
||||
|
||||
// Due to XPC remote object reasons, this delegate is strongly referenced
|
||||
// Invoke cleanup when done with this instance
|
||||
- (instancetype)initWithDelegate:(id <SPUDownloaderDelegate>)delegate;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// SPUDownloader.m
|
||||
// Downloader
|
||||
//
|
||||
// Created by Mayur Pawashe on 4/1/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SPUDownloader.h"
|
||||
#import "SPUDownloaderDelegate.h"
|
||||
#import "SPULocalCacheDirectory.h"
|
||||
#import "SPUURLRequest.h"
|
||||
#import "SPUDownloadData.h"
|
||||
#import "SUErrors.h"
|
||||
#import "SPUDownloader_Private.h"
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SPUDownloader ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation SPUDownloader
|
||||
|
||||
@synthesize delegate = _delegate;
|
||||
@synthesize bundleIdentifier = _bundleIdentifier;
|
||||
@synthesize desiredFilename = _desiredFilename;
|
||||
@synthesize downloadFilename = _downloadFilename;
|
||||
@synthesize disabledAutomaticTermination = _disabledAutomaticTermination;
|
||||
@synthesize mode = _mode;
|
||||
@synthesize receivedExpectedBytes = _receivedExpectedBytes;
|
||||
|
||||
- (instancetype)initWithDelegate:(id <SPUDownloaderDelegate>)delegate
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_delegate = delegate;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
// Don't implement dealloc - make the client call cleanup, which is the only way to remove the reference cycle from the delegate anyway
|
||||
|
||||
- (void)startPersistentDownloadWithRequest:(SPUURLRequest *)__unused request bundleIdentifier:(NSString *)__unused bundleIdentifier desiredFilename:(NSString *)__unused desiredFilename
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (void)startTemporaryDownloadWithRequest:(SPUURLRequest *)__unused request
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (void)enableAutomaticTermination
|
||||
{
|
||||
if (self.disabledAutomaticTermination) {
|
||||
[[NSProcessInfo processInfo] enableAutomaticTermination:SUDownloadingReason];
|
||||
self.disabledAutomaticTermination = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)cleanup
|
||||
{
|
||||
[self enableAutomaticTermination];
|
||||
self.delegate = nil;
|
||||
|
||||
if (self.mode == SPUDownloadModeTemporary && self.downloadFilename != nil)
|
||||
{
|
||||
[[NSFileManager defaultManager] removeItemAtPath:self.downloadFilename error:NULL];
|
||||
self.downloadFilename = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)cancel
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (void)downloadDidFinish
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
-(void)downloadDidFinishWithData:(SPUDownloadData*)data
|
||||
{
|
||||
switch (self.mode) {
|
||||
case SPUDownloadModeTemporary:
|
||||
if (data != nil) {
|
||||
[self.delegate downloaderDidFinishWithTemporaryDownloadData:data];
|
||||
} else {
|
||||
[self.delegate downloaderDidFailWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUDownloadError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to read temporary downloaded data from %@", self.downloadFilename]}]];
|
||||
}
|
||||
break;
|
||||
case SPUDownloadModePersistent:
|
||||
[self.delegate downloaderDidFinishWithTemporaryDownloadData:nil];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(NSString*)getAndCleanTempDirectory
|
||||
{
|
||||
NSString *rootPersistentDownloadCachePath = [[SPULocalCacheDirectory cachePathForBundleIdentifier:self.bundleIdentifier] stringByAppendingPathComponent:@"PersistentDownloads"];
|
||||
|
||||
[SPULocalCacheDirectory removeOldItemsInDirectory:rootPersistentDownloadCachePath];
|
||||
|
||||
NSString *tempDir = [SPULocalCacheDirectory createUniqueDirectoryInDirectory:rootPersistentDownloadCachePath];
|
||||
if (tempDir == nil) {
|
||||
// Okay, something's really broken with this user's file structure.
|
||||
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUTemporaryDirectoryError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Can't make a temporary directory for the update download at %@.", tempDir] }];
|
||||
|
||||
[self.delegate downloaderDidFailWithError:error];
|
||||
|
||||
[self cancel];
|
||||
}
|
||||
return tempDir;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// SPUDownloaderDelegate.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 4/1/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#if __has_feature(modules)
|
||||
@import Foundation;
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SPUDownloadData;
|
||||
|
||||
@protocol SPUDownloaderDelegate <NSObject>
|
||||
|
||||
// This is only invoked for persistent downloads
|
||||
- (void)downloaderDidSetDestinationName:(NSString *)destinationName temporaryDirectory:(NSString *)temporaryDirectory;
|
||||
|
||||
// Under rare cases, this may be called more than once, in which case the current progress should be reset back to 0
|
||||
// This is only invoked for persistent downloads
|
||||
- (void)downloaderDidReceiveExpectedContentLength:(int64_t)expectedContentLength;
|
||||
|
||||
// This is only invoked for persistent downloads
|
||||
- (void)downloaderDidReceiveDataOfLength:(uint64_t)length;
|
||||
|
||||
// downloadData is nil if this is a persisent download, otherwise it's non-nil if it's a temporary download
|
||||
- (void)downloaderDidFinishWithTemporaryDownloadData:(SPUDownloadData * _Nullable)downloadData;
|
||||
|
||||
- (void)downloaderDidFailWithError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// SPUDownloaderProtocol.h
|
||||
// PersistentDownloader
|
||||
//
|
||||
// Created by Mayur Pawashe on 4/1/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#if __has_feature(modules)
|
||||
@import Foundation;
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SPUURLRequest;
|
||||
|
||||
// The protocol that this service will vend as its API. This header file will also need to be visible to the process hosting the service.
|
||||
@protocol SPUDownloaderProtocol
|
||||
|
||||
- (void)startPersistentDownloadWithRequest:(SPUURLRequest *)request bundleIdentifier:(NSString *)bundleIdentifier desiredFilename:(NSString *)desiredFilename;
|
||||
|
||||
- (void)startTemporaryDownloadWithRequest:(SPUURLRequest *)request;
|
||||
|
||||
- (void)downloadDidFinish;
|
||||
|
||||
- (void)cleanup;
|
||||
|
||||
- (void)cancel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// SPUDownloaderSession.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Deadpikle on 12/20/17.
|
||||
// Copyright © 2017 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#if __has_feature(modules)
|
||||
@import Foundation;
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
#import "SPUDownloader.h"
|
||||
#import "SPUDownloaderProtocol.h"
|
||||
|
||||
NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0)
|
||||
@interface SPUDownloaderSession : SPUDownloader <SPUDownloaderProtocol>
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,167 @@
|
||||
//
|
||||
// SPUDownloaderSession.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Deadpikle on 12/20/17.
|
||||
// Copyright © 2017 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SPUDownloaderSession.h"
|
||||
#import "SPUURLRequest.h"
|
||||
#import "SPUDownloader_Private.h"
|
||||
#import "SPULocalCacheDirectory.h"
|
||||
#import "SUErrors.h"
|
||||
#import "SPUDownloadData.h"
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@interface SPUDownloaderSession () <NSURLSessionDelegate>
|
||||
|
||||
@property (nonatomic) NSURLSession *downloadSession;
|
||||
@property (nonatomic) NSURLSessionDownloadTask *download;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SPUDownloaderSession
|
||||
|
||||
@synthesize downloadSession = _downloadSession;
|
||||
@synthesize download = _download;
|
||||
|
||||
- (void)startDownloadWithRequest:(SPUURLRequest *)request
|
||||
{
|
||||
NSOperationQueue *queue = [NSOperationQueue mainQueue];
|
||||
self.downloadSession = [NSURLSession
|
||||
sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]
|
||||
delegate:self
|
||||
delegateQueue:queue];
|
||||
self.download = [self.downloadSession downloadTaskWithRequest:request.request];
|
||||
[self.download resume];
|
||||
}
|
||||
|
||||
- (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 startDownloadWithRequest:request];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (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 startDownloadWithRequest:request];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)URLSession:(NSURLSession *)__unused session downloadTask:(NSURLSessionDownloadTask *)__unused downloadTask didFinishDownloadingToURL:(NSURL *)location
|
||||
{
|
||||
if (self.mode == SPUDownloadModeTemporary) {
|
||||
self.downloadFilename = location.path;
|
||||
[self downloadDidFinish]; // file is already in a system temp dir
|
||||
} 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 {
|
||||
NSString *name = self.download.response.suggestedFilename;
|
||||
if (!name) {
|
||||
name = location.lastPathComponent; // This likely contains nothing useful to identify the file (e.g. CFNetworkDownload_87LVIz.tmp)
|
||||
}
|
||||
NSString *toPath = [downloadFileNameDirectory stringByAppendingPathComponent:name];
|
||||
NSString *fromPath = location.path; // suppress moveItemAtPath: non-null warning
|
||||
NSError *error = nil;
|
||||
if ([[NSFileManager defaultManager] moveItemAtPath:fromPath toPath:toPath error:&error]) {
|
||||
self.downloadFilename = toPath;
|
||||
[self.delegate downloaderDidSetDestinationName:name temporaryDirectory:downloadFileNameDirectory];
|
||||
[self downloadDidFinish];
|
||||
} else {
|
||||
[self.delegate downloaderDidFailWithError:error];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)URLSession:(NSURLSession *)__unused session downloadTask:(NSURLSessionDownloadTask *)__unused downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)__unused totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
|
||||
{
|
||||
|
||||
if (self.mode == SPUDownloadModePersistent && totalBytesExpectedToWrite > 0 && !self.receivedExpectedBytes) {
|
||||
self.receivedExpectedBytes = YES;
|
||||
[self.delegate downloaderDidReceiveExpectedContentLength:totalBytesExpectedToWrite];
|
||||
}
|
||||
|
||||
if (self.mode == SPUDownloadModePersistent && bytesWritten >= 0) {
|
||||
[self.delegate downloaderDidReceiveDataOfLength:(uint64_t)bytesWritten];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)URLSession:(NSURLSession *)__unused session task:(NSURLSessionTask *)__unused task didCompleteWithError:(NSError *)error
|
||||
{
|
||||
self.download = nil;
|
||||
if (error) {
|
||||
[self.delegate downloaderDidFailWithError:error];
|
||||
}
|
||||
[self cleanup];
|
||||
}
|
||||
|
||||
- (void)downloadDidFinish
|
||||
{
|
||||
assert(self.downloadFilename != nil);
|
||||
|
||||
SPUDownloadData *downloadData = nil;
|
||||
if (self.mode == SPUDownloadModeTemporary) {
|
||||
NSData *data = [NSData dataWithContentsOfFile:self.downloadFilename];
|
||||
if (data != nil) {
|
||||
NSURLResponse *response = self.download.response;
|
||||
assert(response != nil);
|
||||
downloadData = [[SPUDownloadData alloc] initWithData:data textEncodingName:response.textEncodingName MIMEType:response.MIMEType];
|
||||
}
|
||||
}
|
||||
|
||||
self.download = nil;
|
||||
|
||||
[super downloadDidFinishWithData:downloadData];
|
||||
}
|
||||
|
||||
-(void)cleanup
|
||||
{
|
||||
[self.download cancel];
|
||||
[self.downloadSession invalidateAndCancel];
|
||||
self.download = nil;
|
||||
self.downloadSession = nil;
|
||||
[super cleanup];
|
||||
}
|
||||
|
||||
- (void)cancel
|
||||
{
|
||||
[self cleanup];
|
||||
}
|
||||
|
||||
// NSURLDownload has a [downlaod:shouldDecodeSourceDataOfMIMEType:] to determine if the data should be decoded.
|
||||
// This does not exist for NSURLSessionDownloadTask and appears unnecessary. Data tasks will decode data, but not download tasks.
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// SPUDownloader_Private.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Deadpikle on 12/20/17.
|
||||
// Copyright © 2017 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SPUDownloader_Private_h
|
||||
#define SPUDownloader_Private_h
|
||||
|
||||
#import "SPUDownloaderDelegate.h"
|
||||
|
||||
typedef NS_ENUM(NSUInteger, SPUDownloadMode)
|
||||
{
|
||||
SPUDownloadModePersistent,
|
||||
SPUDownloadModeTemporary
|
||||
};
|
||||
|
||||
static NSString *SUDownloadingReason = @"Downloading update related file";
|
||||
|
||||
@interface SPUDownloader ()
|
||||
|
||||
// Delegate is intentionally strongly referenced; see header
|
||||
@property (nonatomic) id <SPUDownloaderDelegate> delegate;
|
||||
@property (nonatomic, copy) NSString *bundleIdentifier;
|
||||
@property (nonatomic, copy) NSString *desiredFilename;
|
||||
@property (nonatomic, copy) NSString *downloadFilename;
|
||||
@property (nonatomic) BOOL disabledAutomaticTermination;
|
||||
@property (nonatomic) SPUDownloadMode mode;
|
||||
@property (nonatomic) BOOL receivedExpectedBytes;
|
||||
|
||||
// returns temp directory location if successful; if not successful,
|
||||
// returns nil after sending error message to client and canceling download
|
||||
-(NSString*)getAndCleanTempDirectory;
|
||||
|
||||
-(void)downloadDidFinishWithData:(SPUDownloadData*)data;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* SPUDownloader_Private_h */
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// SULocalCacheDirectory.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 6/23/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SPULocalCacheDirectory : NSObject
|
||||
|
||||
// Returns a path to a suitable cache directory to create specifically for Sparkle
|
||||
// Intermediate directories to this path may not exist yet
|
||||
// This path may depend on the type of running process,
|
||||
// such that sandboxed vs non-sandboxed processes could yield different paths
|
||||
// The caller should create a subdirectory from the path that is returned here so they don't have files that
|
||||
// conflict with other callers. Once that subdirectory name is decided, the caller can remove old items inside it (using +removeOldItemsInDirectory:)
|
||||
// and then create a unique temporary directory inside it (using +createUniqueDirectoryInDirectory:)
|
||||
+ (NSString *)cachePathForBundleIdentifier:(NSString *)bundleIdentifier;
|
||||
|
||||
// Remove old files inside a directory
|
||||
// A caller may want to invoke this on a directory they own rather than remove and re-create an entire directory
|
||||
// This does nothing if the supplied directory does not exist yet
|
||||
+ (void)removeOldItemsInDirectory:(NSString *)directory;
|
||||
|
||||
// Create a unique directory inside a parent directory
|
||||
// The parent directory doesn't have to exist yet. If it doesn't exist, intermediate directories will be created.
|
||||
+ (NSString * _Nullable)createUniqueDirectoryInDirectory:(NSString *)directory;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// SULocalCacheDirectory.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 6/23/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SPULocalCacheDirectory.h"
|
||||
#import "SULog.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static NSTimeInterval OLD_ITEM_DELETION_INTERVAL = 86400 * 10; // 10 days
|
||||
|
||||
@implementation SPULocalCacheDirectory
|
||||
|
||||
// It is important to note this may return a different path whether invoked from a sanboxed vs non-sandboxed process, or from a different user
|
||||
// For this reason, this method should not be a part of SUHost because its behavior depends on what kind of process it's being invoked from
|
||||
+ (NSString *)cachePathForBundleIdentifier:(NSString *)bundleIdentifier
|
||||
{
|
||||
NSURL *cacheURL = [[NSFileManager defaultManager] URLForDirectory:NSCachesDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:NULL];
|
||||
assert(cacheURL != nil);
|
||||
|
||||
NSString *resultPath = [[[cacheURL URLByAppendingPathComponent:bundleIdentifier] URLByAppendingPathComponent:@SPARKLE_BUNDLE_IDENTIFIER] path];
|
||||
assert(resultPath != nil);
|
||||
|
||||
return resultPath;
|
||||
}
|
||||
|
||||
+ (void)removeOldItemsInDirectory:(NSString *)directory
|
||||
{
|
||||
NSMutableArray<NSString *> *filePathsToRemove = [NSMutableArray array];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
if ([fileManager fileExistsAtPath:directory]) {
|
||||
NSDirectoryEnumerator *directoryEnumerator = [fileManager enumeratorAtPath:directory];
|
||||
NSDate *currentDate = [NSDate date];
|
||||
for (NSString *filename in directoryEnumerator)
|
||||
{
|
||||
NSDictionary<NSString *, id> *fileAttributes = [fileManager attributesOfItemAtPath:[directory stringByAppendingPathComponent:filename] error:NULL];
|
||||
if (fileAttributes != nil)
|
||||
{
|
||||
NSDate *lastModificationDate = [fileAttributes objectForKey:NSFileModificationDate];
|
||||
if ([currentDate timeIntervalSinceDate:lastModificationDate] >= OLD_ITEM_DELETION_INTERVAL)
|
||||
{
|
||||
[filePathsToRemove addObject:[directory stringByAppendingPathComponent:filename]];
|
||||
}
|
||||
}
|
||||
|
||||
[directoryEnumerator skipDescendants];
|
||||
}
|
||||
|
||||
for (NSString *filename in filePathsToRemove)
|
||||
{
|
||||
[fileManager removeItemAtPath:filename error:NULL];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSString * _Nullable)createUniqueDirectoryInDirectory:(NSString *)directory
|
||||
{
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSError *createError = nil;
|
||||
if (![fileManager createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:&createError]) {
|
||||
SULog(SULogLevelError, @"Failed to create directory with intermediate components at %@ with error %@", directory, createError);
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString *templateString = [directory stringByAppendingPathComponent:@"XXXXXXXXX"];
|
||||
char buffer[PATH_MAX] = {0};
|
||||
if ([templateString getFileSystemRepresentation:buffer maxLength:sizeof(buffer)]) {
|
||||
if (mkdtemp(buffer) != NULL) {
|
||||
return [[NSString alloc] initWithUTF8String:buffer];
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// SPUURLRequest.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 5/19/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#if __has_feature(modules)
|
||||
@import Foundation;
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// A class that wraps NSURLRequest and implements NSSecureCoding
|
||||
// This class exists because NSURLRequest did not support NSSecureCoding in macOS 10.8
|
||||
// I have not verified if NSURLRequest in 10.9 implements NSSecureCoding or not
|
||||
@interface SPUURLRequest : NSObject <NSSecureCoding>
|
||||
|
||||
// Creates a new URL request
|
||||
// Only these properties are currently tracked:
|
||||
// * URL
|
||||
// * Cache policy
|
||||
// * Timeout interval
|
||||
// * HTTP header fields
|
||||
// * networkServiceType
|
||||
+ (instancetype)URLRequestWithRequest:(NSURLRequest *)request;
|
||||
|
||||
@property (nonatomic, readonly) NSURLRequest *request;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// SPUURLRequest.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mayur Pawashe on 5/19/16.
|
||||
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SPUURLRequest.h"
|
||||
|
||||
#import "SUOperatingSystem.h"
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
static NSString *SPUURLRequestURLKey = @"SPUURLRequestURL";
|
||||
static NSString *SPUURLRequestCachePolicyKey = @"SPUURLRequestCachePolicy";
|
||||
static NSString *SPUURLRequestTimeoutIntervalKey = @"SPUURLRequestTimeoutInterval";
|
||||
static NSString *SPUURLRequestHttpHeaderFieldsKey = @"SPUURLRequestHttpHeaderFields";
|
||||
static NSString *SPUURLRequestNetworkServiceTypeKey = @"SPUURLRequestNetworkServiceType";
|
||||
|
||||
@interface SPUURLRequest ()
|
||||
|
||||
@property (nonatomic, readonly) NSURL *url;
|
||||
@property (nonatomic, readonly) NSURLRequestCachePolicy cachePolicy;
|
||||
@property (nonatomic, readonly) NSTimeInterval timeoutInterval;
|
||||
@property (nonatomic, readonly, nullable) NSDictionary<NSString *, NSString *> *httpHeaderFields;
|
||||
@property (nonatomic, readonly) NSURLRequestNetworkServiceType networkServiceType;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SPUURLRequest
|
||||
|
||||
@synthesize url = _url;
|
||||
@synthesize cachePolicy = _cachePolicy;
|
||||
@synthesize timeoutInterval = _timeoutInterval;
|
||||
@synthesize httpHeaderFields = _httpHeaderFields;
|
||||
@synthesize networkServiceType = _networkServiceType;
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval)timeoutInterval httpHeaderFields:(NSDictionary<NSString *, NSString *> *)httpHeaderFields networkServiceType:(NSURLRequestNetworkServiceType)networkServiceType
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_url = url;
|
||||
_cachePolicy = cachePolicy;
|
||||
_timeoutInterval = timeoutInterval;
|
||||
_httpHeaderFields = httpHeaderFields;
|
||||
_networkServiceType = networkServiceType;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (instancetype)URLRequestWithRequest:(NSURLRequest *)request
|
||||
{
|
||||
return [(SPUURLRequest *)[[self class] alloc] initWithURL:request.URL cachePolicy:request.cachePolicy timeoutInterval:request.timeoutInterval httpHeaderFields:request.allHTTPHeaderFields networkServiceType:request.networkServiceType];
|
||||
}
|
||||
|
||||
+ (BOOL)supportsSecureCoding
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)coder
|
||||
{
|
||||
[coder encodeObject:self.url forKey:SPUURLRequestURLKey];
|
||||
[coder encodeInteger:(NSInteger)self.cachePolicy forKey:SPUURLRequestCachePolicyKey];
|
||||
[coder encodeDouble:self.timeoutInterval forKey:SPUURLRequestTimeoutIntervalKey];
|
||||
[coder encodeInteger:(NSInteger)self.networkServiceType forKey:SPUURLRequestNetworkServiceTypeKey];
|
||||
|
||||
if (self.httpHeaderFields != nil) {
|
||||
[coder encodeObject:self.httpHeaderFields forKey:SPUURLRequestHttpHeaderFieldsKey];
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
NSURL *url = [decoder decodeObjectOfClass:[NSURL class] forKey:SPUURLRequestURLKey];
|
||||
NSURLRequestCachePolicy cachePolicy = (NSURLRequestCachePolicy)[decoder decodeIntegerForKey:SPUURLRequestCachePolicyKey];
|
||||
NSTimeInterval timeoutInterval = [decoder decodeDoubleForKey:SPUURLRequestTimeoutIntervalKey];
|
||||
NSDictionary<NSString *, NSString *> *httpHeaderFields = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class]]] forKey:SPUURLRequestHttpHeaderFieldsKey];
|
||||
NSURLRequestNetworkServiceType networkServiceType = (NSURLRequestNetworkServiceType)[decoder decodeIntegerForKey:SPUURLRequestNetworkServiceTypeKey];
|
||||
|
||||
return [self initWithURL:url cachePolicy:cachePolicy timeoutInterval:timeoutInterval httpHeaderFields:httpHeaderFields networkServiceType:networkServiceType];
|
||||
}
|
||||
|
||||
- (NSURLRequest *)request
|
||||
{
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.url cachePolicy:self.cachePolicy timeoutInterval:self.timeoutInterval];
|
||||
if (self.httpHeaderFields != nil) {
|
||||
request.allHTTPHeaderFields = self.httpHeaderFields;
|
||||
}
|
||||
request.networkServiceType = self.networkServiceType;
|
||||
return [request copy];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -9,25 +9,16 @@
|
||||
#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
|
||||
|
||||
@class SUAppcastItem;
|
||||
SU_EXPORT @interface SUAppcast : NSObject<NSURLDownloadDelegate>
|
||||
SU_EXPORT @interface SUAppcast : NSObject
|
||||
|
||||
@property (copy, nullable) NSString *userAgentString;
|
||||
|
||||
#if __has_feature(objc_generics)
|
||||
@property (copy, nullable) NSDictionary<NSString *, NSString *> *httpHeaders;
|
||||
#else
|
||||
@property (copy, nullable) NSDictionary *httpHeaders;
|
||||
#endif
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url inBackground:(BOOL)bg completionBlock:(void (^)(NSError *_Nullable))err;
|
||||
- (SUAppcast *)copyWithoutDeltaUpdates;
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
#import "SULocalizations.h"
|
||||
#import "SUErrors.h"
|
||||
|
||||
#import "SPUURLRequest.h"
|
||||
#import "SUOperatingSystem.h"
|
||||
#import "SPUDownloadData.h"
|
||||
#import "SPUDownloaderDelegate.h"
|
||||
#import "SPUDownloaderSession.h"
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@@ -39,18 +44,18 @@
|
||||
}
|
||||
@end
|
||||
|
||||
@interface SUAppcast () <NSURLDownloadDelegate>
|
||||
@interface SUAppcast () <SPUDownloaderDelegate>
|
||||
|
||||
@property (strong) void (^completionBlock)(NSError *);
|
||||
@property (copy) NSString *downloadFilename;
|
||||
@property (strong) NSURLDownload *download;
|
||||
@property (strong) SPUDownloader *download;
|
||||
@property (copy) NSArray *items;
|
||||
- (void)reportError:(NSError *)error;
|
||||
- (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SUAppcast
|
||||
|
||||
@synthesize downloadFilename;
|
||||
@synthesize completionBlock;
|
||||
@synthesize userAgentString;
|
||||
@synthesize httpHeaders;
|
||||
@@ -78,50 +83,66 @@
|
||||
}
|
||||
|
||||
[request setValue:@"application/rss+xml,*/*;q=0.1" forHTTPHeaderField:@"Accept"];
|
||||
|
||||
self.download = [[NSURLDownload alloc] initWithRequest:request delegate:self];
|
||||
|
||||
self.download = [[SPUDownloaderSession alloc] initWithDelegate:self];
|
||||
|
||||
SPUURLRequest *urlRequest = [SPUURLRequest URLRequestWithRequest:request];
|
||||
[self.download startTemporaryDownloadWithRequest:urlRequest];
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)__unused aDownload decideDestinationWithSuggestedFilename:(NSString *)filename
|
||||
- (void)downloaderDidSetDestinationName:(NSString *)__unused destinationName temporaryDirectory:(NSString *)__unused temporaryDirectory
|
||||
{
|
||||
NSString *destinationFilename = NSTemporaryDirectory();
|
||||
if (destinationFilename)
|
||||
{
|
||||
destinationFilename = [destinationFilename stringByAppendingPathComponent:filename];
|
||||
[self.download setDestination:destinationFilename allowOverwrite:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)__unused aDownload didCreateDestination:(NSString *)path
|
||||
- (void)downloaderDidReceiveExpectedContentLength:(int64_t)__unused expectedContentLength
|
||||
{
|
||||
self.downloadFilename = path;
|
||||
}
|
||||
|
||||
- (void)downloadDidFinish:(NSURLDownload *)__unused aDownload
|
||||
- (void)downloaderDidReceiveDataOfLength:(uint64_t)__unused length
|
||||
{
|
||||
NSError *error = nil;
|
||||
NSArray *appcastItems = [self parseAppcastItemsFromXMLFile:[NSURL fileURLWithPath:self.downloadFilename] error:&error];
|
||||
}
|
||||
|
||||
[[NSFileManager defaultManager] removeItemAtPath:self.downloadFilename error:nil];
|
||||
self.downloadFilename = nil;
|
||||
|
||||
if (appcastItems) {
|
||||
self.items = appcastItems;
|
||||
self.completionBlock(nil);
|
||||
self.completionBlock = nil;
|
||||
} else {
|
||||
NSMutableDictionary *userInfo = [NSMutableDictionary
|
||||
dictionaryWithObject: SULocalizedString(@"An error occurred while parsing the update feed.", nil)
|
||||
forKey: NSLocalizedDescriptionKey];
|
||||
if (error) {
|
||||
[userInfo setObject:error forKey:NSUnderlyingErrorKey];
|
||||
- (void)downloaderDidFinishWithTemporaryDownloadData:(SPUDownloadData * _Nullable)downloadData
|
||||
{
|
||||
if (downloadData != nil) {
|
||||
NSError *parseError = nil;
|
||||
NSArray *appcastItems = [self parseAppcastItemsFromXMLData:downloadData.data error:&parseError];
|
||||
|
||||
if (appcastItems != nil) {
|
||||
self.items = appcastItems;
|
||||
self.completionBlock(nil);
|
||||
self.completionBlock = nil;
|
||||
} else {
|
||||
NSMutableDictionary *userInfo = [NSMutableDictionary
|
||||
dictionaryWithObject: SULocalizedString(@"An error occurred while parsing the update feed.", nil)
|
||||
forKey: NSLocalizedDescriptionKey];
|
||||
if (parseError != nil) {
|
||||
[userInfo setObject:parseError forKey:NSUnderlyingErrorKey];
|
||||
}
|
||||
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain
|
||||
code:SUAppcastParseError
|
||||
userInfo:userInfo]];
|
||||
}
|
||||
} else {
|
||||
SULog(SULogLevelError, @"Temp data download is null in SUAppcast");
|
||||
|
||||
NSDictionary *userInfo = [NSDictionary
|
||||
dictionaryWithObject: SULocalizedString(@"An error occurred while downloading the update feed.", nil)
|
||||
forKey: NSLocalizedDescriptionKey];
|
||||
|
||||
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain
|
||||
code:SUAppcastParseError
|
||||
code:SUDownloadError
|
||||
userInfo:userInfo]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)downloaderDidFailWithError:(NSError *)error
|
||||
{
|
||||
SULog(SULogLevelError, @"Encountered download feed error: %@", error);
|
||||
|
||||
[self reportError:error];
|
||||
}
|
||||
|
||||
- (NSDictionary *)attributesOfNode:(NSXMLElement *)node
|
||||
{
|
||||
NSEnumerator *attributeEnum = [[node attributes] objectEnumerator];
|
||||
@@ -152,18 +173,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
-(NSArray *)parseAppcastItemsFromXMLFile:(NSURL *)appcastFile error:(NSError *__autoreleasing*)errorp {
|
||||
-(NSArray *)parseAppcastItemsFromXMLFile:(NSURL *)appcastURL error:(NSError *__autoreleasing*)errorp {
|
||||
NSData *data = [NSData dataWithContentsOfURL:appcastURL];
|
||||
return [self parseAppcastItemsFromXMLData:data error:errorp];
|
||||
}
|
||||
|
||||
-(NSArray *)parseAppcastItemsFromXMLData:(NSData *)appcastData error:(NSError *__autoreleasing*)errorp {
|
||||
if (errorp) {
|
||||
*errorp = nil;
|
||||
}
|
||||
|
||||
if (!appcastFile) {
|
||||
if (!appcastData) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSUInteger options = NSXMLNodeLoadExternalEntitiesNever; // Prevent inclusion from file://
|
||||
NSXMLDocument *document = [[NSXMLDocument alloc] initWithContentsOfURL:appcastFile options:options error:errorp];
|
||||
if (nil == document) {
|
||||
NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:appcastData options:options error:errorp];
|
||||
if (nil == document) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -176,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];
|
||||
|
||||
@@ -203,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
|
||||
@@ -212,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) {
|
||||
@@ -222,7 +248,7 @@
|
||||
}
|
||||
}
|
||||
[dict setObject:deltas forKey:name];
|
||||
}
|
||||
}
|
||||
else if ([name isEqualToString:SUAppcastElementTags]) {
|
||||
NSMutableArray *tags = [NSMutableArray array];
|
||||
NSEnumerator *childEnum = [[node children] objectEnumerator];
|
||||
@@ -234,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) {
|
||||
@@ -247,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
|
||||
@@ -262,21 +288,6 @@
|
||||
return appcastItems;
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)__unused aDownload didFailWithError:(NSError *)error
|
||||
{
|
||||
if (self.downloadFilename) {
|
||||
[[NSFileManager defaultManager] removeItemAtPath:self.downloadFilename error:nil];
|
||||
}
|
||||
self.downloadFilename = nil;
|
||||
|
||||
[self reportError:error];
|
||||
}
|
||||
|
||||
- (NSURLRequest *)download:(NSURLDownload *)__unused aDownload willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)__unused redirectResponse
|
||||
{
|
||||
return request;
|
||||
}
|
||||
|
||||
- (void)reportError:(NSError *)error
|
||||
{
|
||||
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{
|
||||
|
||||
@@ -10,26 +10,34 @@
|
||||
#define SUAPPCASTITEM_H
|
||||
|
||||
#if __has_feature(modules)
|
||||
#if __has_warning("-Watimport-in-framework-header")
|
||||
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
||||
#endif
|
||||
@import Foundation;
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
#import "SUExport.h"
|
||||
@class SUSignatures;
|
||||
|
||||
SU_EXPORT @interface SUAppcastItem : NSObject
|
||||
@property (copy, readonly) NSString *title;
|
||||
@property (copy, readonly) NSString *dateString;
|
||||
@property (copy, readonly) NSDate *date;
|
||||
@property (copy, readonly) NSString *itemDescription;
|
||||
@property (strong, readonly) NSURL *releaseNotesURL;
|
||||
@property (copy, readonly) NSString *DSASignature;
|
||||
@property (strong, readonly) SUSignatures *signatures;
|
||||
@property (copy, readonly) NSString *minimumSystemVersion;
|
||||
@property (copy, readonly) NSString *maximumSystemVersion;
|
||||
@property (strong, readonly) NSURL *fileURL;
|
||||
@property (nonatomic, readonly) uint64_t contentLength;
|
||||
@property (copy, readonly) NSString *versionString;
|
||||
@property (copy, readonly) NSString *osString;
|
||||
@property (copy, readonly) NSString *displayVersionString;
|
||||
@property (copy, readonly) NSDictionary *deltaUpdates;
|
||||
@property (strong, readonly) NSURL *infoURL;
|
||||
@property (copy, readonly) NSNumber* phasedRolloutInterval;
|
||||
@property (copy, readonly) NSString *minimumAutoupdateVersion;
|
||||
|
||||
// Initializes with data from a dictionary provided by the RSS class.
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dict;
|
||||
@@ -37,6 +45,7 @@ SU_EXPORT @interface SUAppcastItem : NSObject
|
||||
|
||||
@property (getter=isDeltaUpdate, readonly) BOOL deltaUpdate;
|
||||
@property (getter=isCriticalUpdate, readonly) BOOL criticalUpdate;
|
||||
@property (getter=isMacOsUpdate, readonly) BOOL macOsUpdate;
|
||||
@property (getter=isInformationOnlyUpdate, readonly) BOOL informationOnlyUpdate;
|
||||
|
||||
// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SULog.h"
|
||||
#import "SUConstants.h"
|
||||
|
||||
#import "SUSignatures.h"
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
@@ -18,22 +18,25 @@
|
||||
@property (copy, readwrite) NSString *dateString;
|
||||
@property (copy, readwrite) NSString *itemDescription;
|
||||
@property (strong, readwrite) NSURL *releaseNotesURL;
|
||||
@property (copy, readwrite) NSString *DSASignature;
|
||||
@property (strong, readwrite) SUSignatures *signatures;
|
||||
@property (copy, readwrite) NSString *minimumSystemVersion;
|
||||
@property (copy, readwrite) NSString *maximumSystemVersion;
|
||||
@property (strong, readwrite) NSURL *fileURL;
|
||||
@property (copy, readwrite) NSString *versionString;
|
||||
@property (copy, readwrite) NSString *osString;
|
||||
@property (copy, readwrite) NSString *displayVersionString;
|
||||
@property (copy, readwrite) NSDictionary *deltaUpdates;
|
||||
@property (strong, readwrite) NSURL *infoURL;
|
||||
@property (readwrite, copy) NSDictionary *propertiesDictionary;
|
||||
@property (copy, readwrite) NSNumber* phasedRolloutInterval;
|
||||
@property (copy, readwrite) NSString *minimumAutoupdateVersion;
|
||||
@end
|
||||
|
||||
@implementation SUAppcastItem
|
||||
@synthesize dateString;
|
||||
@synthesize deltaUpdates;
|
||||
@synthesize displayVersionString;
|
||||
@synthesize DSASignature;
|
||||
@synthesize signatures;
|
||||
@synthesize fileURL;
|
||||
@synthesize contentLength = _contentLength;
|
||||
@synthesize infoURL;
|
||||
@@ -43,7 +46,10 @@
|
||||
@synthesize releaseNotesURL;
|
||||
@synthesize title;
|
||||
@synthesize versionString;
|
||||
@synthesize osString;
|
||||
@synthesize propertiesDictionary;
|
||||
@synthesize phasedRolloutInterval;
|
||||
@synthesize minimumAutoupdateVersion;
|
||||
|
||||
- (BOOL)isDeltaUpdate
|
||||
{
|
||||
@@ -53,7 +59,24 @@
|
||||
|
||||
- (BOOL)isCriticalUpdate
|
||||
{
|
||||
return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate];
|
||||
return [(NSArray *)[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate];
|
||||
}
|
||||
|
||||
- (BOOL)isMacOsUpdate
|
||||
{
|
||||
return self.osString == nil || [self.osString isEqualToString:SUAppcastAttributeValueMacOS];
|
||||
}
|
||||
|
||||
- (NSDate*)date {
|
||||
if(self.dateString == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
|
||||
dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
|
||||
dateFormatter.dateFormat = @"E, dd MMM yyyy HH:mm:ss Z";
|
||||
|
||||
return [dateFormatter dateFromString:self.dateString];
|
||||
}
|
||||
|
||||
- (BOOL)isInformationOnlyUpdate
|
||||
@@ -90,7 +113,7 @@
|
||||
|
||||
// Separate the url by underscores and take the last component, as that'll be closest to the end,
|
||||
// then we remove the extension. Hopefully, this will be the version.
|
||||
NSArray *fileComponents = [[enclosure objectForKey:SURSSAttributeURL] componentsSeparatedByString:@"_"];
|
||||
NSArray<NSString *> *fileComponents = [(NSString *)[enclosure objectForKey:SURSSAttributeURL] componentsSeparatedByString:@"_"];
|
||||
if ([fileComponents count] > 1) {
|
||||
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
|
||||
}
|
||||
@@ -118,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";
|
||||
@@ -133,7 +156,7 @@
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
if (enclosureURLString) {
|
||||
NSString *enclosureLengthString = [enclosure objectForKey:SURSSAttributeLength];
|
||||
long long contentLength = 0;
|
||||
@@ -149,7 +172,8 @@
|
||||
self.fileURL = [NSURL URLWithString:fileURLString];
|
||||
}
|
||||
if (enclosure) {
|
||||
self.DSASignature = [enclosure objectForKey:SUAppcastAttributeDSASignature];
|
||||
self.signatures = [[SUSignatures alloc] initWithDsa:[enclosure objectForKey:SUAppcastAttributeDSASignature] ed:[enclosure objectForKey:SUAppcastAttributeEDSignature]];
|
||||
self.osString = [enclosure objectForKey:SUAppcastAttributeOsType];
|
||||
}
|
||||
|
||||
self.versionString = newVersion;
|
||||
@@ -167,6 +191,11 @@
|
||||
self.displayVersionString = self.versionString;
|
||||
}
|
||||
|
||||
NSString* enclosureRolloutIntervalString = [dict objectForKey:SUAppcastElementPhasedRolloutInterval];
|
||||
if(enclosureRolloutIntervalString) {
|
||||
self.phasedRolloutInterval = @(enclosureRolloutIntervalString.integerValue);
|
||||
}
|
||||
|
||||
// Find the appropriate release notes URL.
|
||||
NSString *releaseNotesString = [dict objectForKey:SUAppcastElementReleaseNotesLink];
|
||||
if (releaseNotesString) {
|
||||
@@ -198,6 +227,8 @@
|
||||
}
|
||||
self.deltaUpdates = deltas;
|
||||
}
|
||||
|
||||
self.minimumAutoupdateVersion = [dict objectForKey:SUAppcastElementMinimumAutoupdateVersion];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -110,14 +110,14 @@ static NSString *const SUAutomaticUpdateAlertTouchBarIndentifier = @"" SPARKLE_B
|
||||
|
||||
- (NSTouchBar *)makeTouchBar
|
||||
{
|
||||
NSTouchBar *touchBar = [[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
NSTouchBar *touchBar = [(NSTouchBar *)[NSClassFromString(@"NSTouchBar") alloc] init];
|
||||
touchBar.defaultItemIdentifiers = @[SUAutomaticUpdateAlertTouchBarIndentifier,];
|
||||
touchBar.principalItemIdentifier = SUAutomaticUpdateAlertTouchBarIndentifier;
|
||||
touchBar.delegate = self;
|
||||
return touchBar;
|
||||
}
|
||||
|
||||
- (NSTouchBarItem *)touchBar:(NSTouchBar * __unused)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
|
||||
- (NSTouchBarItem *)touchBar:(NSTouchBar * __unused)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier API_AVAILABLE(macos(10.12.2))
|
||||
{
|
||||
if ([identifier isEqualToString:SUAutomaticUpdateAlertTouchBarIndentifier]) {
|
||||
NSCustomTouchBarItem* item = [(NSCustomTouchBarItem *)[NSClassFromString(@"NSCustomTouchBarItem") alloc] initWithIdentifier:identifier];
|
||||
|
||||
@@ -29,7 +29,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
@interface SUAutomaticUpdateDriver ()
|
||||
|
||||
@property (assign) BOOL postponingInstallation;
|
||||
@property (assign) BOOL showErrors;
|
||||
@property (assign) BOOL willUpdateOnTermination;
|
||||
@property (assign) BOOL isTerminating;
|
||||
@property (strong) SUAutomaticUpdateAlert *alert;
|
||||
@@ -40,7 +39,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
@implementation SUAutomaticUpdateDriver
|
||||
|
||||
@synthesize postponingInstallation;
|
||||
@synthesize showErrors;
|
||||
@synthesize willUpdateOnTermination;
|
||||
@synthesize isTerminating;
|
||||
@synthesize alert;
|
||||
@@ -63,7 +61,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
// update prompt to behave like a normal window. Otherwise if the window were hidden
|
||||
// there may be no way for the application to be activated to make it visible again.
|
||||
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||
[[self.alert window] setHidesOnDeactivate:NO];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
@@ -98,6 +95,12 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
|
||||
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationInvocation:invocation];
|
||||
}
|
||||
else if ([updaterDelegate respondsToSelector:@selector(updater:willInstallUpdateOnQuit:immediateInstallationBlock:)])
|
||||
{
|
||||
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationBlock:^{
|
||||
[self installWithToolAndRelaunch:YES displayingUserInterface:NO];
|
||||
}];
|
||||
}
|
||||
|
||||
// If this is marked as a critical update, we'll prompt the user to install it right away.
|
||||
if ([self.updateItem isCriticalUpdate])
|
||||
@@ -175,8 +178,8 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
- (void)automaticUpdateAlertFinishedWithChoice:(SUAutomaticInstallationChoice)choice
|
||||
{
|
||||
self.alert = nil;
|
||||
switch (choice)
|
||||
{
|
||||
switch (choice)
|
||||
{
|
||||
case SUInstallNowChoice:
|
||||
[self stopUpdatingOnTermination];
|
||||
[self installWithToolAndRelaunch:YES];
|
||||
@@ -202,7 +205,6 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
[self stopUpdatingOnTermination];
|
||||
}
|
||||
|
||||
self.showErrors = YES;
|
||||
[super installWithToolAndRelaunch:relaunch displayingUserInterface:showUI];
|
||||
}
|
||||
|
||||
@@ -231,21 +233,9 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
||||
}
|
||||
}
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
- (BOOL)usesPhasedRollout
|
||||
{
|
||||
if (self.showErrors) {
|
||||
[super abortUpdateWithError:error];
|
||||
} else {
|
||||
// Call delegate separately here because otherwise it won't know we stopped.
|
||||
// Normally this gets called by the superclass
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
||||
[updaterDelegate updater:self.updater didAbortWithError:error];
|
||||
}
|
||||
|
||||
[self abortUpdate];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -10,18 +10,24 @@
|
||||
#define SUBASICUPDATEDRIVER_H
|
||||
|
||||
#import "SUUpdateDriver.h"
|
||||
#import "SPUDownloader.h"
|
||||
#import "SPUDownloaderDelegate.h"
|
||||
|
||||
@class SUAppcast, SUAppcastItem, SUHost;
|
||||
@interface SUBasicUpdateDriver : SUUpdateDriver <NSURLDownloadDelegate>
|
||||
@class SUAppcast, SUAppcastItem, SUHost, SPUDownloadData;
|
||||
@interface SUBasicUpdateDriver : SUUpdateDriver <SPUDownloaderDelegate>
|
||||
|
||||
@property (strong, readonly) SUAppcastItem *updateItem;
|
||||
@property (strong, readonly) NSURLDownload *download;
|
||||
@property (strong, readonly) SUAppcastItem *latestAppcastItem;
|
||||
@property (assign, readonly) NSComparisonResult latestAppcastItemComparisonResult;
|
||||
@property (strong, readonly) SPUDownloader *download;
|
||||
@property (copy, readonly) NSString *downloadPath;
|
||||
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
|
||||
|
||||
- (BOOL)isItemNewer:(SUAppcastItem *)ui;
|
||||
+ (BOOL)hostSupportsItem:(SUAppcastItem *)ui;
|
||||
- (BOOL)itemPreventsAutoupdate:(SUAppcastItem *)ui;
|
||||
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui;
|
||||
- (BOOL)usesPhasedRollout;
|
||||
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui;
|
||||
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui;
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac;
|
||||
@@ -29,9 +35,12 @@
|
||||
- (void)didNotFindUpdate;
|
||||
|
||||
- (void)downloadUpdate;
|
||||
- (void)download:(NSURLDownload *)d decideDestinationWithSuggestedFilename:(NSString *)name;
|
||||
- (void)downloadDidFinish:(NSURLDownload *)d;
|
||||
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error;
|
||||
// SPUDownloaderDelegate
|
||||
- (void)downloaderDidSetDestinationName:(NSString *)destinationName temporaryDirectory:(NSString *)temporaryDirectory;
|
||||
- (void)downloaderDidReceiveExpectedContentLength:(int64_t)expectedContentLength;
|
||||
- (void)downloaderDidReceiveDataOfLength:(uint64_t)length;
|
||||
- (void)downloaderDidFinishWithTemporaryDownloadData:(SPUDownloadData *)downloadData;
|
||||
- (void)downloaderDidFailWithError:(NSError *)error;
|
||||
|
||||
- (void)extractUpdate;
|
||||
- (void)failedToApplyDeltaUpdate;
|
||||
|
||||
@@ -22,14 +22,24 @@
|
||||
#import "SUUpdateValidator.h"
|
||||
#import "SULocalizations.h"
|
||||
#import "SUErrors.h"
|
||||
#import "SUUpdater.h"
|
||||
#import "SUAppcast.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUGlobalUpdateLock.h"
|
||||
#import "SUSystemUpdateInfo.h"
|
||||
|
||||
#import "SPUURLRequest.h"
|
||||
#import "SPUDownloaderSession.h"
|
||||
#import "SPULocalCacheDirectory.h"
|
||||
|
||||
@interface SUBasicUpdateDriver ()
|
||||
|
||||
@property (strong) SUAppcastItem *updateItem;
|
||||
@property (strong) NSURLDownload *download;
|
||||
@property (strong) SUAppcastItem *latestAppcastItem;
|
||||
@property (assign) NSComparisonResult latestAppcastItemComparisonResult;
|
||||
@property (strong) SPUDownloader *download;
|
||||
@property (copy) NSString *downloadPath;
|
||||
@property (copy) NSString *extractionDirectory;
|
||||
|
||||
@property (strong) SUAppcastItem *nonDeltaUpdateItem;
|
||||
@property (copy) NSString *tempDir;
|
||||
@@ -42,8 +52,11 @@
|
||||
@implementation SUBasicUpdateDriver
|
||||
|
||||
@synthesize updateItem;
|
||||
@synthesize latestAppcastItem;
|
||||
@synthesize latestAppcastItemComparisonResult;
|
||||
@synthesize download;
|
||||
@synthesize downloadPath;
|
||||
@synthesize extractionDirectory = _extractionDirectory;
|
||||
|
||||
@synthesize nonDeltaUpdateItem;
|
||||
@synthesize tempDir;
|
||||
@@ -54,9 +67,17 @@
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
|
||||
{
|
||||
[super checkForUpdatesAtURL:URL host:aHost];
|
||||
if ([aHost isRunningOnReadOnlyVolume])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a read-only volume like a disk image or an optical drive. Move %1$@ to your Applications folder, relaunch it from there, and try again.", nil), [aHost name]] }]];
|
||||
if ([aHost isRunningOnReadOnlyVolume])
|
||||
{
|
||||
NSString *hostName = [aHost name];
|
||||
if ([aHost isRunningTranslocated])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningTranslocated userInfo:@{ NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedString(@"Quit %1$@, move it into your Applications folder, relaunch it from there and try again.", nil), hostName], NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can’t be updated if it’s running from the location it was downloaded to.", nil), hostName], }]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated, because it was opened from a read-only or a temporary location.", nil), hostName], NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedString(@"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.", nil), hostName] }]];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -78,7 +99,7 @@
|
||||
{
|
||||
id<SUVersionComparison> comparator = nil;
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
|
||||
|
||||
// Give the delegate a chance to provide a custom version comparator
|
||||
if ([[updater delegate] respondsToSelector:@selector(versionComparatorForUpdater:)]) {
|
||||
comparator = [[updater delegate] versionComparatorForUpdater:self.updater];
|
||||
@@ -92,35 +113,81 @@
|
||||
return comparator;
|
||||
}
|
||||
|
||||
+ (SUAppcastItem *)bestItemFromAppcastItems:(NSArray *)appcastItems getDeltaItem:(SUAppcastItem * __autoreleasing *)deltaItem withHostVersion:(NSString *)hostVersion comparator:(id<SUVersionComparison>)comparator
|
||||
// This method is only used for testing
|
||||
+ (SUAppcastItem *)bestItemFromAppcastItems:(NSArray *)appcastItems getDeltaItem:(SUAppcastItem *_Nullable __autoreleasing *_Nullable)deltaItem withHostVersion:(NSString *)hostVersion comparator:(id<SUVersionComparison>)comparator {
|
||||
SUBasicUpdateDriver* basicUpdateDriver = [[SUBasicUpdateDriver alloc] initWithUpdater:(id<SUUpdaterPrivate>)[SUUpdater sharedUpdater]];
|
||||
return [basicUpdateDriver bestItemFromAppcastItems:appcastItems getDeltaItem:deltaItem withHostVersion:hostVersion comparator:comparator];
|
||||
}
|
||||
|
||||
- (SUAppcastItem *)bestItemFromAppcastItems:(NSArray *)appcastItems getDeltaItem:(SUAppcastItem * __autoreleasing *)deltaItem withHostVersion:(NSString *)hostVersion comparator:(id<SUVersionComparison>)comparator
|
||||
{
|
||||
SUAppcastItem *item = nil;
|
||||
NSComparisonResult order;
|
||||
|
||||
for(SUAppcastItem *candidate in appcastItems) {
|
||||
if ([[self class] hostSupportsItem:candidate]) {
|
||||
if (!item || [comparator compareVersion:item.versionString toVersion:candidate.versionString] == NSOrderedAscending) {
|
||||
if ([self hostSupportsItem:candidate]) {
|
||||
// Pick this item if nothing is picked yet. Always pick an item with a higher version. Only if versions are the same
|
||||
// compare their dates and pick this item if its date is not lower – this covers cases when no date is available
|
||||
// and picks items at the end of the appcast list as they are more likely to be the most recent releases.
|
||||
if (
|
||||
!item
|
||||
|| (order = [comparator compareVersion:item.versionString toVersion:candidate.versionString]) == NSOrderedAscending
|
||||
|| (order == NSOrderedSame && [item.date compare:candidate.date] != NSOrderedDescending)
|
||||
) {
|
||||
item = candidate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (item && deltaItem) {
|
||||
SUAppcastItem *deltaUpdateItem = [[item deltaUpdates] objectForKey:hostVersion];
|
||||
if (deltaUpdateItem && [[self class] hostSupportsItem:deltaUpdateItem]) {
|
||||
if (deltaUpdateItem && [self hostSupportsItem:deltaUpdateItem]) {
|
||||
*deltaItem = deltaUpdateItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
+ (BOOL)hostSupportsItem:(SUAppcastItem *)ui
|
||||
- (BOOL)usesPhasedRollout
|
||||
{
|
||||
if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) &&
|
||||
([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) { return YES; }
|
||||
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:@""]) &&
|
||||
([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) {
|
||||
return osOK;
|
||||
}
|
||||
|
||||
BOOL minimumVersionOK = TRUE;
|
||||
BOOL maximumVersionOK = TRUE;
|
||||
|
||||
|
||||
id<SUVersionComparison> versionComparator = [[SUStandardVersionComparator alloc] init];
|
||||
|
||||
// Check minimum and maximum System Version
|
||||
@@ -131,7 +198,7 @@
|
||||
maximumVersionOK = [versionComparator compareVersion:[ui maximumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedAscending;
|
||||
}
|
||||
|
||||
return minimumVersionOK && maximumVersionOK;
|
||||
return minimumVersionOK && maximumVersionOK && osOK;
|
||||
}
|
||||
|
||||
- (BOOL)isItemNewer:(SUAppcastItem *)ui
|
||||
@@ -139,16 +206,21 @@
|
||||
return [[self versionComparator] compareVersion:[self.host version] toVersion:[ui versionString]] == NSOrderedAscending;
|
||||
}
|
||||
|
||||
- (BOOL)itemPreventsAutoupdate:(SUAppcastItem *)ui
|
||||
{
|
||||
return ([ui minimumAutoupdateVersion] && ! [[ui minimumAutoupdateVersion] isEqualToString:@""] && ([[self versionComparator] compareVersion:[self.host version] toVersion:[ui minimumAutoupdateVersion]] == NSOrderedAscending));
|
||||
}
|
||||
|
||||
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui
|
||||
{
|
||||
NSString *skippedVersion = [self.host objectForUserDefaultsKey:SUSkippedVersionKey];
|
||||
if (skippedVersion == nil) { return NO; }
|
||||
if (skippedVersion == nil) { return NO; }
|
||||
return [[self versionComparator] compareVersion:[ui versionString] toVersion:skippedVersion] != NSOrderedDescending;
|
||||
}
|
||||
|
||||
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui
|
||||
{
|
||||
return ui && [[self class] hostSupportsItem:ui] && [self isItemNewer:ui] && ![self itemContainsSkippedVersion:ui];
|
||||
return ui && [self hostSupportsItem:ui] && [self isItemNewer:ui] && ![self itemContainsSkippedVersion:ui];
|
||||
}
|
||||
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac
|
||||
@@ -168,7 +240,7 @@
|
||||
{
|
||||
item = [[updater delegate] bestValidUpdateInAppcast:ac forUpdater:self.updater];
|
||||
}
|
||||
|
||||
|
||||
if (item != nil) // Does the delegate want to handle it?
|
||||
{
|
||||
if ([item isDeltaUpdate]) {
|
||||
@@ -179,27 +251,38 @@
|
||||
{
|
||||
// Find the best supported update
|
||||
SUAppcastItem *deltaUpdateItem = nil;
|
||||
item = [[self class] bestItemFromAppcastItems:ac.items getDeltaItem:&deltaUpdateItem withHostVersion:self.host.version comparator:[self versionComparator]];
|
||||
|
||||
item = [self bestItemFromAppcastItems:ac.items getDeltaItem:&deltaUpdateItem withHostVersion:self.host.version comparator:[self versionComparator]];
|
||||
|
||||
if (item && deltaUpdateItem) {
|
||||
self.nonDeltaUpdateItem = item;
|
||||
item = deltaUpdateItem;
|
||||
}
|
||||
}
|
||||
|
||||
self.latestAppcastItem = item;
|
||||
self.latestAppcastItemComparisonResult = [[self versionComparator] compareVersion:[self.host version] toVersion:[item versionString]];
|
||||
|
||||
|
||||
if ([self itemContainsValidUpdate:item]) {
|
||||
self.updateItem = item;
|
||||
[self didFindValidUpdate];
|
||||
[self performSelectorOnMainThread:@selector(didFindValidUpdate) withObject:nil waitUntilDone:NO];
|
||||
} else {
|
||||
self.updateItem = nil;
|
||||
[self didNotFindUpdate];
|
||||
[self performSelectorOnMainThread:@selector(didNotFindUpdate) withObject:nil waitUntilDone:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
assert(self.updateItem);
|
||||
|
||||
|
||||
// Handle the case where the update indicates that an automatic update is only available for specific versions
|
||||
if ([self itemPreventsAutoupdate:self.updateItem]) {
|
||||
[self.updater setAutomaticallyDownloadsUpdates:NO]; // This call will persist this setting (automatic downloads will be permanently deactivated), but that is probably OK after the rare case of a non-automatically updateable update - the user can always reactivate this in the settings or when the update information window appears for the next time.
|
||||
[self.updater checkForUpdatesInBackground]; // Will end up in SUUIBasedUpdateDriver instead of here
|
||||
return;
|
||||
}
|
||||
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
|
||||
@@ -215,7 +298,7 @@
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
|
||||
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
||||
[[updater delegate] updaterDidNotFindUpdate:self.updater];
|
||||
}
|
||||
@@ -240,12 +323,12 @@
|
||||
SULog(SULogLevelError, @"Failed to find user's cache directory! Using system default");
|
||||
cachePath = NSTemporaryDirectory();
|
||||
}
|
||||
|
||||
|
||||
NSString *name = [self.host.bundle bundleIdentifier];
|
||||
if (!name) {
|
||||
name = [self.host name];
|
||||
}
|
||||
|
||||
|
||||
cachePath = [cachePath stringByAppendingPathComponent:name];
|
||||
cachePath = [cachePath stringByAppendingPathComponent:@SPARKLE_BUNDLE_IDENTIFIER];
|
||||
return cachePath;
|
||||
@@ -253,12 +336,18 @@
|
||||
|
||||
- (void)downloadUpdate
|
||||
{
|
||||
NSString *bundleIdentifier = self.host.bundle.bundleIdentifier;
|
||||
assert(bundleIdentifier != nil);
|
||||
|
||||
// Clear cache directory so that downloads can't possibly accumulate inside
|
||||
NSString *appCachePath = [self appCachePath];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:appCachePath]) {
|
||||
[[NSFileManager defaultManager] removeItemAtPath:appCachePath error:NULL];
|
||||
}
|
||||
|
||||
// Ensure no other thirdparty app-updater is concurrently updating this app.
|
||||
[[SUGlobalUpdateLock sharedLock] lock];
|
||||
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[self.updateItem fileURL]];
|
||||
@@ -266,67 +355,87 @@
|
||||
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];
|
||||
}
|
||||
self.download = [[NSURLDownload alloc] initWithRequest:request delegate: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];
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)__unused d decideDestinationWithSuggestedFilename:(NSString *)name
|
||||
|
||||
- (void)downloaderDidSetDestinationName:(NSString *)destinationName temporaryDirectory:(NSString *)temporaryDirectory
|
||||
{
|
||||
NSString *downloadFileName = [NSString stringWithFormat:@"%@ %@", [self.host name], [self.updateItem versionString]];
|
||||
|
||||
NSString *appCachePath = [self appCachePath];
|
||||
|
||||
self.tempDir = [appCachePath stringByAppendingPathComponent:downloadFileName];
|
||||
int cnt = 1;
|
||||
while ([[NSFileManager defaultManager] fileExistsAtPath:self.tempDir] && cnt <= 999)
|
||||
{
|
||||
self.tempDir = [appCachePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ %d", downloadFileName, cnt++]];
|
||||
}
|
||||
|
||||
// Create the temporary directory if necessary.
|
||||
BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:self.tempDir withIntermediateDirectories:YES attributes:nil error:NULL];
|
||||
if (!success)
|
||||
{
|
||||
// Okay, something's really broken with this user's file structure.
|
||||
[self.download cancel];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUTemporaryDirectoryError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Can't make a temporary directory for the update download at %@.", self.tempDir] }]];
|
||||
}
|
||||
|
||||
self.downloadPath = [self.tempDir stringByAppendingPathComponent:name];
|
||||
[self.download setDestination:self.downloadPath allowOverwrite:YES];
|
||||
self.tempDir = temporaryDirectory;
|
||||
self.downloadPath = [temporaryDirectory stringByAppendingPathComponent:destinationName];
|
||||
self.extractionDirectory = [SPULocalCacheDirectory createUniqueDirectoryInDirectory:temporaryDirectory];
|
||||
}
|
||||
|
||||
- (void)downloadDidFinish:(NSURLDownload *)__unused d
|
||||
- (void)downloaderDidReceiveExpectedContentLength:(int64_t)__unused expectedContentLength
|
||||
{
|
||||
// don't need to do anything here as there's no GUI with this driver (there can be with child classes)
|
||||
}
|
||||
|
||||
- (void)downloaderDidReceiveDataOfLength:(uint64_t)__unused length
|
||||
{
|
||||
// don't need do anything here as there's no GUI with this driver (there can be with child classes)
|
||||
}
|
||||
|
||||
- (void)downloaderDidFinishWithTemporaryDownloadData:(SPUDownloadData * _Nullable)__unused downloadData
|
||||
{
|
||||
// finished. downloadData should be nil as this was a permanent download
|
||||
assert(self.updateItem);
|
||||
|
||||
if (self.updateItem.phasedRolloutInterval != nil) {
|
||||
// use new update group next time, even if the driver doesn't usesPhasedRollout
|
||||
[SUSystemUpdateInfo setNewUpdateGroupIdentifierForHost:self.host];
|
||||
}
|
||||
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didDownloadUpdate:)]) {
|
||||
[[updater delegate] updater:self.updater didDownloadUpdate:self.updateItem];
|
||||
}
|
||||
|
||||
[self extractUpdate];
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)__unused download didFailWithError:(NSError *)error
|
||||
- (void)downloaderDidFailWithError:(NSError *)error
|
||||
{
|
||||
NSURL *failingUrl = [error.userInfo objectForKey:NSURLErrorFailingURLErrorKey];
|
||||
if (!failingUrl) {
|
||||
failingUrl = [self.updateItem fileURL];
|
||||
}
|
||||
|
||||
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:failedToDownloadUpdate:error:)]) {
|
||||
[[updater delegate] updater:self.updater
|
||||
failedToDownloadUpdate:self.updateItem
|
||||
error:error];
|
||||
failedToDownloadUpdate:self.updateItem
|
||||
error:error];
|
||||
}
|
||||
|
||||
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{
|
||||
NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while downloading the update. Please try again later.", nil),
|
||||
NSUnderlyingErrorKey: error,
|
||||
}];
|
||||
NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while downloading the update. Please try again later.", nil),
|
||||
NSUnderlyingErrorKey: error,
|
||||
}];
|
||||
if (failingUrl) {
|
||||
[userInfo setObject:failingUrl forKey:NSURLErrorFailingURLErrorKey];
|
||||
}
|
||||
@@ -334,43 +443,53 @@
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUDownloadError userInfo:userInfo]];
|
||||
}
|
||||
|
||||
- (BOOL)download:(NSURLDownload *)__unused download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType
|
||||
{
|
||||
// We don't want the download system to extract our gzips.
|
||||
// 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 ([encodingType rangeOfString:@"gzip"].location == NSNotFound);
|
||||
}
|
||||
|
||||
- (void)extractUpdate
|
||||
{
|
||||
BOOL success = NO;
|
||||
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:self.downloadPath updatingHostBundlePath:self.host.bundlePath decryptionPassword:updater.decryptionPassword];
|
||||
|
||||
BOOL success;
|
||||
if (!unarchiver) {
|
||||
SULog(SULogLevelError, @"Error: No valid unarchiver for %@!", self.downloadPath);
|
||||
|
||||
success = NO;
|
||||
id<SUUnarchiverProtocol> unarchiver;
|
||||
if (self.extractionDirectory == nil) {
|
||||
SULog(SULogLevelError, @"Error: Failed to create temporary extraction directory for %@!", self.downloadPath);
|
||||
unarchiver = nil;
|
||||
} else {
|
||||
// Currently unsafe archives are the only case where we can prevalidate before extraction, but that could change in the future
|
||||
BOOL needsPrevalidation = [[unarchiver class] unsafeIfArchiveIsNotValidated];
|
||||
unarchiver = [SUUnarchiver unarchiverForPath:self.downloadPath extractionDirectory:self.extractionDirectory updatingHostBundlePath:self.host.bundlePath decryptionPassword:updater.decryptionPassword];
|
||||
|
||||
self.updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:self.downloadPath dsaSignature:self.updateItem.DSASignature host:self.host performingPrevalidation:needsPrevalidation];
|
||||
|
||||
success = self.updateValidator.canValidate;
|
||||
if (!unarchiver) {
|
||||
SULog(SULogLevelError, @"Error: No valid unarchiver for %@!", self.downloadPath);
|
||||
} else {
|
||||
self.updateValidator = [[SUUpdateValidator alloc] initWithDownloadPath:self.downloadPath signatures:self.updateItem.signatures host:self.host];
|
||||
|
||||
// Currently unsafe archives are the only case where we can prevalidate before extraction, but that could change in the future
|
||||
BOOL needsPrevalidation = [[unarchiver class] mustValidateBeforeExtraction];
|
||||
|
||||
if (needsPrevalidation) {
|
||||
success = [self.updateValidator validateDownloadPath];
|
||||
} else {
|
||||
success = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!success) {
|
||||
NSError *reason = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{NSLocalizedDescriptionKey: @"Failed to extract update."}];
|
||||
[self unarchiverDidFailWithError:reason];
|
||||
} else {
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:willExtractUpdate:)]) {
|
||||
[[updater delegate] updater:self.updater willExtractUpdate:self.updateItem];
|
||||
}
|
||||
|
||||
[unarchiver unarchiveWithCompletionBlock:^(NSError *err){
|
||||
if (err) {
|
||||
[self unarchiverDidFailWithError:err];
|
||||
return;
|
||||
}
|
||||
|
||||
[self unarchiverDidFinish:nil];
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didExtractUpdate:)]) {
|
||||
[[updater delegate] updater:self.updater didExtractUpdate:self.updateItem];
|
||||
}
|
||||
|
||||
[self performSelectorOnMainThread:@selector(unarchiverDidFinish:) withObject:nil waitUntilDone:NO];
|
||||
} progressBlock:^(double progress) {
|
||||
[self unarchiver:nil extractedProgress:progress];
|
||||
}];
|
||||
@@ -395,7 +514,7 @@
|
||||
- (void)unarchiverDidFinish:(id)__unused ua
|
||||
{
|
||||
assert(self.updateItem);
|
||||
|
||||
|
||||
[self installWithToolAndRelaunch:YES];
|
||||
}
|
||||
|
||||
@@ -403,21 +522,17 @@
|
||||
{
|
||||
// No longer needed
|
||||
self.updateValidator = nil;
|
||||
|
||||
|
||||
if ([self.updateItem isDeltaUpdate]) {
|
||||
[self failedToApplyDeltaUpdate];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[self abortUpdateWithError:err];
|
||||
}
|
||||
|
||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch
|
||||
{
|
||||
// TotalFinder-related HACK to prevent relaunch, installer does relaunch automatically
|
||||
// same applies for TotalTerminal and Asepsis
|
||||
relaunch = NO;
|
||||
|
||||
// Perhaps a poor assumption but: if we're not relaunching, we assume we shouldn't be showing any UI either. Because non-relaunching installations are kicked off without any user interaction, we shouldn't be interrupting them.
|
||||
[self installWithToolAndRelaunch:relaunch displayingUserInterface:relaunch];
|
||||
}
|
||||
@@ -457,8 +572,9 @@
|
||||
{
|
||||
assert(self.updateItem);
|
||||
assert(self.updateValidator);
|
||||
|
||||
BOOL validationCheckSuccess = [self.updateValidator validateWithUpdateDirectory:self.tempDir];
|
||||
assert(self.extractionDirectory);
|
||||
|
||||
BOOL validationCheckSuccess = [self.updateValidator validateWithUpdateDirectory:self.extractionDirectory];
|
||||
if (!validationCheckSuccess) {
|
||||
NSDictionary *userInfo = @{
|
||||
NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil),
|
||||
@@ -478,35 +594,59 @@
|
||||
id<SUUpdaterPrivate> updater = self.updater;
|
||||
static BOOL postponedOnce = NO;
|
||||
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||
if (!postponedOnce && [updaterDelegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
|
||||
{
|
||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:)]];
|
||||
[invocation setSelector:@selector(installWithToolAndRelaunch:)];
|
||||
[invocation setArgument:&relaunch atIndex:2];
|
||||
[invocation setTarget:self];
|
||||
postponedOnce = YES;
|
||||
if ([updaterDelegate updater:self.updater shouldPostponeRelaunchForUpdate:self.updateItem untilInvoking:invocation]) {
|
||||
return;
|
||||
if (!postponedOnce) {
|
||||
if ([updaterDelegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)]) {
|
||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:)]];
|
||||
[invocation setSelector:@selector(installWithToolAndRelaunch:)];
|
||||
[invocation setArgument:&relaunch atIndex:2];
|
||||
[invocation setTarget:self];
|
||||
postponedOnce = YES;
|
||||
if ([updaterDelegate updater:self.updater shouldPostponeRelaunchForUpdate:self.updateItem untilInvoking:invocation]) {
|
||||
return;
|
||||
}
|
||||
} else if ([updaterDelegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:)]) {
|
||||
postponedOnce = YES;
|
||||
if ([updaterDelegate updater:self.updater shouldPostponeRelaunchForUpdate:self.updateItem]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ([updaterDelegate respondsToSelector:@selector(updater:willInstallUpdate:)]) {
|
||||
[updaterDelegate updater:self.updater willInstallUpdate:self.updateItem];
|
||||
}
|
||||
|
||||
NSBundle *sparkleBundle = updater.sparkleBundle;
|
||||
if (!sparkleBundle) {
|
||||
SULog(SULogLevelError, @"Sparkle bundle is gone?");
|
||||
return;
|
||||
}
|
||||
|
||||
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
|
||||
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
|
||||
NSString *const relaunchToolName = @"" SPARKLE_RELAUNCH_TOOL_NAME;
|
||||
NSString *const relaunchToolSourcePath = [sparkleBundle pathForResource:relaunchToolName ofType:@"app"];
|
||||
NSString *const relaunchToolSourceName = @"" SPARKLE_RELAUNCH_TOOL_NAME;
|
||||
NSString *const relaunchToolSourcePath = [sparkleBundle pathForResource:relaunchToolSourceName ofType:@"app"];
|
||||
NSString *relaunchCopyTargetPath = nil;
|
||||
NSError *error = nil;
|
||||
BOOL copiedRelaunchPath = NO;
|
||||
|
||||
if (!relaunchToolSourceName || ![relaunchToolSourceName length]) {
|
||||
SULog(SULogLevelError, @"SPARKLE_RELAUNCH_TOOL_NAME not configued");
|
||||
}
|
||||
|
||||
if (!relaunchToolSourcePath) {
|
||||
SULog(SULogLevelError, @"Sparkle.framework is damaged. %@ is missing", relaunchToolSourceName);
|
||||
}
|
||||
|
||||
if (relaunchToolSourcePath) {
|
||||
relaunchCopyTargetPath = [[self appCachePath] stringByAppendingPathComponent:[relaunchToolSourcePath lastPathComponent]];
|
||||
NSString *hostBundleBaseName = [[self.host.bundlePath lastPathComponent] stringByDeletingPathExtension];
|
||||
if (!hostBundleBaseName) {
|
||||
SULog(SULogLevelError, @"Unable to get bundlePath");
|
||||
hostBundleBaseName = @"Sparkle";
|
||||
}
|
||||
NSString *relaunchCopyBaseName = [NSString stringWithFormat:@"%@ (Autoupdate).app", hostBundleBaseName];
|
||||
|
||||
relaunchCopyTargetPath = [[self appCachePath] stringByAppendingPathComponent:relaunchCopyBaseName];
|
||||
|
||||
SUFileManager *fileManager = [SUFileManager defaultManager];
|
||||
|
||||
@@ -522,7 +662,7 @@
|
||||
// Perhaps in a sandboxed environment this matters more. Note that this may not be a fatal error.
|
||||
NSError *quarantineError = nil;
|
||||
if (![fileManager releaseItemFromQuarantineAtRootURL:relaunchCopyTargetURL error:&quarantineError]) {
|
||||
SULog(SULogLevelError, @"Failed to release quarantine on %@ with error %@", relaunchCopyTargetPath, quarantineError);
|
||||
SULog(SULogLevelDefault, @"Warning: could not remove quarantine metadata from %@: %@. This may not be a problem, the update process will continue.", relaunchCopyTargetPath, quarantineError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -558,7 +698,10 @@
|
||||
pathToRelaunch = delegateRelaunchPath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Set relaunching flag.
|
||||
[self.host setBool:YES forUserDefaultsKey:SUUpdateRelaunchingMarkerKey];
|
||||
|
||||
[NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath],
|
||||
pathToRelaunch,
|
||||
[NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]],
|
||||
@@ -602,6 +745,9 @@
|
||||
|
||||
- (void)abortUpdate
|
||||
{
|
||||
// Remove lockfile to prevent 3rd party updaters from updating this app if the update is not going to happen anyway
|
||||
[[SUGlobalUpdateLock sharedLock] unlock];
|
||||
|
||||
[self cleanUpDownload];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
self.updateItem = nil;
|
||||
|
||||
@@ -14,9 +14,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <xar/xar.h>
|
||||
#include <Availability.h>
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
|
||||
#define HAS_XAR_GET_SAFE_PATH 1
|
||||
#else
|
||||
#define HAS_XAR_GET_SAFE_PATH 0
|
||||
#endif
|
||||
|
||||
#if HAS_XAR_GET_SAFE_PATH
|
||||
// This is preferred over xar_get_path (which is deprecated) when it's available
|
||||
// Don't use OS availability for this API
|
||||
extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
|
||||
#endif
|
||||
|
||||
static BOOL applyBinaryDeltaToFile(xar_t x, xar_file_t file, NSString *sourceFilePath, NSString *destinationFilePath)
|
||||
{
|
||||
NSString *patchFile = temporaryFilename(@"apply-binary-delta");
|
||||
@@ -86,6 +99,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
}
|
||||
|
||||
if (majorDiffVersion < FIRST_DELTA_DIFF_MAJOR_VERSION) {
|
||||
xar_close(x);
|
||||
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadCorruptFileError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Unable to identify diff-version %u in delta. Giving up.", majorDiffVersion] }];
|
||||
}
|
||||
@@ -93,18 +108,36 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
}
|
||||
|
||||
if (majorDiffVersion > LATEST_DELTA_DIFF_MAJOR_VERSION) {
|
||||
xar_close(x);
|
||||
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"A later version is needed to apply this patch (on major version %u, but patch requests version %u).", LATEST_DELTA_DIFF_MAJOR_VERSION, majorDiffVersion] }];
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
#if HAS_XAR_GET_SAFE_PATH
|
||||
// Reject patches that did not generate valid hierarchical xar container paths
|
||||
// These will not succeed to patch using recent versions of BinaryDelta
|
||||
if ((majorDiffVersion == SUBinaryDeltaMajorVersion2 && minorDiffVersion < 3) || (majorDiffVersion == SUBinaryDeltaMajorVersion1 && minorDiffVersion < 2)) {
|
||||
xar_close(x);
|
||||
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadCorruptFileError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"This patch version (%u.%u) is too old and potentially unsafe to apply. Please re-generate the patch using the latest version of BinaryDelta or generate_appcast. New version %u.%u patches will still be compatible with older versions of Sparkle.", majorDiffVersion, minorDiffVersion, majorDiffVersion, latestMinorVersionForMajorVersion(majorDiffVersion)] }];
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL usesNewTreeHash = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBeigeMajorVersion);
|
||||
BOOL usesNewTreeHash = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBinaryDeltaMajorVersion2);
|
||||
|
||||
NSString *expectedBeforeHash = usesNewTreeHash ? expectedNewBeforeHash : expectedBeforeHashv1;
|
||||
NSString *expectedAfterHash = usesNewTreeHash ? expectedNewAfterHash : expectedAfterHashv1;
|
||||
|
||||
if (!expectedBeforeHash || !expectedAfterHash) {
|
||||
xar_close(x);
|
||||
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadCorruptFileError userInfo:@{ NSLocalizedDescriptionKey: @"Unable to find before-sha1 or after-sha1 metadata in delta. Giving up." }];
|
||||
}
|
||||
@@ -120,6 +153,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
|
||||
NSString *beforeHash = hashOfTreeWithVersion(source, majorDiffVersion);
|
||||
if (!beforeHash) {
|
||||
xar_close(x);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -130,6 +165,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
}
|
||||
|
||||
if (![beforeHash isEqualToString:expectedBeforeHash]) {
|
||||
xar_close(x);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -146,6 +183,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
progressCallback(2/6.0);
|
||||
|
||||
if (!removeTree(destination)) {
|
||||
xar_close(x);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -158,6 +197,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
progressCallback(3/6.0);
|
||||
|
||||
if (!copyTree(source, destination)) {
|
||||
xar_close(x);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -169,7 +210,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
|
||||
progressCallback(4/6.0);
|
||||
|
||||
BOOL hasExtractKeyAvailable = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBeigeMajorVersion);
|
||||
BOOL hasExtractKeyAvailable = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBinaryDeltaMajorVersion2);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\nPatching...");
|
||||
@@ -178,17 +219,65 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
xar_file_t file;
|
||||
xar_iter_t iter = xar_iter_new();
|
||||
for (file = xar_file_first(x, iter); file; file = xar_file_next(iter)) {
|
||||
NSString *path = @(xar_get_path(file));
|
||||
char *pathCString;
|
||||
#if HAS_XAR_GET_SAFE_PATH
|
||||
if (xar_get_safe_path != NULL) {
|
||||
pathCString = xar_get_safe_path(file);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pathCString = xar_get_path(file);
|
||||
}
|
||||
|
||||
if (pathCString == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NSString *path = @(pathCString);
|
||||
if ([path.pathComponents containsObject:@".."]) {
|
||||
xar_close(x);
|
||||
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Relative path '%@' contains '..' path component", path] }];
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSString *sourceFilePath = [source stringByAppendingPathComponent:path];
|
||||
NSString *destinationFilePath = [destination stringByAppendingPathComponent:path];
|
||||
{
|
||||
NSString *destinationParentDirectory = destinationFilePath.stringByDeletingLastPathComponent;
|
||||
NSDictionary<NSFileAttributeKey, id> *destinationParentDirectoryAttributes = [fileManager attributesOfItemAtPath:destinationParentDirectory error:NULL];
|
||||
|
||||
// It is OK for the directory parent to not exist if it has already been removed
|
||||
if (destinationParentDirectoryAttributes != nil) {
|
||||
// But if it does exist, make sure the entry in the parent directory we're looking at is good
|
||||
// If it's inside a symlink, this is not good in any circumstance
|
||||
NSString *fileType = destinationParentDirectoryAttributes[NSFileType];
|
||||
if ([fileType isEqualToString:NSFileTypeSymbolicLink]) {
|
||||
xar_close(x);
|
||||
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to create patch because '%@' cannot be a symbolic link.", destinationParentDirectory] }];
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Don't use -[NSFileManager fileExistsAtPath:] because it will follow symbolic links
|
||||
BOOL fileExisted = verbose && [fileManager attributesOfItemAtPath:destinationFilePath error:nil];
|
||||
BOOL removedFile = NO;
|
||||
|
||||
// Files that have no property set that we check for will get ignored
|
||||
// This is important because they aren't part of the delta, just part of the directory structure
|
||||
|
||||
const char *value;
|
||||
if (!xar_prop_get(file, DELETE_KEY, &value) || (!hasExtractKeyAvailable && !xar_prop_get(file, DELETE_THEN_EXTRACT_OLD_KEY, &value))) {
|
||||
if (!removeTree(destinationFilePath)) {
|
||||
xar_close(x);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -209,6 +298,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
|
||||
if (!xar_prop_get(file, BINARY_DELTA_KEY, &value)) {
|
||||
if (!applyBinaryDeltaToFile(x, file, sourceFilePath, destinationFilePath)) {
|
||||
xar_close(x);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -224,6 +315,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
} else if ((hasExtractKeyAvailable && !xar_prop_get(file, EXTRACT_KEY, &value)) || (!hasExtractKeyAvailable && xar_prop_get(file, MODIFY_PERMISSIONS_KEY, &value))) { // extract and permission modifications don't coexist
|
||||
|
||||
if (xar_extract_tofile(x, file, [destinationFilePath fileSystemRepresentation]) != 0) {
|
||||
xar_close(x);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -247,6 +340,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
if (!xar_prop_get(file, MODIFY_PERMISSIONS_KEY, &value)) {
|
||||
mode_t mode = (mode_t)[[NSString stringWithUTF8String:value] intValue];
|
||||
if (!modifyPermissions(destinationFilePath, mode)) {
|
||||
xar_close(x);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -261,6 +356,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xar_close(x);
|
||||
|
||||
progressCallback(5/6.0);
|
||||
|
||||
@@ -53,15 +53,14 @@
|
||||
|
||||
typedef NS_ENUM(uint16_t, SUBinaryDeltaMajorVersion)
|
||||
{
|
||||
SUAzureMajorVersion = 1,
|
||||
SUBeigeMajorVersion = 2
|
||||
SUBinaryDeltaMajorVersion1 = 1,
|
||||
SUBinaryDeltaMajorVersion2 = 2
|
||||
};
|
||||
|
||||
#define FIRST_DELTA_DIFF_MAJOR_VERSION SUAzureMajorVersion
|
||||
#define LATEST_DELTA_DIFF_MAJOR_VERSION SUBeigeMajorVersion
|
||||
#define FIRST_DELTA_DIFF_MAJOR_VERSION SUBinaryDeltaMajorVersion1
|
||||
#define LATEST_DELTA_DIFF_MAJOR_VERSION SUBinaryDeltaMajorVersion2
|
||||
|
||||
extern int compareFiles(const FTSENT **a, const FTSENT **b);
|
||||
extern NSData *hashOfFileContents(FTSENT *ent);
|
||||
extern NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion);
|
||||
extern NSString *hashOfTree(NSString *path);
|
||||
extern BOOL removeTree(NSString *path);
|
||||
|
||||
@@ -42,10 +42,10 @@ NSString *stringWithFileSystemRepresentation(const char *input)
|
||||
int latestMinorVersionForMajorVersion(SUBinaryDeltaMajorVersion majorVersion)
|
||||
{
|
||||
switch (majorVersion) {
|
||||
case SUAzureMajorVersion:
|
||||
return 1;
|
||||
case SUBeigeMajorVersion:
|
||||
case SUBinaryDeltaMajorVersion1:
|
||||
return 2;
|
||||
case SUBinaryDeltaMajorVersion2:
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -137,15 +137,6 @@ static BOOL _hashOfFileContents(unsigned char *hash, FTSENT *ent)
|
||||
return YES;
|
||||
}
|
||||
|
||||
NSData *hashOfFileContents(FTSENT *ent)
|
||||
{
|
||||
unsigned char fileHash[CC_SHA1_DIGEST_LENGTH];
|
||||
if (!_hashOfFileContents(fileHash, ent)) {
|
||||
return nil;
|
||||
}
|
||||
return [NSData dataWithBytes:fileHash length:CC_SHA1_DIGEST_LENGTH];
|
||||
}
|
||||
|
||||
NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion)
|
||||
{
|
||||
char pathBuffer[PATH_MAX] = { 0 };
|
||||
@@ -171,7 +162,7 @@ NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion)
|
||||
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D)
|
||||
continue;
|
||||
|
||||
if (ent->fts_info == FTS_D && !MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
|
||||
if (ent->fts_info == FTS_D && !MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -188,8 +179,13 @@ NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion)
|
||||
const char *relativePathBytes = [relativePath fileSystemRepresentation];
|
||||
CC_SHA1_Update(&hashContext, relativePathBytes, (CC_LONG)strlen(relativePathBytes));
|
||||
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2)) {
|
||||
uint16_t mode = ent->fts_statp->st_mode;
|
||||
// permission of symlinks is irrelevant and can't be changed.
|
||||
// hardcoding a value helps avoid differences between filesystems.
|
||||
if (ent->fts_info == FTS_SL) {
|
||||
mode = 0755;
|
||||
}
|
||||
uint16_t type = ent->fts_info;
|
||||
uint16_t permissions = mode & PERMISSION_FLAGS;
|
||||
|
||||
@@ -242,7 +238,7 @@ BOOL modifyPermissions(NSString *path, mode_t desiredPermissions)
|
||||
return NO;
|
||||
}
|
||||
mode_t newMode = ([permissions unsignedShortValue] & ~PERMISSION_FLAGS) | desiredPermissions;
|
||||
int (*changeModeFunc)(const char *, mode_t) = [[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeSymbolicLink] ? lchmod : chmod;
|
||||
int (*changeModeFunc)(const char *, mode_t) = [(NSString *)[attributes objectForKey:NSFileType] isEqualToString:NSFileTypeSymbolicLink] ? lchmod : chmod;
|
||||
if (changeModeFunc([path fileSystemRepresentation], newMode) != 0) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -66,30 +66,37 @@ 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) };
|
||||
}
|
||||
|
||||
static bool isSymLink(const FTSENT *ent)
|
||||
{
|
||||
if (ent->fts_info == FTS_SL)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool aclExists(const FTSENT *ent)
|
||||
{
|
||||
// macOS does not currently support ACLs for symlinks
|
||||
@@ -156,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;
|
||||
}
|
||||
@@ -165,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;
|
||||
}
|
||||
|
||||
@@ -183,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;
|
||||
}
|
||||
|
||||
@@ -196,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;
|
||||
}
|
||||
|
||||
@@ -213,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);
|
||||
@@ -254,7 +323,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "Creating version %u.%u patch...\n", majorVersion, minorVersion);
|
||||
fprintf(stderr, "Processing %s...", [source fileSystemRepresentation]);
|
||||
fprintf(stderr, "Processing source, %s...", [source fileSystemRepresentation]);
|
||||
}
|
||||
|
||||
FTSENT *ent = 0;
|
||||
@@ -320,7 +389,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\nProcessing %s...", [destination fileSystemRepresentation]);
|
||||
fprintf(stderr, "\nProcessing destination, %s...", [destination fileSystemRepresentation]);
|
||||
}
|
||||
|
||||
pathBuffer[0] = 0;
|
||||
@@ -370,15 +439,12 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
// We should also not allow files with code signed extended attributes since Apple doesn't recommend inserting these
|
||||
// inside an application, and since we don't preserve extended attribitutes anyway
|
||||
|
||||
mode_t permissions = [info[INFO_PERMISSIONS_KEY] unsignedShortValue];
|
||||
if (!IS_VALID_PERMISSIONS(permissions)) {
|
||||
mode_t permissions = [(NSNumber *)info[INFO_PERMISSIONS_KEY] unsignedShortValue];
|
||||
if (!isSymLink(ent) && !IS_VALID_PERMISSIONS(permissions)) {
|
||||
permissions = 0755;
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "\nwarning: file permissions %o of '%s' won't be preserved in the delta update (only permissions with modes 0755 and 0644 are supported).\n", permissions & PERMISSION_FLAGS, ent->fts_path);
|
||||
}
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSFileReadUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Invalid file permissions after-tree on file %@ (only permissions with modes 0755 and 0644 are supported)", @(ent->fts_path)] }];
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (aclExists(ent)) {
|
||||
@@ -408,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) {
|
||||
@@ -439,6 +505,9 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
}
|
||||
|
||||
NSString *temporaryFile = temporaryPatchFile(patchFile);
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\nWriting to temporary file %s...", [temporaryFile fileSystemRepresentation]);
|
||||
}
|
||||
xar_t x = xar_open([temporaryFile fileSystemRepresentation], WRITE);
|
||||
if (!x) {
|
||||
if (verbose) {
|
||||
@@ -458,8 +527,8 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
xar_subdoc_prop_set(attributes, MINOR_DIFF_VERSION_KEY, [[NSString stringWithFormat:@"%u", minorVersion] UTF8String]);
|
||||
|
||||
// Version 1 patches don't have a major or minor version field, so we need to differentiate between the hash keys
|
||||
const char *beforeHashKey = MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) ? BEFORE_TREE_SHA1_KEY : BEFORE_TREE_SHA1_OLD_KEY;
|
||||
const char *afterHashKey = MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) ? AFTER_TREE_SHA1_KEY : AFTER_TREE_SHA1_OLD_KEY;
|
||||
const char *beforeHashKey = MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2) ? BEFORE_TREE_SHA1_KEY : BEFORE_TREE_SHA1_OLD_KEY;
|
||||
const char *afterHashKey = MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2) ? AFTER_TREE_SHA1_KEY : AFTER_TREE_SHA1_OLD_KEY;
|
||||
|
||||
xar_subdoc_prop_set(attributes, beforeHashKey, [beforeHash UTF8String]);
|
||||
xar_subdoc_prop_set(attributes, afterHashKey, [afterHash UTF8String]);
|
||||
@@ -477,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");
|
||||
|
||||
@@ -494,30 +566,30 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
NSDictionary *originalInfo = originalTreeState[key];
|
||||
NSDictionary *newInfo = newTreeState[key];
|
||||
if (shouldSkipDeltaCompression(originalInfo, newInfo)) {
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) && shouldSkipExtracting(originalInfo, newInfo)) {
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2) && shouldSkipExtracting(originalInfo, newInfo)) {
|
||||
if (shouldChangePermissions(originalInfo, newInfo)) {
|
||||
xar_file_t newFile = xar_add_frombuffer(x, 0, [key fileSystemRepresentation], (char *)"", 1);
|
||||
xar_file_t newFile = _xarAddFile(fileTable, x, key, NULL);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, MODIFY_PERMISSIONS_KEY, [[NSString stringWithFormat:@"%u", [newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]] UTF8String]);
|
||||
xar_prop_set(newFile, MODIFY_PERMISSIONS_KEY, [[NSString stringWithFormat:@"%u", [(NSNumber *)newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]] UTF8String]);
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n👮 %s %s (0%o -> 0%o)", VERBOSE_MODIFIED, [key fileSystemRepresentation], [originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue], [newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]);
|
||||
fprintf(stderr, "\n👮 %s %s (0%o -> 0%o)", VERBOSE_MODIFIED, [key fileSystemRepresentation], [(NSNumber *)originalInfo[INFO_PERMISSIONS_KEY] unsignedShortValue], [(NSNumber *)newInfo[INFO_PERMISSIONS_KEY] unsignedShortValue]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NSString *path = [destination stringByAppendingPathComponent:key];
|
||||
xar_file_t newFile = xar_add_frompath(x, 0, [key fileSystemRepresentation], [path fileSystemRepresentation]);
|
||||
xar_file_t newFile = _xarAddFile(fileTable, x, key, path);
|
||||
assert(newFile);
|
||||
|
||||
if (shouldDeleteThenExtract(originalInfo, newInfo)) {
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2)) {
|
||||
xar_prop_set(newFile, DELETE_KEY, "true");
|
||||
} else {
|
||||
xar_prop_set(newFile, DELETE_THEN_EXTRACT_OLD_KEY, "true");
|
||||
}
|
||||
}
|
||||
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) {
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2)) {
|
||||
xar_prop_set(newFile, EXTRACT_KEY, "true");
|
||||
}
|
||||
|
||||
@@ -531,7 +603,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
}
|
||||
} else {
|
||||
NSNumber *permissions =
|
||||
(MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion) && shouldChangePermissions(originalInfo, newInfo)) ?
|
||||
(MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion2) && shouldChangePermissions(originalInfo, newInfo)) ?
|
||||
newInfo[INFO_PERMISSIONS_KEY] :
|
||||
nil;
|
||||
CreateBinaryDeltaOperation *operation = [[CreateBinaryDeltaOperation alloc] initWithRelativePath:key oldTree:source newTree:destination oldPermissions:originalInfo[INFO_PERMISSIONS_KEY] newPermissions:permissions];
|
||||
@@ -558,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]);
|
||||
@@ -574,13 +646,19 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
|
||||
xar_close(x);
|
||||
|
||||
unlink([patchFile fileSystemRepresentation]);
|
||||
link([temporaryFile fileSystemRepresentation], [patchFile fileSystemRepresentation]);
|
||||
unlink([temporaryFile fileSystemRepresentation]);
|
||||
NSFileManager *filemgr;
|
||||
filemgr = [NSFileManager defaultManager];
|
||||
|
||||
[filemgr removeItemAtPath: patchFile error: NULL];
|
||||
if ([filemgr moveItemAtPath: temporaryFile toPath: patchFile error: NULL] != YES)
|
||||
{
|
||||
if (verbose) {
|
||||
fprintf(stderr, "Failed to move temporary file, %s, to %s!\n", [temporaryFile fileSystemRepresentation], [patchFile fileSystemRepresentation]);
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\nDone!\n");
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
@@ -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]) {
|
||||
|
||||
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SUBinaryDeltaUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath;
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||
@property (nonatomic, copy, readonly) NSString *updateHostBundlePath;
|
||||
@property (nonatomic, copy, readonly) NSString *extractionDirectory;
|
||||
|
||||
@end
|
||||
|
||||
@@ -27,13 +28,14 @@
|
||||
|
||||
@synthesize archivePath = _archivePath;
|
||||
@synthesize updateHostBundlePath = _updateHostBundlePath;
|
||||
@synthesize extractionDirectory = _extractionDirectory;
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||
{
|
||||
return [[path pathExtension] isEqualToString:@"delta"];
|
||||
}
|
||||
|
||||
+ (BOOL)unsafeIfArchiveIsNotValidated
|
||||
+ (BOOL)mustValidateBeforeExtraction
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
@@ -73,12 +75,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_archivePath = [archivePath copy];
|
||||
_updateHostBundlePath = [updateHostBundlePath copy];
|
||||
_extractionDirectory = [extractionDirectory copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -96,7 +99,7 @@
|
||||
- (void)extractDeltaWithNotifier:(SUUnarchiverNotifier *)notifier
|
||||
{
|
||||
NSString *sourcePath = self.updateHostBundlePath;
|
||||
NSString *targetPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
||||
NSString *targetPath = [self.extractionDirectory stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
||||
|
||||
NSError *applyDiffError = nil;
|
||||
BOOL success = applyBinaryDelta(sourcePath, targetPath, self.archivePath, NO, ^(double progress){
|
||||
|
||||
@@ -9,12 +9,18 @@
|
||||
#ifndef SUCODESIGNINGVERIFIER_H
|
||||
#define SUCODESIGNINGVERIFIER_H
|
||||
|
||||
#if __has_feature(modules)
|
||||
@import Foundation;
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
#import "SUExport.h"
|
||||
|
||||
@interface SUCodeSigningVerifier : NSObject
|
||||
SU_EXPORT @interface SUCodeSigningVerifier : NSObject
|
||||
+ (BOOL)codeSignatureAtBundleURL:(NSURL *)oldBundlePath matchesSignatureAtBundleURL:(NSURL *)newBundlePath error:(NSError **)error;
|
||||
+ (BOOL)codeSignatureIsValidAtBundleURL:(NSURL *)bundlePath error:(NSError **)error;
|
||||
+ (BOOL)bundleAtURLIsCodeSigned:(NSURL *)bundlePath;
|
||||
+ (NSDictionary *)codeSignatureInfoAtBundleURL:(NSURL *)bundlePath;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -121,7 +121,22 @@ static id valueOrNSNull(id value) {
|
||||
return value ? value : [NSNull null];
|
||||
}
|
||||
|
||||
+ (void)logSigningInfoForCode:(SecStaticCodeRef)code label:(NSString*)label {
|
||||
+ (NSDictionary *)codeSignatureInfoAtBundleURL:(NSURL *)bundlePath {
|
||||
NSDictionary *info = nil;
|
||||
SecStaticCodeRef code = NULL;
|
||||
OSStatus result = SecStaticCodeCreateWithPath((__bridge CFURLRef)bundlePath, kSecCSDefaultFlags, &code);
|
||||
if (result != noErr) {
|
||||
SULog(SULogLevelError, @"Failed to get static code %d", result);
|
||||
goto finally;
|
||||
}
|
||||
info = [self codeSignatureInfoForCode:code];
|
||||
|
||||
finally:
|
||||
if (code) CFRelease(code);
|
||||
return info;
|
||||
}
|
||||
|
||||
+ (NSDictionary *)codeSignatureInfoForCode:(SecStaticCodeRef)code {
|
||||
CFDictionaryRef signingInfo = nil;
|
||||
const SecCSFlags flags = (SecCSFlags) (kSecCSSigningInformation | kSecCSRequirementInformation | kSecCSDynamicInformation | kSecCSContentInformation);
|
||||
if (SecCodeCopySigningInformation(code, flags, &signingInfo) == noErr) {
|
||||
@@ -133,8 +148,14 @@ static id valueOrNSNull(id value) {
|
||||
NSDictionary *infoPlist = [signingDict objectForKey:@"info-plist"];
|
||||
[relevantInfo setObject:valueOrNSNull([infoPlist objectForKey:@"CFBundleShortVersionString"]) forKey:@"version"];
|
||||
[relevantInfo setObject:valueOrNSNull([infoPlist objectForKey:(__bridge NSString *)kCFBundleVersionKey]) forKey:@"build"];
|
||||
SULog(SULogLevelDefault, @"%@: %@", label, relevantInfo);
|
||||
return [relevantInfo copy];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (void)logSigningInfoForCode:(SecStaticCodeRef)code label:(NSString*)label {
|
||||
NSDictionary *relevantInfo = [self codeSignatureInfoForCode:code];
|
||||
SULog(SULogLevelDefault, @"%@: %@", label, relevantInfo);
|
||||
}
|
||||
|
||||
+ (BOOL)bundleAtURLIsCodeSigned:(NSURL *)bundleURL
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Misc:
|
||||
// Misc:
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
extern const NSTimeInterval SUMinimumUpdateCheckInterval;
|
||||
@@ -21,23 +21,28 @@ extern const NSTimeInterval SUDefaultUpdateCheckInterval;
|
||||
|
||||
extern NSString *const SUBundleIdentifier;
|
||||
|
||||
extern NSString *const SUAppcastAttributeValueMacOS;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Notifications:
|
||||
// Notifications:
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
extern NSString *const SUTechnicalErrorInformationKey;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// PList keys::
|
||||
// PList keys::
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
extern NSString *const SUFeedURLKey;
|
||||
extern NSString *const SUHasLaunchedBeforeKey;
|
||||
extern NSString *const SUUpdateRelaunchingMarkerKey;
|
||||
extern NSString *const SUShowReleaseNotesKey;
|
||||
extern NSString *const SUSkippedVersionKey;
|
||||
extern NSString *const SUScheduledCheckIntervalKey;
|
||||
extern NSString *const SULastCheckTimeKey;
|
||||
extern NSString *const SUExpectsDSASignatureKey;
|
||||
extern NSString *const SUExpectsEDSignatureKey;
|
||||
extern NSString *const SUPublicEDKeyKey;
|
||||
extern NSString *const SUPublicDSAKeyKey;
|
||||
extern NSString *const SUPublicDSAKeyFileKey;
|
||||
extern NSString *const SUAutomaticallyUpdateKey;
|
||||
@@ -45,9 +50,9 @@ extern NSString *const SUAllowsAutomaticUpdatesKey;
|
||||
extern NSString *const SUEnableAutomaticChecksKey;
|
||||
extern NSString *const SUEnableSystemProfilingKey;
|
||||
extern NSString *const SUSendProfileInfoKey;
|
||||
extern NSString *const SUUpdateGroupIdentifierKey;
|
||||
extern NSString *const SULastProfileSubmitDateKey;
|
||||
extern NSString *const SUPromptUserOnFirstLaunchKey;
|
||||
extern NSString *const SUKeepDownloadOnFailedInstallKey;
|
||||
extern NSString *const SUDefaultsDomainKey;
|
||||
extern NSString *const SUEnableJavaScriptKey;
|
||||
extern NSString *const SUFixedHTMLDisplaySizeKey __attribute__((deprecated("This key is obsolete and has no effect.")));
|
||||
@@ -57,20 +62,24 @@ extern NSString *const SUNormalizeInstalledApplicationNameKey __attribute__((dep
|
||||
extern NSString *const SURelaunchToolNameKey __attribute__((deprecated("This key is obsolete. SPARKLE_RELAUNCH_TOOL_NAME.")));
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Appcast keys::
|
||||
// Appcast keys::
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
extern NSString *const SUAppcastAttributeDeltaFrom;
|
||||
extern NSString *const SUAppcastAttributeDSASignature;
|
||||
extern NSString *const SUAppcastAttributeEDSignature;
|
||||
extern NSString *const SUAppcastAttributeShortVersionString;
|
||||
extern NSString *const SUAppcastAttributeVersion;
|
||||
extern NSString *const SUAppcastAttributeOsType;
|
||||
|
||||
extern NSString *const SUAppcastElementCriticalUpdate;
|
||||
extern NSString *const SUAppcastElementDeltas;
|
||||
extern NSString *const SUAppcastElementMinimumAutoupdateVersion;
|
||||
extern NSString *const SUAppcastElementMinimumSystemVersion;
|
||||
extern NSString *const SUAppcastElementMaximumSystemVersion;
|
||||
extern NSString *const SUAppcastElementReleaseNotesLink;
|
||||
extern NSString *const SUAppcastElementTags;
|
||||
extern NSString *const SUAppcastElementPhasedRolloutInterval;
|
||||
|
||||
extern NSString *const SURSSAttributeURL;
|
||||
extern NSString *const SURSSAttributeLength;
|
||||
@@ -81,4 +90,6 @@ extern NSString *const SURSSElementLink;
|
||||
extern NSString *const SURSSElementPubDate;
|
||||
extern NSString *const SURSSElementTitle;
|
||||
|
||||
extern NSString *const SUXMLLanguage;
|
||||
|
||||
#endif
|
||||