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
608d0227
Commit
608d0227
authored
Feb 27, 2020
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable shadowsocks-rust
parent
fa116942
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
46 deletions
+11
-46
core/build.gradle
core/build.gradle
+3
-3
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
+2
-2
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
.../src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
+4
-6
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+0
-5
core/src/main/res/values/arrays.xml
core/src/main/res/values/arrays.xml
+1
-29
core/src/main/rust
core/src/main/rust
+1
-1
No files found.
core/build.gradle
View file @
608d0227
...
@@ -57,14 +57,14 @@ cargo {
...
@@ -57,14 +57,14 @@ cargo {
module
=
'src/main/rust'
module
=
'src/main/rust'
libname
=
'sslocal'
libname
=
'sslocal'
targets
=
[
'arm'
,
'arm64'
,
'x86'
,
'x86_64'
]
targets
=
[
'arm'
,
'arm64'
,
'x86'
,
'x86_64'
]
profile
=
'
release
'
profile
=
'
debug
'
targetIncludes
=
[
'libsslocal.so'
]
targetIncludes
=
[
'libsslocal.so'
]
extraCargoBuildArguments
=
[
'--bin'
,
'sslocal'
]
extraCargoBuildArguments
=
[
'--bin'
,
'sslocal'
]
features
{
features
{
noDefaultBut
"sodium"
noDefaultBut
"sodium"
,
"android"
}
}
exec
{
spec
,
toolchain
->
exec
{
spec
,
toolchain
->
spec
.
environment
(
"RUSTFLAGS"
,
"-C link-arg=-o -C link-arg=target/${toolchain.target}/
release
/libsslocal.so"
)
spec
.
environment
(
"RUSTFLAGS"
,
"-C link-arg=-o -C link-arg=target/${toolchain.target}/
${profile}
/libsslocal.so"
)
}
}
}
}
...
...
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
View file @
608d0227
...
@@ -241,12 +241,12 @@ object BaseService {
...
@@ -241,12 +241,12 @@ object BaseService {
data
.
proxy
!!
.
start
(
this
,
data
.
proxy
!!
.
start
(
this
,
File
(
Core
.
deviceStorage
.
noBackupFilesDir
,
"stat_main"
),
File
(
Core
.
deviceStorage
.
noBackupFilesDir
,
"stat_main"
),
File
(
configRoot
,
CONFIG_FILE
),
File
(
configRoot
,
CONFIG_FILE
),
if
(
udpFallback
==
null
)
"-
u
"
else
null
)
if
(
udpFallback
==
null
)
"-
U
"
else
null
)
check
(
udpFallback
?.
plugin
==
null
)
{
"UDP fallback cannot have plugins"
}
check
(
udpFallback
?.
plugin
==
null
)
{
"UDP fallback cannot have plugins"
}
udpFallback
?.
start
(
this
,
udpFallback
?.
start
(
this
,
File
(
Core
.
deviceStorage
.
noBackupFilesDir
,
"stat_udp"
),
File
(
Core
.
deviceStorage
.
noBackupFilesDir
,
"stat_udp"
),
File
(
configRoot
,
CONFIG_FILE_UDP
),
File
(
configRoot
,
CONFIG_FILE_UDP
),
"-
U
"
)
"-
u
"
)
}
}
fun
startRunner
()
{
fun
startRunner
()
{
...
...
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
View file @
608d0227
...
@@ -115,13 +115,14 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -115,13 +115,14 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
this
.
configFile
=
configFile
this
.
configFile
=
configFile
val
config
=
profile
.
toJson
()
val
config
=
profile
.
toJson
()
plugin
?.
let
{
(
path
,
opts
)
->
config
.
put
(
"plugin"
,
path
).
put
(
"plugin_opts"
,
opts
.
toString
())
}
plugin
?.
let
{
(
path
,
opts
)
->
config
.
put
(
"plugin"
,
path
).
put
(
"plugin_opts"
,
opts
.
toString
())
}
config
.
put
(
"local_addr"
,
DataStore
.
listenAddress
)
config
.
put
(
"local_addr
ess
"
,
DataStore
.
listenAddress
)
config
.
put
(
"local_port"
,
DataStore
.
portProxy
)
config
.
put
(
"local_port"
,
DataStore
.
portProxy
)
configFile
.
writeText
(
config
.
toString
())
configFile
.
writeText
(
config
.
toString
())
val
cmd
=
service
.
buildAdditionalArguments
(
arrayListOf
(
val
cmd
=
service
.
buildAdditionalArguments
(
arrayListOf
(
File
((
service
as
Context
).
applicationInfo
.
nativeLibraryDir
,
Executable
.
SS_LOCAL
).
absolutePath
,
File
((
service
as
Context
).
applicationInfo
.
nativeLibraryDir
,
Executable
.
SS_LOCAL
).
absolutePath
,
"-S"
,
stat
.
absolutePath
,
"--stat-path"
,
stat
.
absolutePath
,
"--protect-path"
,
"protect_path"
,
"-c"
,
configFile
.
absolutePath
))
"-c"
,
configFile
.
absolutePath
))
if
(
extraFlag
!=
null
)
cmd
.
add
(
extraFlag
)
if
(
extraFlag
!=
null
)
cmd
.
add
(
extraFlag
)
...
@@ -130,10 +131,7 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -130,10 +131,7 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
cmd
+=
Acl
.
getFile
(
route
).
absolutePath
cmd
+=
Acl
.
getFile
(
route
).
absolutePath
}
}
// for UDP profile, it's only going to operate in UDP relay mode-only so this flag has no effect
// if (DataStore.tcpFastOpen) cmd += "--fast-open"
if
(
profile
.
route
==
Acl
.
ALL
)
cmd
+=
"-D"
if
(
DataStore
.
tcpFastOpen
)
cmd
+=
"--fast-open"
service
.
data
.
processes
!!
.
start
(
cmd
)
service
.
data
.
processes
!!
.
start
(
cmd
)
}
}
...
...
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
View file @
608d0227
...
@@ -151,11 +151,6 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
...
@@ -151,11 +151,6 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
sendFd
(
startVpn
())
sendFd
(
startVpn
())
}
}
override
fun
buildAdditionalArguments
(
cmd
:
ArrayList
<
String
>):
ArrayList
<
String
>
{
cmd
+=
"-V"
return
cmd
}
private
suspend
fun
startVpn
():
FileDescriptor
{
private
suspend
fun
startVpn
():
FileDescriptor
{
val
profile
=
data
.
proxy
!!
.
profile
val
profile
=
data
.
proxy
!!
.
profile
val
builder
=
Builder
()
val
builder
=
Builder
()
...
...
core/src/main/res/values/arrays.xml
View file @
608d0227
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<string-array
name=
"enc_method_entry"
translatable=
"false"
>
<string-array
name=
"enc_method_entry"
translatable=
"false"
>
<item>
RC4-MD5
</item>
<item>
AES-128-CFB
</item>
<item>
AES-192-CFB
</item>
<item>
AES-256-CFB
</item>
<item>
AES-128-CTR
</item>
<item>
AES-192-CTR
</item>
<item>
AES-256-CTR
</item>
<item>
BF-CFB
</item>
<item>
CAMELLIA-128-CFB
</item>
<item>
CAMELLIA-192-CFB
</item>
<item>
CAMELLIA-256-CFB
</item>
<item>
SALSA20
</item>
<item>
CHACHA20
</item>
<item>
CHACHA20-IETF
</item>
<item>
AES-128-GCM
</item>
<item>
AES-128-GCM
</item>
<item>
AES-192-GCM
</item>
<item>
AES-192-GCM
</item>
<item>
AES-256-GCM
</item>
<item>
AES-256-GCM
</item>
...
@@ -23,20 +9,6 @@
...
@@ -23,20 +9,6 @@
</string-array>
</string-array>
<string-array
name=
"enc_method_value"
translatable=
"false"
>
<string-array
name=
"enc_method_value"
translatable=
"false"
>
<item>
rc4-md5
</item>
<item>
aes-128-cfb
</item>
<item>
aes-192-cfb
</item>
<item>
aes-256-cfb
</item>
<item>
aes-128-ctr
</item>
<item>
aes-192-ctr
</item>
<item>
aes-256-ctr
</item>
<item>
bf-cfb
</item>
<item>
camellia-128-cfb
</item>
<item>
camellia-192-cfb
</item>
<item>
camellia-256-cfb
</item>
<item>
salsa20
</item>
<item>
chacha20
</item>
<item>
chacha20-ietf
</item>
<item>
aes-128-gcm
</item>
<item>
aes-128-gcm
</item>
<item>
aes-192-gcm
</item>
<item>
aes-192-gcm
</item>
<item>
aes-256-gcm
</item>
<item>
aes-256-gcm
</item>
...
@@ -212,4 +184,4 @@
...
@@ -212,4 +184,4 @@
<item>
vpn
</item>
<item>
vpn
</item>
<item>
transproxy
</item>
<item>
transproxy
</item>
</string-array>
</string-array>
</resources>
</resources>
\ No newline at end of file
rust
@
71b29f66
Subproject commit
a6bad0389f44dec993afc39c71f1ddfe02b65fa9
Subproject commit
71b29f66b06ec01e1f0747db0bb85676e0f1663c
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