Minor verification improvements
This commit is contained in:
@@ -768,7 +768,7 @@
|
||||
DEVELOPMENT_TEAM = Y357EKMWLB;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = "iOS Example/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
@@ -792,7 +792,7 @@
|
||||
DEVELOPMENT_TEAM = Y357EKMWLB;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = "iOS Example/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.tikhop.InAppReceipt.iOS-Example";
|
||||
|
||||
@@ -54,13 +54,13 @@ public extension InAppReceipt
|
||||
}
|
||||
|
||||
#if os(iOS) || os(watchOS) || os(tvOS)
|
||||
guard let v = Bundle.main.infoDictionary?["CFBundleVersion"] as? String,
|
||||
guard let v = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String,
|
||||
v == originalAppVersion else
|
||||
{
|
||||
throw IARError.validationFailed(reason: .bundleVersionVefirication)
|
||||
}
|
||||
#elseif os(macOS)
|
||||
guard let v = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String,
|
||||
guard let v = Bundle.main.infoDictionary?["CFBundleVersion"] as? String,
|
||||
v == originalAppVersion else
|
||||
{
|
||||
throw IARError.validationFailed(reason: .bundleVersionVefirication)
|
||||
@@ -104,13 +104,12 @@ public extension InAppReceipt
|
||||
let opaqueData = opaqueValue
|
||||
let bundleIdData = bundleIdentifierData
|
||||
|
||||
var hash: Array<UInt8> = Array<UInt8>.init(repeating: 0, count: 20)
|
||||
var sha1 = SHA1()
|
||||
hash = try! sha1.update(withBytes: uuidData.bytes)
|
||||
hash = try! sha1.update(withBytes: opaqueData.bytes)
|
||||
hash = sha1.calculate(for: bundleIdData.bytes)
|
||||
try! sha1.update(withBytes: uuidData.bytes)
|
||||
try! sha1.update(withBytes: opaqueData.bytes)
|
||||
let hash = sha1.calculate(for: bundleIdData.bytes)
|
||||
|
||||
return Data(bytes: hash, count: hash.count)
|
||||
return Data(hash)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import UIKit
|
||||
import TPInAppReceipt
|
||||
|
||||
var rBase64 = "You Receupt"
|
||||
var rBase64 = "Your Receipt"
|
||||
|
||||
class ViewController: UIViewController {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user