Skip to content

Commit 9844ffa

Browse files
committed
chore: Update README.md
1 parent 52c9fec commit 9844ffa

File tree

7 files changed

+116
-86
lines changed

7 files changed

+116
-86
lines changed

README-ZH.md

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# auto_updater
22

3-
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] ![][visits-count-image]
3+
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url]
44

55
[pub-image]: https://img.shields.io/pub/v/auto_updater.svg
66
[pub-url]: https://pub.dev/packages/auto_updater
7-
87
[discord-image]: https://img.shields.io/discord/884679008049037342.svg
98
[discord-url]: https://discord.gg/zPa6EZ2jqb
109

11-
[visits-count-image]: https://img.shields.io/badge/dynamic/json?label=Visits%20Count&query=value&url=https://api.countapi.xyz/hit/leanflutter.auto_updater/visits
12-
1310
这个插件允许 Flutter **桌面** 应用自动更新自己 (基于 [sparkle](https://sparkle-project.org/)[winsparkle](https://winsparkle.com))。
1411

1512
<img src="screenshots/sparkle.png" width="732" alt="">
@@ -23,39 +20,41 @@
2320
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2421
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
2522

26-
- [auto_updater](#auto_updater)
27-
- [平台支持](#平台支持)
28-
- [快速开始](#快速开始)
29-
- [安装](#安装)
30-
- [⚠️ Windows requirements](#️-windows-requirements)
31-
- [用法](#用法)
32-
- [发布你的应用](#发布你的应用)
33-
- [生成私钥](#生成私钥)
34-
- [macOS](#macos)
35-
- [Windows](#windows)
36-
- [打包应用](#打包应用)
37-
- [macOS](#macos-1)
38-
- [Windows](#windows-1)
39-
- [获取签名](#获取签名)
40-
- [macOS](#macos-2)
41-
- [Windows](#windows-2)
42-
- [分发应用](#分发应用)
43-
- [谁在用使用它?](#谁在用使用它)
44-
- [API](#api)
45-
- [AutoUpdater](#autoupdater)
46-
- [Methods](#methods)
47-
- [setFeedURL](#setfeedurl)
48-
- [checkForUpdates](#checkforupdates)
49-
- [相关链接](#相关链接)
50-
- [许可证](#许可证)
23+
- [平台支持](#%E5%B9%B3%E5%8F%B0%E6%94%AF%E6%8C%81)
24+
- [快速开始](#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)
25+
- [安装](#%E5%AE%89%E8%A3%85)
26+
- [⚠️ Windows requirements](#-windows-requirements)
27+
- [用法](#%E7%94%A8%E6%B3%95)
28+
- [发布你的应用](#%E5%8F%91%E5%B8%83%E4%BD%A0%E7%9A%84%E5%BA%94%E7%94%A8)
29+
- [生成私钥](#%E7%94%9F%E6%88%90%E7%A7%81%E9%92%A5)
30+
- [macOS](#macos)
31+
- [Windows](#windows)
32+
- [打包应用](#%E6%89%93%E5%8C%85%E5%BA%94%E7%94%A8)
33+
- [macOS](#macos-1)
34+
- [Windows](#windows-1)
35+
- [获取签名](#%E8%8E%B7%E5%8F%96%E7%AD%BE%E5%90%8D)
36+
- [macOS](#macos-2)
37+
- [Windows](#windows-2)
38+
- [分发应用](#%E5%88%86%E5%8F%91%E5%BA%94%E7%94%A8)
39+
- [故障排除](#%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4)
40+
- [macOS](#macos-3)
41+
- [谁在用使用它?](#%E8%B0%81%E5%9C%A8%E7%94%A8%E4%BD%BF%E7%94%A8%E5%AE%83)
42+
- [API](#api)
43+
- [AutoUpdater](#autoupdater)
44+
- [Methods](#methods)
45+
- [setFeedURL](#setfeedurl)
46+
- [checkForUpdates](#checkforupdates)
47+
- [setScheduledCheckInterval](#setscheduledcheckinterval)
48+
- [相关链接](#%E7%9B%B8%E5%85%B3%E9%93%BE%E6%8E%A5)
49+
- [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81)
5150

5251
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
5352

5453
## 平台支持
5554

5655
| Linux | macOS | Windows |
5756
| :---: | :---: | :-----: |
58-
| | ✔️ | ✔️ |
57+
|| ✔️ | ✔️ |
5958

6059
## 快速开始
6160

@@ -99,7 +98,7 @@ void main() async {
9998
// 必须加上这一行。
10099
WidgetsFlutterBinding.ensureInitialized();
101100
102-
String feedURL = 'http://localhost:5000/appcast.xml';
101+
String feedURL = 'http://localhost:5002/appcast.xml';
103102
await autoUpdater.setFeedURL(feedURL);
104103
await autoUpdater.checkForUpdates();
105104
await autoUpdater.setScheduledCheckInterval(3600);
@@ -117,7 +116,7 @@ void main() async {
117116
运行以下命令:
118117

119118
```bash
120-
flutter pub run auto_updater:generate_keys
119+
dart run auto_updater:generate_keys
121120
```
122121

123122
> 需要分别在 `macOS``Windows` 系统中运行该命令。
@@ -235,7 +234,7 @@ flutter_distributor release --name dev --jobs release-windows
235234
运行以下命令:
236235

237236
```
238-
flutter pub run auto_updater:sign_update dist/1.1.0+2/auto_updater_example-1.1.0+2-macos.zip
237+
dart run auto_updater:sign_update dist/1.1.0+2/auto_updater_example-1.1.0+2-macos.zip
239238
```
240239

241240
输出:
@@ -251,15 +250,14 @@ sparkle:edSignature="pbdyPt92pnPkzLfQ7BhS9hbjcV9/ndkzSIlWjFQIUMcaCNbAFO2fzl0tISM
251250
运行以下命令:
252251

253252
```
254-
flutter pub run auto_updater:sign_update dist/1.1.0+2/auto_updater_example-1.1.0+2-windows-setup.exe
253+
dart run auto_updater:sign_update dist/1.1.0+2/auto_updater_example-1.1.0+2-windows-setup.exe
255254
```
256255

257256
输出:
258257

259258
```
260259
261-
MEUCIQCVbVzVID7H3aUzAY5znpi+ySZKznkukV8whlMFzKh66AIgREUGOmvavlcg
262-
6hwAwkb2o4IqVE/D56ipIBshIqCH8rk=
260+
sparkle:dsaSignature="MEUCIQCVbVzVID7H3aUzAY5znpi+ySZKznkukV8whlMFzKh66AIgREUGOmvavlcg6hwAwkb2o4IqVE/D56ipIBshIqCH8rk=" length="13400992"
263261
```
264262

265263
将获得的新签名更新到 `appcast.xml` 文件 `enclosure` 节点的 `sparkle:dsaSignature` 属性值。
@@ -296,7 +294,7 @@ MEUCIQCVbVzVID7H3aUzAY5znpi+ySZKznkukV8whlMFzKh66AIgREUGOmvavlcg
296294
<pubDate>Sun, 16 Feb 2022 12:00:00 +0800</pubDate>
297295
<enclosure url="1.1.0+2/auto_updater_example-1.1.0+2-windows.exe"
298296
sparkle:dsaSignature="MEUCIQCVbVzVID7H3aUzAY5znpi+ySZKznkukV8whlMFzKh66AIgREUGOmvavlcg6hwAwkb2o4IqVE/D56ipIBshIqCH8rk="
299-
sparkle:version="1.1.0"
297+
sparkle:version="1.1.0+2"
300298
sparkle:os="windows"
301299
length="0"
302300
type="application/octet-stream" />
@@ -314,13 +312,30 @@ cd dist/
314312
serve -l 5002
315313
```
316314

315+
## 故障排除
316+
317+
### macOS
318+
319+
- 确保按照 [Sparkle 文档](https://sparkle-project.org/documentation/)中的说明添加了 sparkle pod
320+
- 通过将以下内容添加到您的授权文件以进行调试和发布,确保您已添加并启用应用程序的网络功能并禁用沙箱以进行发布
321+
322+
```
323+
<key>com.apple.security.network.client</key>
324+
<true/>
325+
<key>com.apple.security.network.server</key>
326+
<true/>
327+
<key>com.apple.security.app-sandbox</key>
328+
<false/>
329+
```
330+
317331
## 谁在用使用它?
318332

319333
- [比译](https://biyidev.com/) - 一个便捷的翻译和词典应用程序。
320334

321335
## API
322336

323337
<!-- README_DOC_GEN -->
338+
324339
### AutoUpdater
325340

326341
#### Methods

README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# auto_updater
22

3-
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] ![][visits-count-image]
3+
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url]
44

55
[pub-image]: https://img.shields.io/pub/v/auto_updater.svg
66
[pub-url]: https://pub.dev/packages/auto_updater
7-
87
[discord-image]: https://img.shields.io/discord/884679008049037342.svg
98
[discord-url]: https://discord.gg/zPa6EZ2jqb
109

11-
[visits-count-image]: https://img.shields.io/badge/dynamic/json?label=Visits%20Count&query=value&url=https://api.countapi.xyz/hit/leanflutter.auto_updater/visits
12-
1310
This plugin allows Flutter **desktop** apps to automatically update themselves (based on [sparkle](https://sparkle-project.org/) and [winsparkle](https://winsparkle.com)).
1411

1512
<img src="screenshots/sparkle.png" width="732" alt="">
@@ -23,39 +20,41 @@ English | [简体中文](./README-ZH.md)
2320
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2421
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
2522

26-
- [auto_updater](#auto_updater)
27-
- [Platform Support](#platform-support)
28-
- [Quick Start](#quick-start)
29-
- [Installation](#installation)
30-
- [⚠️ Windows requirements](#️-windows-requirements)
31-
- [Usage](#usage)
32-
- [Publish your app](#publish-your-app)
33-
- [Generate private key](#generate-private-key)
34-
- [macOS](#macos)
35-
- [Windows](#windows)
36-
- [Packaging](#packaging)
37-
- [macOS](#macos-1)
38-
- [Windows](#windows-1)
39-
- [Get signature](#get-signature)
40-
- [macOS](#macos-2)
41-
- [Windows](#windows-2)
42-
- [Distributing](#distributing)
43-
- [Who's using it?](#whos-using-it)
44-
- [API](#api)
45-
- [AutoUpdater](#autoupdater)
46-
- [Methods](#methods)
47-
- [setFeedURL](#setfeedurl)
48-
- [checkForUpdates](#checkforupdates)
49-
- [Related Links](#related-links)
50-
- [License](#license)
23+
- [Platform Support](#platform-support)
24+
- [Quick Start](#quick-start)
25+
- [Installation](#installation)
26+
- [⚠️ Windows requirements](#-windows-requirements)
27+
- [Usage](#usage)
28+
- [Publish your app](#publish-your-app)
29+
- [Generate private key](#generate-private-key)
30+
- [macOS](#macos)
31+
- [Windows](#windows)
32+
- [Packaging](#packaging)
33+
- [macOS](#macos-1)
34+
- [Windows](#windows-1)
35+
- [Get signature](#get-signature)
36+
- [macOS](#macos-2)
37+
- [Windows](#windows-2)
38+
- [Distributing](#distributing)
39+
- [Troubleshooting](#troubleshooting)
40+
- [macOS](#macos-3)
41+
- [Who's using it?](#whos-using-it)
42+
- [API](#api)
43+
- [AutoUpdater](#autoupdater)
44+
- [Methods](#methods)
45+
- [setFeedURL](#setfeedurl)
46+
- [checkForUpdates](#checkforupdates)
47+
- [setScheduledCheckInterval](#setscheduledcheckinterval)
48+
- [Related Links](#related-links)
49+
- [License](#license)
5150

5251
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
5352

5453
## Platform Support
5554

5655
| Linux | macOS | Windows |
5756
| :---: | :---: | :-----: |
58-
| | ✔️ | ✔️ |
57+
|| ✔️ | ✔️ |
5958

6059
## Quick Start
6160

@@ -117,7 +116,7 @@ void main() async {
117116
Run the following command:
118117

119118
```bash
120-
flutter pub run auto_updater:generate_keys
119+
dart run auto_updater:generate_keys
121120
```
122121

123122
> You need to run this command on `macOS` and `Windows` systems separately.
@@ -235,7 +234,7 @@ flutter_distributor release --name dev --jobs release-windows
235234
Run the following command:
236235

237236
```
238-
flutter pub run auto_updater:sign_update dist/1.1.0+2/auto_updater_example-1.1.0+2-macos.zip
237+
dart run auto_updater:sign_update dist/1.1.0+2/auto_updater_example-1.1.0+2-macos.zip
239238
```
240239

241240
Output:
@@ -251,15 +250,14 @@ Update the obtained new signature to the value of the `sparkle:edSignature` attr
251250
Run the following command:
252251

253252
```
254-
flutter pub run auto_updater:sign_update dist/1.1.0+2/auto_updater_example-1.1.0+2-windows-setup.exe
253+
dart run auto_updater:sign_update dist/1.1.0+2/auto_updater_example-1.1.0+2-windows-setup.exe
255254
```
256255

257256
Output:
258257

259258
```
260259
261-
MEUCIQCVbVzVID7H3aUzAY5znpi+ySZKznkukV8whlMFzKh66AIgREUGOmvavlcg
262-
6hwAwkb2o4IqVE/D56ipIBshIqCH8rk=
260+
sparkle:dsaSignature="MEUCIQCVbVzVID7H3aUzAY5znpi+ySZKznkukV8whlMFzKh66AIgREUGOmvavlcg6hwAwkb2o4IqVE/D56ipIBshIqCH8rk=" length="13400992"
263261
```
264262

265263
Update the obtained new signature to the value of the `sparkle:dsaSignature` attribute of the `enclosure` node of the `appcast.xml` file.
@@ -296,7 +294,7 @@ Add `appcast.xml` to your project `dist/` directory.
296294
<pubDate>Sun, 16 Feb 2022 12:00:00 +0800</pubDate>
297295
<enclosure url="1.1.0+2/auto_updater_example-1.1.0+2-windows.exe"
298296
sparkle:dsaSignature="MEUCIQCVbVzVID7H3aUzAY5znpi+ySZKznkukV8whlMFzKh66AIgREUGOmvavlcg6hwAwkb2o4IqVE/D56ipIBshIqCH8rk="
299-
sparkle:version="1.1.0"
297+
sparkle:version="1.1.0+2"
300298
sparkle:os="windows"
301299
length="0"
302300
type="application/octet-stream" />
@@ -313,12 +311,14 @@ Start the test update server:
313311
cd dist/
314312
serve -l 5002
315313
```
314+
316315
## Troubleshooting
317316

318317
### macOS
319318

320319
- Make sure you have the sparkle pod added as described in [Sparkle Documentation](https://sparkle-project.org/documentation/)
321320
- Make sure you have added and enabled network capabilties of your app and disabled the sandbox for release by adding the following to your entitlement files for debug and release
321+
322322
```
323323
<key>com.apple.security.network.client</key>
324324
<true/>
@@ -335,6 +335,7 @@ serve -l 5002
335335
## API
336336

337337
<!-- README_DOC_GEN -->
338+
338339
### AutoUpdater
339340

340341
#### Methods
@@ -351,7 +352,6 @@ Asks the server whether there is an update. You must call setFeedURL before usin
351352

352353
Sets the auto update check interval, default 86400, minimum 3600, 0 to disable update
353354

354-
355355
<!-- README_DOC_GEN -->
356356

357357
## Related Links

bin/sign_update.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ Future<void> main(List<String> args) async {
3434

3535
int exitCode = processResult.exitCode;
3636
if (exitCode == 0) {
37-
String signature =
38-
processResult.stdout.toString().replaceFirst('\r\n', '').trim();
39-
stdout.write('sparkle:dsaSignature="$signature" length="0"');
37+
String signature = processResult.stdout.toString();
38+
if (Platform.isWindows) {
39+
signature = signature.replaceFirst('\r\n', '').trim();
40+
signature = 'sparkle:dsaSignature="$signature" length="0"';
41+
}
42+
stdout.write(signature);
4043
} else {
4144
stderr.write(processResult.stderr);
4245
}

example/macos/Podfile.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ PODS:
33
- FlutterMacOS
44
- Sparkle
55
- FlutterMacOS (1.0.0)
6+
- screen_retriever (0.0.1):
7+
- FlutterMacOS
68
- Sparkle (2.0.0)
9+
- window_manager (0.2.0):
10+
- FlutterMacOS
711

812
DEPENDENCIES:
913
- auto_updater (from `Flutter/ephemeral/.symlinks/plugins/auto_updater/macos`)
1014
- FlutterMacOS (from `Flutter/ephemeral`)
15+
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
16+
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
1117

1218
SPEC REPOS:
1319
trunk:
@@ -18,11 +24,17 @@ EXTERNAL SOURCES:
1824
:path: Flutter/ephemeral/.symlinks/plugins/auto_updater/macos
1925
FlutterMacOS:
2026
:path: Flutter/ephemeral
27+
screen_retriever:
28+
:path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos
29+
window_manager:
30+
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
2131

2232
SPEC CHECKSUMS:
2333
auto_updater: d3c03e9e5f2a00ec78572d9f7473cb8c9a6c0273
2434
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
35+
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
2536
Sparkle: 128c668ddd0780beb08576ce18460d2a37f64f9f
37+
window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8
2638

2739
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
2840

example/macos/Runner/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
<key>NSPrincipalClass</key>
3535
<string>NSApplication</string>
3636
<key>SUPublicEDKey</key>
37-
<string>bHaXClrRGMmKoKP/3HJnr/jn2ODTRPAM3VZhhkI9ZvY=</string>
37+
<string>frAJxov3qLUBA7EbVq0yhs8EKGPlRE/V2tTP1Ao6J7M=</string>
3838
</dict>
3939
</plist>

0 commit comments

Comments
 (0)