more fixes for VPN but not quite ready yet
This commit is contained in:
parent
7f50f79b0e
commit
3ef94e009c
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.torproject.android.vpn;
|
package org.torproject.android.vpn;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -98,6 +99,14 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
|
||||||
|
|
||||||
if (mProxyServer != null)
|
if (mProxyServer != null)
|
||||||
mProxyServer.stop();
|
mProxyServer.stop();
|
||||||
|
|
||||||
|
if (mInterface != null)
|
||||||
|
try {
|
||||||
|
mInterface.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -136,7 +145,7 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
|
||||||
//builder.addRoute("192.168.43.0",8);
|
//builder.addRoute("192.168.43.0",8);
|
||||||
builder.addDnsServer("8.8.8.8");
|
builder.addDnsServer("8.8.8.8");
|
||||||
|
|
||||||
// Create a new interface using the builder and save the parameters.
|
// Create a new interface using the builder and save the parameters.
|
||||||
mInterface = builder.setSession(mSessionName)
|
mInterface = builder.setSession(mSessionName)
|
||||||
.setConfigureIntent(mConfigureIntent)
|
.setConfigureIntent(mConfigureIntent)
|
||||||
.establish();
|
.establish();
|
||||||
|
|
Loading…
Reference in New Issue