//
// IMDeviceHardware.m
// Project
//
// Created by haibara on 12/15/17.
//

#import "IMDeviceHardware.h"
#import <sys/utsname.h>

@implementation IMDeviceHardware

+ (NSString *)platform {
	if (TARGET_IPHONE_SIMULATOR) {
		NSProcessInfo *processInfo = [NSProcessInfo processInfo];
		return processInfo.environment[@"SIMULATOR_MODEL_IDENTIFIER"];
	} else {
		struct utsname systemInfo;
		uname(&systemInfo);
		return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
	}
}

@end
