11import 'dart:convert' ;
22import 'dart:async' ;
33import 'dart:math' ;
4- import 'package:flutter_v2ray /flutter_v2ray.dart' ;
4+ import 'package:flutter_v2ray_client /flutter_v2ray.dart' ;
55import 'package:http/http.dart' as http;
66import 'package:shared_preferences/shared_preferences.dart' ;
77import 'package:proxycloud/models/v2ray_config.dart' ;
@@ -123,14 +123,14 @@ class V2RayService extends ChangeNotifier {
123123 static final V2RayService _instance = V2RayService ._internal ();
124124 factory V2RayService () => _instance;
125125
126- late final FlutterV2ray _flutterV2ray;
126+ late final V2ray _flutterV2ray;
127127
128128 // Current V2Ray status from the callback
129129 V2RayStatus ? _currentStatus;
130130 V2RayStatus ? get currentStatus => _currentStatus;
131131
132132 V2RayService ._internal () {
133- _flutterV2ray = FlutterV2ray (
133+ _flutterV2ray = V2ray (
134134 onStatusChanged: (status) {
135135 print ('V2Ray status changed: $status ' );
136136 _currentStatus = status;
@@ -174,7 +174,7 @@ class V2RayService extends ChangeNotifier {
174174
175175 Future <void > initialize () async {
176176 if (! _isInitialized) {
177- await _flutterV2ray.initializeV2Ray (
177+ await _flutterV2ray.initialize (
178178 notificationIconResourceType: "mipmap" ,
179179 notificationIconResourceName: "ic_launcher" ,
180180 );
@@ -190,7 +190,7 @@ class V2RayService extends ChangeNotifier {
190190 await initialize ();
191191
192192 // Parse the configuration
193- V2RayURL parser = FlutterV2ray .parseFromURL (config.fullConfig);
193+ V2RayURL parser = V2ray .parseFromURL (config.fullConfig);
194194
195195 // Request permission if needed (for VPN mode)
196196 bool hasPermission = await _flutterV2ray.requestPermission ();
@@ -520,7 +520,7 @@ class V2RayService extends ChangeNotifier {
520520 try {
521521 await initialize ();
522522
523- final parser = FlutterV2ray .parseFromURL (config.fullConfig);
523+ final parser = V2ray .parseFromURL (config.fullConfig);
524524 final delay = await _flutterV2ray
525525 .getServerDelay (config: parser.getFullConfiguration ())
526526 .timeout (
@@ -605,7 +605,7 @@ class V2RayService extends ChangeNotifier {
605605 line.startsWith ('vless://' ) ||
606606 line.startsWith ('trojan://' ) ||
607607 line.startsWith ('ss://' )) {
608- V2RayURL parser = FlutterV2ray .parseFromURL (line);
608+ V2RayURL parser = V2ray .parseFromURL (line);
609609 String configType = '' ;
610610
611611 if (line.startsWith ('vmess://' )) {
@@ -939,7 +939,7 @@ class V2RayService extends ChangeNotifier {
939939 Future <V2RayConfig ?> parseSubscriptionConfig (String configText) async {
940940 try {
941941 // Try to parse as a V2Ray URL
942- final parser = FlutterV2ray .parseFromURL (configText);
942+ final parser = V2ray .parseFromURL (configText);
943943
944944 // Determine the protocol type from the URL prefix
945945 String configType = '' ;
0 commit comments