docs(android): 修正工具链记录(降Go保pin→SagerNet gomobile fork+5层环境修复)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,12 @@
|
||||
## Global Constraints
|
||||
|
||||
- sing-box 内核版本 `v1.13.12`(`app/kernel/VERSION` 锚定,禁止脚本内硬编码)。
|
||||
- Go 工具链 **降到 `1.24.3`、保 gomobile pin `v0.0.0-20240604150348-70c4c5da7d30`**(贴 SFA 官方验证组合;本机 Go 1.26.1 不动,用官方 `golang.org/dl/go1.24.3` 并存)。
|
||||
- Go 工具链:用官方 `golang.org/dl/go1.24.3` 当启动器(本机 Go 1.26.1 不动);sing-box go.mod 为 `go 1.24.7`,GOTOOLCHAIN=auto 会自动下载并切到 **1.24.7** 编译。
|
||||
- **gomobile = `github.com/sagernet/gomobile@v0.1.12`**(SagerNet fork,非上游 `golang.org/x/mobile`;对照 sing-box v1.13.12 go.mod 与 `cmd/internal/build_libbox`)。原 VERSION 里的上游 pin 是失效 revision。
|
||||
- libbox bind ldflags 必须含 **`-checklinkname=0`**(放行 `badlinkname` 的 `//go:linkname`,Go 1.23+ 默认 checklinkname=1 会拒 `os.checkPidfdOnce` 等,缺则链接失败);build tags 含 `badlinkname,tfogo_checklinkname0`。
|
||||
- 构建需 **JDK**(gomobile bind 末段 javac):用 Android Studio JBR(OpenJDK 21);macOS `/usr/bin/javac` 仅桩。
|
||||
- 国内网络:`GOPROXY=https://goproxy.cn,direct` + `GOSUMDB=sum.golang.google.cn`(proxy.golang.org 连不上)。
|
||||
- Android 构建栈(Flutter 3.44 要求):**Gradle 8.7 + 声明式 plugins block + AGP 8.6.0 + Kotlin 2.2.0**(旧脚手架是 Gradle 8.0/AGP 8.1/命令式插件,全需升级迁移)。
|
||||
- libbox build tags:`with_quic,with_utls,with_clash_api,with_gvisor`(脚本默认,勿改)。
|
||||
- `minSdkVersion 21`(libbox `-androidapi 21` 要求),`targetSdkVersion` 跟随 flutter。
|
||||
- Channel 契约冻结(`pangolin/vpn` + `pangolin/vpn/status` + `pangolin/vpn/stats`),方法签名见 `client/lib/bridge/vpn_bridge.dart`,**不得私改**。
|
||||
|
||||
Reference in New Issue
Block a user