Skip to content

Commit

Permalink
Remove TCP resolving of hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed May 23, 2018
1 parent daa9d9f commit 16672a1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 79 deletions.
1 change: 0 additions & 1 deletion mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation "com.takisoft.fix:preference-v7-simplemenu:$takisoftFixVersion"
implementation 'com.twofortyfouram:android-plugin-api-for-locale:1.0.2'
implementation 'dnsjava:dnsjava:2.1.8'
implementation 'eu.chainfire:libsuperuser:1.0.0.201704021214'
implementation 'net.glxn.qrgen:android:2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
Expand Down
8 changes: 2 additions & 6 deletions mobile/src/main/java/com/github/shadowsocks/bg/BaseService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import okhttp3.Request
import org.json.JSONObject
import java.io.File
import java.io.IOException
import java.net.UnknownHostException
import java.net.*
import java.security.MessageDigest
import java.util.*
import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -364,10 +364,6 @@ object BaseService {
try {
if (profile.host == "198.199.101.152") {
val client = OkHttpClient.Builder()
.dns {
listOf((Dns.resolve(it, false) ?: throw UnknownHostException())
.parseNumericAddress())
}
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
Expand Down Expand Up @@ -402,7 +398,7 @@ object BaseService {
killProcesses()

if (!profile.host.isNumericAddress())
profile.host = Dns.resolve(profile.host, true) ?: throw UnknownHostException()
profile.host = InetAddress.getByName(profile.host).hostAddress ?: throw UnknownHostException()

startNativeProcesses()

Expand Down
72 changes: 0 additions & 72 deletions mobile/src/main/java/com/github/shadowsocks/bg/Dns.kt

This file was deleted.

0 comments on commit 16672a1

Please sign in to comment.