gpt4 book ai didi

xcode - 代码签名 : Identifier of Designated Requirements mismatches app identifier

转载 作者:行者123 更新时间:2023-12-01 01:04:35 29 4
gpt4 key购买 nike

我有一个 codesign 无法完全验证的应用程序,因为它“不满足其指定的要求”。第一次检查返回“在磁盘上有效”,所以没关系。
codesign -dvvvv -r- PATH_TO_APP 告诉我要求,它是:

Identifier=com.foobar.BarBuz-Helper
[...]
designated => anchor apple generic and identifier "com.foobar” and
(certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or
certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and
certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and
certificate leaf[subject.OU] = XXXXXXXXXX)

看起来正确。除了应用程序的标识符实际上不是“com.foobar”而是“com.foobar.BarBuz-Helper”,我认为这就是它不满足其要求的原因。

Xcode 使用错误的标识符对应用程序进行签名。这是运行的 Xcode 命令:
CodeSign /Users/matthias/[…]-Helper
setenv CODESIGN_ALLOCATE /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Using code signing identity "Developer ID Application: Matthias Bauch"
/usr/bin/codesign --force --sign 0123456789 --requirements =designated\ =>\ anchor\ apple\ generic\ \ and\ identifier\ \"com.foobar\"\ and\ ((cert\ leaf[field.1.2.840.113635.100.6.1.9]\ exists)\ or\ (\ certificate\ 1[field.1.2.840.113635.100.6.2.6]\ exists\ and\ certificate\ leaf[field.1.2.840.113635.100.6.1.13]\ exists\ \ and\ certificate\ leaf[subject.OU]\ =\ \"XXXXXXXXXX\"\ )) /Users/matthias/[...]-Helper

我不知道为什么会发生这种情况。

有人知道这里出了什么问题吗?应用程序从哪里获得其指定的代码签名要求?为什么应用的标识符与 DR 中的标识符不匹配?

我检查了所有的 plist 和build设置,我找不到发生这种情况的地方。

最佳答案

事实证明,指定需求中的标识符来自应用程序的 Info.plist。

由于此应用程序是命令行应用程序,因此默认情况下它没有 info.plist。我想用 SMJobBless 运行这个助手,所以我创建了一个 info.plist 并且我将 plist(链接器中的 -sectcreate)嵌入到应用程序中。

我没有做的是在打包build设置中设置“Info.plist 文件”。当我正确指定 Info.plist 时,codesign 可以验证应用程序。

关于xcode - 代码签名 : Identifier of Designated Requirements mismatches app identifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19914159/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com