Commit 907aa2f1 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Current state

parent c4f6f0ee
...@@ -93,7 +93,8 @@ android { ...@@ -93,7 +93,8 @@ android {
configurations.all { configurations.all {
resolutionStrategy { resolutionStrategy {
force 'com.frostnerd.utilskt:dnstunnelproxy:1.5.54-test4' force 'com.frostnerd.utilskt:dnstunnelproxy:1.5.55-test4'
//force 'com.frostnerd.utilskt:vpntunnelproxy:2.3.29-test4'
} }
} }
......
...@@ -251,11 +251,6 @@ class RootDnsService:Service() { ...@@ -251,11 +251,6 @@ class RootDnsService:Service() {
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().permitAll().build()) StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().permitAll().build())
dnsProxy = SmokeProxy(handle, createProxyBypassHandlers(), createDnsCache(), createQueryLogger(), createLocalResolver()) dnsProxy = SmokeProxy(handle, createProxyBypassHandlers(), createDnsCache(), createQueryLogger(), createLocalResolver())
dnsProxy!!.parseDevicePacketOverride = { arr, orig ->
val pPacket = orig(arr)
ParsedPacket(pPacket.sourceAddress, pPacket.destinationAddress, pPacket.sourcePort, pPacket.destinationPort, pPacket.dnsPayload)
}
log("DnsProxy created, creating VPN proxy") log("DnsProxy created, creating VPN proxy")
vpnProxy = VPNTunnelProxy(dnsProxy!!, socketProtector = object:Proxy.SocketProtector { vpnProxy = VPNTunnelProxy(dnsProxy!!, socketProtector = object:Proxy.SocketProtector {
override fun protectDatagramSocket(socket: DatagramSocket) { override fun protectDatagramSocket(socket: DatagramSocket) {
...@@ -283,7 +278,7 @@ class RootDnsService:Service() { ...@@ -283,7 +278,7 @@ class RootDnsService:Service() {
log("VPN proxy creating, trying to run...") log("VPN proxy creating, trying to run...")
val port = 45001 val port = 45001
Runtime.getRuntime().exec("su && iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:$port").waitFor() Runtime.getRuntime().exec("su && iptables -t nat -A OUTPUT -p udp ! -d 127.0.0.1 --dport 53 -j DNAT --to-destination 127.0.0.1:$port").waitFor()
GlobalScope.launch { GlobalScope.launch {
IpWrappingUdpTunnel(bindPort = port, socketReadCoroutineContext = newSingleThreadContext(""), tunnelReadCoroutineContext = newSingleThreadContext("")).start(vpnProxy!!) IpWrappingUdpTunnel(bindPort = port, socketReadCoroutineContext = newSingleThreadContext(""), tunnelReadCoroutineContext = newSingleThreadContext("")).start(vpnProxy!!)
log("VPN proxy started.") log("VPN proxy started.")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment