【问题标题】:Asset validation failed (90287) Invalid Code Signing Entitlements when signing an electron app资产验证失败 (90287) 签署电子应用程序时代码签名权利无效
【发布时间】: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


    【解决方案1】:

    我可以通过了解几个主题来解决它:

    • 我相信只有当您计划在其他地方而不是在 Mac App Store 中分发您的应用程序时才需要公证。
    • 为了公证,只接受开发者 ID 密钥。
    • electron-forge 不会更新electron-notarize 包中的所有字段,其中一个字段是provisioningProfile,您需要将它放在根文件夹中才能加载它。
    • 您可以设置DEBUG=electron-osx-sign* 以获得完整的签名日志。
    • 我仍然需要手动签署 .pkg 文件,因为 Transporter 不接受由 electron-forge 的 make 管道签署的包。

    【讨论】:

      猜你喜欢
      • 2012-12-17
      • 1970-01-01
      • 2013-02-15
      • 1970-01-01
      • 2014-02-26
      • 1970-01-01
      • 2020-10-01
      • 1970-01-01
      • 2018-02-23
      相关资源
      最近更新 更多