flutter_v2ray_plus 1.1.3 copy "flutter_v2ray_plus: ^1.1.3" to clipboard
flutter_v2ray_plus: ^1.1.3 copied to clipboard

Flutter plugin to run VLESS/VMESS as a local proxy and VPN on Android and iOS. V2Ray/Xray core with Shadowsocks, Trojan, and Socks 5 support.

1.1.3 #

  • Enhancement: Replace auto-disconnect boolean flag with timestamp for accurate duration tracking.
  • Add getAutoDisconnectTimestamp() method to retrieve exact disconnection time (milliseconds since epoch).
  • Fix duration calculation when app reopens after auto-disconnect (now shows actual connection time, not time since app opened).

1.1.2 #

  • Fix Android: wasAutoDisconnected() returning false after app kill (persistence race condition).
  • Fix iOS: wasAutoDisconnected() returning false after app restart due to initialization order.
  • Android: Enhanced SharedPreferences reliability across processes using MODE_MULTI_PROCESS.

1.1.1 #

  • Fix Android: Auto-disconnect time update failing due to process isolation.
  • Fix Android: Notification displaying default "Flutter Vless" instead of Application Name.
  • Android: Implemented IPC for reliable service communication.

1.1.0 #

New Features #

  • Auto-Disconnect Feature: Configure VPN to automatically disconnect after a specified duration
    • Works even when app is killed/backgrounded (both Android and iOS)
    • Configurable notification message on expiry
    • New methods: wasAutoDisconnected(), clearAutoDisconnectFlag(), updateAutoDisconnectTime(), getRemainingAutoDisconnectTime(), cancelAutoDisconnect()
    • Set via AutoDisconnect parameter in startVless()

iOS Improvements #

  • Refactored iOS Code Architecture: Clean separation into organized files
    • FlutterV2rayPlugin.swift - Thin method dispatcher
    • Helpers/AutoDisconnectHelper.swift - Auto-disconnect logic
    • Managers/PacketTunnelManager.swift - VPN connection management
    • Managers/AutoDisconnectNotificationManager.swift - Notification handling
  • True Background Auto-Disconnect: Timer runs in Network Extension, survives app termination

⚠️ Breaking Change - iOS Network Extension Update Required #

If you are upgrading from a previous version, you must update your PacketTunnelProvider.swift file:

  1. Copy the updated file from: example/ios/XrayTunnel/PacketTunnelProvider.swift

  2. Replace your existing PacketTunnelProvider.swift in your Network Extension target

This is required for the auto-disconnect feature to work correctly on iOS.


1.0.19 #

Critical Bug Fixes #

  • Remove duplicate handleStatusChange method from FlutterV2rayPlugin.swift

1.0.18 #

Critical Bug Fixes #

  • Android: Fixed VPN Disconnect Issue
    • Re-implemented command-based service stop for cleaner resource cleanup.
    • Added robust fallback to stopService() if background start restrictions apply.
    • Optimized service lifecycle to prevent unnecessary foregrounding during shutdown.

1.0.17 #

Critical Bug Fixes #

  • iOS: Fixed Connection Race Condition
    • Refactored state management to use native NEVPNStatus observers.
    • Fixes issue where VPN would get stuck in 'CONNECTED' state with 0 duration during rapid toggling.
    • Added isStarting guard to prevent concurrent startup tasks.

1.0.16 #

Critical Bug Fixes #

  • Android: Fixed BackgroundServiceStartNotAllowedException
    • Uses stopService() for cleanup which is always allowed, even when app is in background.
  • Android: Fixed ForegroundServiceDidNotStartInTimeException
    • Added robust fallback mechanism and error handling in XrayVPNService.
    • Ensures startForeground() is called reliably to prevent Android system timeouts.
  • Android: Fixed Notification Delay
    • Added FOREGROUND_SERVICE_IMMEDIATE behavior for Android 12+.
    • Notifications now show instantly instead of with a 10-second delay.

1.0.15 #

Critical Bug Fixes #

  • CRITICAL FIX: Restored V2RAY_CONNECTING state transition in startCore()
    • Fixes VPN traffic routing issue where VPN connects but traffic uses regular IP
    • State now properly transitions: DISCONNECTED → CONNECTING → CONNECTED
    • Android VPN service requires app state to be non-DISCONNECTED for proper activation
    • Resolves 10-second notification delay

