Created
October 11, 2015 13:20
-
-
Save hm0429/858de4b8b40345389c24 to your computer and use it in GitHub Desktop.
TSMC check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Required to include #include <sys/sysctl.h> | |
- (BOOL)isTSMC { | |
size_t size; | |
sysctlbyname("hw.model", NULL, &size, NULL, 0); | |
char *model = (char*)malloc(size); | |
sysctlbyname("hw.model", model, &size, NULL, 0); | |
NSString *modelName = [NSString stringWithCString:model encoding:NSUTF8StringEncoding]; | |
free(model); | |
NSLog(@"modelName: %@", modelName); | |
NSArray *tsmcModels = @[@"N71mAP", @"N66mAP"]; | |
if ([tsmcModels containsObject:modelName]) { | |
NSLog(@"Yay!"); | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// result
2015-10-11 21:19:32.105 HWInfo[2853:1508460] modelName: N71mAP
2015-10-11 21:19:32.106 HWInfo[2853:1508460] Yay!