5

Other question show how you can sign an already signed IPA, like this, or this. Specially this part is what interests me:

/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --resource-rules "Payload/Application.app/ResourceRules.plist" "Payload/Application.app"

Once I have the re-signed ipa, how can I see/know that in fact the IPA I currently have has been signed by "iPhone Distribution: Certificate Name"?

Community
  • 1
  • 1
Rui Peres
  • 25,741
  • 9
  • 87
  • 137

3 Answers3

12

codesign -d -vvvv /path/to/The.app

-d for displaying signature info, lots of vs for lots of verbosity.

  • I tested this on an IPA I am re-signing by command line and it said `code object is not signed at all`. Which might be true. But, I exported one from Xcode (another project) signed with my iOS Distribution Profile and it says the same thing. – Rui Peres Mar 07 '13 at 15:42
  • 3
    Late but: you have to extract the app first. Eg. "unzip -q xxx.ipa" then change into Payload and run codesign on the xxx.app. this will show you the cert etc. – schmidiii Oct 17 '13 at 14:25
3

I don't know if its the best way. By using Terminal you can browse the contents of signed ipa file. Change the extension to zip and extract it. Then try browsing to following path >Payload/AppName.app/embedded.mobileprovision.

You can copy the embedded.mobileprovision to some other location and open in text editor to see the details.

Anupdas
  • 10,211
  • 2
  • 35
  • 60
  • While that does work, but the solution given by @GrahamLee takes that information and displays in a very readable form; much easier than picking apart raw configuration file. – Mike D Mar 07 '13 at 16:01
  • When I finish the re-sign the embedded.mobileprovision doesn't exist. Although it does exit before doing the re-sign... – Rui Peres Mar 07 '13 at 16:01
  • 1
    @MikeD I only shared a way that would work :). Thanks for the info. – Anupdas Mar 07 '13 at 16:05
  • @JackyBoy AFAIK embedded.mobileprovision only exists in codeSigned applications. I have done a tool for resigning ipa files with mobileprovision certificates, it would rewrite the embedded.provision if it's already there. If not just add provision and repackage. – Anupdas Mar 07 '13 at 16:08
  • Actually, @GrahamLee's answer did not work for me, while this one did. But I must confess the first one is better. – Rui Peres Mar 08 '13 at 12:16
1

To my knowledge, 'codesign' do not have any option to actually check that the resigning of the app is ok.

Actually, it can go wrong for many reasons (entitlements, provisioning, id mismatch ...).

The only way to check is to install the IPA (via Xcode, iPhone Configurator or iTunes if no other choice) on a device and see if the app launches.

ikarius
  • 513
  • 6
  • 10