1+ """
2+ hda_universal_audio.py: Audio patch set for macOS 26
3+ """
4+ from .....detections .amfi_detect import AmfiConfigDetectLevel
5+ from ..base import BaseHardware , HardwareVariant
6+ from ...base import PatchType
7+ from .....constants import Constants
8+ from .....datasets .os_data import os_data
9+ from .....support import utilities
10+ class HDAU (BaseHardware ):
11+
12+ def __init__ (self , xnu_major , xnu_minor , os_build , global_constants : Constants ) -> None :
13+ super ().__init__ (xnu_major , xnu_minor , os_build , global_constants )
14+
15+
16+ def name (self ) -> str :
17+ """
18+ Display name for end users
19+ """
20+ return f"{ self ._trans .get (self .hardware_variant (), self .hardware_variant ())} : HDAUniversal"
21+
22+ def required_amfi_level (self ) -> AmfiConfigDetectLevel :
23+ """
24+ What level of AMFI configuration is required for this patch set
25+ Currently defaulted to AMFI needing to be disabled
26+ """
27+ return AmfiConfigDetectLevel .NO_CHECK
28+
29+ def present (self ) -> bool :
30+ return self ._constants .audio_type == "HDAUniversal" and not self ._constants .hdau_patch_already and not self ._computer .t2_chip
31+
32+
33+ def native_os (self ) -> bool :
34+ if self ._xnu_major < os_data .tahoe .value :
35+ return True
36+ return False
37+
38+
39+ def hardware_variant (self ) -> HardwareVariant :
40+ """
41+ Type of hardware variant
42+ """
43+ return HardwareVariant .AUDIO
44+
45+
46+ def _hdau_audio_patches (self ) -> dict :
47+ """
48+ Patches for Modern Audio
49+ """
50+
51+ return {
52+ "HDAUniversal" : {
53+ # On macOS 26+ /Library is a firmlink to the Data volume, so
54+ # /Library/Extensions and /Library/PreferencePanes no longer exist
55+ # on the System volume. Install to the Data volume instead.
56+ PatchType .OVERWRITE_DATA_VOLUME : {
57+ "/Library/Extensions" : {
58+ "HDAUniversal.kext" :"HDAUniversal" ,
59+ },
60+ },
61+ PatchType .REMOVE_SYSTEM_VOLUME :{
62+ "/Library/Extensions" :[
63+ "VoodooHDA.kext" ,
64+ "AppleHDADisabler.kext" ,
65+ ],
66+ "/Library/PreferencePanes" :[
67+ 'VoodooHDA.prefPane' ,
68+ ]
69+ },
70+ },
71+ }
72+ def patches (self ) -> dict :
73+ """
74+ Patches for HDAUniversal
75+ """
76+ if self .native_os () is True :
77+ return {}
78+
79+ return self ._hdau_audio_patches ()
0 commit comments