fix a bypass issue

This commit is contained in:
Max Lv
2014-03-07 15:10:44 +08:00
parent 1c4c54e962
commit 4bf784fd9f
4 changed files with 15 additions and 6 deletions
@@ -86,7 +86,7 @@ object ConfigUtils {
|
|server {
| label = "china-servers";
| ip = %s, 114.114.114.114, 114.114.115.115;
| ip = %s, 114.114.114.114;
| timeout = 5;
|}
|
@@ -53,7 +53,7 @@ import android.os.Build
import android.provider.Settings
import scala.Some
import java.security.MessageDigest
import com.github.shadowsocks.{BuildConfig}
import com.github.shadowsocks.{BuildConfig, System}
object Utils {
@@ -80,6 +80,15 @@ 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