ipa_utilities
Simple ruby gem to execute common ipa utilities, such as verify integrity, convert certificate formats, re-signs an ipa using a new provision profile and more.
Installation
$ gem install ipa_utilities
Command Line Tool
ipa_utilities is available as a command line tool. the main functionalities are described bellow:
For help use
ipa_utilities -h
# works for any of the verbs bellow
ipa_utilities verify -h
verify
ipa_utilities verify verb is used to verify the integrity and signature of an ipa file
ipa_utilities verify ipa_path
ipa_utilities verify ipa_path -c apns_certificate_path
ipa_utilities verify ipa_path -c apns_certificate_path -d device_UDID
By using the -c apns_certificate_path you can cross reference the ipa APNS environment with the APNS_Certificate passed
By passing a device UDID using -d UDID option, you can verify if the UDID is included in the embedded provision profile
certificate
ipa_utilities certificate ipa_path
This command will return the name of the APNS certificate that will be used with for the current ipa, it will also search the keychain for the existence of the certificate returned
convert
ipa_utilities convert p12_path
Convert verb helps in converting a P12 formatted identity file to a PEM file to be used with your APNS server implementation
Use -o out_path to select the save location
resign
ipa_utilities resign ipa_path -p new_provision_path
Re-Signs the ipa using the new new_provision_path
Use -o out_path to select the save location
Ruby Classes
IpaUtilities
IpaUtilities contains high level ipa bound operations:
ipa = IpaUtilities.new ipa_path
ipa.unzipto unzip the ipaipa.zip pathzip the ipa to a specific locationipa.verifyCodeSignverifies the code sign for the unzipped ipaipa.parsecreate and return aProvisionParserobject that is used to query the embedded provision profile
ProvisionParser
ProvisionParser used to query a provision profile
parser = ProvisionParser.new provision_profile_path
parser.uuidreturns the UUID of the provision profileparser.signingIdentitiesreturns the signing identities from the certificate object within the the provision profileparser.certificatesreturns the array of the certificatesparser.provisionedDevicesreturns array of devices included in the provision profileparser.isAPNSProductionreads the entitlements and checks for APNS environmentparser.isBuildRelease,isBuildStoreDistributionreadsget-task-allowfro the - entitlementsparser.appBundleIDreturns theparser.teamNamereturns the team nameparser.teamIdentifierreturns the team identifier
PemParser
PemParser reads a PEM formatted certificate files
pem = PemParser.new pem_path
namethe common name of the certificateisAPNSchecks if the pem is APNSisProductioncheck if the certificate is for productionbundleIDreturn the bundle id from the certificate
Contact
Omar Abdelhafith
License
ipa_utilities is available under the MIT license.
Future
Since xcode keeps changing how it signs and package the ipa files i will keep that up-todate for this library.
Other future improvements:
- Adding RSpec tests
- Better document the libraries
- Refactor the ipa_utilities binary
Contribute
Please!
Feel free to fork me on github