unzip xxx.ipa //解压ipa
rm -rf Payload/ xxx.app/_CodeSignature //删除旧签名
cp newEmbedded.mobileprovision Payload/xxx.app/embedded.mobileprovision //替换mp
codesign -f -s "iPhone Distribution: xxx Technology Co., Ltd. " --entitlements entitlements.plist Payload/xxx.app //重签名
其中 entitlements.plist 不能搞错,不然重签出来的包安装不了。
给下我这企签的样式:
<?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>G7ZDN2AJQH.cn.xxxxxx.*</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>G7ZDN2AJQH.*</string>
</array>
</dict>
</plist>
或是用第三方工具:iResign 试用了该工具依然生效.