• This repository has been archived on 13/Feb/2020
  • Stars
    star
    754
  • Rank 59,813 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created over 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code sign iOS applications, without proprietary Apple software or hardware

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. isign can alter the app so that it can run on another developer's iPhone.

Apple tools already exist to do this. But with isign, now you can do this on operating systems like Linux.

Table of contents

Installing

Linux

The latest version of isign can be installed via PyPi:

$ pip install isign

Mac OS X

On Mac OS X, there are a lot of prerequisites, so the pip method probably won't work. The easiest method is to use git to clone the source code repository and run the install script:

$ git clone https://github.com/saucelabs/isign.git
$ cd isign
$ sudo ./INSTALL.sh

How to get started

All the libraries and tools that isign needs 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 the documentation on credentials on Github.

You should have a key and certificate in Keychain 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 the Certificates. Find the certificate you use to sign apps. Right click on it and export the key as a .p12 file, let's say Certificates.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.p12

If you get prompted for a password, just press Return.

By default, isign_export_creds.sh will put these files into ~/.isign, which is the standard place to put isign configuration 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 the isign_guess_mobileprovision.sh script. If you typically have only a few provisioning profiles and install on one phone, it might find it.

Anyway, once you have a .mobileprovision file, 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.pem

And now you're ready to start re-signing apps!

How to use isign

If you've installed all the files in the proper locations above, then isign can be now invoked on any iOS .app directory, or .ipa archive, or .app.zip zipped directory. For example:

$ isign -o resigned.ipa my.ipa
archived Ipa to /home/alice/resigned.ipa

You can also call it from Python:

from isign import isign

isign.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 the Apple Certificate documentation.

-c <path>, --certificate <path>

Path to your certificate in PEM format. Defaults to $HOME/.isign/certificate.pem.

-d, --display

For the application path, display the information property list (Info.plist) as JSON.

-h, --help

Show a help message and exit.

-i, --info

While resigning, add or update info in the application's information property list (Info.plist). Takes a comma-separated list of key=value pairs, such as CFBundleIdentifier=com.example.app,CFBundleName=ExampleApp. Use with caution! See Apple documentation for valid 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 to out in 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, --verbose

More verbose logs will be printed to STDERR.

Application path

The 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 .app directory or even a zipped .app directory. When resigning, isign will always create an archive of the same type as the original.

Contributing

Sauce Labs open source projects have a Code of Conduct. In short, we try to respect each other, listen, and be helpful.

Development happens on our 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. virtualenvwrapper is 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.sh

If the tests don't pass please file an issue. Please keep the tests up to date as you develop.

Note: some tests require Apple's codesign to 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 the isign command line tool works.

Sauce Labs supports ongoing public isign development. isign is a part of our infrastructure for the iOS Real Device Cloud, which allows customers to test apps and websites on real iOS devices. isign has been successfully re-signing submitted customer apps in production since June 2015.

More documentation

See the docs directory of this repository for random stuff that didn't fit here.

Authors

Neil Kandalgaonkar is the main developer and maintainer.

Proof of concept by Steven Hazel and Neil Kandalgaonkar.

Reference scripts using Apple tools by Michael Han.

More Repositories

1

sauce_ruby

This is the Ruby client adapter for testing with Sauce Labs, a Selenium-based browser testing service (saucelabs.com).
Ruby
100
star
2

Java-TestNG-Selenium

Java
89
star
3

test_right

Opinionated Selenium testing framework
Ruby
69
star
4

mac-osx-on-kvm

Patches to QEMU and KVM so you can virtualize Mac OS X with qemu-kvm
57
star
5

Java-Junit-Selenium

Java
38
star
6

Python-Pytest-Selenium

Python
31
star
7

JS-Mocha-WebdriverIO-Selenium

JavaScript
31
star
8

calculator

Sample Calculator App for Android
Java
27
star
9

JS-Nightwatch.js

JavaScript
26
star
10

JS-Protractor-Selenium

JavaScript
22
star
11

selbot

#selenium bot
Shell
15
star
12

parallel-clojure-example

Running your Selenium tests in parallel: Clojure
Clojure
12
star
13

Java-CucumberJVM-JUnit-Selenium

Java
11
star
14

Java-TestNG-Appium-Android

Java
10
star
15

Python-Behave-Appium-Android

Python
9
star
16

Groovy-Geb-Spock-Gradle-Selenium

Groovy
8
star
17

Java-Selenium

Selenium scripts for Java
Java
8
star
18

Python-Behave-Appium-iOS

Python
7
star
19

it-jira-bamboohr

Python
7
star
20

setups

Java
7
star
21

python-sauceconnect

Python library for Sauce Connect 4
Python
7
star
22

appium-java-travisci-example

An example repository for TravisCI, Appium Tests on TestObject
Java
7
star
23

Python-Pytest-Appium-iOS

Python
7
star
24

awscli

Ansible role to install AWS cli and manage credentials and profile configuration.
Shell
6
star
25

Python-Robot-Selenium

RobotFramework
6
star
26

saucecon19-advanced-selenium-workshop

A repository containing hands-on source code, as well as detailed guides for the SauceCon 2019 "Advanced Selenium" workshop
Java
6
star
27

Ruby-RSpec-Selenium

Ruby
6
star
28

Python-Behave-Selenium

Python
6
star
29

visual-scripting

A visual testing language
Java
6
star
30

JS-Grunt-Mocha-Parallel-WebdriverJS

JavaScript
5
star
31

JavaScript

JavaScript scripts used in the Sauce Labs DOCS wiki
JavaScript
5
star
32

espresso-runner_TBD

A command line application that uploads and runs Espresso/Robotium tests on the Sauce Labs real device cloud
Java
5
star
33

pip

Ansible role to install pip.
Shell
5
star
34

