Package: isign
A tool and library to re-sign iOS applications, without proprietary Apple software.For example, an iOS app in development would probably only run on the developer’s iPhone.isigncan alter the app so that it can run on another developer’s iPhone.Apple tools already exist to do this. But withisign, now you can do this on operating
systems like Linux.Table of contentsInstallingHow to get startedHow to use isignisign command line argumentsContributingMore documentationAuthorsInstallingLinuxThe latest version ofisigncan be installed viaPyPi:$ pip install isignMac OS XOn Mac OS X, there are a lot of prerequisites, so thepipmethod probably won’t work.
The easiest method is to usegitto clone thesource code repositoryand
run the install script:$ git clone https://github.com/saucelabs/isign.git
$ cd isign
$ sudo ./INSTALL.shHow to get startedAll the libraries and tools thatisignneeds to run will work on both Linux
and Mac OS X. However, you will need a Mac to export your Apple developer
credentials.If you’re like most iOS developers, credentials are confusing – if so check out
thedocumentation on credentialson Github.You should have a key and certificate inKeychain Access,
and a provisioning profile associated with that certificate, that you
can use to sign iOS apps for one or more of your own iOS devices.In Keychain Access, open theCertificates. Find the certificate you use to sign apps.
Right click on it and export the key as a.p12file, let’s sayCertificates.p12. If Keychain
asks you for a password to protect this file, just leave it blank.Next, let’s extract the key and certificate you need, into a standard PEM format.$ isign_export_creds.sh ~/Certificates.p12If you get prompted for a password, just pressReturn.By default,isign_export_creds.shwill put these files into~/.isign, which is
the standard place to putisignconfiguration files.Finally, you need a provisioning profile from the Apple Developer Portal that uses
the same certificate. If you’ve never dealt with this, the provisioning profile is
what tells the phone that you Apple has okayed you installing apps onto this particular phone.If you develop with XCode, you might have a provisioning profile already.
On the Mac where you develop with XCode, try running theisign_guess_mobileprovision.shscript.
If you typically have only a few provisioning profiles and install on one phone, it might find it.Anyway, once you have a.mobileprovisionfile, move it to~/.isign/isign.mobileprovision.The end result should look like this:$ ls -l ~/.isign
-r--r--r--    1 alice  staff  2377 Sep  4 14:17 certificate.pem
-r--r--r--    1 alice  staff  9770 Nov 23 13:30 isign.mobileprovision
-r--------    1 alice  staff  1846 Sep  4 14:17 key.pemAnd now you’re ready to start re-signing apps!How to use isignIf you’ve installed all the files in the proper locations above, thenisigncan be now invoked
on any iOS.appdirectory, or.ipaarchive, or.app.zipzipped directory. For example:$ isign -o resigned.ipa my.ipa
archived Ipa to /home/alice/resigned.ipaYou can also call it from Python:fromisignimportisignisign.resign("my.ipa",output_path="resigned.ipa")isign command line arguments# Resigning by specifying all credentials, input file, and output file
$ isign -c /path/to/mycert.pem -k ~/mykey.pem -p path/to/my.mobileprovision \
        -o resigned.ipa original.ipa

# Resigning, with credentials under default filenames in ~/.isign - less to type!
$ isign -o resigned.ipa original.ipa

# Modify Info.plist properties in resigned app
$ isign -i CFBundleIdentifier=com.example.myapp,CFBundleName=MyApp -o resigned.ipa original.ipa

# Display Info.plist properties from an app as JSON
$ isign -d my.ipa

# Get help
$ isign -h-a <path>, –apple-cert <path>Path to Apple certificate in PEM format. This is already included in the library, so you will likely
never need it. In the event that the certificates need to be changed, See theApple Certificate documentation.-c <path>, –certificate <path>Path to your certificate in PEM format. Defaults to$HOME/.isign/certificate.pem.-d, –displayFor the application path, display the information property list (Info.plist) as JSON.-h, –helpShow a help message and exit.-i, –infoWhile resigning, add or update info in the application’s information property list (Info.plist).
Takes a comma-separated list of key=value pairs, such asCFBundleIdentifier=com.example.app,CFBundleName=ExampleApp. Use with caution!
See Apple documentation forvalid Info.plist keys.-k <path>, –key <path>Path to your private key in PEM format. Defaults to$HOME/.isign/key.pem.-n <directory>, –credentials <directory>Equivalent to:-k <directory>/key.pem
-c <directory>/certificate.pem
-p <directory>/isign.mobileprovision-o <path>, –output <path>Path to write the re-signed application. Defaults tooutin your current working directory.-p <path>, –provisioning-profile <path>Path to your provisioning profile. This should be associated with your certificate. Defaults to$HOME/.isign/isign.mobileprovision.-v, –verboseMore verbose logs will be printed to STDERR.Application pathThe app to be resigned is specified on the command line after other arguments. The application path is
typically an IPA, but can also be a.appdirectory or even a zipped.appdirectory. When
resigning,isignwill always create an archive of the same type as the original.ContributingDevelopment happens onour Github repository. File an issue, or fork the code!You’ll probably want to create some kind of python virtualenv, so you don’t have to touch your system python or its
libraries.virtualenvwrapperis a good tool for this.Then, just do the following:$ git clone https://github.com/saucelabs/isign.git
$ cd isign
$ dev/setup.sh
$ ./run_tests.shIf the tests don’t pass pleasefile an issue. Please keep the tests up to date as you develop.Note: some tests require Apple’scodesignto run, so they are skipped unless you run them on a Macintosh computer with developer tools.Okay, if all the tests passed, you now have an ‘editable’ install of isign. Any edits to this repo will affect (for instance)
how theisigncommand line tool works.Sauce Labs supports ongoing publicisigndevelopment.isignis a part of our infrastructure
for theiOS Real Device Cloud,
which allows customers to test apps and websites on real iOS devices.isignhas been successfully re-signing submitted customer apps in production
since June 2015.This project not have an official code of conduct, yet, but one is forthcoming. Please contribute
to discussionhere.More documentationSee thedocsdirectory of this repository for random stuff that didn’t fit here.AuthorsNeil Kandalgaonkaris the main developer and maintainer.Proof of concept bySteven Hazeland Neil Kandalgaonkar.Reference scripts using Apple tools byMichael Han.