feat: Add Windows support to openvpn_flutter#147
Open
Spokplacenta wants to merge 51 commits into
Open
Conversation
…ndling. Update dependencies in pubspec.yaml.
- Correction de l'erreur CMake avec add_custom_command POST_BUILD qui référençait une cible inexistante - Remplacement par set(openvpn_flutter_bundled_libraries) pour laisser Flutter gérer l'installation - Ajout des répertoires d'inclusion cpp_client_wrapper/include pour trouver les headers Flutter - Correction des noms de fichiers header (tirets -> underscores) pour correspondre aux fichiers réels
- Ajout de l'héritage public Plugin pour permettre l'utilisation avec AddPlugin()
- Utilisation de file(TO_CMAKE_PATH) pour normaliser les chemins Windows - Ajout d'un message STATUS quand les artefacts précompilés sont trouvés - Correction de la vérification d'existence des fichiers
… absolus - Conversion en chemin absolu pour une détection plus fiable des fichiers prebuilt - Correction du problème de détection des artefacts Rust sur Windows
- file(GLOB) fonctionne mieux que EXISTS avec les liens symboliques sur Windows - Correction de la détection des artefacts Rust précompilés
…bsolue - Vérification EXISTS avec chemin relatif plus fiable avec les liens symboliques - Conversion en chemin absolu seulement après confirmation de l'existence
- StreamHandler est une classe abstraite et ne peut pas être instanciée directement - StreamHandlerFunctions est la classe helper fournie par Flutter pour utiliser des fonctions - Ajout de l'include event_stream_handler_functions.h
- Rust génère openvpn_flutter_rust.dll.lib et non openvpn_flutter_rust.lib - Correction du nom de fichier pour correspondre à la sortie de Rust
…egistrant - Permet à generated_plugin_registrant.cc de trouver openvpn_flutter_plugin.h - Correction de l'erreur d'inclusion du header
- Création du sous-répertoire openvpn_flutter avec le header - Permet à generated_plugin_registrant.cc de trouver openvpn_flutter/openvpn_flutter_plugin.h
- Ajout de la déclaration OpenvpnFlutterPluginRegisterWithRegistrar - Permet à generated_plugin_registrant.cc de trouver la fonction
…ktopPluginRegistrarRef - Évite la redéfinition du type - Utilise le type officiel de Flutter
…répertoire de build
…into dev_branch # Conflicts: # example/pubspec.lock
Open
Author
|
Hi @nizwar, would you have some time to review this PR ? |
…t to prebuilt Rust binaries for Windows consumers and fall back to cargo builds only when artifacts are missing or explicitly disabled. Add CI verification to keep committed prebuilt artifacts in sync with Rust sources.
Replace strict prebuilt artifact diff checks with drift detection and patch upload in CI, because Windows Rust binaries can vary between environments. Keep artifact generation/upload and document the new drift handling flow for maintainers.
Refactor the release workflow to build Android APKs and Windows Rust prebuilt binaries in dedicated jobs, then publish both artifact sets in a single GitHub Release. Restrict publishing to version tags to avoid creating releases on regular branch pushes.
…sole window for OpenVPN on Windows
… adapter release, and improve error detection for TAP/TUN issues
…connection handling in Rust code
…ebug and release builds
…DME, and remove TAP management code
… elevation and updating error classification
… handling in OpenVPN process management
…onality and adjusting connection timeout settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Windows Support to openvpn_flutter
Summary
This PR adds comprehensive Windows support to the
openvpn_flutterplugin, allowing Flutter applications to connect to OpenVPN servers on Windows platforms.Key Features
1. Windows Binary Management
openvpn.exe.binfrom assets (assets/openvpn/windows/)2. Windows Plugin Implementation
openvpn.exeprocess3. Dart API Integration
openvpn.exe.binfrom assets and extracts it for use4. Technical Implementation
Rust Components
lib.rs: FFI interface exposing C-compatible functionsopenvpn.rs: OpenVPN process management and output parsingmanager.rs: Thread-safe singleton for OpenVPN managererror.rs: Custom error types usingthiserrorC++ Components
openvpn_flutter_plugin.h/cpp: Flutter plugin bridgeDart Components
windows_binary_manager.dart: Embedded binary loading and managementwindows_tap_manager.dart: TAP adapter management (optional)vpn_engine.dart: Windows-specific integrationFiles Changed
New Files
lib/src/windows_binary_manager.dart- Embedded binary loading and managementlib/src/windows_tap_manager.dart- TAP adapter managementwindows/rust/- Rust implementationwindows/openvpn_flutter_plugin.h/cpp- C++ bridgewindows/CMakeLists.txt- Build configurationassets/openvpn/windows/openvpn.exe.bin- Embedded OpenVPN binarytest_integration/- Integration test applicationModified Files
lib/src/vpn_engine.dart- Windows platform supportpubspec.yaml- Windows platform entry and dependenciesandroid/build.gradle- Updated NDK version and OpenVPN libraryDependencies Added
path_provider: ^2.1.1- For file system accesspath: ^1.8.3- For path manipulationRust Dependencies
tokio- Async runtimeanyhow- Error handlingthiserror- Custom errorsserde/serde_json- JSON serializationtempfile- Temporary file managementchrono- Timestamp handlingTesting
An integration test application is included in
test_integration/demonstrating:Breaking Changes
None. This is a purely additive feature that doesn't affect existing Android/iOS functionality.
Compatibility
Notes
openvpn.exe.binfrom assetsRelated Issues
This PR addresses the need for Windows support in the openvpn_flutter plugin.