Title: Migrate WireGuard engine from wireguard-go to gotatun (Rust) by kasnder · Pull Request #594 · TrackerControl/tracker-control-android · GitHub
Open Graph Title: Migrate WireGuard engine from wireguard-go to gotatun (Rust) by kasnder · Pull Request #594 · TrackerControl/tracker-control-android
X Title: Migrate WireGuard engine from wireguard-go to gotatun (Rust) by kasnder · Pull Request #594 · TrackerControl/tracker-control-android
Description: Summary Replaces the Go wgbridge module (wireguard-go via gomobile) with a new Rust crate wgbridge-rs/ embedding gotatun 0.7.2, Mullvad's WireGuard® implementation, and removes the Go toolchain from the repo and CI entirely. Motivation: tunnel instability when roaming across networks/borders or under long uptime, higher battery drain, and reduced throughput. Mullvad hit the same wall — over 85% of their app crashes originated in wireguard-go, and after shipping gotatun to all Android users their user-perceived crash rate dropped from 0.40% to 0.01% (announcement). What changed wgbridge-rs/ — gotatun with custom transports for TrackerControl's unusual packet path: IpRecv over the socketpair written by the C hijack (ip.c), IpSend to the VpnService TUN fd with the passive DNS inspection ported from dns.go (test vectors included), and a VpnService.protect()-ed UDP factory that fails closed. Hand-written Java bindings in net.kollnig.missioncontrol.wgbridge with the same API shape as the gomobile-generated classes — WgEgress, the profile generators, and key rotation needed no call-site changes. Roaming fixes (the actual user-facing symptom): on network change or a broken-tunnel verdict, the bridge now rebinds the UDP sockets onto the new default network and re-resolves the peer endpoint (bypassing the 5-min cache) via new Tunnel.rebind() / Tunnel.updateEndpoint() — instead of tearing down and re-handshaking. Escalates to a full restart only if the tunnel breaks again within 90s. Build/CI — wgbridgeBuild Gradle task drives cargo-ndk for all four ABIs with 16KB-aligned LOAD segments (Android 15+); CI installs Rust instead of Go and runs cargo test. Contributor and F-Droid prerequisites documented in wgbridge-rs/README.md. Testing cargo test: 16/16 (DNS parser incl. compression pointers and IPv6 extension headers, UAPI config parsing, X25519 keys incl. RFC 7748 vector) ./gradlew testGithubDebugUnitTest: passes, existing connectivity-monitor tests unchanged ./gradlew assembleGithubDebug: APK bundles libwgbridge.so for all four ABIs (~0.8–1.3 MB each, vs the multi-MB Go runtime), zero Go artifacts, 16KB alignment verified with llvm-readelf ⚠️ Not yet done: on-device end-to-end testing (handshake, Wi-Fi↔cellular roaming recovery, DNS answers reaching the tracker mapping, multi-hour uptime) Notes gotatun is pinned to =0.7.2; its transport traits are the pre-1.0 surface most likely to change. gotatun has no direct "send keepalive now" API, so the monitor's prod pulses persistent_keepalive to 1s and restores it; rebind is triggered by a listen-port toggle that forces gotatun's connection re-setup through our protecting socket factory. 🤖 Generated with Claude Code
Open Graph Description: Summary Replaces the Go wgbridge module (wireguard-go via gomobile) with a new Rust crate wgbridge-rs/ embedding gotatun 0.7.2, Mullvad's WireGuard® implementation, and removes the Go toolchain...
X Description: Summary Replaces the Go wgbridge module (wireguard-go via gomobile) with a new Rust crate wgbridge-rs/ embedding gotatun 0.7.2, Mullvad's WireGuard® implementation, and removes the Go toolc...
Opengraph URL: https://github.com/TrackerControl/tracker-control-android/pull/594
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:34c45938-5513-a357-151a-170ec035f120 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E856:1EF1:1A34A8:27CB6F:6A4BE89D |
| html-safe-nonce | 0cd95776162a9f70758e450289f6accb4ad6adc36b004b4a263bf15d553082f1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODU2OjFFRjE6MUEzNEE4OjI3Q0I2Rjo2QTRCRTg5RCIsInZpc2l0b3JfaWQiOiI2Mzk2Mzk3Mjk5OTU4NTQwNDQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7d35b67d1797c42427e5a67bad2794d855735b89c0602f645cd4ce2c30b0e3c6 |
| hovercard-subject-tag | pull_request:3987128877 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/TrackerControl/tracker-control-android/pull/594/files |
| twitter:image | https://avatars.githubusercontent.com/u/5175206?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5175206?s=400&v=4 |
| og:image:alt | Summary Replaces the Go wgbridge module (wireguard-go via gomobile) with a new Rust crate wgbridge-rs/ embedding gotatun 0.7.2, Mullvad's WireGuard® implementation, and removes the Go toolchain... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0f5d3ba365b3985d75c32a5957c8635488d58dcf027ae6ae958eee7edaa306a2 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/TrackerControl/tracker-control-android git https://github.com/TrackerControl/tracker-control-android.git |
| octolytics-dimension-user_id | 81009368 |
| octolytics-dimension-user_login | TrackerControl |
| octolytics-dimension-repository_id | 220825189 |
| octolytics-dimension-repository_nwo | TrackerControl/tracker-control-android |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 220825189 |
| octolytics-dimension-repository_network_root_nwo | TrackerControl/tracker-control-android |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f24da9b76b42d77b0bb458f810509565e9ba5f1a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width