mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Auth debug email
This commit is contained in:
@@ -372,6 +372,17 @@ public enum DeviceModel: CaseIterable, Equatable {
|
||||
|
||||
public static let current = DeviceModel()
|
||||
|
||||
public static func currentModelCode() -> String {
|
||||
var systemInfo = utsname()
|
||||
uname(&systemInfo)
|
||||
let modelCode = withUnsafePointer(to: &systemInfo.machine) {
|
||||
$0.withMemoryRebound(to: CChar.self, capacity: 1) {
|
||||
ptr in String.init(validatingUTF8: ptr)
|
||||
}
|
||||
}
|
||||
return modelCode ?? "unknown"
|
||||
}
|
||||
|
||||
private init() {
|
||||
var systemInfo = utsname()
|
||||
uname(&systemInfo)
|
||||
|
||||
Reference in New Issue
Block a user