Skip to content

Commit 25c66b6

Browse files
committed
fix(shell): use built-in core URL resolution
1 parent fbff9fc commit 25c66b6

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

py/test_installer_contract.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ def test_commit_locked_package_flow(self) -> None:
121121
self.assertIn('PACKAGE_MAX_ROUNDS="${PACKAGE_MAX_ROUNDS:-2}"', content)
122122
self.assertNotIn("OpenClash@package/dev/", content)
123123

124+
def test_core_update_uses_builtin_url_resolution(self) -> None:
125+
expected_call = '"$core_script" "$core_type" ||'
126+
invalid_prefix_argument = (
127+
'"$core_script" "$core_type" "https://testingcf.jsdelivr.net/"'
128+
)
129+
for path, content in ((LIGHT, self.light), (FULL, self.full)):
130+
with self.subTest(path=path.name):
131+
self.assertIn(expected_call, content)
132+
self.assertNotIn(invalid_prefix_argument, content)
133+
124134
def test_full_installer_resource_and_smart_contract(self) -> None:
125135
required = (
126136
"auto_smart_switch",

shell/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,10 @@ CPU 检测保留 x86_64 v1/v2/v3、x86、ARM、MIPS、LoongArch、RISC-V 和 s39
9191
插件覆盖重装后,安装器调用:
9292

9393
```sh
94-
/usr/share/openclash/openclash_core.sh \
95-
"<Meta 或 Smart>" \
96-
"https://testingcf.jsdelivr.net/"
94+
/usr/share/openclash/openclash_core.sh "<Meta 或 Smart>"
9795
```
9896

99-
内核类型遵循 OpenClash 当前设置:`smart_enable=1` 时使用 Smart,否则读取 `core_type`,空值默认为 Meta。下载、重试、解压、配置测试、替换和重启决策由 OpenClash 内置脚本负责。
97+
内核类型遵循 OpenClash 当前设置:`smart_enable=1` 时使用 Smart,否则读取 `core_type`,空值默认为 Meta。安装器不传入第二参数;当前 OpenClash 会将第二参数视为完整内核下载 URL,而 CDN 前缀已通过 `github_address_mod=https://testingcf.jsdelivr.net/` 写入。下载、重试、解压、配置测试、替换和重启决策由 OpenClash 内置脚本负责。
10098

10199
最后两个安装器都执行:
102100

shell/install_openclash_dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ run_core_update() {
613613
[ -x "$core_script" ] || return 1
614614
core_type=$(get_effective_core_type)
615615
log_info "调用 OpenClash 内置内核流程:$core_type"
616-
"$core_script" "$core_type" "https://testingcf.jsdelivr.net/" ||
616+
"$core_script" "$core_type" ||
617617
log_warn "内置内核脚本返回非零;请查看 $OPENCLASH_LOG"
618618
log_info "内核实际远端更新结果请查看 $OPENCLASH_LOG"
619619
}

shell/install_openclash_dev_update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ run_core_update() {
621621
[ -x "$core_script" ] || return 1
622622
core_type=$(get_effective_core_type)
623623
log_info "调用 OpenClash 内置内核流程:$core_type"
624-
"$core_script" "$core_type" "https://testingcf.jsdelivr.net/" ||
624+
"$core_script" "$core_type" ||
625625
log_warn "内置内核脚本返回非零;请查看 $OPENCLASH_LOG"
626626
log_info "内核实际远端更新结果请查看 $OPENCLASH_LOG"
627627
}

0 commit comments

Comments
 (0)