Skip to content

Instantly share code, notes, and snippets.

View CocoaBeans's full-sized avatar

Kevin Ross CocoaBeans

View GitHub Profile
@0xc010d
0xc010d / ReCodeSign
Created November 14, 2011 22:38
Codesign an iOS app, with a different distribution certificate and mobileprovisioning file.
- Copy the delivered ipa into a directory to work in.
- export PlistBuddy="/usr/libexec/PlistBuddy" to get the PlistBuddy tool to your shell. If it is not added, all references to PlistBuddy
will need to be written as the full path.
- Take the delivered App.ipa and unzip it using the unzip command. This should produce a Payload directory containing the app and its
resources.
- Enter the command "codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/" This pulls the entitlements out of the app, and
prints them to a plist, without a leading "blob" of data. Pay particular attention to the colon before the enterprise.plist file name.
@mikeash
mikeash / gist:1355671
Created November 10, 2011 18:28
Multiple return
// clang -W -Wall -Wno-unused-parameter -framework Foundation -fobjc-arc test.m
#import <Foundation/Foundation.h>
#define IDARRAY(...) ((id[]){ __VA_ARGS__ })
#define IDCOUNT(...) (sizeof(IDARRAY(__VA_ARGS__)) / sizeof(id))
typedef id (^Tuple)(int);