| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,17 +27,15 @@ class System { | |||
| 27 | 27 | static var name: String? { | |
| 28 | 28 | var systemInfo = utsname() | |
| 29 | 29 | uname(&systemInfo) | |
| 30 | - | ||
| 31 | - if let identifier = String(cString: &systemInfo.machine.0, encoding: .ascii) { | ||
| 32 | - // Simulator Check | ||
| 33 | - if identifier == "x86_64" || identifier == "i386" { | ||
| 34 | - return ProcessInfo.processInfo.environment["SIMULATOR_MODEL_IDENTIFIER"] | ||
| 30 | + let identifier = withUnsafePointer(to: &systemInfo.machine, { | ||
| 31 | + $0.withMemoryRebound(to: CChar.self, capacity: Int(_SYS_NAMELEN)) { | ||
| 32 | + ptr in String(cString: ptr) | ||
| 35 | 33 | } | |
| 36 | - | ||
| 37 | - return identifier | ||
| 34 | + }) | ||
| 35 | + // Simulator Check | ||
| 36 | + if identifier == "x86_64" || identifier == "i386" || identifier == "arm64" { | ||
| 37 | + return ProcessInfo.processInfo.environment["SIMULATOR_MODEL_IDENTIFIER"] | ||
| 38 | 38 | } | |
| 39 | - | ||
| 40 | - | ||
| 41 | - return nil | ||
| 39 | + return identifier | ||
| 42 | 40 | } | |
| 43 | 41 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments