我有一个需要重新签名的.ipa文件。我尝试按照objc.io博客上的说明进行操作:
$ 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
- get-task-allow
那我该怎么做呢?我没有一个entitlements文件,在xCode 7中,只需要检查Capabilities。而且我只有苹果推送通知。
最后澄清一下我的要求:
- 我不会更改App ID或使用与xCode导出的不同的provisioning profile或code signing identity。
- 仅使用工具更改主可执行文件,因此需要重新签名。
codesign --preserve-metadata=entitlements --force --verbose --sign "Apple Development" MyApp.app
- user464014