Verify if the application or its components have been tampered with using bundle IDs, mobile provisioning profiles, or Mach-O file hashes.
Tamper Detection
Pass an array of requirements (e.g., .bundleID, .mobileProvision, .machO) to amITampered(_:).
Manual Hash Verification
Use getMachOFileHashValue(_:) to verify the SHA256 hash of a specific dylib or the main executable (.default).
// Detect tampering via multiple indicators
if IOSSecuritySuite.amITampered([.bundleID("biz.securing.FrameworkClientApp"),
.mobileProvision("2976c70b56e9ae1e2c8e8b231bf6b0cff12bbbd0a593f21846d9a004dd181be3"),
.machO("IOSSecuritySuite", "6d8d460b9a4ee6c0f378e30f137cebaf2ce12bf31a2eef3729c36889158aa7fc")]).result {
print("I have been Tampered.")
}
// Verify dylib hash
if let hashValue = IOSSecuritySuite.getMachOFileHashValue(.custom("IOSSecuritySuite")), hashValue == "6d8d460b9a4ee6c0f378e30f137cebaf2ce12bf31a2eef3729c36889158aa7fc" {
print("I have not been Tampered.")
}
// Verify main executable hash
if let hashValue = IOSSecuritySuite.getMachOFileHashValue(.default), hashValue == "your-application-executable-hash-value" {
print("I have not been Tampered.")
}