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"
|
||||
|
||||
@@ -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="speed">%s/s</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_testing">Testing…</string>
|
||||
<string name="connection_test_available">Success: %dms latency</string>
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
android:key="testUrl"
|
||||
android:title="@string/connection_test_url"
|
||||
app:pref_summaryHasText="%s"/>
|
||||
<AutoSummaryEditTextPreference
|
||||
android:key="testUrlChinaList"
|
||||
android:title="@string/connection_test_url_chinalist"
|
||||
app:pref_summaryHasText="%s"/>
|
||||
<PreferenceCategory
|
||||
android:title="@string/advanced">
|
||||
<SimpleMenuPreference
|
||||
|
||||
Reference in New Issue
Block a user