fix(android/kernel): gomobile 改用 SagerNet fork v0.1.12 + 补 linkname tags
原 pin golang.org/x/mobile@v0.0.0-20240604...70c4c5da7d30 是失效 revision; 对照 sing-box v1.13.12 go.mod 与 cmd/internal/build_libbox,官方用 github.com/sagernet/gomobile@v0.1.12;补 badlinkname,tfogo_checklinkname0 以适配 Go 1.24 的 //go:linkname 限制。Task 2 blocker 修复。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+7
-3
@@ -5,12 +5,16 @@
|
||||
# SINGBOX_VERSION : 改为目标 GitHub tag(如 v1.14.0)
|
||||
# 同步更新 fetch-desktop-bin.sh 中的桌面 SHA256 说明
|
||||
# GO_VERSION : 与官方 SFA/SFI CI 保持同步(go1.x.y)
|
||||
# GOMOBILE_VERSION : 对应 golang.org/x/mobile 的 pseudo-version 或 tag
|
||||
# go install golang.org/x/mobile/cmd/gomobile@<GOMOBILE_VERSION>
|
||||
# GOMOBILE_MODULE : gomobile 模块路径。sing-box 官方用 SagerNet fork
|
||||
# (github.com/sagernet/gomobile),非上游 golang.org/x/mobile。
|
||||
# 对照 sing-box <tag> 的 go.mod 与 cmd/internal/build_libbox。
|
||||
# GOMOBILE_VERSION : GOMOBILE_MODULE 的版本 tag(与 sing-box go.mod 同步)
|
||||
# go install ${GOMOBILE_MODULE}/cmd/gomobile@<GOMOBILE_VERSION>
|
||||
# WINTUN_VERSION : Wintun 驱动版本(Windows 专用),保持与 sing-box 推荐版本同步
|
||||
# 下载: https://www.wintun.net/builds/wintun-<WINTUN_VERSION>.zip
|
||||
|
||||
SINGBOX_VERSION=v1.13.12
|
||||
GO_VERSION=1.24.3
|
||||
GOMOBILE_VERSION=v0.0.0-20240604150348-70c4c5da7d30
|
||||
GOMOBILE_MODULE=github.com/sagernet/gomobile
|
||||
GOMOBILE_VERSION=v0.1.12
|
||||
WINTUN_VERSION=0.14.1
|
||||
|
||||
@@ -46,7 +46,10 @@ OUT_AAR="${DIST_DIR}/libbox.aar"
|
||||
BUILD_SRC="${SCRIPT_DIR}/.build/singbox"
|
||||
|
||||
# ── Build tags ────────────────────────────────────────────────────────────────
|
||||
BUILD_TAGS="with_quic,with_utls,with_clash_api,with_gvisor"
|
||||
# 功能 tags(最小集:REALITY/VLESS + Hysteria2(quic) + uTLS + Clash API + gVisor)。
|
||||
# badlinkname,tfogo_checklinkname0 = Go 1.23+ 的 //go:linkname 限制放行
|
||||
# (对齐 sing-box cmd/internal/build_libbox 的 sharedTags,缺则 Go 1.24 编译失败)。
|
||||
BUILD_TAGS="with_quic,with_utls,with_clash_api,with_gvisor,badlinkname,tfogo_checklinkname0"
|
||||
# 取消注释以增加功能(会增大 .so 体积):
|
||||
# BUILD_TAGS="${BUILD_TAGS},with_grpc"
|
||||
# BUILD_TAGS="${BUILD_TAGS},with_ech"
|
||||
@@ -81,10 +84,10 @@ else
|
||||
printf '⚠ 未设置 ANDROID_NDK_HOME / ANDROID_HOME,gomobile init 可能失败\n' >&2
|
||||
fi
|
||||
|
||||
# ── 安装 gomobile ─────────────────────────────────────────────────────────────
|
||||
printf '==> 安装 gomobile@%s…\n' "${GOMOBILE_VERSION}"
|
||||
go install "golang.org/x/mobile/cmd/gomobile@${GOMOBILE_VERSION}"
|
||||
go install "golang.org/x/mobile/cmd/gobind@${GOMOBILE_VERSION}"
|
||||
# ── 安装 gomobile(SagerNet fork,见 VERSION 注释)────────────────────────────
|
||||
printf '==> 安装 %s/cmd/gomobile@%s…\n' "${GOMOBILE_MODULE}" "${GOMOBILE_VERSION}"
|
||||
go install "${GOMOBILE_MODULE}/cmd/gomobile@${GOMOBILE_VERSION}"
|
||||
go install "${GOMOBILE_MODULE}/cmd/gobind@${GOMOBILE_VERSION}"
|
||||
|
||||
printf '==> gomobile init…\n'
|
||||
gomobile init
|
||||
|
||||
Reference in New Issue
Block a user