This article is not tested, the initial look at the code flow close to my thoughts, left to record.
Intoduction
This is the code allow for resign your own IPA assuming that has:
1) A developer certificate issued by Apple and added to your keychain
2) a mobileprovision file
This is the code allow resign your app without using Xcode or if you need to add a UDID for development distribution.
This code correctly signs IPAs with frameworks (. Framework folders), Plugins (. Appex folders), Applications (. App folders)
This code autoincludes entitlements with binaries extracting them from the provided mobileprovision file.
Usage
This code runs on Mac OSX
You should already has installed OSX Command Lines Tools
The code is a shell script
Step 1
Change the following variables inside the signall.sh script:
123456 |
signscript="/path/to/sign.sh" Ipasourcefolder="Path/to/ipas/source/folder" Ipadestfolder="/path/to/ipas/destinations/folder/" developer1="IPhone developer:xxxxx (xxxxx)" mobileprovision1="/path/to/mobile/provision" |
Step 2
123 |
make Sure, Ipasourcefolder and Ipadestfolder are writable run signall. SH via terminaldone |
In your destination folder you'll have all your IPAs signed.
Source and Updates
Https://bitbucket.org/xgiovio/ios-ipa-resign/src
Code
signall.sh
123456789101112131415161718192021 |
#!/bin/bashsignscript="/path/to/sign.sh" Ipasourcefolder="Path/to/ipas/source/folder" Ipadestfolder="/path/to/ipas/destinations/folder/" developer1="IPhone developer:xxxxx (xxxxx)" mobileprovision1="/path/to/mobile/provision" CD $ipasourcefolder Find -D . -type f -name "*.ipa"> files. TXT while ifs= " read -r line | | [[ - n "$line" ]]; do FileName=$(basename "$line" . IPA) echo "IPA: $filename" #_dev1_______ Output=$ipadestfolder$filename output+ ="_signed_dev1.ipa" "$signscript" "$line" "$developer 1" "$mobileprovision 1" "$output" done < files. TXT rm files. TXT |
sign.sh
1234567891011121314151617181920212223242526272829303132333435363738 |
#!/bin/bashSourceipa="$" DEVELOPER="$" Mobileprov=" $ $"TARGET="$4" Unzip -qo "$SOURCEIPA" -d extracted Application=$(ls extracted/Payload/) cp "$MOBILEPROV" "extracted/payload/$APPLICATION/embedded.mobileprovision" echo "resigning with Certificate: $DEVELOPER" >&2 Find -D Extracted\( -Name "*.app" -O -name " *.appex " -o -name " *.framework " -o -name " *.dylib " \) > directories< Span class= "Crayon-sy". txt security cms -d -i "extracted/payload/$APPLICATION/embedded.mobileprovision" > t_entitlements_full< Span class= "Crayon-sy". plist /usr/libexec/plistbuddy -x -c ' print:entitlements ' t_entitlements_fullplist > t_entitlements. plist #/usr/libexec/plistbuddy-c ' print:application-identifier ' t_entitlements.plist > T_entitlements_ Application-identifier #save developer Application-identifier to file#/usr/libexec/plistbuddy-c ' print:com.apple.developer.team-identifier ' t_entitlements.plist > T_ Entitlements_com.apple.developer.team-identifier #save Com.apple.developer.team-identifier Application-identifier To filewhile ifs= " read -r line | | [[ - n "$line" ]]; do #/usr/bin/codesign-d--entitlements:-"$line" > T_entitlements_original.plist #save original Entitlem Ents from the app #/usr/libexec/plistbuddy-x-C ' Import application-identifier t_entitlements_application-identifier ' T_ Entitlements_original.plist #overwrite application-identifier #/usr/libexec/plistbuddy-x-C ' Import com.apple.developer.team-identifier t_entitlements_ Com.apple.developer.team-identifier ' T_entitlements_original.plist #overwrite com.apple.developer.team-identifier /usr /bin/codesign --continue -f -s< Span class= "crayon-h" > "$DEVELOPER" --entitlements "T_entitlements.plist" "$line" done < directories. TXT echo "Creating the signed IPA" cd extracted zip -qry . /extracted. IPA * CD .. mv extracted. IPA "$TARGET" RM -rf "extracted" RM directories. TXT rm t_entitlements. plist rm T_entitlements_full. plist #rm t_entitlements_original.plist#rm T_entitlements_application-identifier#rm T_entitlements_com.apple.developer.team-identifier |
Re-signing the iOS. IPA file (with third-party frameworks and plugins)