gpt4 book ai didi

ios - 应用程序未通过代码设计验证。签名无效,包含不允许的权利,或者未使用分发签名

转载 作者:可可西里 更新时间:2023-11-01 04:02:58 26 4
gpt4 key购买 nike

我正在尝试将 iOS 应用程序推送到 iTunes Connect,但是当我尝试在 Xcode 中验证它时出现此错误:

Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate

我见过很多与同一问题相关的问题,但这些问题对我没有用。我遵循 Apple 的每一步 Technical Note TN2250 .我检查了build设置中是否选择了发布配置文件(已尝试使用通配符和应用程序的自定义配置文件)并且模式是正确的。为确保该应用已使用该配置文件进行签名,我使用了 codesign -d -vvvv MyApp.app 命令,并得到如下信息:

Executable=/Users/myuser/Library/Developer/Xcode/Archives/2012-09-17/myapp 17-09-12 09.27.xcarchive/Products/Applications/MyApp.app/MyApp
Identifier=com.example.MyApp
...
Authority=iPhone Distribution: My Company
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
...

我使用 security cms -D -i MyApp.app/embedded.mobileprovision 检查我没有修改的权利,得到这个:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ApplicationIdentifierPrefix</key>
<array>
<string>PR3F1X</string>
</array>
<key>CreationDate</key>
<date>2012-09-17T07:20:35Z</date>
<key>DeveloperCertificates</key>
<array>
<data>
...
</data>
</array>
<key>Entitlements</key>
<dict>
<key>application-identifier</key>
<string>PR3F1X.com.example.MyApp</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>PR3F1X.*</string>
</array>
</dict>
<key>ExpirationDate</key>
<date>2013-09-16T07:20:35Z</date>
<key>Name</key>
<string>PROFILE NAME</string>
<key>TeamIdentifier</key>
<array>
<string>PR3F1X</string>
</array>
<key>TimeToLive</key>
<integer>364</integer>
<key>UUID</key>
<string>...</string>
<key>Version</key>
<integer>1</integer>
</dict>
</plist>

这个应用程序的 bundle id 看起来像 com.example.MyApp,我认为大写字母可能是问题所在,但更改了它们但没有成功。之后,我吊销了我的证书,获得了新的 mobileprovision 配置文件并再次完成了整个过程,但没有成功。

我使用的软件是 Xcode 4.3.2 和 Mac OS X 10.7.4

我看不出问题出在哪里,我遗漏了什么。

编辑 1:修改 bundle ID 是否需要我手动更改一些其他设置?

编辑 2:我刚刚从头开始制作了一个示例应用程序,用相同的证书对其进行了签名,一切都很顺利,所以问题似乎出在配置上。我试图查看这两个项目设置之间的差异,但唯一值得注意的是第一个仅适用于 iPad,并且它使用了几个 PhoneGap 插件。

最佳答案

我遇到了同样的问题。您必须检查应用程序的签名,请参阅 How do I check the entitlements on my Application's Signature具有以下内容:

codesign -d --entitlements -/path/to/MyGreatApp.app

这是OK,我不知道你有什么错误,如果你得到类似的东西:

Executable=/path/to/MyGreatApp.app/MyGreatApp
??qq?<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>ABC123DE45.com.appleseedinc.mygreatapp</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>ABC123DE45.com.appleseedinc.mygreatapp</string>
</array>
</dict>
</plist>

但是如果你只得到:

Executable=/path/to/MyGreatApp.app/MyGreatApp

那么,问题来了。可能是您在使用 codesign 工具重新编写代码时损坏了权利。

我已采取后续步骤来修复它:

  1. 在 Xcode 中存档任何应用。
  2. 选择“分发...”->“为企业临时部署保存”作为 AppName.ipa
  3. 解压AppName.ipa
  4. 创建应用程序的签名权利文件:codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/
  5. 转到上传的应用程序所在的文件夹。
  6. 创建配置文件授权文件:

    security cms -D -i/path/to/the.app/embedded.mobileprovision > provision_entitlements.plist

  7. 打开 provision_entitlements.plist 和 enterprise.plist。修改 enterprise.plist 的设置,它应该等于 provision_entitlements.plist->Entitlements 属性。保存更改。

  8. 当退出应用程序时,将参数 --entitlements enterprise.plist 添加到协同设计工具。

    codesign -fs "iPhone Distribution: My Company" APP_DIRECTORY --entitlements enterprise.plist

关于ios - 应用程序未通过代码设计验证。签名无效,包含不允许的权利,或者未使用分发签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12455072/

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