加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – 应用程序验证失败.签名无效,包含不允许的权利,或者未使用

发布时间:2020-12-14 19:36:37 所属栏目:百科 来源:网络整理
导读:我正在尝试将iOS应用程序推送到iTunes Connect,但是当我尝试在 Xcode中验证它时出现此错误: Application failed codesign verification. The signature was invalid,contains disallowed entitlements,or it was not signed with an iPhone Distribution Ce
我正在尝试将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的每一步进行操作.我检查在构建设置中是否选择了发布的分发配置文件(尝试使用通配符和应用程序的自定义配置文件),架构是正确的.为了确保应用程序使用该配置文件进行签名,我使用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
...

我使用安全性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>

这个应用程序的包ID看起来像com.example.MyApp,我认为上面的情况可能是问题,但改变了它们,它没有做.之后,我撤销了我的证书,获得了新的mobileprovision配置文件并再次完成了整个过程,但没有成功.

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

我看不出问题出在哪里,我错过了什么.

编辑1:
修改捆绑包ID是否需要手动更改其他设置?

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

解决方法

我有同样的问题.
您必须检查您的应用程序的签名,请参阅 How do I check the entitlements on my Application’s Signature,其中包括:

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

没关系,我不知道你有什么错误,如果得到类似的东西:

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>

但如果你只得到:

可执行= /路径/到/ MyGreatApp.app / MyGreatApp

然后,这是一个问题.可能是您在使用codesign工具重新签名的代码中损坏了权利.

我已经做了下一步修复它:

>在Xcode中存档任何应用程序.
>选择’分发…’ – >’保存以进行企业临时部署’作为AppName.ipa
>解压缩AppName.ipa
>创建应用程序的签名权利文件:
codesign -d –entitlements:enterprise.plist Payload / PathToApp.app /
>转到上传应用程序所在的文件夹.
>创建配置文件权利文件:

security cms -D -i /path/to/the.app/embedded.mobileprovision> provision_entitlements.plist
>打开provision_entitlements.plist和enterprise.plist.修改enterprise.plist的设置,它应该等于provision_entitlements.plist-> Entitlements属性.保存更改.
>当重新签名应用程序添加参数–entitlements enterprise.plist到codesign工具.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读