diff options
-rw-r--r-- | main/src/main/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java | 9 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/main/src/main/AndroidManifest.xml b/main/src/main/AndroidManifest.xml index 8f478bcc..e226bdfc 100644 --- a/main/src/main/AndroidManifest.xml +++ b/main/src/main/AndroidManifest.xml @@ -42,7 +42,6 @@ <activity android:name=".activities.FileSelect" /> <activity android:name=".activities.MainActivity" - android:uiOptions="splitActionBarWhenNarrow" tools:ignore="ExportedActivity" > <intent-filter> <action android:name="android.intent.action.MAIN" /> diff --git a/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java b/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java index fd3dee92..701909d1 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java +++ b/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java @@ -21,6 +21,8 @@ import de.blinkt.openvpn.BuildConfig; public class NetworkSpace { + + static class ipAddress implements Comparable<ipAddress> { private BigInteger netAddress; public int networkMask; @@ -198,6 +200,13 @@ public class NetworkSpace { mIpAddresses.add(new ipAddress(cidrIp, include)); } + public void addIPSplit(CIDRIP cidrIp, boolean include) { + ipAddress newIP = new ipAddress(cidrIp, include); + ipAddress[] splitIps = newIP.split(); + for (ipAddress split: splitIps) + mIpAddresses.add(split); + } + void addIPv6(Inet6Address address, int mask, boolean included) { mIpAddresses.add(new ipAddress(address, mask, included)); } diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index 29009e5c..3f16248d 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -16,7 +16,6 @@ import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.net.ConnectivityManager; -import android.net.NetworkCapabilities; import android.net.NetworkRequest; import android.net.VpnService; import android.os.Binder; @@ -651,7 +650,8 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac continue; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT && !mProfile.mAllowLocalLAN) { - mRoutes.addIP(new CIDRIP(ipAddr,netMask), true); + mRoutes.addIPSplit(new CIDRIP(ipAddr,netMask), true); + } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && mProfile.mAllowLocalLAN) mRoutes.addIP(new CIDRIP(ipAddr,netMask), false); } |