-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from adjust/receipt
Receipt verification
- Loading branch information
Showing
13 changed files
with
181 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "Adjust" | ||
s.version = "4.0.8" | ||
s.version = "4.1.0" | ||
s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com." | ||
s.homepage = "http://adjust.com" | ||
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' } | ||
s.author = { "Christian Wellenbrock" => "[email protected]" } | ||
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.8" } | ||
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.1.0" } | ||
s.platform = :ios, '4.3' | ||
s.framework = 'SystemConfiguration' | ||
s.weak_framework = 'AdSupport', 'iAd' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// NSData+ADJAdditions.h | ||
// adjust | ||
// | ||
// Created by Pedro Filipe on 26/03/15. | ||
// Copyright (c) 2015 adjust GmbH. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSData(ADJAdditions) | ||
|
||
- (NSString *)adjEncodeBase64; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// NSData+ADJAdditions.m | ||
// adjust | ||
// | ||
// Created by Pedro Filipe on 26/03/15. | ||
// Copyright (c) 2015 adjust GmbH. All rights reserved. | ||
// | ||
|
||
#import "NSData+ADJAdditions.h" | ||
|
||
@implementation NSData(ADJAdditions) | ||
|
||
static const char _base64EncodingTable[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | ||
|
||
// http://stackoverflow.com/a/4727124 | ||
- (NSString *)adjEncodeBase64 { | ||
const unsigned char * objRawData = self.bytes; | ||
char * objPointer; | ||
char * strResult; | ||
|
||
// Get the Raw Data length and ensure we actually have data | ||
NSUInteger intLength = self.length; | ||
if (intLength == 0) return nil; | ||
|
||
// Setup the String-based Result placeholder and pointer within that placeholder | ||
strResult = (char *)calloc((((intLength + 2) / 3) * 4) + 1, sizeof(char)); | ||
objPointer = strResult; | ||
|
||
// Iterate through everything | ||
while (intLength > 2) { // keep going until we have less than 24 bits | ||
*objPointer++ = _base64EncodingTable[objRawData[0] >> 2]; | ||
*objPointer++ = _base64EncodingTable[((objRawData[0] & 0x03) << 4) + (objRawData[1] >> 4)]; | ||
*objPointer++ = _base64EncodingTable[((objRawData[1] & 0x0f) << 2) + (objRawData[2] >> 6)]; | ||
*objPointer++ = _base64EncodingTable[objRawData[2] & 0x3f]; | ||
|
||
// we just handled 3 octets (24 bits) of data | ||
objRawData += 3; | ||
intLength -= 3; | ||
} | ||
|
||
// now deal with the tail end of things | ||
if (intLength != 0) { | ||
*objPointer++ = _base64EncodingTable[objRawData[0] >> 2]; | ||
if (intLength > 1) { | ||
*objPointer++ = _base64EncodingTable[((objRawData[0] & 0x03) << 4) + (objRawData[1] >> 4)]; | ||
*objPointer++ = _base64EncodingTable[(objRawData[1] & 0x0f) << 2]; | ||
*objPointer++ = '='; | ||
} else { | ||
*objPointer++ = _base64EncodingTable[(objRawData[0] & 0x03) << 4]; | ||
*objPointer++ = '='; | ||
*objPointer++ = '='; | ||
} | ||
} | ||
|
||
// Terminate the string-based result | ||
*objPointer = '\0'; | ||
|
||
// Return the results as an NSString object | ||
NSString *encodedString = [NSString stringWithCString:strResult encoding:NSASCIIStringEncoding]; | ||
free(strResult); | ||
return encodedString; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.0.8 | ||
4.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.