| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <mach-o/arch.h> | 5 #include <mach-o/arch.h> |
| 6 | 6 |
| 7 #import "SystemInfo.h" | 7 #import "SystemInfo.h" |
| 8 | 8 |
| 9 @implementation SystemInfo | 9 @implementation SystemInfo |
| 10 | 10 |
| 11 + (NSString*)getArch { | 11 + (NSString*)getArch { |
| 12 // NOTE: It seems the below function `NSGetLocalArchInfo` returns an |
| 13 // arch->name that is either "x84_64h" or "i486". |
| 12 const NXArchInfo* arch = NXGetLocalArchInfo(); | 14 const NXArchInfo* arch = NXGetLocalArchInfo(); |
| 13 NSString* archName = [NSString stringWithUTF8String:arch->name]; | 15 NSString* archName = [NSString stringWithUTF8String:arch->name]; |
| 14 return archName; | 16 return archName; |
| 15 } | 17 } |
| 16 | 18 |
| 17 + (NSString*)getOSVersion { | 19 + (NSString*)getOSVersion { |
| 18 NSDictionary* systemVersion = | 20 NSDictionary* systemVersion = |
| 19 [NSDictionary dictionaryWithContentsOfFile: | 21 [NSDictionary dictionaryWithContentsOfFile: |
| 20 @"/System/Library/CoreServices/SystemVersion.plist"]; | 22 @"/System/Library/CoreServices/SystemVersion.plist"]; |
| 21 NSString* versionNumber = [systemVersion objectForKey:@"ProductVersion"]; | 23 NSString* versionNumber = [systemVersion objectForKey:@"ProductVersion"]; |
| 22 | 24 |
| 23 return versionNumber; | 25 return versionNumber; |
| 24 } | 26 } |
| 25 | 27 |
| 26 @end | 28 @end |
| OLD | NEW |