#證書名稱
CERTIFICATE=$"iPhone Developer: XXXX"
#app的路徑
ORIGINAL_FILE=$"/Users/yuxiaoguang/Desktop/Payload/apple.app"
#回到Payload路徑
cd $ORIGINAL_FILE
cd ..
cd ..
echo '*** 生成t_entitlements.plist ***'
security cms -D -i "$ORIGINAL_FILE/embedded.mobileprovision" > t_entitlements_full.plist
/usr/libexec/PlistBuddy -x -c 'Print:Entitlements' t_entitlements_full.plist > t_entitlements.plist
echo '*** framework重簽名 ***'
codesign -f -s "$CERTIFICATE" $ORIGINAL_FILE/Frameworks/AggregateKitCore.framework
echo '*** app重簽名 ***'
codesign -f -s "$CERTIFICATE" $ORIGINAL_FILE/ --entitlements t_entitlements.plist
echo '*** 壓縮成ipa文件 ***'
echo 'zxcv'|sudo -S zip -qr resign.ipa ./Payload
其中CERTIFICATE是證書名字,ORIGINAL_FILE是路徑缸榄,'zxcv'是電腦密碼
對于路徑的命令搞不懂渤弛,所以寫得有點糟糕,歡迎指正甚带。