首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >签名电子应用程序时,资产验证失败(90287)无效的代码签名权限

签名电子应用程序时,资产验证失败(90287)无效的代码签名权限
EN

Stack Overflow用户
提问于 2022-08-10 18:40:16
回答 1查看 1K关注 0票数 2

我第一次尝试在Mac中签署一个电子应用程序(通过electron-forge,它在引擎盖下使用@electron/osx-sign )和公众。

在几个错误之后,我可以成功地签名,但其中两个仍然存在:

代码语言:javascript
复制
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: ***)

当我试图通过苹果公司的传输程序发送它时,就会发生这种情况。我在寻找最后的日子,但我所尝试的一切都是徒劳的,就像:

Developer;

  • Manually

  • 下载不同的配置文件:开发、分发、通过CLI进行签名/公证;
  • 使用开发/分发environments;

我的配置文件:

代码语言:javascript
复制
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: ['...']
}

我的权利档案:

代码语言:javascript
复制
<?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>

问题是:我如何将这些密钥添加到我的配置文件中?这是正确的做法吗?

提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2022-08-11 10:09:09

我可以通过理解以下几个主题来解决这个问题:

  • --我认为只有当你计划在其他地方发布应用程序时才需要公证,而不是在Mac。
  • 要公证,只接受开发人员ID键。
  • electron-forge不更新electron-notarize包中的所有字段,其中一个字段是provisioningProfile。您需要将它放在根文件夹中才能加载它。
  • 您可以将DEBUG=electron-osx-sign*设置为有一个完整的签名日志。
  • I仍然需要手动签署.pkg文件,因为Transporter不接受由electron-forge的make管线签名的包。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73311205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档