diff options
author | cyBerta <cyberta@riseup.net> | 2025-04-12 11:54:58 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2025-04-12 11:54:58 +0200 |
commit | e2d7b1a2cf9f9f67e3c835b8b97ca97fde94c5c0 (patch) | |
tree | cd6c2554733e16a9f4bad6a02397e121fa01848d | |
parent | fcb3b143d24327432430809f1ea8e64777f62da9 (diff) |
always close obfspvn client first, then stop running openvpn process
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index 1ed7bc39..1cfb2c27 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -378,13 +378,6 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac Connection connection = mProfile.mConnections[0]; VpnStatus.setCurrentlyConnectingProfile(mProfile); - // Set a flag that we are starting a new VPN - mStarting = true; - // Stop the previous session by interrupting the thread. - stopOldOpenVPNProcess(); - // An old running VPN should now be exited - mStarting = false; - // stop old running obfsvpn client if (!stopObfsvpn()) { VpnStatus.logError("Failed to stop already running obfsvpn client"); @@ -392,6 +385,13 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac return; } + // Set a flag that we are starting a new VPN + mStarting = true; + // Stop the previous session by interrupting the thread. + stopOldOpenVPNProcess(); + // An old running VPN should now be exited + mStarting = false; + // optionally start start obfsvpn and adapt openvpn config to the port obfsvpn is listening to Connection.TransportType transportType = connection.getTransportType(); if (mProfile.usePluggableTransports() && transportType.isPluggableTransport()) { |