-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path【手Q】Mac QQ公证.txt
82 lines (51 loc) · 2.52 KB
/
【手Q】Mac QQ公证.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
【手Q】Mac QQ 公证
背景
macOS 10.15 Catalina 起,对非 App Store 渠道的官网包需要进行公证:Notarizing Your App Before Distribution。
上传安装包进行公证
先下载从 RDM 打包的 Mac QQ 官网包(Developer 证书),然后上传到苹果验证服务器。
xcrun altool --notarize-app --primary-bundle-id "com.xxx.xx" --username "[email protected]" --password "xxxx-xxxx-xxxx-xxxx" --file QQ_6.5.6.dmg
几分钟后,返回用于查询的 RequestUUID = xxxxx
No errors uploading '/Users/xxxx/Downloads/QQ_6.5.6.dmg'.
RequestUUID = xxxxx
查询公证状态
再过几分钟后,使用 RequestUUID 查询公证状态
xcrun altool --notarization-info xxxxx -u "[email protected]" -p "xxxx-xxxx-xxxx-xxxx"
还在公证中:
No errors getting notarization info.
Date: 2019-10-25 02:26:06 +0000
Hash: xxxxx
RequestUUID: xxxxx
Status: in progress
公证成功:
No errors getting notarization info.
Date: 2019-10-25 02:26:06 +0000
Hash: xxxxxx
LogFileURL: xxxxxx
RequestUUID: xxxxxx
Status: success
Status Code: 0
Status Message: Package Approved
如果 Status: invalid 失败,通过 LogFileURL 下载日志查看错误。
即使公证成功,也要始终检查日志文件,因为该日志文件可能包含警告,您可以在下一次提交之前进行修复。
给安装包打上公证信息
公证成功完成后,下一次任何用户尝试在macOS 10.14或更高版本上运行您的应用程序时,Gatekeeper都会在线找到该票证(ticket)。其中包括在经过公证之前下载了您的应用的用户。
为了离线状态下 Gatekeeper 仍然能够找到 ticket 信息,需要使用 stapler 工具给安装包打上 ticket。
# 先 cd 到相关目录下
xcrun stapler staple "QQ_6.5.6.dmg"
结果:
Processing: /Users/xxxx/Downloads/QQ_6.5.6.dmg
The staple and validate action worked!
验证安装包是否有公证信息
xcrun stapler validate QQ_6.5.6.dmg
存在公证信息:
Processing: /Users/xxxx/Downloads/QQ_6.5.6.dmg
The validate action worked!
不存在公证信息:
QQ_6.5.5.dmg does not have a ticket stapled to it.
至此,Mac QQ 已经可以在 macOS 10.15 Catalina 上打开(正常提示):
如果没有公证(无法打开,这种情况仍然可以在 系统偏好设置-安全和隐私-仍然打开QQ):
参考
Notarizing Your App Before Distribution
Customizing the Notarization Workflow
Mac端多扩展Electron应用打包公证流程
小心你的app变非法 -- macOS应用需要苹果公证