Revert "VPNServiceBuilder: document excludeRoute not supported on pre-33 API" (#471)

pull/472/head
Andrea Gottardo 3 months ago committed by GitHub
parent fcfb997fde
commit a843c93669
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4,15 +4,11 @@
package com.tailscale.ipn
import android.net.VpnService
import android.os.Build
import android.util.Log
import libtailscale.ParcelFileDescriptor
import java.net.InetAddress
import android.net.IpPrefix as AndroidIpPrefix
class VPNServiceBuilder(private val builder: VpnService.Builder) : libtailscale.VPNServiceBuilder {
private val TAG = "VPNServiceBuilder"
override fun addAddress(p0: String, p1: Int) {
builder.addAddress(p0, p1)
}
@ -26,14 +22,9 @@ class VPNServiceBuilder(private val builder: VpnService.Builder) : libtailscale.
}
override fun excludeRoute(p0: String, p1: Int) {
// excludeRoute requires API 33 (Android 13)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
val inetAddress = InetAddress.getByName(p0)
val prefix = AndroidIpPrefix(inetAddress, p1)
builder.excludeRoute(prefix)
} else {
Log.d(TAG, "excludeRoute is not supported on Android API < 33, 'Allow LAN Access' will be ignored")
}
val inetAddress = InetAddress.getByName(p0)
val prefix = AndroidIpPrefix(inetAddress, p1)
builder.excludeRoute(prefix)
}
override fun addSearchDomain(p0: String) {

Loading…
Cancel
Save