Refactor sound hardware check

This commit is contained in:
Hoang Hong Quan
2025-03-21 22:26:11 +07:00
parent 9daa272e44
commit 91982b1751

View File

@@ -125,8 +125,8 @@ class KextMaestro:
self.utils.parse_darwin_version(macos_version) >= self.utils.parse_darwin_version("23.0.0"):
selected_kexts.append("RestrictEvents")
if hardware_report.get("Sound"):
if list(hardware_report.get("Sound").items())[0][-1].get("Device ID") in codec_layouts.data:
for codec_properties in hardware_report.get("Sound", {}).values():
if codec_properties.get("Device ID") in codec_layouts.data:
selected_kexts.append("AppleALC")
if "AMD" in hardware_report.get("CPU").get("Manufacturer") and self.utils.parse_darwin_version(macos_version) >= self.utils.parse_darwin_version("21.4.0") or \