iOS重籤

 
 

因爲渠道推廣須要,可能須要多個包作備份推廣,區別是icon、遊戲名稱、登陸logo、bundleid、簽名證書、支付Consumables不一樣,其餘遊戲包體徹底相同。shell

 
 

反覆修改屢次文件提交Jenkins導包徹底是浪費精力,因而嘗試iReSign工具重籤。app

 
 

遇到的問題:工具

 
 

1.手動修改後綴ipa爲zip使用解壓工具解壓,而後修改文件,最後重籤失敗,使用zip/unzip命令最後重籤成功學習

 
 

2.手動建立的entitlements.plist文件未被工具重籤時替換,未知無解,不選entitlements.plist選項會一直提示entitlements gennerated...,最後仍是手動替換的spa

 
 

腳本重籤,順便又學習了下shell腳本:code




1
echo "重簽過程請依次正確輸入:ipa文件、描述文件mobileprovision、證書名稱cerName\n" 2 3 4 read -p "請輸入ipa文件路徑(拖入終端便可) : " param_ipa 5 echo "輸入:$param_ipa\n" 6 7 if ! ([ -f "$param_ipa" ]); then 8 echo \"${param_ipa}\"文件不存在 9 exit 10 fi 11 12 read -p "請輸入mobileprovision文件路徑(拖入終端便可) : " param_mobileprovision 13 echo "輸入:$param_mobileprovision\n" 14 15 if ! ([ -f "$param_mobileprovision" ]); then 16 echo \"${param_mobileprovision}\"文件不存在 17 exit 18 fi 19 20 read -p "請輸入cerName('iPhone Developer: XXXXX (XXX)') : " param_cerName 21 echo "輸入:$param_cerName\n" 22 23 24 unzip -qo "$param_ipa" -d extracted 25 26 APPLICATION=$(ls extracted/Payload/) 27 28 cp "$param_mobileprovision" "extracted/Payload/$APPLICATION/embedded.mobileprovision" 29 30 echo "Resigning with certificate: $param_cerName" >&2 31 find -d extracted \( -name "*.app" -o -name "*.appex" -o -name "*.framework" -o -name "*.dylib" \) > directories.txt 32 security cms -D -i "extracted/Payload/$APPLICATION/embedded.mobileprovision" > t_entitlements_full.plist 33 /usr/libexec/PlistBuddy -x -c 'Print:Entitlements' t_entitlements_full.plist > t_entitlements.plist 34 while IFS='' read -r line || [[ -n "$line" ]]; do 35 /usr/bin/codesign --continue -f -s "$param_cerName" --entitlements "t_entitlements.plist" "$line" 36 echo "line: ${line}" 37 done < directories.txt 38 39 # /usr/bin/codesign --continue -f -s "$param_cerName" --entitlements "t_entitlements.plist" "extracted/Payload/$APPLICATION" 40 41 echo "Creating the Signed IPA" 42 cd extracted 43 zip -qry ../extracted.ipa * 44 cd .. 45 46 ls_date=`date +%Y%m%d` 47 mv extracted.ipa "${ls_date}_Signed.ipa" 48 49 rm -rf "extracted" 50 rm directories.txt 51 rm t_entitlements.plist 52 rm t_entitlements_full.plist
相關文章
相關標籤/搜索