Ignore system proxy settings before Android 10
This commit is contained in:
@@ -163,19 +163,14 @@ class VPNService : VpnService(), PlatformInterfaceWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.isHTTPProxyEnabled) {
|
if (options.isHTTPProxyEnabled && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
systemProxyAvailable = true
|
systemProxyAvailable = true
|
||||||
systemProxyEnabled = Settings.systemProxyEnabled
|
systemProxyEnabled = Settings.systemProxyEnabled
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
if (systemProxyEnabled) builder.setHttpProxy(
|
||||||
if (systemProxyEnabled) builder.setHttpProxy(
|
ProxyInfo.buildDirectProxy(
|
||||||
ProxyInfo.buildDirectProxy(
|
options.httpProxyServer, options.httpProxyServerPort
|
||||||
options.httpProxyServer,
|
|
||||||
options.httpProxyServerPort
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
} else {
|
)
|
||||||
error("android: tun.platform.http_proxy requires android 10 or higher")
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
systemProxyAvailable = false
|
systemProxyAvailable = false
|
||||||
systemProxyEnabled = false
|
systemProxyEnabled = false
|
||||||
|
|||||||
Reference in New Issue
Block a user