Aus öffentlichen Paketdaten erstellte Orientierung.
Das openvpn_flutter-Paket ermöglicht Flutter-Anwendungen die Verbindung zu OpenVPN-Diensten auf Android- und iOS-Plattformen. Es bietet eine einfache Schnittstelle zum Verwalten von VPN-Verbindungen, sodass Benutzer sichere Netzwerk-Tunnel programmgesteuert herstellen können. Das Plugin integriert native OpenVPN-Bibliotheken und gewährleistet die Kompatibilität mit Standard-OpenVPN-Konfigurationen und .ovpn-Dateien. Es ist für Entwickler konzipiert, die sicherheitsrelevante Funktionen in ihre Apps einbauen möchten, wie beispielsweise den Zugriff auf private Netzwerke oder verbesserten Daten-Schutz.
Anwendungsfälle
Sichere App-zu-Server-Kommunikation
Privater Netzwerkzugriff in Unternehmensanwendungen
Erweiterte Datenschutz für Benutzerdaten
Regionale Inhaltseinschränkungen umgehen
Verbindung zu Unternehmens-VPNs herstellen
Hauptmerkmale
Unterstützt Android- und iOS-Plattformen
Integration mit standardmäßigen .ovpn-Konfigurationsdateien
Programmatische Verbindungsverwaltung
Sichere Tunnelherstellung
Leicht und einfach zu integrieren
Geeignet für
Unternehmensmobile Anwendungen
Apps, die sicheren Netzwerkzugriff erfordern
Entwickler, die auf Datenschutz ausgerichtete Tools entwickeln
Anwendungen, die eine Remote-Server-Konnektivität benötigen
Projekte, die OpenVPN-Infrastruktur verwenden
Hinweise
Benötigt Native OpenVPN-Bibliothek-Integration
Möglicherweise sind zusätzliche Berechtigungen unter Android und iOS erforderlich
Die Verarbeitung von Konfigurationsdateien muss sicher sein
Beschränkt auf das OpenVPN-Protokoll
Plattformspezifische Einrichtung kann erforderlich sein
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
Connect to the OpenVPN service using Flutter. Contributions through issues and pull requests are highly appreciated!
Android Setup
1. Permission Handler
Java
Include the following code in the onActivityResult method of MainActivity.java (if you are using Java):
voidconnect() {
openvpn.connect(
config,
name,
username: username,
password: password,
bypassPackages: [],
// In iOS connection can get stuck in "connecting" if this flag is "false". // Solution is to switch it to "true".
certIsRequired: false,
);
}
Disconnect
voiddisconnect(){
openvpn.disconnect();
}
Publishing to Play Store and App Store
Android
You can use app bundles to publish the app.
Add the following to your files in the android folder (special thanks to https://github.com/nizwar/openvpn_flutter/issues/10). Otherwise, the connection may not be established in some cases and will silently report "disconnected" when trying to connect. This is likely related to some symbols being stripped by Google Play.
gradle.properties > android.bundle.enableUncompressedNativeLibs=falseAndroidManifest > android:extractNativeLibs="true"in the application tag
Add the following inside the android tag in app/build.gradle:
android {
...
//from here ======
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
bundle {
language {
enableSplit = false
}
density {
enableSplit = false
}
abi {
enableSplit = false
}
}
//to here
...
}
Notifications
As the plugin shows notifications for connection status and connection details, you must request permission using third-party packages.
///Put it anywhere you wish, like once you initialize the VPN or pre-connect to the serverPermission.notification.isGranted.then((_) {
if (!_) Permission.notification.request();
});