Commit e827cb2
peer-proxy: add macOS native handler
macOS routes through MethodChannel → Swift → MobileSetPeerShareEnabled
(gomobile-bind) rather than the FFI path that Windows + Linux use.
The previous review fix gated the toggle to PlatformUtils.isFFISupported
to avoid a MissingPluginException on macOS, but per Phase 1 plan macOS
should be supported.
* macos/Runner/Handlers/MethodHandler.swift: new setPeerProxyEnabled
case + setPeerProxyEnabled function calling MobileSetPeerShareEnabled,
plus an isPeerProxyEnabled case calling MobileIsPeerShareEnabled.
Mirrors the existing setBlockAdsEnabled handler exactly. (The
MobileSet/IsPeerShareEnabled gomobile bindings come from the
SetPeerShareEnabled / IsPeerShareEnabled methods added to
lantern-core/mobile/mobile.go in PR 8729; the Liblantern xcframework
needs a rebuild via `make macos-framework` to pick them up.)
* lantern_platform_service.dart: restore the MethodChannel passthrough
for setPeerProxyEnabled / isPeerProxyEnabled. The "not supported on
this platform" stubs from the prior review fix are no longer
appropriate now that there's a native handler.
* vpn_setting.dart: widen the toggle gate from isFFISupported (Windows
+ Linux) to isDesktop (Windows + Linux + macOS).
* radiance_settings_providers.dart: same widening for the
isPeerProxyEnabled probe in _refresh.
Verified locally: `make macos-framework` rebuilds successfully and
exports MobileSetPeerShareEnabled / MobileIsPeerShareEnabled.
flutter analyze clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7329dfa commit e827cb2
4 files changed
Lines changed: 45 additions & 13 deletions
File tree
- lib
- features
- home/provider
- setting
- lantern
- macos/Runner/Handlers
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | 291 | | |
296 | 292 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
305 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
306 | 313 | | |
307 | 314 | | |
308 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
248 | 258 | | |
249 | 259 | | |
250 | 260 | | |
| |||
1131 | 1141 | | |
1132 | 1142 | | |
1133 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1134 | 1158 | | |
1135 | 1159 | | |
1136 | 1160 | | |
| |||
0 commit comments