Skip to content

Commit

Permalink
add back sniffing
Browse files Browse the repository at this point in the history
  • Loading branch information
eycorsican committed Feb 23, 2019
1 parent 25439fb commit 540466d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies {
implementation 'com.google.android.material:material:1.1.0-alpha02'
implementation "androidx.paging:paging-runtime:2.1.0-rc01"
implementation 'com.beust:klaxon:3.0.1'

implementation(name: 'tun2socks', ext: 'aar')

implementation 'androidx.room:room-runtime:2.1.0-alpha03'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,17 @@ open class SimpleVpnService : VpnService() {

ProxyLogDatabase.getInstance(applicationContext).proxyLogDao().getAllCount()


var sniffing = Preferences.getString(applicationContext, getString(R.string.sniffing), "http,tls")
// Just ensure no whitespaces in the the string.
val sniffingList = sniffing.split(",")
var sniffings = ArrayList<String>()
for (s in sniffingList) {
sniffings.add(s.trim())
}
sniffing = sniffings.joinToString(",")

Tun2socks.setLocalDNS("$localDns:53")
val ret = Tun2socks.startV2Ray(flow, service, dbService, configString.toByteArray(), filesDir.absolutePath, "127.0.0.1", 1086)
val ret = Tun2socks.startV2Ray(flow, service, dbService, configString.toByteArray(), "tun2socks", sniffing, filesDir.absolutePath)
if (ret.toInt() != 0) {
sendBroadcast(Intent("vpn_start_err"))
return@thread
Expand Down

0 comments on commit 540466d

Please sign in to comment.