网站租用,泸州网站建设公司,网站开发需要多少费用,网站开发我们都能解决为什么需要公证
mac os14.5之后的系统#xff0c;如果不对应用进行公证#xff0c;安装#xff0c;打开#xff0c;权限使用上都会存在问题#xff0c;而且有些问题你强制开启#xff08;sudo spctl --master-disable#xff09;使用后可能会有另外的问题#xff0c; …为什么需要公证
mac os14.5之后的系统如果不对应用进行公证安装打开权限使用上都会存在问题而且有些问题你强制开启sudo spctl --master-disable使用后可能会有另外的问题
例如在安全和隐私里面想开启麦克风和视像头的时候找不到自己的应用或是无法收到桌面通知(这些问题也是有的电脑会有的不会可能跟以前是否已经安装过有关具体的机制没有细究总之就是可能出现未知问题) 如何公证
公证前准备
开发者账号中必须生成两份重要证书
develop ID Application 证书 —— 用来对 .app 进行分发签名。类似于 iOS 的 inhouse enterprise企业内部分发应用
develop ID Installer 根证书 —— 用来对打包生成的 .dmg, .pkg 进行签名
一个主账号授权的副账号用来做 .pkg / .dmg 的公正用。可以直接用主账号
这个副账号对应的专有密钥需要在 https://appleid.apple.com 中生成
副账号所属的 Team ID 如何生成develop ID Application 证书和的develop ID Installer 根证书
Sign In - Apple Application证书安装后设置成始终信任避免老是频繁询问需要输入密码。 打包的设备需要安装这2份证书并且需要安装在钥匙串的登录里面双击安装默认好像是安装在系统如果安装在这里签名命令执行可能失败。 如何获取用于公证的专有密钥
Manage your Apple Account 如何创建appidapp 的 bundle ID mac的公证不确认是否需要该项操作目前是有com.moa.pc和com.sangfor.meeting
Sign In - Apple 公证主要用到几个命令
1.签名应用
签名的要求一是app里面的所有2进制文件.app应用都需要签名并且app包里面不能包含zip等压缩包
签名的要求二签名的应用必须开启hardened runtime
签名的命令
codesign --verbose --force --deep --strict --options runtime --timestamp --sign develop ID Application 证书 --entitlements neededToRun.entitlements 需要签名的文件或应用
命令里面neededToRun.entitlements是个文件内容如下
?xml version1.0 encodingUTF-8?
!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd
plist version1.0dictkeycom.apple.security.device.camera/keytrue/keycom.apple.security.device.audio-input/keytrue/keycom.apple.security.device.microphone/keytrue/keycom.apple.security.automation.apple-events/keytrue/keycom.apple.security.cs.allow-dyld-environment-variables/keytrue/keycom.apple.security.cs.allow-jit/keytrue/keycom.apple.security.cs.allow-unsigned-executable-memory/keytrue/keycom.apple.security.cs.disable-executable-page-protection/keytrue/keycom.apple.security.cs.disable-library-validation/keytrue//dict
/plist
例如
codesign --verbose --force --deep --strict --options runtime --timestamp --sign Developer ID Application: XXX --entitlements neededToRun.entitlements ./XXX.app/Contents/MacOS/nwjs
neededToRun.entitlements这个文件跟hardened runtime相关如果需要开启一些权限处理配置plist之外还要配置这个文件。
签名需要注意签名也是有顺序的一般是从文件夹最里面前到外面如果包有其他的修改nwjs这个文件都需要重新签名。对应sing.js里面的sign([${contents}/MacOS/nwjs]);
2.打包签名pkg包
命令
pkgbuild --component 打包的应用 --install-location 安装目录 --scripts 安装脚本相关 --version 版本 --identifier pkgid --sign install的签名证书 输出的pkg包名字
3.验证签名结果验证签名成功不等于所有app里面所有文件都签名成功
命令
codesign --verify -vvvv 应用或文件路径
例如
codesign --verify -vvvv ./XXXapp/Contents/MacOS/nwjs
4.上传公证pkg包
命令
xcrun notarytool submit --apple-id 账号 --password 密码 --team-id ID号 xxxxx.pkg
5. 检测公证结果
一般执行完上述第4步后就可以开始使用以下命令查看公证结果立即检测的话一般是处于公证中的状态这个状态一般持续1分钟左右一般等个1-2分钟后就会有结果。 命令
xcrun notarytool info --apple-id 账号 --password 密码 --team-id ID号 RequestUUID
例如
xcrun notarytool info --apple-id 账号 --password 密码 --team-id ID号 0818c020-fd0c-4886-a056-056481858828