Commit 15262343 authored by Max Lv's avatar Max Lv

restore DNS nicely

parent be31a0ce
......@@ -138,7 +138,7 @@ class ShadowsocksNatService extends Service with BaseService {
}
def resetDns() = {
setDnsForAllNetwork("114.114.114.114 8.8.8.8 208.67.222.222")
restoreDnsForAllNetwork()
}
def flushDns() {
......@@ -541,10 +541,6 @@ class ShadowsocksNatService extends Service with BaseService {
// Clean up
killProcesses()
// Set DNS
if (Utils.isLollipopOrAbove) setupDns()
flushDns()
var resolved: Boolean = false
if (!InetAddressUtils.isIPv4Address(config.proxy) &&
!InetAddressUtils.isIPv6Address(config.proxy)) {
......@@ -559,6 +555,11 @@ class ShadowsocksNatService extends Service with BaseService {
}
if (resolved && handleConnection) {
// Set DNS
if (Utils.isLollipopOrAbove) setupDns()
flushDns()
notifyForegroundAlert(getString(R.string.forward_success),
getString(R.string.service_running).format(config.profileName))
changeState(State.CONNECTED)
......
Markdown is supported
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