🛸 Sync 2026-10-27 02:27:08

This commit is contained in:
github-actions[bot] committed 2026-10-27 02:27:08 +08:00
1 parent b3798acf79
commit 8b63d5d4a9
78 files changed
+2288 -518

No files matched your search

+10 -3
View File
@@ -5,14 +5,14 @@ PKG_UPSTREAM_VERSION:=1.19.33
PKG_UPSTREAM_TAG:=v$(PKG_UPSTREAM_VERSION)
PKG_SHORT_SHA:=3f27ef3
PKG_VERSION:=2026.10.25.$(PKG_UPSTREAM_VERSION)
PKG_RELEASE:=19
PKG_VERSION:=2026.10.26-r3
PKG_RELEASE:=20
PKG_SOURCE:=$(PKG_NAME)-stable-$(PKG_UPSTREAM_TAG)-$(PKG_SHORT_SHA).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-stable-$(PKG_UPSTREAM_TAG)-$(PKG_SHORT_SHA)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_SOURCE_URL:=https://github.com/kenzok8/openwrt-clashoo/releases/download/mihomo-src
PKG_SOURCE_VERSION:=57468807be288af4250181a024e29c2971eb228c
PKG_SOURCE_VERSION:=392b4ed33f99b4025cf2ec0054993d01d86a085a
PKG_HASH:=skip
PKG_BUILD_VERSION:=$(PKG_UPSTREAM_TAG)
@@ -128,6 +128,13 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
rm -f /usr/share/clashoo/cuslist.sh /usr/share/clashoo/groups.sh /usr/share/clashoo/load_groups.sh /usr/share/clashoo/panel_diag.sh
rm -f /usr/share/clashoo/rmlist.sh /usr/share/clashoo/uplist.sh /usr/share/clashoo/rpc_restart_async.sh /usr/share/clashoo/rpc_update_china_ip_async.sh
rm -rf /usr/share/clashoo/create
# 旧方案把 stable 内核放在 /usr/bin/mihomo-stable,现方案改用
# /usr/libexec/clashoo/mihomo-stable(随包)+ /usr/share/clashoo/bin/(自定义下载)。
# preinst 已把它抄到 /usr/share/clashoo/bin/mihomo-stable,确认内容相同后才删
# 旧位置;目标已有其他自定义内核时保留旧文件,避免误删。
if [ -f /usr/share/clashoo/bin/mihomo-stable ] && [ -f /usr/bin/mihomo-stable ] && [ ! -L /usr/bin/mihomo-stable ] && cmp -s /usr/bin/mihomo-stable /usr/share/clashoo/bin/mihomo-stable; then
rm -f /usr/bin/mihomo-stable
fi
/usr/share/clashoo/migrate_lan_acl.sh >/dev/null 2>&1 || true
/usr/share/clashoo/migrate_fake_ip_filter.sh >/dev/null 2>&1 || true
/usr/share/clashoo/detect_core_arch.sh >/dev/null 2>&1 || true
+5 -1
View File
@@ -2099,7 +2099,11 @@ _finish_geo_bootstrap() {
read need_mmdb need_geosite < /var/run/clashoo_bootstrap_pending 2>/dev/null
log_msg "Bootstrap: fetching geo data via proxy" "引导模式:正在通过代理补全 Geo 数据"
/usr/share/clashoo/update/geoip.sh >/dev/null 2>&1
if [ "$need_geosite" = "1" ]; then
/usr/share/clashoo/update/geoip.sh --require-geosite >/dev/null 2>&1
else
/usr/share/clashoo/update/geoip.sh >/dev/null 2>&1
fi
still=0
[ "$need_mmdb" = "1" ] && ! _has_valid_local_mmdb && still=1
@@ -120,7 +120,6 @@ set clashoo_china6 {
2400:5280:1400::/38,
2400:5280:1c00::/38,
2400:5280:3400::/38,
2400:5280:4c00::/38,
2400:5280:5000::/36,
2400:5280:6000::/35,
2400:5280:8000::/34,
@@ -962,6 +961,7 @@ set clashoo_china6 {
2402:7d80::/32,
2402:7da0::/32,
2402:7e20::/32,
2402:7ee0::/32,
2402:8180::/32,
2402:8300::/32,
2402:8380::/32,
@@ -1791,7 +1791,11 @@ set clashoo_china6 {
2405:84c0:8050::/48,
2405:84c0:8053::/48,
2405:84c0:8058::/45,
2405:84c0:8060::/43,
2405:84c0:8061::/48,
2405:84c0:8062::/47,
2405:84c0:8064::/46,
2405:84c0:8068::/45,
2405:84c0:8070::/44,
2405:84c0:8080::/41,
2405:84c0:8100::/40,
2405:84c0:8200::/39,
@@ -2050,7 +2054,10 @@ set clashoo_china6 {
2406:840:8a0::/43,
2406:840:8c0::/42,
2406:840:900::/40,
2406:840:a00::/44,
2406:840:a01::/48,
2406:840:a02::/47,
2406:840:a04::/46,
2406:840:a08::/45,
2406:840:a12::/47,
2406:840:a14::/46,
2406:840:a18::/45,
@@ -2248,7 +2255,8 @@ set clashoo_china6 {
2406:840:9610::/44,
2406:840:9630::/44,
2406:840:9640::/43,
2406:840:9660::/46,
2406:840:9660::/48,
2406:840:9662::/47,
2406:840:9664::/47,
2406:840:9667::/48,
2406:840:9668::/45,
@@ -2272,6 +2280,7 @@ set clashoo_china6 {
2406:840:9900::/42,
2406:840:9940::/43,
2406:840:9960::/47,
2406:840:9963::/48,
2406:840:9965::/48,
2406:840:9968::/46,
2406:840:996d::/48,
@@ -3144,8 +3153,7 @@ set clashoo_china6 {
240b:4006::/48,
240b:4006:1000::/43,
240b:4006:1020::/44,
240b:4006:1100::/45,
240b:4006:110c::/46,
240b:4006:1100::/44,
240b:4006:1110::/45,
240b:4006:1118::/46,
240b:4007::/32,
@@ -3261,8 +3269,6 @@ set clashoo_china6 {
2605:9d80:9042::/48,
2605:9d80:9071::/48,
2605:9d80:9092::/48,
2620:57:4004::/47,
2804:1e48:9002::/48,
2a03:f900::/29,
2a04:3e00::/48,
2a04:3e00:2::/47,
@@ -394,16 +394,13 @@ set clashoo_china {
43.92.0.0/15,
43.94.0.0/18,
43.96.0.0/23,
43.96.2.130/32,
43.96.3.0/24,
43.96.4.0/22,
43.96.8.0/22,
43.96.16.130/32,
43.96.18.0/24,
43.96.20.0/22,
43.96.24.0/22,
43.96.32.0/22,
43.96.36.130/32,
43.96.40.0/24,
43.96.42.0/24,
43.96.44.0/23,
@@ -414,7 +411,6 @@ set clashoo_china {
43.96.62.0/23,
43.96.64.0/21,
43.96.72.0/22,
43.96.77.131/32,
43.96.78.0/24,
43.96.80.0/23,
43.96.85.0/24,
@@ -459,8 +455,7 @@ set clashoo_china {
43.123.0.0/17,
43.123.128.0/18,
43.124.0.0/16,
43.125.0.0/20,
43.125.24.0/21,
43.125.0.0/19,
43.125.32.0/20,
43.125.48.0/21,
43.126.0.0/17,
@@ -805,6 +800,7 @@ set clashoo_china {
45.117.68.0/22,
45.117.124.0/22,
45.117.252.0/22,
45.119.42.0/23,
45.119.60.0/22,
45.119.64.0/21,
45.119.72.0/22,
@@ -1124,6 +1120,7 @@ set clashoo_china {
47.246.192.0/20,
47.246.208.0/23,
47.246.212.0/22,
47.246.216.0/22,
47.250.0.0/18,
47.250.68.0/22,
47.250.72.0/21,
@@ -1478,8 +1475,7 @@ set clashoo_china {
103.8.108.0/22,
103.8.156.0/22,
103.8.200.0/21,
103.8.221.0/24,
103.8.222.0/23,
103.8.220.0/22,
103.9.8.0/22,
103.9.24.0/22,
103.9.108.0/22,
@@ -2113,7 +2109,6 @@ set clashoo_china {
103.89.184.0/21,
103.89.192.0/19,
103.89.224.0/21,
103.90.51.0/24,
103.90.52.0/22,
103.90.56.0/23,
103.90.92.0/22,
@@ -2683,6 +2678,7 @@ set clashoo_china {
103.186.228.0/23,
103.189.92.0/23,
103.189.152.0/22,
103.189.197.0/24,
103.190.20.0/23,
103.190.71.0/24,
103.190.104.0/23,
@@ -4062,10 +4058,6 @@ set clashoo_china {
124.67.0.0/16,
124.68.16.0/20,
124.68.64.0/18,
124.68.176.0/20,
124.68.224.0/20,
124.68.244.0/22,
124.68.248.0/21,
124.69.0.0/16,
124.70.0.0/16,
124.71.0.0/17,
@@ -4445,6 +4437,7 @@ set clashoo_china {
160.202.62.0/24,
160.202.148.0/22,
160.202.152.0/22,
160.202.210.0/23,
160.202.212.0/22,
160.202.216.0/21,
160.202.224.0/19,
@@ -4741,6 +4734,7 @@ set clashoo_china {
192.140.160.0/19,
192.140.192.0/20,
192.140.208.0/21,
192.140.244.0/23,
192.144.128.0/17,
192.163.11.0/24,
192.232.34.0/23,
@@ -6497,12 +6491,14 @@ set clashoo_china {
223.112.0.0/14,
223.116.0.0/15,
223.121.128.0/17,
223.122.4.0/22,
223.122.12.0/22,
223.122.5.0/24,
223.122.6.0/23,
223.122.13.0/24,
223.122.14.0/23,
223.122.18.0/23,
223.122.20.0/22,
223.122.26.0/23,
223.122.28.0/22,
223.122.28.0/23,
223.123.196.0/22,
223.123.204.0/22,
223.123.208.0/20,
Binary file not shown.
Binary file not shown.
@@ -296,20 +296,27 @@ load_github_urls() {
return 0
}
# `~` 是版本里的预发布分隔符,而 release 资产文件名会把它换成 `.`
# (clashoo_2026.10.25.6780eee-r3_x86_64.ipk 对应已安装的 2026.10.25~6780eee-r3)。
# 只比分隔符就会误判成「校验失败」,所以比较前统一归一化,解析时保持文件名原样。
version_equal() {
[ -n "$1" ] && [ "$(printf '%s' "$1" | tr '~' '.')" = "$(printf '%s' "$2" | tr '~' '.')" ]
}
package_version_from_url() {
file="${1##*/}"
case "$file" in
clashoo_*_"$ARCH".ipk)
v="${file#clashoo_}"
v="${v%_${ARCH}.ipk}"
printf '%s\n' "$v" | sed 's/^\([0-9][0-9][0-9][0-9]\.[0-9][0-9]*\.[0-9][0-9]*\)\./\1~/'
printf '%s\n' "${v%_${ARCH}.ipk}"
;;
clashoo_*.ipk) printf '%s\n' "$file" | sed -n 's/^clashoo_\(.*\)_[^_][^_]*\.ipk$/\1/p' | sed 's/^\([0-9][0-9][0-9][0-9]\.[0-9][0-9]*\.[0-9][0-9]*\)\./\1~/' ;;
# 架构名本身可能带下划线(aarch64_generic / arm_cortex-a7_neon-vfpv4),
# 只截到版本号为止,否则尾巴会混进版本串。
clashoo_*.ipk) printf '%s\n' "$file" | sed -n 's/^clashoo_\([^_]*\)_.*\.ipk$/\1/p' ;;
luci-app-clashoo_*.ipk) printf '%s\n' "$file" | sed -n 's/^luci-app-clashoo_\(.*\)_all\.ipk$/\1/p' ;;
luci-i18n-clashoo-zh-cn_*.ipk) printf '%s\n' "$file" | sed -n 's/^luci-i18n-clashoo-zh-cn_\(.*\)_all\.ipk$/\1/p' ;;
clashoo-*.apk)
v="$(printf '%s\n' "$file" | sed -n -e 's/^clashoo-\(.*-r[0-9][0-9]*\)-.*\.apk$/\1/p' -e 's/^clashoo-\(.*-r[0-9][0-9]*\)\.apk$/\1/p' | head -n 1)"
printf '%s\n' "$v" | sed 's/^\([0-9][0-9][0-9][0-9]\.[0-9][0-9]*\.[0-9][0-9]*\)\./\1~/'
printf '%s\n' "$file" | sed -n -e 's/^clashoo-\(.*-r[0-9][0-9]*\)-.*\.apk$/\1/p' -e 's/^clashoo-\(.*-r[0-9][0-9]*\)\.apk$/\1/p' | head -n 1
;;
luci-app-clashoo-*.apk) printf '%s\n' "$file" | sed -n -e 's/^luci-app-clashoo-\(.*-r[0-9][0-9]*\)-.*\.apk$/\1/p' -e 's/^luci-app-clashoo-\(.*-r[0-9][0-9]*\)\.apk$/\1/p' | head -n 1 ;;
luci-i18n-clashoo-zh-cn-*.apk) printf '%s\n' "$file" | sed -n -e 's/^luci-i18n-clashoo-zh-cn-\(.*-r[0-9][0-9]*\)-.*\.apk$/\1/p' -e 's/^luci-i18n-clashoo-zh-cn-\(.*-r[0-9][0-9]*\)\.apk$/\1/p' | head -n 1 ;;
@@ -405,14 +412,14 @@ run_pkg_update() {
core_ver_before="$(installed_package_version clashoo)"
apk_core_ready() {
package_installed clashoo && [ "$(installed_package_version clashoo)" = "$core_ver" ] \
package_installed clashoo && version_equal "$(installed_package_version clashoo)" "$core_ver" \
&& [ -x /etc/init.d/clashoo ] && [ -x /usr/share/clashoo/update/component_update.sh ]
}
apk_luci_ready() {
package_installed luci-app-clashoo && [ "$(installed_package_version luci-app-clashoo)" = "$luci_ver" ] \
package_installed luci-app-clashoo && version_equal "$(installed_package_version luci-app-clashoo)" "$luci_ver" \
&& { [ -z "$I18N_URL" ] || { package_installed luci-i18n-clashoo-zh-cn \
&& [ "$(installed_package_version luci-i18n-clashoo-zh-cn)" = "$i18n_ver" ]; }; } \
&& version_equal "$(installed_package_version luci-i18n-clashoo-zh-cn)" "$i18n_ver"; }; } \
&& [ -r /usr/share/luci/menu.d/luci-app-clashoo.json ] \
&& [ -r /usr/share/rpcd/ucode/luci.clashoo ]
}
@@ -434,7 +441,7 @@ run_pkg_update() {
cur_ver="$(installed_package_version clashoo)"
if [ "$PM" = "apk" ] && apk_update_ready; then
finish 0 "Clashoo 核心已是最新版本"
elif [ "$PM" != "apk" ] && [ -n "$core_ver" ] && [ "$cur_ver" = "$core_ver" ]; then
elif [ "$PM" != "apk" ] && version_equal "$cur_ver" "$core_ver"; then
finish 0 "Clashoo 核心已是最新版本"
fi
else
@@ -442,7 +449,7 @@ run_pkg_update() {
cur_ver="$(installed_package_version luci-app-clashoo)"
if [ "$PM" = "apk" ] && apk_update_ready; then
finish 0 "客户端已是最新版本"
elif [ "$PM" != "apk" ] && [ -n "$luci_ver" ] && [ "$cur_ver" = "$luci_ver" ]; then
elif [ "$PM" != "apk" ] && version_equal "$cur_ver" "$luci_ver"; then
finish 0 "客户端已是最新版本"
fi
fi
@@ -532,11 +539,11 @@ run_pkg_update() {
apk_update_ready || validation_failed
fi
elif [ "$which" = "clashoo" ]; then
package_installed clashoo && [ "$(installed_package_version clashoo)" = "$core_ver" ] \
package_installed clashoo && version_equal "$(installed_package_version clashoo)" "$core_ver" \
&& [ -x /etc/init.d/clashoo ] && [ -x /usr/share/clashoo/update/component_update.sh ] \
|| validation_failed
else
package_installed luci-app-clashoo && [ "$(installed_package_version luci-app-clashoo)" = "$luci_ver" ] \
package_installed luci-app-clashoo && version_equal "$(installed_package_version luci-app-clashoo)" "$luci_ver" \
&& [ -r /usr/share/luci/menu.d/luci-app-clashoo.json ] \
&& [ -r /usr/share/rpcd/ucode/luci.clashoo ] \
|| validation_failed
@@ -12,6 +12,8 @@ cfg_mmdb_url="$(uci -q get clashoo.config.geoip_mmdb_url 2>/dev/null)"
cfg_geosite_url="$(uci -q get clashoo.config.geosite_url 2>/dev/null)"
cfg_geoip_dat_url="$(uci -q get clashoo.config.geoip_dat_url 2>/dev/null)"
cfg_geoip_asn_url="$(uci -q get clashoo.config.geoip_asn_url 2>/dev/null)"
require_geosite=0
[ "$1" = "--require-geosite" ] && require_geosite=1
DEFAULT_MMDB_URL="https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb"
DEFAULT_GEOSITE_URL="https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/release/geosite.dat"
@@ -36,6 +38,10 @@ cleanup() {
}
config_needs_geosite() {
_cfg="$(uci -q get clashoo.config.use_config 2>/dev/null)"
if [ -s "$_cfg" ] && grep -Eq "^[[:space:]]*-[[:space:]]*[\"']?GEOSITE,|^[[:space:]]*geosite:[[:space:]]*|^[[:space:]]*'geosite:|^[[:space:]]*-[[:space:]]*[\"']?geosite:" "$_cfg"; then
return 0
fi
_cfg="/etc/clashoo/config.yaml"
[ -f "$_cfg" ] || return 1
grep -Eq "^[[:space:]]*-[[:space:]]*[\"']?GEOSITE,|^[[:space:]]*geosite:[[:space:]]*|^[[:space:]]*'geosite:|^[[:space:]]*-[[:space:]]*[\"']?geosite:" "$_cfg"
@@ -133,19 +139,19 @@ download_geosite() {
size=0
if [ -z "$url" ]; then
log "GeoSite.dat skip (url empty)"
return 0
return 1
fi
rm -f "$tmp_target" >/dev/null 2>&1
if ! download_to "$url" "$tmp_target"; then
rm -f "$tmp_target" >/dev/null 2>&1
log "GeoSite.dat update failed"
return 0
return 1
fi
size=$(wc -c <"$tmp_target" 2>/dev/null)
if [ -z "$size" ] || [ "$size" -lt "$GEOSITE_MIN_SIZE" ]; then
log "GeoSite.dat download invalid or incomplete (${size:-0} bytes)"
rm -f "$tmp_target" >/dev/null 2>&1
return 0
return 1
fi
mv -f "$tmp_target" /etc/clashoo/GeoSite.dat >/dev/null 2>&1 || return 1
cp -f /etc/clashoo/GeoSite.dat /etc/clashoo/geosite.dat >/dev/null 2>&1 || true
@@ -248,8 +254,10 @@ if [ "$geoip_source" != "1" ]; then
fi
log "Country.mmdb updated"
if config_needs_geosite; then
download_geosite "$geosite_url"
if [ "$require_geosite" -eq 1 ] || config_needs_geosite; then
if ! download_geosite "$geosite_url"; then
exit 1
fi
else
log "GeoSite.dat skip (no geosite reference in config)"
fi
@@ -257,6 +265,13 @@ if [ "$geoip_source" != "1" ]; then
download_optional "$geoip_asn_url" /etc/clashoo/GeoLite2-ASN.mmdb "GeoLite2-ASN.mmdb"
fi
if [ "$geoip_source" = "1" ] && { [ "$require_geosite" -eq 1 ] || config_needs_geosite; }; then
geosite_url="${cfg_geosite_url:-$DEFAULT_GEOSITE_URL}"
if ! download_geosite "$geosite_url"; then
exit 1
fi
fi
touch /var/run/geoip_down_complete >/dev/null 2>&1
if pidof mihomo >/dev/null 2>&1 || pidof clash-meta >/dev/null 2>&1; then