Skip to content

Instantly share code, notes, and snippets.

View enigmaticape's full-sized avatar

Enigmatic Ape enigmaticape

View GitHub Profile
- (id) parseReceiptData:(NSData *)receipt_data OnAppStoreUsingURL:(NSURL *) store_URL {
NSDictionary * request_contents = @{
@"receipt-data" : [receipt_data base64EncodedStringWithOptions:0]
};
NSError * error = nil;
NSData * request_data = (
[NSJSONSerialization
{
environment = Sandbox;
receipt = {
"adam_id" = 0;
"application_version" = "1.2";
"bundle_id" = "com.enigmaticape.Phoreal";
"download_id" = 0;
"in_app" = (
);
"original_application_version" = "1.0";
@enigmaticape
enigmaticape / gist:26fb131f7379a20c7718
Created May 22, 2014 16:17
Quick, dirty and really painfully ugly way to parse the data fields out of an app store receipt.
#import <Foundation/Foundation.h>
typedef struct _ASNObject {
NSInteger index;
uint8_t type;
NSUInteger datap;
NSUInteger length;
NSUInteger next;
} ASNObject;
Type : 8 Version : 1 Octets :
Type : 20 Version : 1 Octets :
Type : 1 Version : 1 Octets : 0
Type : 11 Version : 1 Octets : 0
Type : 14 Version : 1 Octets : 82
Type : 15 Version : 1 Octets : 0
Type : 16 Version : 1 Octets : 0
Type : 25 Version : 1 Octets : 3
Type : 10 Version : 1 Octets : 4+
Type : 3 Version : 1 Octets : 1.2