├── README.md └── resign.sh /README.md: -------------------------------------------------------------------------------- 1 | # Tool for Fast Batch Resigning of iOS Applications on macOS 2 | 3 | ## Steps 4 | 5 | > [!NOTE] 6 | > If this is your first time using this tool, execute the following commands before you begin: 7 | > ``` 8 | > chmod +x /path/to/iSigner/resign.sh 9 | > ``` 10 | > ``` 11 | > xattr -c /path/to/iSigner/resign.sh 12 | > ``` 13 | 14 |
This script is based on the work of Artur Kotov, specifically his ResignTool
29 |The original script was further improved by my friend Dmytro Furman. You can reach him on Telegram
30 | -------------------------------------------------------------------------------- /resign.sh: -------------------------------------------------------------------------------- 1 | # !/bin/bash 2 | 3 | # Colors 4 | GREEN="\033[1;32m" 5 | ORANGE="\033[1;33m" 6 | PURPLE="\033[1;34m" 7 | RED="\033[1;31m" 8 | LINK="\033[1;35m" 9 | RESET="\033[0m" 10 | 11 | # Directories 12 | DIR="`dirname \"$0\"`" 13 | 14 | # Certificate name and mobileprovision file 15 | certname="iPhone Distribution: John Doe (XX123XXX123)" 16 | mobileprovision="$DIR/embedded.mobileprovision" 17 | bundle="null.null" 18 | 19 | sourcedirectory="$DIR/source/" 20 | outputdirectory="$DIR/output/" 21 | 22 | cd "$sourcedirectory" 23 | 24 | function fixEntitlements() { 25 | local plist_file="$1" 26 | 27 | # Ensure entitlements file exists 28 | if [ ! -f "$plist_file" ]; then 29 | echo "${RED}✘ Error: Entitlements file not found: $plist_file${RESET}" 30 | return 1 31 | fi 32 | 33 | # Fix iCloud environment (force it to 'Production') 34 | /usr/libexec/PlistBuddy -c "Delete :com.apple.developer.icloud-container-environment" "$plist_file" 2>/dev/null 35 | /usr/libexec/PlistBuddy -c "Add :com.apple.developer.icloud-container-environment string Production" "$plist_file" 36 | 37 | # Fix iCloud services (force it to array with 'CloudKit') 38 | /usr/libexec/PlistBuddy -c "Delete :com.apple.developer.icloud-services" "$plist_file" 2>/dev/null 39 | /usr/libexec/PlistBuddy -c "Add :com.apple.developer.icloud-services array" "$plist_file" 40 | /usr/libexec/PlistBuddy -c "Add :com.apple.developer.icloud-services:0 string CloudKit" "$plist_file" 41 | } 42 | 43 | function signIPA() { 44 | SOURCEIPA="$1" 45 | DEVELOPER="$2" 46 | MOBILEPROV="$3" 47 | TARGET="$4" 48 | BUNDLE="$5" 49 | 50 | unzip -qo "$SOURCEIPA" -d extracted 51 | 52 | APPLICATION=$(ls extracted/Payload/) 53 | 54 | cp "$MOBILEPROV" "extracted/Payload/$APPLICATION/embedded.mobileprovision" 55 | 56 | echo "${ORANGE}• Extracting entitlements...${RESET}" 57 | security cms -D -i "extracted/Payload/$APPLICATION/embedded.mobileprovision" -o t_entitlements_full.plist 58 | /usr/libexec/PlistBuddy -x -c 'Print:Entitlements' t_entitlements_full.plist > t_entitlements.plist 59 | 60 | fixEntitlements "t_entitlements.plist" 61 | 62 | echo "${GREEN}✔ Resigning with certificate: $DEVELOPER${RESET}" 63 | find -d extracted \( -name "*.app" -o -name "*.appex" -o -name "*.framework" -o -name "*.dylib" \) > directories.txt 64 | 65 | while IFS='' read -r line || [[ -n "$line" ]]; do 66 | echo "${PURPLE}→ Signing: ${line##*/}${RESET}" 67 | /usr/bin/codesign --continue -f -s "$DEVELOPER" --entitlements "t_entitlements.plist" "$line" > /dev/null 2>&1 68 | done < directories.txt 69 | 70 | echo "${GREEN}✔ Creating signed IPA...${RESET}" 71 | cd extracted 72 | zip -qry ../extracted.ipa * 73 | cd .. 74 | mv extracted.ipa "$TARGET" 75 | 76 | rm -rf "extracted" directories.txt t_entitlements.plist t_entitlements_full.plist 77 | } 78 | 79 | find -d . -type f -name "*.ipa" > files.txt 80 | while IFS='' read -r line || [[ -n "$line" ]]; do 81 | filename=$(basename "$line" .ipa) 82 | output="$outputdirectory${filename}_sign.ipa" 83 | signIPA "$line" "$certname" "$mobileprovision" "$output" "$bundle" 84 | done < files.txt 85 | rm files.txt 86 | 87 | echo "\n${GREEN}If you find this script useful, feel free to support me! ☕\n${RESET}${LINK}https://www.buymeacoffee.com/dayanch96${RESET}" --------------------------------------------------------------------------------