diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 94d4f5503..1250a4545 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -189,7 +189,6 @@ jobs: - name: Replace Bundle ID run: | sed -i "" 's/com.darock.DarockBili.watchkitapp/com.djbx.life.agent.dat/g' DarockBili.xcodeproj/project.pbxproj - sed -i "" 's/com.darock.DarockBili/com.djbx.life.agent.dat/g' DarockBili.xcodeproj/project.pbxproj - name: Restore Caches uses: actions/cache/restore@v3 @@ -386,12 +385,27 @@ jobs: - name: Resign IPA env: COMPANY_P12_NAME: ${{ secrets.COMPANY_P12_NAME }} - SIGN_SCRIPT: ${{ secrets.SIGN_SCRIPT }} run: | - echo -n "$SIGN_SCRIPT" > sign.sh - sudo chmod a+x ./sign.sh - ./sign.sh DarockBili_Release.ipa "$RUNNER_TEMP/build_pp.mobileprovision" "$COMPANY_P12_NAME" - mv DarockBili_Release.resigned.ipa resigned.ipa + CODESIGN_ALLOCATE=`xcrun --find codesign_allocate`; export CODESIGN_ALLOCATE + IPA="./DarockBili_Release.ipa" + PROVISION="$RUNNER_TEMP/build_pp.mobileprovision" + CERTIFICATE="$COMPANY_P12_NAME" + # unzip the ipa + unzip -q "$IPA" + mkdir Scache + mv Payload/*.app/Watch/*.app Scache + rm -rf Payload/* + mv Scache/*.app Payload/ + # remove the signature + rm -rf Payload/*.app/_CodeSignature + # replace the provision + cp "$PROVISION" Payload/*.app/embedded.mobileprovision + plutil -convert xml1 Payload/*.app/Info.plist -o Info.plist + mv Info.plist Payload/*.app/Info.plist + # sign with the new certificate (--resource-rules has been deprecated OS X Yosemite (10.10), it can safely be removed) + /usr/bin/codesign -f -s "$CERTIFICATE" Payload/*.app + # zip it back up + zip -qr resigned.ipa Payload - name: Upload IPA File uses: actions/upload-artifact@v3