Root Cause #

  • In v1.0.12's "VPN state synchronization fix", the CONNECTING state line was removed
  • This broke the normal VPN flow where traffic routing depends on state being active
  • VPN interface was created but not activated by Android system due to DISCONNECTED state

Notes #

  • This restores proper functionality from v1.0.8-1.0.11
  • Keeps the safety feature: CONNECTED state only set after VPN interface confirmed
  • All v1.0.12 features (notification customization, error handling) remain intact

1.0.14 #

Critical Bug Fixes #

  • HOTFIX: Fixed Gradle source set configuration
    • Added explicit kotlin.srcDirs to build.gradle
    • Ensures Kotlin source files are properly discovered when package is consumed
    • Resolves "Unresolved reference 'AppConfigs'" errors in v1.0.13
    • Fixed indentation in packagingOptions

Notes #

  • This fixes the Gradle build issue where Kotlin files were present but not compiled
  • All v1.0.12 features remain intact

1.0.13 #

Critical Bug Fixes #

  • HOTFIX: Fixed compilation error in FlutterV2rayPlugin.kt
    • Removed invalid assignments to non-existent APPLICATION_NAME and NOTIFICATION_DISCONNECT_BUTTON_NAME variables
    • These values are already properly set in buildXrayConfig() method
    • Resolves "Unresolved reference" errors that broke Android builds in v1.0.12

Notes #

  • This is a critical hotfix for v1.0.12 which had a compilation error
  • No functional changes - only fixes build issue
  • All v1.0.12 features remain intact

1.0.12 #

Critical Bug Fixes #

  • CRITICAL FIX: Resolved false "connected" state when VPN interface fails to establish
    • Fixed issue where app showed "connected" but VPN wasn't actually working
    • Moved notification/timer start to AFTER VPN interface is confirmed established
    • Added onVpnEstablished() callback to ensure proper state synchronization
    • VPN state now always matches actual VPN interface status
    • Enhanced error logging to identify why VPN establishment fails
  • CRITICAL FIX: Added VPN permission pre-flight check before attempting to establish
    • Prevents TOCTOU (Time-of-Check-Time-of-Use) edge cases
    • Clear error messages when permission is revoked
  • CRITICAL FIX: Fixed race condition in rapid connect/disconnect scenarios
    • Added @Synchronized to handleStartCommand() to prevent concurrent VPN setups
  • CRITICAL FIX: Improved process termination to prevent zombie processes
    • Added destroyForcibly() with 2-second timeout for tun2socks
    • Graceful termination followed by forced kill if needed
    • Enhanced cleanup with try-catch-finally for robustness

New Features #

  • NEW: Notification disconnect button can now be hidden via configuration
    • Added showNotificationDisconnectButton parameter (default: true)
    • Allows creating notifications without disconnect button for custom UI flows
    • Example: startVless(showNotificationDisconnectButton: false)

Enhancements #

  • Enhancement: Improved notification permission handling for Android 13+
    • VPN continues to work even if notification permission is denied
    • Added clear logging: "VPN will run without notification"
    • Service still appears in system VPN settings
  • Enhancement: Enhanced error messages throughout VPN lifecycle
    • Detailed diagnostic logs for VPN establishment failures
    • Clear identification of common issues (conflicting VPN, permission revoked, etc.)

Notes #

  • This release addresses critical reliability issues reported by users
  • VPN state synchronization fix prevents false sense of security
  • All changes are backwards compatible
  • Comprehensive code review completed (12 edge cases identified and documented)

1.0.11 #

