Skip to content

Commit a6ceba7

Browse files
committed
Updated to remove hash check
1 parent 48b3aa6 commit a6ceba7

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

BranchSDK/BNCAppleReceipt.m

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,12 @@ - (BOOL)isTestFlight {
6767
+ (BOOL)isReceiptValid {
6868
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
6969
NSData *receiptData = [NSData dataWithContentsOfURL:receiptURL];
70-
71-
if (!receiptData) {
72-
return NO;
73-
}
74-
75-
NSString *receiptHash = [self sha256HashForData:receiptData];
76-
if (receiptHash) {
77-
return YES;
78-
}
79-
80-
return NO;
81-
}
82-
83-
+ (NSString *)sha256HashForData:(NSData *)data {
84-
uint8_t digest[CC_SHA256_DIGEST_LENGTH];
85-
CC_SHA256(data.bytes, (CC_LONG)data.length, digest);
86-
NSMutableString *output = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH * 2];
87-
for (int i = 0; i < CC_SHA256_DIGEST_LENGTH; i++) {
88-
[output appendFormat:@"%02x", digest[i]];
70+
71+
if (receiptData == nil) {
72+
return false;
73+
} else {
74+
return true;
8975
}
90-
return output;
9176
}
9277

9378
@end

0 commit comments

Comments
 (0)