Commit 654b6277 authored by Mygod's avatar Mygod

Use VectorDrawable for ic_navigation_close on API 21+

parent a4f32615
......@@ -21,6 +21,8 @@
package com.github.shadowsocks
import java.io.IOException
import java.net.InetAddress
import java.util
import java.util.concurrent.TimeUnit
import java.util.{Timer, TimerTask}
......@@ -35,7 +37,7 @@ import com.github.shadowsocks.ShadowsocksApplication.app
import com.github.shadowsocks.aidl.{IShadowsocksService, IShadowsocksServiceCallback}
import com.github.shadowsocks.database.Profile
import com.github.shadowsocks.utils._
import okhttp3.{FormBody, OkHttpClient, Request}
import okhttp3.{Dns, FormBody, OkHttpClient, Request}
import scala.util.Random
......@@ -137,7 +139,10 @@ trait BaseService extends Service {
val sig = Utils.getSignature(this)
val client = new OkHttpClient.Builder()
.dns(new CustomDns())
.dns(hostname => Utils.resolve(hostname, enableIPv6 = false) match {
case Some(ip) => util.Arrays.asList(InetAddress.getByName(ip))
case _ => Dns.SYSTEM.lookup(hostname)
})
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
......
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