1+ """
2+ Control.py: Control Center patch set for macOS 26 B6+
3+ DO NOT USE ON MACOS SEQUOIA
4+ """
5+
6+ from ..base import BaseHardware , HardwareVariant
7+
8+ from ...base import PatchType
9+
10+ from .....constants import Constants
11+
12+ from .....datasets .os_data import os_data
13+
14+ from .....support import utilities
15+
16+
17+ class ModernControl (BaseHardware ):
18+
19+ def __init__ (self , xnu_major , xnu_minor , os_build , global_constants : Constants ) -> None :
20+ super ().__init__ (xnu_major , xnu_minor , os_build , global_constants )
21+
22+ def name (self ) -> str :
23+ """
24+ Display name for end users
25+ """
26+ return f"{ self .hardware_variant ()} : Control Center"
27+
28+
29+ def present (self ) -> bool :
30+ return self ._constants .change_control_center
31+ def requires_kernel_debug_kit (self ) -> bool :
32+ """
33+ Apple no longer provides standalone kexts in the base OS
34+ """
35+ return False
36+ def native_os (self ) -> bool :
37+ """
38+ - Everything before macOS Tahoe 26 is considered native
39+ """
40+ if self ._xnu_major < os_data .tahoe .value :
41+ return True
42+ if self ._os_build == "25A5279m" or self ._os_build == "25A5295e" or self ._os_build == "25A5306g" or self ._os_build == "25A5316i" or self ._os_build == "25A5327h" :
43+ return True
44+ return False
45+
46+
47+ def hardware_variant (self ) -> HardwareVariant :
48+ """
49+ Type of hardware variant
50+ """
51+ return HardwareVariant .MISCELLANEOUS
52+
53+
54+ def _modern_audio_patches (self ) -> dict :
55+ """
56+ Patches for Modern Audio
57+ """
58+ return {
59+ "Control Center" : {
60+ PatchType .OVERWRITE_SYSTEM_VOLUME : {
61+ "/System/Library/CoreServices" : {
62+ "ControlCenter.app" : f"26.0 Beta 5" ,
63+ },
64+ },
65+ PatchType .MERGE_SYSTEM_VOLUME :{
66+ "/System/Library/PrivateFrameworks" :{
67+ "ControlCenter.framework" : "26.0 Beta 5" ,
68+ },
69+ },
70+ },
71+ }
72+
73+
74+ def patches (self ) -> dict :
75+ """
76+ Patches for modern audio
77+ """
78+ if self .native_os () is True :
79+ return {}
80+
81+ return self ._modern_audio_patches ()
0 commit comments