From 41ebaa64e7f516cf505dbf2a8671cf31e4977b4d Mon Sep 17 00:00:00 2001 From: F1248 Date: Wed, 25 Dec 2024 23:52:40 +0100 Subject: [PATCH] Use IORegistry instead of sysctl where possible --- Genius/Models/SystemInformation/Hardware.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Genius/Models/SystemInformation/Hardware.swift b/Genius/Models/SystemInformation/Hardware.swift index 6958cbe..bb440c3 100644 --- a/Genius/Models/SystemInformation/Hardware.swift +++ b/Genius/Models/SystemInformation/Hardware.swift @@ -27,7 +27,7 @@ extension SystemInformation { """ return String(Network.transferURL(url)?.between(start: "", end: "")) }() ?? name.value) - static let identifier = SystemInformationData(Sysctl.read("hw.product")) + static let identifier = SystemInformationData(IORegistry(class: "IOPlatformExpertDevice").read("model")) static let number = SystemInformationData( { guard @@ -105,7 +105,7 @@ extension SystemInformation { #error("Unsupported architecture") #endif }()) - static let name = SystemInformationData(Sysctl.read("machdep.cpu.brand_string")) + static let name = SystemInformationData(IORegistry(name: "product").read("product-soc-name")) static let frequency = SystemInformationData({ Sysctl.read("hw.cpufrequency").map(Frequency.init) }, applicable: type.value == .intel) }