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
abbfe4a0
Commit
abbfe4a0
authored
Dec 08, 2020
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up code
parent
ebee665f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
14 deletions
+5
-14
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
.../src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
+4
-10
core/src/main/java/com/github/shadowsocks/database/Profile.kt
.../src/main/java/com/github/shadowsocks/database/Profile.kt
+1
-4
No files found.
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
View file @
abbfe4a0
...
@@ -21,8 +21,6 @@
...
@@ -21,8 +21,6 @@
package
com.github.shadowsocks.bg
package
com.github.shadowsocks.bg
import
android.content.Context
import
android.content.Context
import
android.util.Base64
import
com.github.shadowsocks.Core
import
com.github.shadowsocks.acl.Acl
import
com.github.shadowsocks.acl.Acl
import
com.github.shadowsocks.acl.AclSyncer
import
com.github.shadowsocks.acl.AclSyncer
import
com.github.shadowsocks.database.Profile
import
com.github.shadowsocks.database.Profile
...
@@ -30,16 +28,13 @@ import com.github.shadowsocks.plugin.PluginConfiguration
...
@@ -30,16 +28,13 @@ import com.github.shadowsocks.plugin.PluginConfiguration
import
com.github.shadowsocks.plugin.PluginManager
import
com.github.shadowsocks.plugin.PluginManager
import
com.github.shadowsocks.preference.DataStore
import
com.github.shadowsocks.preference.DataStore
import
com.github.shadowsocks.utils.parseNumericAddress
import
com.github.shadowsocks.utils.parseNumericAddress
import
com.github.shadowsocks.utils.signaturesCompat
import
com.github.shadowsocks.utils.useCancellable
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.Dispatchers
import
org.json.JSONArray
import
kotlinx.coroutines.withContext
import
java.io.File
import
java.io.File
import
java.io.IOException
import
java.io.IOException
import
java.net.
*
import
java.net.
URI
import
java.
security.MessageDigest
import
java.
net.URISyntaxException
import
org.json.JSONArray
import
java.net.UnknownHostException
/**
/**
* This class sets up environment for ss-local.
* This class sets up environment for ss-local.
...
@@ -48,7 +43,6 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -48,7 +43,6 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
private
var
configFile
:
File
?
=
null
private
var
configFile
:
File
?
=
null
var
trafficMonitor
:
TrafficMonitor
?
=
null
var
trafficMonitor
:
TrafficMonitor
?
=
null
val
plugin
by
lazy
{
PluginManager
.
init
(
PluginConfiguration
(
profile
.
plugin
?:
""
))
}
val
plugin
by
lazy
{
PluginManager
.
init
(
PluginConfiguration
(
profile
.
plugin
?:
""
))
}
private
var
scheduleConfigUpdate
=
false
suspend
fun
init
(
service
:
BaseService
.
Interface
)
{
suspend
fun
init
(
service
:
BaseService
.
Interface
)
{
// it's hard to resolve DNS on a specific interface so we'll do it here
// it's hard to resolve DNS on a specific interface so we'll do it here
...
...
core/src/main/java/com/github/shadowsocks/database/Profile.kt
View file @
abbfe4a0
...
@@ -54,7 +54,7 @@ data class Profile(
...
@@ -54,7 +54,7 @@ data class Profile(
// user configurable fields
// user configurable fields
var
name
:
String
?
=
""
,
var
name
:
String
?
=
""
,
var
host
:
String
=
sponsored
,
var
host
:
String
=
"example.shadowsocks.org"
,
var
remotePort
:
Int
=
8388
,
var
remotePort
:
Int
=
8388
,
var
password
:
String
=
"u1rRWTssNv0p"
,
var
password
:
String
=
"u1rRWTssNv0p"
,
var
method
:
String
=
"aes-256-cfb"
,
var
method
:
String
=
"aes-256-cfb"
,
...
@@ -101,7 +101,6 @@ data class Profile(
...
@@ -101,7 +101,6 @@ data class Profile(
companion
object
{
companion
object
{
private
const
val
serialVersionUID
=
1L
private
const
val
serialVersionUID
=
1L
private
const
val
sponsored
=
"example.shadowsocks.org"
private
val
pattern
=
private
val
pattern
=
"""(?i)ss://[-a-zA-Z0-9+&@#/%?=.~*'()|!:,;_\[\]]*[-a-zA-Z0-9+&@#/%=.~*'()|\[\]]"""
.
toRegex
()
"""(?i)ss://[-a-zA-Z0-9+&@#/%?=.~*'()|!:,;_\[\]]*[-a-zA-Z0-9+&@#/%=.~*'()|\[\]]"""
.
toRegex
()
private
val
userInfoPattern
=
"^(.+?):(.*)$"
.
toRegex
()
private
val
userInfoPattern
=
"^(.+?):(.*)$"
.
toRegex
()
...
@@ -339,8 +338,6 @@ data class Profile(
...
@@ -339,8 +338,6 @@ data class Profile(
if
(
fallback
!=
null
&&
fallback
.
plugin
.
isNullOrEmpty
())
fallback
.
toJson
().
also
{
put
(
"udp_fallback"
,
it
)
}
if
(
fallback
!=
null
&&
fallback
.
plugin
.
isNullOrEmpty
())
fallback
.
toJson
().
also
{
put
(
"udp_fallback"
,
it
)
}
}
}
val
isSponsored
get
()
=
host
==
sponsored
fun
serialize
()
{
fun
serialize
()
{
DataStore
.
editingId
=
id
DataStore
.
editingId
=
id
DataStore
.
privateStore
.
putString
(
Key
.
name
,
name
)
DataStore
.
privateStore
.
putString
(
Key
.
name
,
name
)
...
...
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