如何通过授权辞退应用程序? [英] How do I resign app with entitlements?

查看:127
本文介绍了如何通过授权辞退应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.ipa文件,需要辞职.我尝试按照 objc.io博客中的说明进行操作:

I have an .ipa file which I need to resign. I tried doing it as explained on the objc.io blog:

$ codesign -f -s 'iPhone Developer: Thomas Kollbach (7TPNXN7G6K)' Example.app

但是这还不够.当我进行代码签名时,我得到的是这样的:

However this is insufficient. When I do codesign I get something like this:

$ codesign -d --entitlements - Example.app/Example
Executable=/Users/myuser/Payload/Example.app/Example

我没有列出任何应享权利.

I don't get any entitlements listed.

但是如果我从xCode对原始IPA文件执行codesign -d --entitlements,我会得到:

However if I do codesign -d --entitlements on the original IPA file from xCode I get:

<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>UFAYDHAUP.com.company.example</string>
    <key>aps-environment</key>
    <string>production</string>
    <key>beta-reports-active</key>
    <true/>
    <key>com.apple.developer.team-identifier</key>
    <string>UFAYDHAUP</string>
    <key>get-task-allow</key>
    <false/>
    <key>keychain-access-groups</key>
    <array>
        <string>UFAYDHAUP.com.company.example</string>
    </array>
</dict>
</plist>

我尝试了下面的行

 codesign --entitlements Example.app/archived-expanded-entitlements.xcent -f -s 'iPhone Developer: Thomas Kollbach (7TPNXN7G6K)' Example.app

但是不包括以下键:

  • beta报告激活
  • 允许任务

那我应该怎么做呢?我没有授权文件,在xCode 7中,仅检查功能.我只有Apple Push通知.

So how am I supposed to do this? I don't have an entitlements file, in xCode 7, one only checks Capabilities. And all I have is Apple Push notifications.

最后澄清我的要求:

  1. 与xCode导出的内容相比,我不会更改App ID或使用不同的配置文件或代码签名身份.
  2. 只有主可执行文件才能用工具更改,这就是为什么需要辞职的原因.

推荐答案

答案在问题本身中很明显.输出:

The answer is actually quite self evident in the question itself. The output from:

$ codesign -d --entitlements - Example.app/Example

实际上是一个完全有效的授权文件.因此,您可以通过编写以下命令来存储从xCode导出的原始.ipa的输出:

Is actually a perfectly valid entitlements file. So you can store the output from the original .ipa exported from xCode by writing:

$ codesign -d --entitlements entitlements.xml Example.app/Example

这会将权利存储在entitlements.xml中,然后您可以在参数中使用这些权利来自己对.ipa文件进行签名:

This will store the entitlements in entitlements.xml which you can then use in an argument to sign the .ipa file yourself:

codesign --entitlements entitlements.xml   -f -s "iPhone Distribution: Company (UFAYDHAUP)" Payload/Example.app

自然地,"iPhone Distribution:Company(UFAYDHAUP)"必须替换为您使用的签名标识,并且Payload/Example.app将是从.ipa文件解压缩的应用程序路径.

Naturally "iPhone Distribution: Company (UFAYDHAUP)" has to be replaced with the signing identify you use and Payload/Example.app will be the path to your app which has been unzipped from the .ipa file.

这篇关于如何通过授权辞退应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