如何退出具有权利的应用程序?
How do I resign app with entitlements?
我有一个 .ipa 文件需要退出。我尝试按照 objc.io blog:
中的说明进行操作
$ codesign -f -s 'iPhone Developer: Thomas Kollbach (7TPNXN7G6K)' Example.app
但这还不够。当我进行代码设计时,我得到这样的结果:
$ codesign -d --entitlements - Example.app/Example
Executable=/Users/myuser/Payload/Example.app/Example
我没有列出任何权利。
但是,如果我对来自 xCode 的原始 IPA 文件执行 codesign -d --entitlements
,我得到:
<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-reports-activ
- 获取任务允许
那我该怎么做呢?我没有权利文件,在 xCode 7 中,一个只检查 Capabilities。我只有 Apple 推送通知。
终于明确了我的要求:
- 与 xCode 导出的内容相比,我不会更改 App ID 或使用不同的配置文件或代码签名身份。
- 只有主要的可执行文件被一个工具改变了,这就是为什么需要辞职。
答案实际上在问题本身中是不言自明的。输出来自:
$ codesign -d --entitlements - Example.app/Example
实际上是一个完全有效的权利文件。因此,您可以存储从 xCode 导出的原始 .ipa 的输出,方法是:
$ codesign -d --entitlements entitlements.xml Example.app/Example
这会将权利存储在 entitlements.xml
中,然后您可以在参数中使用它来自己签署 .ipa 文件:
codesign --entitlements entitlements.xml -f -s "iPhone Distribution: Company (UFAYDHAUP)" Payload/Example.app
当然 "iPhone Distribution: Company (UFAYDHAUP)" 必须替换为您使用的签名标识,Payload/Example.app
将是您的应用程序的路径,该应用程序已从 .ipa 文件中解压缩。
它帮助了我:
--preserve-metadata=entitlements
不再需要保存和恢复权利。
我有一个 .ipa 文件需要退出。我尝试按照 objc.io blog:
中的说明进行操作$ codesign -f -s 'iPhone Developer: Thomas Kollbach (7TPNXN7G6K)' Example.app
但这还不够。当我进行代码设计时,我得到这样的结果:
$ codesign -d --entitlements - Example.app/Example
Executable=/Users/myuser/Payload/Example.app/Example
我没有列出任何权利。
但是,如果我对来自 xCode 的原始 IPA 文件执行 codesign -d --entitlements
,我得到:
<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-reports-activ
- 获取任务允许
那我该怎么做呢?我没有权利文件,在 xCode 7 中,一个只检查 Capabilities。我只有 Apple 推送通知。
终于明确了我的要求:
- 与 xCode 导出的内容相比,我不会更改 App ID 或使用不同的配置文件或代码签名身份。
- 只有主要的可执行文件被一个工具改变了,这就是为什么需要辞职。
答案实际上在问题本身中是不言自明的。输出来自:
$ codesign -d --entitlements - Example.app/Example
实际上是一个完全有效的权利文件。因此,您可以存储从 xCode 导出的原始 .ipa 的输出,方法是:
$ codesign -d --entitlements entitlements.xml Example.app/Example
这会将权利存储在 entitlements.xml
中,然后您可以在参数中使用它来自己签署 .ipa 文件:
codesign --entitlements entitlements.xml -f -s "iPhone Distribution: Company (UFAYDHAUP)" Payload/Example.app
当然 "iPhone Distribution: Company (UFAYDHAUP)" 必须替换为您使用的签名标识,Payload/Example.app
将是您的应用程序的路径,该应用程序已从 .ipa 文件中解压缩。
它帮助了我:
--preserve-metadata=entitlements
不再需要保存和恢复权利。