Skip to content

Commit

Permalink
Revert "fix a bypass issue"
Browse files Browse the repository at this point in the history
This reverts commit 4bf784f.
  • Loading branch information
madeye committed Mar 7, 2014
1 parent 5aab822 commit a03a1b5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ShadowsocksNatService extends Service with BaseService {
Path.BASE + "ss-local.pid")
.format(config.proxy, config.remotePort, 8153, config.sitekey, config.encMethod)
} else {
val conf = ConfigUtils.PDNSD.format("127.0.0.1", getString(R.string.exclude), Utils.getDNS);
val conf = ConfigUtils.PDNSD.format("127.0.0.1", getString(R.string.exclude), System.getDNS1);
ConfigUtils.printToFile(new File(Path.BASE + "pdnsd.conf"))(p => {
p.println(conf)
})
Expand Down Expand Up @@ -310,8 +310,8 @@ class ShadowsocksNatService extends Service with BaseService {

// Bypass DNS servers
init_sb.append(cmd_bypass.replace("0.0.0.0", "127.0.0.1"))
init_sb.append(cmd_bypass.replace("0.0.0.0", Utils.getDNS))
init_sb.append(cmd_bypass.replace("0.0.0.0", "114.114.114.114"))
init_sb.append(cmd_bypass.replace("0.0.0.0", "114.114.115.115"))

if (hasRedirectSupport) {
init_sb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
Path.BASE + "ss-tunnel.pid")
.format(config.proxy, config.remotePort, 8153, config.sitekey, config.encMethod)
} else {
val conf = ConfigUtils.PDNSD.format("0.0.0.0", getString(R.string.exclude), Utils.getDNS)
val conf = ConfigUtils.PDNSD.format("0.0.0.0", getString(R.string.exclude), System.getDNS1)
ConfigUtils.printToFile(new File(Path.BASE + "pdnsd.conf"))(p => {
p.println(conf)
})
Expand All @@ -115,7 +115,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {

def isByass(util: SubnetUtils): Boolean = {
val info = util.getInfo
info.isInRange(config.proxy) || info.isInRange("114.114.114.114") || info.isInRange(Utils.getDNS)
info.isInRange(config.proxy) || info.isInRange("114.114.114.114") || info.isInRange("114.114.115.115")
}

def startVpn() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ object ConfigUtils {
|
|server {
| label = "china-servers";
| ip = %s, 114.114.114.114;
| ip = %s, 114.114.114.114, 114.114.115.115;
| timeout = 5;
|}
|
Expand Down
11 changes: 1 addition & 10 deletions src/main/scala/com/github/shadowsocks/utils/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import android.os.Build
import android.provider.Settings
import scala.Some
import java.security.MessageDigest
import com.github.shadowsocks.{BuildConfig, System}
import com.github.shadowsocks.{BuildConfig}


object Utils {
Expand All @@ -80,15 +80,6 @@ object Utils {
var data_path: String = null
var rootTries = 0

def getDNS(): String = {
val dns1 = System.getDNS1
if (dns1 != null && !dns1.isEmpty && InetAddressUtils.isIPv4Address(dns1)) {
dns1
} else {
"114.114.114.114"
}
}

def getSignature(context: Context): String = {
val info = context
.getPackageManager
Expand Down

0 comments on commit a03a1b5

Please sign in to comment.