记录使用终端对快过期的ipa进行企业重签名。
- 在开发者后台下载对应的描述文件,与需要进行重签的ipa放在同一文件夹内
(方便操作)
查询过期方式:把ipa改成zip后缀,然后解压,或者使用eZip直接右击打开查看embedded.mobileprovision文件快过期的描述文件
image.png
2.获取证书里面的信息embedded.plist
security cms -D -i embedded.mobileprovision > embedded.plist

3.导出entitlements.plist
/usr/libexec/PlistBuddy -x -c 'Print:Entitlements' embedded.plist > entitlements.plist

4.解压ipa包
unzip test.ipa

5.删除旧签名
rm -rf Payload/test.app/_CodeSignature/


6.替换配置文件
cp embedded.mobileprovision Payload/test.app/

7.签名,签名名称可以在钥匙串中查询到

codesign -f -s "你的证书的名称" --entitlements entitlements.plist Payload/test.app
- 如果有动态库,所有的动态都需要删除旧签名,并且添加新的签名
其实就是重复6、7的步骤,注意文件路径
rm -rf Payload/test.app/Frameworks/sdk.framework/_CodeSignature
codesign -f -s "你的证书的名称" Payload/test.app/Frameworks/sdk.framework/
- 打包ipa
zip -r test.ipa Payload/
下一步需要学习并使用脚本进行自动化签名,减少重复工作
网友评论