Skip to content

Commit 85cb0dc

Browse files
committed
add control center patch
1 parent fe1585a commit 85cb0dc

File tree

5 files changed

+96
-2
lines changed

5 files changed

+96
-2
lines changed

oclp_r/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def __init__(self) -> None:
138138

139139
# Patcher Settings
140140
## Internal settings
141+
self.change_control_center: bool = False
141142
self.allow_oc_everywhere: bool = False # Set whether Patcher can be run on unsupported Macs
142143
self.gui_mode: bool = False # Determine whether running in a GUI or TUI
143144
self.cli_mode: bool = True # Determine if running in CLI mode

oclp_r/sys_patch/patchsets/detect.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
legacy_audio,
4444
legacy_usb11,
4545
modern_audio,
46+
Control,
4647
Launch,
4748
modern_usb,
4849
pcie_webcam,
@@ -133,6 +134,7 @@ def __init__(self, constants: constants.Constants,
133134
modern_wireless.ModernWireless,
134135
legacy_audio.LegacyAudio,
135136
modern_audio.ModernAudio,
137+
Control.ModernControl,
136138
Launch.LaunchPad,
137139
voodoo_audio.VoodooAudio,
138140
modern_usb.LegacyUSBHost,
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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()

oclp_r/sys_patch/patchsets/hardware/misc/Launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def requires_kernel_debug_kit(self) -> bool:
3333
"""
3434
Apple no longer provides standalone kexts in the base OS
3535
"""
36-
return True
36+
return False
3737
def native_os(self) -> bool:
3838
"""
3939
- Everything before macOS Tahoe 26 is considered native

oclp_r/wx_gui/gui_settings.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,11 +770,21 @@ def _settings(self) -> dict:
770770
"extensions on Tahoe.",
771771
],
772772
},
773-
"Allow Launchpad Patch": {
773+
"Allow Launchpad Patch (Exp.)": {
774774
"type": "checkbox",
775775
"value": self.constants.change_launchpad,
776776
"variable": "change_launchpad",
777777
"constants_variable": "change_launchpad",
778+
"description": [
779+
"When enabled, this will patch the LaunchPad",
780+
"on Tahoe.",
781+
],
782+
},
783+
"Allow Control Center Patch (Exp.)": {
784+
"type": "checkbox",
785+
"value": self.constants.change_control_center,
786+
"variable": "change_control_center",
787+
"constants_variable": "change_control_center",
778788
"description": [
779789
"When enabled, this will patch the Control",
780790
"Center on Tahoe.",

0 commit comments

Comments
 (0)