Skip to content

Commit 99a2518

Browse files
pyquickCopilot
andcommitted
fix kdk download showing
Co-authored-by: Copilot <copilot@github.com>
1 parent 89b1f87 commit 99a2518

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

oclp_r/datasets/os_data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def kernel_to_os(kernel: int) -> str:
6363
Returns:
6464
str: OS version
6565
"""
66-
if kernel >= os_data.big_sur:
66+
if kernel >= os_data.tahoe:
67+
return str((kernel + 1))
68+
elif kernel >= os_data.big_sur and kernel < os_data.tahoe:
6769
return str((kernel - 9))
6870
else:
6971
return str((f"10.{kernel - 4}"))

oclp_r/support/translate_language.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,6 +2506,7 @@ def gui_sys_patch_display(self):
25062506
def gui_sys_patch_start(self):
25072507
if self.language_point=="English":
25082508
trans={
2509+
"KDK checksum validation failed":"KDK checksum validation failed",
25092510
"An internal error occurred while running the Root Patcher:\n":"An internal error occurred while running the Root Patcher:\n",
25102511
"Starting root patching":"Starting root patching",
25112512
"Metallib installation complete":"Metallib installation complete",
@@ -2551,6 +2552,7 @@ def gui_sys_patch_start(self):
25512552
}
25522553
elif self.language_point=="简体中文":
25532554
trans={
2555+
"KDK checksum validation failed":"KDK 校验失败",
25542556
"Built from source, running from socure":"以源代码运行",
25552557
"- Patch {patch} not installed":"- 补丁 {patch} 未安装",
25562558
"No new patches detected for system":"没有新的系统补丁",

oclp_r/wx_gui/gui_KDK_download.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,31 @@ def _fetch_installers():
7474
KDK_API_LINK=self.constants.kdk_api_link
7575
response = requests.get(KDK_API_LINK,verify=False)
7676
self.kdk_data = response.json()
77+
7778
self.kdk_data_latest = []
78-
kdk_data_number=[]
79-
kdk_data_build=[]
79+
kdk_data_number=[] #大版本number的合集
80+
kdk_data_build=[] #所有版本的合集
8081
maxnx=[]
82+
#处理kdk的 seen 和 url参数
8183
for i in range(len(self.kdk_data)):
8284
self.kdk_data[i]['seen']=((self.kdk_data[i]['seen']).split("T"))[0]
83-
8485
if self.constants.github_proxy_link=="gh-proxy":
8586
self.kdk_data[i]['url']="https://gh-proxy.com/"+self.kdk_data[i]['url']
8687
if self.constants.github_proxy_link=="ghfast":
8788
self.kdk_data[i]['url']="https://ghfast.top/"+self.kdk_data[i]['url']
8889
if self.constants.github_proxy_link=="ghllkk":
8990
self.kdk_data[i]['url']="https://gh.llkk.cc/"+self.kdk_data[i]['url']
91+
9092
for i in range(len(self.kdk_data)):
91-
data=self.kdk_data[i]["build"][:2]
92-
data2=self.kdk_data[i]["build"]
93-
kdk_data_number.append(data)
94-
kdk_data_build.append(data2)
93+
data=self.kdk_data[i]["build"][:2] # 获取build大版本,darwin的版本
94+
data2=self.kdk_data[i]["build"] #获取build的完整版本
95+
96+
kdk_data_number.append(data) #增加版本
97+
kdk_data_number.sort(reverse=True)
98+
kdk_data_build.append(data2)
99+
kdk_data_build.sort(reverse=True)
100+
logging.info(f"kdk_data_number: {kdk_data_number}")
101+
logging.info(f"kdk_data_build: {kdk_data_build}")
95102
for i in range(4):
96103
maxn=kdk_data_number[0]
97104
while True:

0 commit comments

Comments
 (0)