when this objective-c based method call in Simulator, it doesn't matter.
But in real iPhone device, it occurs Thread 1: signal SIGABRT
warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.
here is code
+ (NSData *)aesDecrypt:(NSURL *)url :(NSString *)key {
NSData *data = [NSData dataWithContentsOfURL: url];
if (data == nil) {
NSLog(@"file not found");
return nil;
}
char keyPtr[kCCKeySizeAES128];
bzero(keyPtr, sizeof(keyPtr));
[key getCString:keyPtr maxLength:sizeof(keyPtr)];
size_t bufferSize = [data length] + kCCBlockSizeAES128;
size_t decryptedBytesSize = 0;
void *buffer = malloc(bufferSize);
CCCryptorStatus result = CCCrypt(kCCDecrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding, keyPtr, kCCKeySizeAES128, keyPtr, [data bytes],
[data length], buffer, bufferSize, &decryptedBytesSize);
NSData *decrypted = [NSData dataWithBytes:buffer length:bufferSize];
NSError *error;
if (kCCSuccess != result) {
NSLog(@"aes decrypt error");
return nil;
}
return decrypted;
}
I tried to fix that code several types.
- return other types.
- save NSData to files, and return nothing. read it in swift.
All of my tries can't fix the problems: No problem in Simulator, death in real device - iPhone 6 with iOS 11.3.1



