Commit 13ef297a authored by Mygod's avatar Mygod

Change default DNS port to 5450 to avoid conflicts with Orbot

parent 725fb04f
...@@ -160,12 +160,10 @@ class ShadowsocksApplication extends Application { ...@@ -160,12 +160,10 @@ class ShadowsocksApplication extends Application {
if (dataStore.getLong(Key.assetUpdateTime, -1) != info.lastUpdateTime) copyAssets() if (dataStore.getLong(Key.assetUpdateTime, -1) != info.lastUpdateTime) copyAssets()
// hopefully hashCode = mHandle doesn't change, currently this is true from KitKat to Nougat // hopefully hashCode = mHandle doesn't change, currently this is true from KitKat to Nougat
if (!(1025 to 65535 contains dataStore.portProxy)) lazy val userIndex = Binder.getCallingUserHandle.hashCode
dataStore.putInt(Key.portProxy, 1080 + Binder.getCallingUserHandle.hashCode) if (!(1025 to 65535 contains dataStore.portProxy)) dataStore.putInt(Key.portProxy, 1080 + userIndex)
if (!(1025 to 65535 contains dataStore.portLocalDns)) if (!(1025 to 65535 contains dataStore.portLocalDns)) dataStore.putInt(Key.portLocalDns, 5450 + userIndex)
dataStore.putInt(Key.portLocalDns, 5400 + Binder.getCallingUserHandle.hashCode) if (!(1025 to 65535 contains dataStore.portTransproxy)) dataStore.putInt(Key.portTransproxy, 8200 + userIndex)
if (!(1025 to 65535 contains dataStore.portTransproxy))
dataStore.putInt(Key.portTransproxy, 8200 + Binder.getCallingUserHandle.hashCode)
if (Build.VERSION.SDK_INT >= 26) { if (Build.VERSION.SDK_INT >= 26) {
val nm = getSystemService(classOf[NotificationManager]) val nm = getSystemService(classOf[NotificationManager])
......
...@@ -23,7 +23,6 @@ package com.github.shadowsocks.database ...@@ -23,7 +23,6 @@ package com.github.shadowsocks.database
import java.util.Locale import java.util.Locale
import android.net.Uri import android.net.Uri
import android.os.Binder
import android.util.Base64 import android.util.Base64
import com.github.shadowsocks.plugin.PluginConfiguration import com.github.shadowsocks.plugin.PluginConfiguration
import com.github.shadowsocks.preference.OrmLitePreferenceDataStore import com.github.shadowsocks.preference.OrmLitePreferenceDataStore
......
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