Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
f6d3d095
Unverified
Commit
f6d3d095
authored
Apr 21, 2020
by
Mygod
Committed by
GitHub
Apr 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate TCP Fast Open (#2501)
parent
b52b3563
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
5 additions
and
137 deletions
+5
-137
core/src/main/java/com/github/shadowsocks/Core.kt
core/src/main/java/com/github/shadowsocks/Core.kt
+0
-2
core/src/main/java/com/github/shadowsocks/net/TcpFastOpen.kt
core/src/main/java/com/github/shadowsocks/net/TcpFastOpen.kt
+0
-65
core/src/main/java/com/github/shadowsocks/preference/DataStore.kt
.../main/java/com/github/shadowsocks/preference/DataStore.kt
+0
-3
core/src/main/java/com/github/shadowsocks/utils/Constants.kt
core/src/main/java/com/github/shadowsocks/utils/Constants.kt
+0
-1
core/src/main/res/values/strings.xml
core/src/main/res/values/strings.xml
+0
-3
mobile/src/main/java/com/github/shadowsocks/GlobalSettingsPreferenceFragment.kt
...om/github/shadowsocks/GlobalSettingsPreferenceFragment.kt
+3
-22
mobile/src/main/res/drawable/ic_action_offline_bolt.xml
mobile/src/main/res/drawable/ic_action_offline_bolt.xml
+0
-10
mobile/src/main/res/xml/pref_global.xml
mobile/src/main/res/xml/pref_global.xml
+1
-6
tv/src/main/java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
.../java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
+0
-20
tv/src/main/res/xml/pref_main.xml
tv/src/main/res/xml/pref_main.xml
+1
-5
No files found.
core/src/main/java/com/github/shadowsocks/Core.kt
View file @
f6d3d095
...
@@ -41,7 +41,6 @@ import com.github.shadowsocks.aidl.ShadowsocksConnection
...
@@ -41,7 +41,6 @@ import com.github.shadowsocks.aidl.ShadowsocksConnection
import
com.github.shadowsocks.core.R
import
com.github.shadowsocks.core.R
import
com.github.shadowsocks.database.Profile
import
com.github.shadowsocks.database.Profile
import
com.github.shadowsocks.database.ProfileManager
import
com.github.shadowsocks.database.ProfileManager
import
com.github.shadowsocks.net.TcpFastOpen
import
com.github.shadowsocks.preference.DataStore
import
com.github.shadowsocks.preference.DataStore
import
com.github.shadowsocks.subscription.SubscriptionService
import
com.github.shadowsocks.subscription.SubscriptionService
import
com.github.shadowsocks.utils.*
import
com.github.shadowsocks.utils.*
...
@@ -115,7 +114,6 @@ object Core {
...
@@ -115,7 +114,6 @@ object Core {
// handle data restored/crash
// handle data restored/crash
if
(
Build
.
VERSION
.
SDK_INT
>=
24
&&
DataStore
.
directBootAware
&&
if
(
Build
.
VERSION
.
SDK_INT
>=
24
&&
DataStore
.
directBootAware
&&
app
.
getSystemService
<
UserManager
>()
?.
isUserUnlocked
==
true
)
DirectBoot
.
flushTrafficStats
()
app
.
getSystemService
<
UserManager
>()
?.
isUserUnlocked
==
true
)
DirectBoot
.
flushTrafficStats
()
if
(
DataStore
.
tcpFastOpen
&&
!
TcpFastOpen
.
sendEnabled
)
TcpFastOpen
.
enableTimeout
()
if
(
DataStore
.
publicStore
.
getLong
(
Key
.
assetUpdateTime
,
-
1
)
!=
packageInfo
.
lastUpdateTime
)
{
if
(
DataStore
.
publicStore
.
getLong
(
Key
.
assetUpdateTime
,
-
1
)
!=
packageInfo
.
lastUpdateTime
)
{
val
assetManager
=
app
.
assets
val
assetManager
=
app
.
assets
try
{
try
{
...
...
core/src/main/java/com/github/shadowsocks/net/TcpFastOpen.kt
deleted
100644 → 0
View file @
b52b3563
/*******************************************************************************
* *
* Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com> *
* Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.be> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
package
com.github.shadowsocks.net
import
com.github.shadowsocks.utils.readableMessage
import
kotlinx.coroutines.runBlocking
import
kotlinx.coroutines.withTimeoutOrNull
import
java.io.File
import
java.io.IOException
object
TcpFastOpen
{
private
const
val
PATH
=
"/proc/sys/net/ipv4/tcp_fastopen"
/**
* Is kernel version >= 3.7.1.
*/
val
supported
by
lazy
{
if
(
File
(
PATH
).
canRead
())
return
@lazy
true
val
match
=
"""^(\d+)\.(\d+)\.(\d+)"""
.
toRegex
().
find
(
System
.
getProperty
(
"os.version"
)
?:
""
)
if
(
match
==
null
)
false
else
when
(
match
.
groupValues
[
1
].
toInt
())
{
in
Int
.
MIN_VALUE
..
2
->
false
3
->
when
(
match
.
groupValues
[
2
].
toInt
())
{
in
Int
.
MIN_VALUE
..
6
->
false
7
->
match
.
groupValues
[
3
].
toInt
()
>=
1
else
->
true
}
else
->
true
}
}
val
sendEnabled
:
Boolean
get
()
{
val
file
=
File
(
PATH
)
// File.readText doesn't work since this special file will return length 0
// on Android containers like Chrome OS, this file does not exist so we simply judge by the kernel version
return
if
(
file
.
canRead
())
file
.
bufferedReader
().
use
{
it
.
readText
()
}.
trim
().
toInt
()
and
1
>
0
else
supported
}
fun
enable
():
String
?
{
return
try
{
ProcessBuilder
(
"su"
,
"-c"
,
"echo 3 > $PATH"
).
redirectErrorStream
(
true
).
start
()
.
inputStream
.
bufferedReader
().
readText
()
}
catch
(
e
:
IOException
)
{
e
.
readableMessage
}
}
fun
enableTimeout
()
=
runBlocking
{
withTimeoutOrNull
(
1000
)
{
enable
()
}
}
}
core/src/main/java/com/github/shadowsocks/preference/DataStore.kt
View file @
f6d3d095
...
@@ -26,7 +26,6 @@ import com.github.shadowsocks.BootReceiver
...
@@ -26,7 +26,6 @@ import com.github.shadowsocks.BootReceiver
import
com.github.shadowsocks.Core
import
com.github.shadowsocks.Core
import
com.github.shadowsocks.database.PrivateDatabase
import
com.github.shadowsocks.database.PrivateDatabase
import
com.github.shadowsocks.database.PublicDatabase
import
com.github.shadowsocks.database.PublicDatabase
import
com.github.shadowsocks.net.TcpFastOpen
import
com.github.shadowsocks.utils.DirectBoot
import
com.github.shadowsocks.utils.DirectBoot
import
com.github.shadowsocks.utils.Key
import
com.github.shadowsocks.utils.Key
import
com.github.shadowsocks.utils.parsePort
import
com.github.shadowsocks.utils.parsePort
...
@@ -64,7 +63,6 @@ object DataStore : OnPreferenceDataStoreChangeListener {
...
@@ -64,7 +63,6 @@ object DataStore : OnPreferenceDataStoreChangeListener {
?:
BootReceiver
.
enabled
.
also
{
publicStore
.
putBoolean
(
Key
.
persistAcrossReboot
,
it
)
}
?:
BootReceiver
.
enabled
.
also
{
publicStore
.
putBoolean
(
Key
.
persistAcrossReboot
,
it
)
}
val
canToggleLocked
:
Boolean
get
()
=
publicStore
.
getBoolean
(
Key
.
directBootAware
)
==
true
val
canToggleLocked
:
Boolean
get
()
=
publicStore
.
getBoolean
(
Key
.
directBootAware
)
==
true
val
directBootAware
:
Boolean
get
()
=
Core
.
directBootSupported
&&
canToggleLocked
val
directBootAware
:
Boolean
get
()
=
Core
.
directBootSupported
&&
canToggleLocked
val
tcpFastOpen
:
Boolean
get
()
=
TcpFastOpen
.
sendEnabled
&&
publicStore
.
getBoolean
(
Key
.
tfo
,
false
)
val
serviceMode
get
()
=
publicStore
.
getString
(
Key
.
serviceMode
)
?:
Key
.
modeVpn
val
serviceMode
get
()
=
publicStore
.
getString
(
Key
.
serviceMode
)
?:
Key
.
modeVpn
val
listenAddress
get
()
=
if
(
publicStore
.
getBoolean
(
Key
.
shareOverLan
,
false
))
"0.0.0.0"
else
"127.0.0.1"
val
listenAddress
get
()
=
if
(
publicStore
.
getBoolean
(
Key
.
shareOverLan
,
false
))
"0.0.0.0"
else
"127.0.0.1"
var
portProxy
:
Int
var
portProxy
:
Int
...
@@ -83,7 +81,6 @@ object DataStore : OnPreferenceDataStoreChangeListener {
...
@@ -83,7 +81,6 @@ object DataStore : OnPreferenceDataStoreChangeListener {
*/
*/
fun
initGlobal
()
{
fun
initGlobal
()
{
persistAcrossReboot
persistAcrossReboot
if
(
publicStore
.
getBoolean
(
Key
.
tfo
)
==
null
)
publicStore
.
putBoolean
(
Key
.
tfo
,
tcpFastOpen
)
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
if
(
publicStore
.
getString
(
Key
.
portTransproxy
)
==
null
)
portTransproxy
=
portTransproxy
if
(
publicStore
.
getString
(
Key
.
portTransproxy
)
==
null
)
portTransproxy
=
portTransproxy
...
...
core/src/main/java/com/github/shadowsocks/utils/Constants.kt
View file @
f6d3d095
...
@@ -64,7 +64,6 @@ object Key {
...
@@ -64,7 +64,6 @@ object Key {
const
val
dirty
=
"profileDirty"
const
val
dirty
=
"profileDirty"
const
val
tfo
=
"tcp_fastopen"
const
val
hosts
=
"hosts"
const
val
hosts
=
"hosts"
const
val
assetUpdateTime
=
"assetUpdateTime"
const
val
assetUpdateTime
=
"assetUpdateTime"
...
...
core/src/main/res/values/strings.xml
View file @
f6d3d095
...
@@ -56,9 +56,6 @@
...
@@ -56,9 +56,6 @@
<string
name=
"auto_connect_summary"
>
Enable Shadowsocks on startup/app update if it was running before
</string>
<string
name=
"auto_connect_summary"
>
Enable Shadowsocks on startup/app update if it was running before
</string>
<string
name=
"direct_boot_aware"
>
Allow Toggling in Lock Screen
</string>
<string
name=
"direct_boot_aware"
>
Allow Toggling in Lock Screen
</string>
<string
name=
"direct_boot_aware_summary"
>
Your selected profile information will be less protected
</string>
<string
name=
"direct_boot_aware_summary"
>
Your selected profile information will be less protected
</string>
<string
name=
"tcp_fastopen_summary"
>
Toggling might require ROOT permission
</string>
<string
name=
"tcp_fastopen_summary_unsupported"
>
Unsupported kernel version: %s
<
3.7.1
</string>
<string
name=
"tcp_fastopen_failure"
>
Toggle failed
</string>
<plurals
name=
"hosts_summary"
>
<plurals
name=
"hosts_summary"
>
<item
quantity=
"one"
>
1 hostname configured
</item>
<item
quantity=
"one"
>
1 hostname configured
</item>
<item
quantity=
"other"
>
%d hostnames configured
</item>
<item
quantity=
"other"
>
%d hostnames configured
</item>
...
...
mobile/src/main/java/com/github/shadowsocks/GlobalSettingsPreferenceFragment.kt
View file @
f6d3d095
...
@@ -30,14 +30,13 @@ import androidx.preference.Preference
...
@@ -30,14 +30,13 @@ import androidx.preference.Preference
import
androidx.preference.PreferenceFragmentCompat
import
androidx.preference.PreferenceFragmentCompat
import
androidx.preference.SwitchPreference
import
androidx.preference.SwitchPreference
import
com.github.shadowsocks.bg.BaseService
import
com.github.shadowsocks.bg.BaseService
import
com.github.shadowsocks.preference.DataStore
import
com.github.shadowsocks.utils.DirectBoot
import
com.github.shadowsocks.utils.Key
import
com.github.shadowsocks.net.TcpFastOpen
import
com.github.shadowsocks.plugin.showAllowingStateLoss
import
com.github.shadowsocks.plugin.showAllowingStateLoss
import
com.github.shadowsocks.preference.BrowsableEditTextPreferenceDialogFragment
import
com.github.shadowsocks.preference.BrowsableEditTextPreferenceDialogFragment
import
com.github.shadowsocks.preference.DataStore
import
com.github.shadowsocks.preference.EditTextPreferenceModifiers
import
com.github.shadowsocks.preference.EditTextPreferenceModifiers
import
com.github.shadowsocks.preference.HostsSummaryProvider
import
com.github.shadowsocks.preference.HostsSummaryProvider
import
com.github.shadowsocks.utils.DirectBoot
import
com.github.shadowsocks.utils.Key
import
com.github.shadowsocks.utils.readableMessage
import
com.github.shadowsocks.utils.readableMessage
import
com.github.shadowsocks.utils.remove
import
com.github.shadowsocks.utils.remove
import
com.github.shadowsocks.widget.MainListListener
import
com.github.shadowsocks.widget.MainListListener
...
@@ -64,23 +63,6 @@ class GlobalSettingsPreferenceFragment : PreferenceFragmentCompat() {
...
@@ -64,23 +63,6 @@ class GlobalSettingsPreferenceFragment : PreferenceFragmentCompat() {
true
true
}
else
canToggleLocked
.
remove
()
}
else
canToggleLocked
.
remove
()
val
tfo
=
findPreference
<
SwitchPreference
>(
Key
.
tfo
)
!!
tfo
.
isChecked
=
DataStore
.
tcpFastOpen
tfo
.
setOnPreferenceChangeListener
{
_
,
value
->
if
(
value
as
Boolean
&&
!
TcpFastOpen
.
sendEnabled
)
{
val
result
=
TcpFastOpen
.
enable
()
?.
trim
()
if
(
TcpFastOpen
.
sendEnabled
)
true
else
{
(
activity
as
MainActivity
).
snackbar
(
if
(
result
.
isNullOrEmpty
())
getText
(
R
.
string
.
tcp_fastopen_failure
)
else
result
).
show
()
false
}
}
else
true
}
if
(!
TcpFastOpen
.
supported
)
{
tfo
.
isEnabled
=
false
tfo
.
summary
=
getString
(
R
.
string
.
tcp_fastopen_summary_unsupported
,
System
.
getProperty
(
"os.version"
))
}
hosts
.
setOnBindEditTextListener
(
EditTextPreferenceModifiers
.
Monospace
)
hosts
.
setOnBindEditTextListener
(
EditTextPreferenceModifiers
.
Monospace
)
hosts
.
summaryProvider
=
HostsSummaryProvider
hosts
.
summaryProvider
=
HostsSummaryProvider
val
serviceMode
=
findPreference
<
Preference
>(
Key
.
serviceMode
)
!!
val
serviceMode
=
findPreference
<
Preference
>(
Key
.
serviceMode
)
!!
...
@@ -96,7 +78,6 @@ class GlobalSettingsPreferenceFragment : PreferenceFragmentCompat() {
...
@@ -96,7 +78,6 @@ class GlobalSettingsPreferenceFragment : PreferenceFragmentCompat() {
}
}
val
listener
:
(
BaseService
.
State
)
->
Unit
=
{
val
listener
:
(
BaseService
.
State
)
->
Unit
=
{
val
stopped
=
it
==
BaseService
.
State
.
Stopped
val
stopped
=
it
==
BaseService
.
State
.
Stopped
tfo
.
isEnabled
=
stopped
hosts
.
isEnabled
=
stopped
hosts
.
isEnabled
=
stopped
serviceMode
.
isEnabled
=
stopped
serviceMode
.
isEnabled
=
stopped
portProxy
.
isEnabled
=
stopped
portProxy
.
isEnabled
=
stopped
...
...
mobile/src/main/res/drawable/ic_action_offline_bolt.xml
deleted
100644 → 0
View file @
b52b3563
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
android:tint=
"?attr/colorControlNormal"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M12,2.02c-5.51,0 -9.98,4.47 -9.98,9.98s4.47,9.98 9.98,9.98 9.98,-4.47 9.98,-9.98S17.51,2.02 12,2.02zM11.48,20v-6.26H8L13,4v6.26h3.35L11.48,20z"
/>
</vector>
mobile/src/main/res/xml/pref_global.xml
View file @
f6d3d095
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:app=
"http://schemas.android.com/apk/res-auto"
<PreferenceScreen
xmlns:app=
"http://schemas.android.com/apk/res-auto"
app:initialExpandedChildrenCount=
"
4
"
>
app:initialExpandedChildrenCount=
"
3
"
>
<SwitchPreference
<SwitchPreference
app:key=
"isAutoConnect"
app:key=
"isAutoConnect"
app:icon=
"@drawable/ic_communication_phonelink_ring"
app:icon=
"@drawable/ic_communication_phonelink_ring"
...
@@ -11,11 +11,6 @@
...
@@ -11,11 +11,6 @@
app:icon=
"@drawable/ic_action_lock"
app:icon=
"@drawable/ic_action_lock"
app:summary=
"@string/direct_boot_aware_summary"
app:summary=
"@string/direct_boot_aware_summary"
app:title=
"@string/direct_boot_aware"
/>
app:title=
"@string/direct_boot_aware"
/>
<SwitchPreference
app:key=
"tcp_fastopen"
app:icon=
"@drawable/ic_action_offline_bolt"
app:summary=
"@string/tcp_fastopen_summary"
app:title=
"TCP Fast Open"
/>
<EditTextPreference
<EditTextPreference
app:key=
"hosts"
app:key=
"hosts"
app:icon=
"@drawable/ic_maps_menu_book"
app:icon=
"@drawable/ic_maps_menu_book"
...
...
tv/src/main/java/com/github/shadowsocks/tv/MainPreferenceFragment.kt
View file @
f6d3d095
...
@@ -44,7 +44,6 @@ import com.github.shadowsocks.aidl.TrafficStats
...
@@ -44,7 +44,6 @@ import com.github.shadowsocks.aidl.TrafficStats
import
com.github.shadowsocks.bg.BaseService
import
com.github.shadowsocks.bg.BaseService
import
com.github.shadowsocks.database.ProfileManager
import
com.github.shadowsocks.database.ProfileManager
import
com.github.shadowsocks.net.HttpsTest
import
com.github.shadowsocks.net.HttpsTest
import
com.github.shadowsocks.net.TcpFastOpen
import
com.github.shadowsocks.preference.DataStore
import
com.github.shadowsocks.preference.DataStore
import
com.github.shadowsocks.preference.EditTextPreferenceModifiers
import
com.github.shadowsocks.preference.EditTextPreferenceModifiers
import
com.github.shadowsocks.preference.HostsSummaryProvider
import
com.github.shadowsocks.preference.HostsSummaryProvider
...
@@ -70,7 +69,6 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
...
@@ -70,7 +69,6 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
private
lateinit
var
controlImport
:
Preference
private
lateinit
var
controlImport
:
Preference
private
lateinit
var
hosts
:
EditTextPreference
private
lateinit
var
hosts
:
EditTextPreference
private
lateinit
var
serviceMode
:
Preference
private
lateinit
var
serviceMode
:
Preference
private
lateinit
var
tfo
:
SwitchPreference
private
lateinit
var
shareOverLan
:
Preference
private
lateinit
var
shareOverLan
:
Preference
private
lateinit
var
portProxy
:
EditTextPreference
private
lateinit
var
portProxy
:
EditTextPreference
private
lateinit
var
portLocalDns
:
EditTextPreference
private
lateinit
var
portLocalDns
:
EditTextPreference
...
@@ -116,7 +114,6 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
...
@@ -116,7 +114,6 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
this
.
state
=
state
this
.
state
=
state
val
stopped
=
state
==
BaseService
.
State
.
Stopped
val
stopped
=
state
==
BaseService
.
State
.
Stopped
controlImport
.
isEnabled
=
stopped
controlImport
.
isEnabled
=
stopped
tfo
.
isEnabled
=
stopped
hosts
.
isEnabled
=
stopped
hosts
.
isEnabled
=
stopped
serviceMode
.
isEnabled
=
stopped
serviceMode
.
isEnabled
=
stopped
shareOverLan
.
isEnabled
=
stopped
shareOverLan
.
isEnabled
=
stopped
...
@@ -154,23 +151,6 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
...
@@ -154,23 +151,6 @@ class MainPreferenceFragment : LeanbackPreferenceFragmentCompat(), ShadowsocksCo
true
true
}
}
tfo
=
findPreference
(
Key
.
tfo
)
!!
tfo
.
isChecked
=
DataStore
.
tcpFastOpen
tfo
.
setOnPreferenceChangeListener
{
_
,
value
->
if
(
value
as
Boolean
&&
!
TcpFastOpen
.
sendEnabled
)
{
val
result
=
TcpFastOpen
.
enable
()
?.
trim
()
if
(
TcpFastOpen
.
sendEnabled
)
true
else
{
Toast
.
makeText
(
requireContext
(),
if
(
result
.
isNullOrEmpty
())
getText
(
R
.
string
.
tcp_fastopen_failure
)
else
result
,
Toast
.
LENGTH_SHORT
).
show
()
false
}
}
else
true
}
if
(!
TcpFastOpen
.
supported
)
{
tfo
.
isEnabled
=
false
tfo
.
summary
=
getString
(
R
.
string
.
tcp_fastopen_summary_unsupported
,
System
.
getProperty
(
"os.version"
))
}
hosts
=
findPreference
(
Key
.
hosts
)
!!
hosts
=
findPreference
(
Key
.
hosts
)
!!
hosts
.
summaryProvider
=
HostsSummaryProvider
hosts
.
summaryProvider
=
HostsSummaryProvider
serviceMode
=
findPreference
(
Key
.
serviceMode
)
!!
serviceMode
=
findPreference
(
Key
.
serviceMode
)
!!
...
...
tv/src/main/res/xml/pref_main.xml
View file @
f6d3d095
...
@@ -20,15 +20,11 @@
...
@@ -20,15 +20,11 @@
<PreferenceCategory
<PreferenceCategory
app:key=
"settings"
app:key=
"settings"
app:title=
"@string/settings"
app:title=
"@string/settings"
app:initialExpandedChildrenCount=
"
3
"
>
app:initialExpandedChildrenCount=
"
2
"
>
<SwitchPreference
<SwitchPreference
app:key=
"isAutoConnect"
app:key=
"isAutoConnect"
app:summary=
"@string/auto_connect_summary"
app:summary=
"@string/auto_connect_summary"
app:title=
"@string/auto_connect"
/>
app:title=
"@string/auto_connect"
/>
<SwitchPreference
app:key=
"tcp_fastopen"
app:summary=
"@string/tcp_fastopen_summary"
app:title=
"TCP Fast Open"
/>
<EditTextPreference
<EditTextPreference
app:key=
"hosts"
app:key=
"hosts"
app:title=
"hosts"
/>
app:title=
"hosts"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment