temporarily use udpgw-client to make DNS and UDP tunneling to work

This commit is contained in:
Nathan Freitas 2014-10-24 01:14:54 -04:00
parent f9e340b465
commit 2d98a29d82
3 changed files with 9 additions and 14 deletions

View File

@ -66,6 +66,11 @@
/>
<item android:id="@+id/menu_vpn"
android:title="@string/menu_vpn"
yourapp:showAsAction="never"/>
<item android:id="@+id/menu_exit"
android:title="@string/menu_exit"
android:icon="@drawable/ic_menu_exit"
@ -73,9 +78,6 @@
/>
<item android:id="@+id/menu_vpn"
android:title="start VPN"
yourapp:showAsAction="never"/>
<!--
<item android:id="@+id/menu_diag"
android:title="Test Mode"

View File

@ -301,4 +301,5 @@
<string name="you_do_not_have_root_access_enabled">You do not have ROOT access enabled</string>
<string name="you_may_need_to_stop_and_start_orbot_for_settings_change_to_be_enabled_">You may need to stop and start Orbot for settings change to be enabled.</string>
<string name="menu_vpn">Start VPN</string>
</resources>

View File

@ -87,7 +87,7 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
mProxyServer.setVpnService(OrbotVpnService.this);
mProxyServer.start(mSocksProxyPort, 5, InetAddress.getLocalHost());
} catch (Exception e) {
e.printStackTrace();
Log.d(TAG,"proxy server error: " + e.getLocalizedMessage(),e);
}
}
};
@ -133,22 +133,14 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
builder.setSession("OrbotVPN");
builder.addRoute("0.0.0.0",0);
builder.addRoute("10.0.0.0",8);
//builder.addDnsServer("10.0.0.2");
builder.addDnsServer("127.0.0.1");
// Close the old interface since the parameters have been changed.
try {
mInterface.close();
} catch (Exception e) {
// ignore
}
builder.addDnsServer("8.8.8.8");
// Create a new interface using the builder and save the parameters.
mInterface = builder.setSession(mSessionName)
.setConfigureIntent(mConfigureIntent)
.establish();
Tun2Socks.Start(mInterface, 3000, "10.0.0.2", "255.255.255.0", "localhost:" + TorServiceConstants.PORT_SOCKS_DEFAULT, null, true);
Tun2Socks.Start(mInterface, 3000, "10.0.0.2", "255.255.255.0", "localhost:" + TorServiceConstants.PORT_SOCKS_DEFAULT, "50.116.51.157:7300", true);
}
}