File tree Expand file tree Collapse file tree 1 file changed +5
-20
lines changed
Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments