Commit 8e83272f authored by V.E.O's avatar V.E.O

remove test URL for ChinaList

parent d17d791b
...@@ -166,9 +166,7 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, Drawe ...@@ -166,9 +166,7 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, Drawe
*/ */
private fun testConnection(id: Int) { private fun testConnection(id: Int) {
val (success, result) = try { val (success, result) = try {
val urlString = when (app.currentProfile!!.route) { val urlString = DataStore.testUrl
Acl.CHINALIST -> DataStore.testUrlChinaList
else -> DataStore.testUrl}
val url = URL(urlString) val url = URL(urlString)
if (url.protocol != "https") if (url.protocol != "https")
throw MalformedURLException(getString(R.string.connection_test_url_non_https, urlString)) throw MalformedURLException(getString(R.string.connection_test_url_non_https, urlString))
......
...@@ -54,9 +54,6 @@ object DataStore { ...@@ -54,9 +54,6 @@ object DataStore {
var testUrl: String var testUrl: String
get() = publicStore.getString(Key.testUrl) ?: "https://www.google.com/generate_204" get() = publicStore.getString(Key.testUrl) ?: "https://www.google.com/generate_204"
set(value) = publicStore.putString(Key.testUrl, value) 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 var serviceMode: String
get() = publicStore.getString(Key.serviceMode) ?: Key.modeVpn get() = publicStore.getString(Key.serviceMode) ?: Key.modeVpn
set(value) = publicStore.putString(Key.serviceMode, value) set(value) = publicStore.putString(Key.serviceMode, value)
...@@ -73,7 +70,6 @@ object DataStore { ...@@ -73,7 +70,6 @@ object DataStore {
fun initGlobal() { fun initGlobal() {
// temporary workaround for support lib bug // temporary workaround for support lib bug
if (publicStore.getString(Key.testUrl) == null) testUrl = testUrl 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.serviceMode) == null) serviceMode = serviceMode
if (publicStore.getString(Key.portProxy) == null) portProxy = portProxy if (publicStore.getString(Key.portProxy) == null) portProxy = portProxy
if (publicStore.getString(Key.portLocalDns) == null) portLocalDns = portLocalDns if (publicStore.getString(Key.portLocalDns) == null) portLocalDns = portLocalDns
......
...@@ -50,7 +50,6 @@ object Key { ...@@ -50,7 +50,6 @@ object Key {
const val udpdns = "isUdpDns" const val udpdns = "isUdpDns"
const val ipv6 = "isIpv6" const val ipv6 = "isIpv6"
const val testUrl = "testUrl" const val testUrl = "testUrl"
const val testUrlChinaList = "testUrlChinaList"
const val host = "proxy" const val host = "proxy"
const val password = "sitekey" const val password = "sitekey"
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
<string name="stat_summary">Sent: \t\t\t\t\t%3$s\t↑\t%1$s\nReceived: \t%4$s\t↓\t%2$s</string> <string name="stat_summary">Sent: \t\t\t\t\t%3$s\t↑\t%1$s\nReceived: \t%4$s\t↓\t%2$s</string>
<string name="speed">%s/s</string> <string name="speed">%s/s</string>
<string name="connection_test_url">Connection Test URL</string> <string name="connection_test_url">Connection Test URL</string>
<string name="connection_test_url_chinalist">Connection Test URL (China List mode only)</string>
<string name="connection_test_pending">Check Connectivity</string> <string name="connection_test_pending">Check Connectivity</string>
<string name="connection_test_testing">Testing…</string> <string name="connection_test_testing">Testing…</string>
<string name="connection_test_available">Success: %dms latency</string> <string name="connection_test_available">Success: %dms latency</string>
......
...@@ -16,10 +16,6 @@ ...@@ -16,10 +16,6 @@
android:key="testUrl" android:key="testUrl"
android:title="@string/connection_test_url" android:title="@string/connection_test_url"
app:pref_summaryHasText="%s"/> app:pref_summaryHasText="%s"/>
<AutoSummaryEditTextPreference
android:key="testUrlChinaList"
android:title="@string/connection_test_url_chinalist"
app:pref_summaryHasText="%s"/>
<PreferenceCategory <PreferenceCategory
android:title="@string/advanced"> android:title="@string/advanced">
<SimpleMenuPreference <SimpleMenuPreference
......
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