Ruby-Cucumber-Selenium

Ruby
5
star
35

appium-cross-platform-example

An example cross platform Appium test that uses the page object design pattern
Java
5
star
36

sauce-connect-composer

A Composer Package for Sauce Connect
PHP
5
star
37

bind

Ansible role to manage and setup BIND (Berkley Internet Naming Daemon).
Shell
5
star
38

saucecon19-best-practices-workshop

A repository containing hands-on source code, as well as detailed guides for the SauceCon 2019 "Best Practices for Automated Testing" workshop
Java
5
star
39

WebdriverIO-download-upload

Example of how to do down and uploads with WebdriverIO and local / Sauce Labs
JavaScript
4
star
40

Ruby-RSpec-Capybara

Ruby
4
star
41

Python-Selenium

Selenium scripts in Python used in the Sauce Labs DOCS wiki
Python
4
star
42

Ruby-Selenium

Selenium Scripts in Ruby used in the Sauce Labs DOCS wiki
Ruby
4
star
43

Python-Pytest-Appium-Android

Python
4
star
44

sauce-support

JavaScript
4
star
45

testobject-java-api

TestObject Java API
Java
4
star
46

testobject-gradle-plugin_TBD

This project is deprecated. Use https://github.com/testobject/espresso-runner instead.
Java
4
star
47

JS-Jasmine-WebdriverJS

JavaScript
4
star
48

percona_toolkit

Ansible role to install and configure the MySQL Percona toolkit.
Shell
3
star
49

CSharp-Nunit-Selenium

C#
3
star
50

percona_apt

Ansible role to setup the Percona apt repository.
Shell
3
star
51

Java-Junit-Appium-Android

Java
3
star
52

Ruby-Cucumber-Appium-Android

Ruby
3
star
53

role-homebrew

Install homebrew and manage homebrew packages
Ruby
3
star
54

gitdumper-oss

Fil missed this tool so much he begged us to open source it!
Python
3
star
55

JS-CucumberJS-WebdriverIO-Selenium

JavaScript
3
star
56

Python-UnitTest-Selenium

Python
3
star
57

help

TestObject Help Website
CSS
3
star
58

Java-CucumberJVM-JUnit-Appium-Andriod

Java
3
star
59

squid3

Squid3 deb package build
C++
3
star
60

Java-JUnit-Applitools-Selenium

Java
3
star
61

Java-Junit-Appium-AndroidStudio-Gradle

Example Android Project to demonstrate in Android Studio CI and TDD
Java
3
star
62

JS-Karma-UnitTest

JavaScript
3
star
63

ios-rdc-quickstart

How to get started with the iOS Real Device Cloud.
Python
3
star
64

Ruby-Cucumber-Watir

Example of Running Watir & Cucumber on Sauce Labs
Ruby
3
star
65

Groovy-Geb-Spock-Selenium

Sample with geb-spock and selenium
Groovy
3
star
66

appium-python-example

Python
3
star
67

appium-c-sharp

Example Appium tests written in C#
C#
3
star
68

percona_xtrabackup

Ansible role to install percona-xtrabackup.
Shell
3
star
69

Python-Nose-Selenium

Python
3
star
70

Ruby-RSpec-Watir

This Sauce Labs Example Code has moved to a new Repository
3
star
71

appium-java-example

Example showing how to use the Appium Java client for local and cloud usage including the page object pattern.
Java
3
star
72

JS-CucumberJS-Protractor3.0

JavaScript
3
star
73

sauce-dotnet-examples

An example project demonstrating Selenium testing with Sauce Labs on .NET
C#
2
star
74

calculator-test-gradle

A simple Appium test for the Calculator app (Android).
Java
2
star
75

dhcp_server

Ansible role to install and configure the Internet Systems Consortium DHCP server.
Shell
2
star
76

Python-Pytest-with-Pytest-Selenium

A sample Python test framework using Sauce, Pytest and the pytest-selenium plugin for Pytest
Python
2
star
77

Ruby-RSpec-Appium-Android1

Ruby
2
star
78

JS-Mocha-WD.js

JavaScript
2
star
79

Java-Junit-Appium-iOS

Java
2
star
80

tradefed

Java
2
star
81

super-appium-test

Java
2
star
82

JS-Mocha-WebdriverIO-Appium-Android

JavaScript
2
star
83

clj-appium

Clojure Appium Client
Clojure
2
star
84

Ruby-Cucumber-Capybara

Ruby
2
star
85

pear

sauce labs pear channel for sauce php integration (pear sauce!)
PHP
2
star
86

Java-TestNG-Appium-iOS

Java
2
star
87

Node-Selenium

Node.js scripts used in the Sauce Labs DOCS wiki
JavaScript
2
star
88

codeception-example

Example Codeception test configured to run on TestObject
PHP
2
star
89

RDC-Python-Robot-Appium-Android

RobotFramework
2
star
90

Python-Lettuce-Selenium

Python
2
star
91

sample-Jenkins-pipeline

A basic example of a Jenkins pipeline job including automated tests that can be triggered by individual contributors
JavaScript
2
star
92

Getting-Started-with-Appium

Java
2
star
93

apt-pin

Creates APT preferences pin files.
2
star
94

android-testing

Java
2
star
95

sauce-hipchat-service

JavaScript
2
star
96

Ruby-Cucumber-Appium-iOS

Ruby
2
star
97

saucecon19-pipeline-workshop

A repository containing hands-on source code, as well as detailed guides for setting up a CI/CD pipeline with Sauce
JavaScript
2
star
98

slacktalker

Python
2
star
99

Ruby-RSpec-Appium-Android

Ruby
1
star
100

C-Sharp-Selenium

C# scripts used in the DOCS tutorials
C#
1
star