remove test URL for ChinaList
This commit is contained in:
@@ -166,9 +166,7 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, Drawe
|
||||
*/
|
||||
private fun testConnection(id: Int) {
|
||||
val (success, result) = try {
|
||||
val urlString = when (app.currentProfile!!.route) {
|
||||
Acl.CHINALIST -> DataStore.testUrlChinaList
|
||||
else -> DataStore.testUrl}
|
||||
val urlString = DataStore.testUrl
|
||||
val url = URL(urlString)
|
||||
if (url.protocol != "https")
|
||||
throw MalformedURLException(getString(R.string.connection_test_url_non_https, urlString))
|
||||
|
||||
@@ -54,9 +54,6 @@ object DataStore {
|
||||
var testUrl: String
|
||||
get() = publicStore.getString(Key.testUrl) ?: "https://www.google.com/generate_204"
|
||||
set(value) = publicStore.putString(Key.testUrl, value)
|
||||
var testUrlChinaList: String
|
||||
get() = publicStore.getString(Key.testUrlChinaList) ?: "https://www.qualcomm.cn/generate_204"
|
||||
set(value) = publicStore.putString(Key.testUrlChinaList, value)
|
||||
var serviceMode: String
|
||||
get() = publicStore.getString(Key.serviceMode) ?: Key.modeVpn
|
||||
set(value) = publicStore.putString(Key.serviceMode, value)
|
||||
@@ -73,7 +70,6 @@ object DataStore {
|
||||
fun initGlobal() {
|
||||
// temporary workaround for support lib bug
|
||||
if (publicStore.getString(Key.testUrl) == null) testUrl = testUrl
|
||||
if (publicStore.getString(Key.testUrlChinaList) == null) testUrlChinaList = testUrlChinaList
|
||||
if (publicStore.getString(Key.serviceMode) == null) serviceMode = serviceMode
|
||||
if (publicStore.getString(Key.portProxy) == null) portProxy = portProxy
|
||||
if (publicStore.getString(Key.portLocalDns) == null) portLocalDns = portLocalDns
|
||||
|
||||
@@ -50,7 +50,6 @@ object Key {
|
||||
const val udpdns = "isUdpDns"
|
||||
const val ipv6 = "isIpv6"
|
||||
const val testUrl = "testUrl"
|
||||
const val testUrlChinaList = "testUrlChinaList"
|
||||
|
||||
const val host = "proxy"
|
||||
const val password = "sitekey"
|
||||
|
||||
Reference in New Issue
Block a user