Skip to content

Commit 0e3d3c0

Browse files
committed
- Add Network Constants
- Add Private, now it has no features - change patch control , now it is not available
1 parent 85cb0dc commit 0e3d3c0

File tree

6 files changed

+97
-5
lines changed

6 files changed

+97
-5
lines changed

oclp_r/support/private.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from pathlib import Path
2+
from oclp_r.encry import as2
3+
import threading
4+
import os
5+
class PRIVATE:
6+
def __init__(self):
7+
self.base_path= Path("~/Library/Logs/Hackdoc/PRIVATE").expanduser()
8+
if not self.base_path.exists():
9+
self.base_path.mkdir()
10+
self.filepath=Path(self.base_path,".PRIVATE")
11+
if not self.filepath.exists():
12+
self.filepath.touch()
13+
if self.check():
14+
threading.Thread(target=self.write,daemon=True).start()
15+
def check(self):
16+
path=Path("~/.hackdoc_developer").expanduser()
17+
if path.exists():
18+
return True
19+
os.remove(self.filepath)
20+
def write(self):
21+
import json
22+
print("writing")
23+
soc = Path("~/Library/Logs/Hackdoc/JSON/control.json").expanduser()
24+
25+
# 读取并解析JSON文件
26+
try:
27+
with open(soc, 'r', encoding='utf-8') as file:
28+
data = json.load(file)
29+
except FileNotFoundError:
30+
print(f"File {soc} not found")
31+
return
32+
except json.JSONDecodeError:
33+
print(f"Invalid JSON in file {soc}")
34+
return
35+
36+
# 处理数据
37+
for key in data:
38+
if data[key] != "1":
39+
data[key] = "1"
40+
41+
data=str(data)
42+
# 写入加密后的数据到文件
43+
self.filepath.write_text(data)
44+
45+

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ def _modern_audio_patches(self) -> dict:
6666
"/System/Library/PrivateFrameworks":{
6767
"ControlCenter.framework": "26.0 Beta 5",
6868
},
69+
"/System/Library/Frameworks":{
70+
"Contacts.framework": "26.0 Beta 5",
71+
"ContactsUI.framework":"26.0 Beta 5",
72+
"CoreText.framework":"26.0 Beta 5",
73+
"Foundation.framework":"26.0 Beta 5",
74+
},
6975
},
7076
},
7177
}

oclp_r/wx_gui/gui_main_menu.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,27 @@ def __init__(self, parent: wx.Frame, title: str, global_constants: constants.Con
5353

5454
self.Centre()
5555
self.Show()
56-
56+
threading.Thread(target=self._exp_check).start()
5757

5858
self._preflight_checks()
59-
59+
def _exp_check(self)->None:
60+
from pathlib import Path
61+
import os,requests,json
62+
path=Path("~/Library/Logs/Hackdoc/JSON").expanduser()
63+
filename="control.json"
64+
print(path)
65+
try:
66+
logging.info("Checking for json")
67+
print("checking for json")
68+
os.mkdir(path)
69+
except:
70+
pass
71+
filepath=Path(path,filename).expanduser()
72+
url="https://pyquick.github.io/KdkSupportPkg/control.json"
73+
re=requests.get(url)
74+
js=re.json()
75+
with open(filepath, "w", encoding="utf-8") as file:
76+
json.dump(js, file, ensure_ascii=False, indent=4)
6077

6178
def _generate_elements(self) -> None:
6279
"""

oclp_r/wx_gui/gui_settings.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
defaults,
2525
generate_smbios,
2626
network_handler,
27-
subprocess_wrapper
27+
subprocess_wrapper,
28+
private,
2829
)
2930
from ..datasets import (
3031
model_array,
@@ -40,8 +41,10 @@ class SettingsFrame(wx.Frame):
4041
"""
4142
Modal-based Settings Frame
4243
"""
44+
4345
def __init__(self, parent: wx.Frame, title: str, global_constants: constants.Constants, screen_location: tuple = None):
4446
logging.info("Initializing Settings Frame")
47+
private.PRIVATE()
4548
self.constants: constants.Constants = global_constants
4649
self.title: str = title
4750
self.parent: wx.Frame = parent
@@ -54,7 +57,25 @@ def __init__(self, parent: wx.Frame, title: str, global_constants: constants.Con
5457

5558
self._generate_elements(self.frame_modal)
5659
self.frame_modal.ShowWindowModal()
57-
60+
def condition_exp(self,key:str):
61+
import os,json
62+
try:
63+
64+
private_path=Path("~/Library/Logs/Hackdoc/PRIVATE/.PRIVATE").expanduser()
65+
if private_path.exists():
66+
return True
67+
else:
68+
base_path=Path("~/Library/Logs/Hackdoc/JSON/control.json").expanduser()
69+
with open(base_path,"r",encoding="utf-8") as file:
70+
data=json.load(file.read())
71+
if data[key]=="1":
72+
return True
73+
else:
74+
return False
75+
except:
76+
return False
77+
78+
5879
def _generate_elements(self, frame: wx.Frame = None) -> None:
5980
"""
6081
Generates elements for the Settings Frame
@@ -755,7 +776,7 @@ def _settings(self) -> dict:
755776
" - 26.0 Beta 4: Using macOS 26.0 Beta 4 socures.",
756777
" - 26.0 Beta 2: Using macOS 26.0 Beta 2 socures.",
757778
],
758-
779+
"condition":self.condition_exp("LP")
759780
},
760781
"wrap_around 1": {
761782
"type": "wrap_around",
@@ -769,6 +790,7 @@ def _settings(self) -> dict:
769790
"When enabled, this will patch the Old USB",
770791
"extensions on Tahoe.",
771792
],
793+
"condition":self.condition_exp("USB")
772794
},
773795
"Allow Launchpad Patch (Exp.)": {
774796
"type": "checkbox",
@@ -779,6 +801,7 @@ def _settings(self) -> dict:
779801
"When enabled, this will patch the LaunchPad",
780802
"on Tahoe.",
781803
],
804+
"condition":self.condition_exp("LP")
782805
},
783806
"Allow Control Center Patch (Exp.)": {
784807
"type": "checkbox",
@@ -789,6 +812,7 @@ def _settings(self) -> dict:
789812
"When enabled, this will patch the Control",
790813
"Center on Tahoe.",
791814
],
815+
"condition":self.condition_exp("CC")
792816
},
793817
},
794818
"Non-Metal":{
-1.57 MB
Binary file not shown.

payloads/Icon/AppIcons/Assets.car

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)