我正在使用 VpnService 与 SOCKS5 代理建立连接。它适用于除我之外的其他应用程序。它适用于 Gmail 和其他应用程序的 Google Chrome。
private fun configure(
name: String,
route: String,
perApp: Boolean,
bypass: Boolean,
apps: Array<String>?,
ipv6: Boolean
) {
val b: Builder = Builder()
b.setMtu(1500)
.setSession(name)
.addAddress("26.26.26.1", 24)
.addDnsServer("8.8.8.8")
if (ipv6) {
// Route all IPv6 traffic
b.addAddress("fdfe:dcba:9876::1", 126)
.addRoute("::", 0)
}
Routes.addRoutes(this, b, route)
// Add the default DNS
// Note that this DNS is just a stub.
// Actual DNS requests will be redirected through pdnsd.
b.addRoute("8.8.8.8", 32)
//I THINK PROBLEM IS HERE
b.addAllowedApplication("ru.kbs41.testproxy")
b.addAllowedApplication("org.chromium.webview_shell")
//IT WORKS FOR org.chromium.webview_shell
//AND DOESN'T WORK FOR ru.kbs41.testproxy
mInterface = b.establish()
}