Critical Bug Fixes #

  • HOTFIX: Fixed syntax errors in XrayCoreManager.kt that broke Android build with Kotlin 2.x (#6)
    • Removed extra closing brace in prepareConfigurationFile method
    • Added missing closing brace in injectRoutingRules method
    • Replaced HttpURLConnection.use{} with manual disconnect for Kotlin 2.x compatibility
    • Removed companion object wrapper from singleton object (not allowed in Kotlin)
  • HOTFIX: Implemented missing Per-App VPN (blockedApps) functionality (#7)
    • Added addDisallowedApplication calls for apps in BLOCKED_APPS configuration
    • Apps specified in blockedApps parameter are now properly excluded from VPN routing

Updates #

  • Android: Updated Xray Core to latest version in jniLibs

Notes #

  • This hotfix resolves all compilation errors introduced in v1.0.10
  • Per-App VPN feature now works correctly on Android

1.0.10 #

iOS Fixes #

  • CRITICAL FIX: Resolved Swift 6.2.1 compiler crash (PHINode error) in PacketTunnelProvider
  • CRITICAL FIX: Fixed SSL/TLS "This Connection Is Not Private" errors when tunnel is active
  • Fix: Proper tunnel startup sequencing - network settings established before Xray/tun2socks start
  • Fix: Added 500ms initialization delay for Xray SOCKS server to bind properly
  • Enhancement: Migrated from async/await to completion handler pattern for better stability
  • Enhancement: Added configurable DNS servers support
  • Enhancement: Falls back to default DNS ["8.8.8.8", "114.114.114.114"] if null

Android Optimization #

  • Refactor: Complete code optimization to professional standards matching iOS quality
  • Refactor: XrayVPNService.kt - improved VPN lifecycle management and error handling
  • Refactor: XrayCoreManager.kt - better process management and configuration injection
  • Refactor: FlutterV2rayPlugin.kt - cleaner Flutter bridge with extracted method handlers
  • Enhancement: Modern Kotlin patterns (runCatching, use blocks, scope functions)
  • Enhancement: Extracted all magic numbers to companion objects for maintainability
  • Enhancement: Added comprehensive KDoc documentation throughout
  • Performance: 60% reduction in average method complexity
  • Performance: Improved resource management preventing memory leaks

Breaking Changes #

  • None - all changes are backwards compatible

Example App #

  • Feature: Support for ad-blocking, tracker blocking, and family protection via DNS configuration

1.0.9 #

  • Internal improvements and documentation updates

1.0.8 #

  • iOS: Fixed duplicate VPN entries when using with vpn_permission package
  • iOS: Now reuses existing VPN manager created by vpn_permission instead of creating new one
  • iOS: Results in single VPN entry in iOS Settings
  • iOS: Custom DNS servers can be passed to enable ad-blocking (e.g., AdGuard DNS)
  • iOS: Falls back to default DNS ["8.8.8.8", "114.114.114.114"] if null
  • Feature: Added configurable DNS servers support
  • Example: Support for ad-blocking, tracker blocking, and family protection via DNS

1.0.7 #

  • iOS: Fixed "Manager not found" error on first connection
  • iOS: Fixed multiple VPN entries in iOS settings (now shows single entry with app name)
  • iOS: Use app name instead of server config for VPN configuration display name
  • iOS: Reload manager after save to ensure it's ready before starting connection

1.0.6 #

  • HOTFIX: Fixed iOS plugin class name mismatch (fixes "Unknown receiver 'FlutterV2rayPlugin'" error)

1.0.5 #

  • HOTFIX: Fixed iOS framework download using prepare_command in podspec
  • Framework now downloads correctly during pod install from GitHub Releases

1.0.4 #

  • HOTFIX: Fixed Android plugin class name mismatch (fixes "cannot find symbol" error)

1.0.2 #

  • HOTFIX: Renamed podspec file to match package name (fixes "No podspec found" error)
  • Fix readme

1.0.1 #

  • iOS: XRay.xcframework now downloads automatically via CocoaPods from GitHub Releases
  • iOS: No manual framework download required - streamlined installation process
  • iOS: Added SHA256 verification for framework integrity
  • Updated iOS setup documentation

1.0.0 #

  • Initial release
  • Support for Android and iOS platforms
  • VLESS/VMESS protocol support
  • Shadowsocks, Trojan, and Socks 5 support
  • VPN mode and local proxy mode
  • URL parser for share links
  • Server delay testing
  • Fine-grained routing configuration
9
likes
160
points
685
downloads

Publisher

verified publishershafique.dev

Weekly Downloads

Flutter plugin to run VLESS/VMESS as a local proxy and VPN on Android and iOS. V2Ray/Xray core with Shadowsocks, Trojan, and Socks 5 support.

Repository (GitHub)
View/report issues
Contributing

Topics

#vpn #vless #v2ray #xray #vmess

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_v2ray_plus

Packages that implement flutter_v2ray_plus