Auth debug email

This commit is contained in:
Isaac
2025-09-12 10:55:11 +02:00
parent ebcd0557e5
commit 842711de04
6 changed files with 82 additions and 47 deletions

View File

@@ -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)