feat(android): Dart provider 接 Android→VpnNativeBridge(Task 4)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// vpn_bridge_provider.dart — VpnBridge 平台分派
|
||||
//
|
||||
// macOS / Linux / Windows → DesktopVpnBridge(真实子进程)
|
||||
// Android → VpnNativeBridge(内嵌 libbox 的 VpnService,走 pangolin/vpn 通道)
|
||||
// 其他平台(iOS / Web / 测试)→ VpnBridgeMock
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -24,6 +25,9 @@ final vpnBridgeProvider = Provider<VpnBridge>((ref) {
|
||||
if (Platform.isMacOS && kUseNativeVpnMacOS) {
|
||||
return VpnNativeBridge();
|
||||
}
|
||||
if (Platform.isAndroid) {
|
||||
return VpnNativeBridge();
|
||||
}
|
||||
if (Platform.isMacOS || Platform.isLinux || Platform.isWindows) {
|
||||
return DesktopVpnBridge();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user