Code Re-signing

11
Code Re-signing with Chris (with a K)

description

Learn what it is, when you should do it, and what you need to re-sign your app.

Transcript of Code Re-signing

Page 1: Code Re-signing

Code Re-signingwith Chris (with a K)

Page 2: Code Re-signing
Page 3: Code Re-signing

What is code re-signing?Apple signs all iOS apps in the build process with your

developer signature. Re-signing is the process of popping the app open and inserting a different signature.

Page 4: Code Re-signing

Why would I want to re-sign my app?1) in order to distribute through an enterprise account, in order to avoid the app store.

2) your client wants to distribute the app under their apple account.

Page 5: Code Re-signing

What do I need to do it?Two apple developer certificates. One to build with and one to re-sign with. If you want to circumvent the app

store and distribute it yourself, you'll need an apple enterprise account.

Page 6: Code Re-signing

• Build the app as normal under your usual apple developer certificate

• If you're going to provision it for push notifications, do so as normal

• From the re-signing account, you'll need a .p12

• The p12 contains the keychain certificate and private key. Double-

click it to add it to your keychain.

• if you're re-signing from your own enterprise account, you should

already have the p12 on your keychain

• to create a p12, go to Keychain Access, then right-click on the

certificate and export. Choose to export it as p12.

Page 7: Code Re-signing
Page 8: Code Re-signing

• If you're making an app for a client who wants push provisioning,

they'll need to provision the app for push with their own push

account

• At this point, we'd finish the process by running a little python script

we made that does the heavy lifting.

•the four arguments are: {full_path_to_ipa} {"certificate name"}

{bundle id} {full_path_to_mobileprovision_file}

Page 9: Code Re-signing

The script does the following:

• unzips the ipa

• alters the info.plist by swapping out the bundle id from the

original mobileprovision profile with the bundle id of the new

mobile provision profile (com.crowdcompass.com ->

com.blogher.com)

• copies new mobileprovision file into app, replacing the

embedded.mobileprovision

• resigns app with the code

• repackages with xcrun

Page 10: Code Re-signing