【发布时间】:2022-12-14 07:35:55
【问题描述】:
我第一次尝试签署一个电子应用程序(通过 electron-forge 在引擎盖下使用 @electron/osx-sign)并在 Mac App Store 中公开。
在几次错误之后,我可以成功签名,但其中两个错误仍然存在:
Asset validation failed (90287)
Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'com.apple.application-identifier' in 'com.COMPANY.APP.pkg/Payload/APP.app/Contents/MacOS/APP'. (ID: ***)
Asset validation failed (90287)
Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'com.apple.developer.team-identifier' in 'com.COMPANY.APP.pkg/Payload/APP.app/Contents/MacOS/APP'. (ID: ***)
当我尝试通过 Apple 的 Transporter 发送它时会发生这种情况。 我正在寻找最后几天,但我尝试的一切都是徒劳的,例如:
- 下载不同的配置文件:开发、分发、开发人员;
- 通过 CLI 手动签名/公证;
- 使用开发/分发环境;
我的配置文件:
const path = require('path');
const fs = require('fs');
require('dotenv').config();
const APP_BUNDLE_ID = 'com.COMPANY.APP';
const MACOS_ENTITLEMENTS_PATH = path.join('osx', 'entitlements.plist');
module.exports = {
packagerConfig: {
icon: './assets/icon.ico',
appBundleId: APP_BUNDLE_ID,
appVersion: process.env.APP_VERSION,
name: 'APP',
appCategoryType: 'public.app-category.developer-tools',
darwinDarkModeSupport: true,
executableName: 'APP',
osxUniversal: {
mergeASARs: true,
x64ArchFiles: '**/{node_modules/\.cache,node_modules}/**'
},
osxSign: {
identity: process.env.APPLE_SIGN_IDENTITY,
provisioningProfile: path.join('osx', 'dist.provisionprofile'),
hardenedRuntime: true,
entitlements: MACOS_ENTITLEMENTS_PATH,
'entitlements-inherit': MACOS_ENTITLEMENTS_PATH,
'signature-flags': 'library',
'gatekeeper-assess': false,
},
osxNotarize: {
appleId: process.env.APPLE_SIGN_APPLEID,
appleIdPassword: process.env.APPLE_SIGN_APPLEIDPASSWORD,
}
},
makers: ['...']
}
我的权利文件:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
问题是:如何将这些密钥添加到我的配置文件中?这是正确的做法吗?
提前致谢!
【问题讨论】:
标签: macos electron mac-app-store entitlements electron-forge