LTS 稳定版:长连接保活修复 + HarmonyOS 桌面托盘 + OHOS 核心/HAP CI - #160
Open
jerry-271828 wants to merge 31 commits into
Open
Conversation
Builds the mihomo/gVisor backend with the OpenHarmony NDK and the OHOS-patched Go toolchain (ohos_golang_go, -tlsmodegd), split into small independently-failing steps. Uploads the arm64-v8a libflclash.so as an artifact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The parent repo pins core to 1638edba, which xfz347/Clash.Meta no longer has
("not our ref"), so git submodule update fails. Clone the default branch tips
instead to unblock the build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
release-branch.go1.24 of ohos_golang_go lacks the legacy -tlsmodegd flag. Newer OHOS Go ports expose a real GOOS=ohos target that handles c-shared TLS natively (and implies the `ohos` build tag), so build with that instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
go1.24 branch gates c-shared off for ohos and lacks -tlsmodegd. Revert to the project's proven recipe (GOOS=linux + c-shared + -tlsmodegd) on release-branch.go1.23. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Only master, release-branch.go1.24, and go1.24_HiShell exist on the mirror; go1.24 lacks -tlsmodegd. master is the only untried branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The public ohos_golang_go branches (go1.24/master) don't carry the -tlsmodegd flag. Vendor moodyhunter/libHv2rayCore's 0001-support-tls-mode-gd.patch (adds the flag + arm64 general-dynamic TLS via TLSDESC + musl c-shared runtime fixes) and apply it to the go1.24 source before make.bash. Cache key now includes the patch hash; link with -fuse-ld=lld per the reference recipe. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The OHOS go1.24 fork has its own edits in flags.go/base.flag.go and rejects the patch. The patch targets upstream go1.24, so clone golang/go release-branch.go1.24 as the base (also drops the flaky gitcode dep); add --fuzz=3 fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Patch was cut against a specific go1.24.x; current release-branch HEAD drifted in flags.go/base.flag.go. Full single-branch clone + git apply --3way merges past it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
moodyhunter/go-tls-mode-gd is go1.26.2 with tls-mode-gd already applied, so clone and make.bash it directly instead of patching stock go and fighting point-release drift. Removes the vendored patch and the apply step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xfz347/Clash.Meta default branch (main) has no go.mod; the OHOS-adapted code + go.mod live on the `ohos` branch (same for likuai2010/gvisor-ohos). Pin both clones to ohos and sanity-check go.mod presence. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The ohos-branch core needs deps not in flclash's pinned go.sum (go-ordered-map, go-chi, sagernet/cors); -mod=mod lets go download + record them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
flclash's pinned go.mod pulls newer metacubex/quic-go+sing-quic than the ohos core (API drift: component/tls vs metacubex/tls). Reinit a minimal go.mod + go mod tidy so ./core's go.mod picks the matching (older) versions. GOTOOLCHAIN=local avoids toolchain auto-download over the flaky network. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- docs/lts-connection-lifecycle-audit.md: call-graph audit proving public LTS has no automatic ClearConnections caller (destructive paths are manual or deliberate profile-switch/recovery only) - docs/lts-stable-build.md: why this build replaces store V2 - version identity 1.7.4-lts-stable.1 (1007048), bundle unchanged (org.xbgroup.clashboxLTS, coexists with store V2) No application-logic change.
- INVESTIGATION-2026-08-11-synchronized-fin.md: full root-cause record (store V2 ~180.5s UI-timer ClearConnections; mechanism, discriminators, exonerations, instrumented-build notes) - latest_analysis.md: UI-execution-gated timer evidence (CPU-measured A/B/A) - VERIFICATION-PROTOCOL.md: instrumented-build + V2 bisection protocol - UPSTREAM-ISSUE-DRAFT.md: issue draft for xiaobaigroup/ClashBox - LTS-BUILD-VALIDATION.md: install guide + on-device validation results (17min + 67min runs, zero automatic wipes, manual clear works)
Machine lock freezes/reclaims background app processes without a continuous task, which kills the ClashBox UI process hosting the proxy core and control plane (Codex and other proxied apps lose connectivity). - Add ProxyKeepAliveService: auto-request TASK_KEEPING continuous task on proxy start (PC/2in1/tablet), release on proxy stop; idempotent, mutually exclusive with user-enabled keep-alive toggles; re-request with bounded retry when the system cancels the task. - ClashViewModel: start keep-alive in StartVpn/ReStartVpn, stop in StopVpn, covering UI, widget-card and core-recovery paths. - EntryAbility: subscribe to screen off/lock/on/unlock common events to reassert the continuous task around lock transitions; the existing 1s recovery loop then restarts the core if the VPN extension was killed.
Add release-hap.yml: rebuilds the native core at the pinned revisions, packages the unsigned release HAP, and publishes it as a GitHub Release (stable release on version-tag pushes, rolling nightly prerelease on manual dispatch). Add !/.github to .gitignore so new workflow files are trackable, and document the unsigned flow in docs/ci-hap-signing.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
本 PR 将 LTS 稳定线(
fix/lts-stable-long-connections)的修复与新功能合并到当前master(基于1fdc47ebrebase,共 31 个提交)。核心内容:修复 Fixes
fix: hold continuous task while proxy runs to survive screen lockfix: synchronize tray proxy selection statefix: refresh proxy duration after tray restorefix: stabilize HarmonyOS status bar lifecycle新功能 Features
TrayManager/ClashTrayHolderAbility,支持桌面托盘展示与代理切换,详见docs/tray-desktop-feature.md.github/workflows/build-core.yml交叉编译libflclash.so(基于 -tlsmodegd 补丁工具链).github/workflows/release-hap.yml构建签名 HAP,并在版本 tag 上发布 unsigned release HAPCI / 构建
xb_components子模块 vendor 进仓库,便于云端构建scripts/ci/下签名 / Profile 生成脚本,及docs/ci-hap-signing.md文档
docs/lts-connection-lifecycle-audit.mddocs/lts-stable-build.md合并说明
master顶端(1fdc47eb),便于 review 与合并build-profile.json5与上游新版本冲突,已按“保留上游 signingConfigs、仅应用本分支的注释清理”解决