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
1ff8174e
Commit
1ff8174e
authored
Mar 01, 2020
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine command line interface
parent
a3a70f0d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
7 deletions
+6
-7
.circleci/config.yml
.circleci/config.yml
+1
-1
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
+1
-1
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
.../src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
+2
-3
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+1
-1
core/src/main/rust/shadowsocks-rust
core/src/main/rust/shadowsocks-rust
+1
-1
No files found.
.circleci/config.yml
View file @
1ff8174e
...
@@ -13,7 +13,7 @@ jobs:
...
@@ -13,7 +13,7 @@ jobs:
key
:
jars-{{ checksum "build.gradle" }}
key
:
jars-{{ checksum "build.gradle" }}
-
run
:
-
run
:
name
:
Run Build and Tests
name
:
Run Build and Tests
command
:
./gradlew
cargoBuild && ./gradlew
assembleDebug check
command
:
./gradlew assembleDebug check
-
save_cache
:
-
save_cache
:
paths
:
paths
:
-
~/.gradle
-
~/.gradle
...
...
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
View file @
1ff8174e
...
@@ -232,7 +232,7 @@ object BaseService {
...
@@ -232,7 +232,7 @@ object BaseService {
}
}
}
}
fun
isVpnService
():
Boolean
=
false
val
isVpnService
get
()
=
false
suspend
fun
startProcesses
(
hosts
:
HostsFile
)
{
suspend
fun
startProcesses
(
hosts
:
HostsFile
)
{
val
configRoot
=
(
if
(
Build
.
VERSION
.
SDK_INT
<
24
||
app
.
getSystemService
<
UserManager
>()
val
configRoot
=
(
if
(
Build
.
VERSION
.
SDK_INT
<
24
||
app
.
getSystemService
<
UserManager
>()
...
...
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
View file @
1ff8174e
...
@@ -114,7 +114,7 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -114,7 +114,7 @@ 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
()
val
vpnFlags
=
if
(
service
.
isVpnService
()
)
";V"
else
""
val
vpnFlags
=
if
(
service
.
isVpnService
)
";V"
else
""
plugin
?.
let
{
(
path
,
opts
)
->
config
.
put
(
"plugin"
,
path
).
put
(
"plugin_opts"
,
opts
.
toString
()
+
vpnFlags
)
}
plugin
?.
let
{
(
path
,
opts
)
->
config
.
put
(
"plugin"
,
path
).
put
(
"plugin_opts"
,
opts
.
toString
()
+
vpnFlags
)
}
config
.
put
(
"local_address"
,
DataStore
.
listenAddress
)
config
.
put
(
"local_address"
,
DataStore
.
listenAddress
)
config
.
put
(
"local_port"
,
DataStore
.
portProxy
)
config
.
put
(
"local_port"
,
DataStore
.
portProxy
)
...
@@ -122,9 +122,8 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -122,9 +122,8 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
val
cmd
=
arrayListOf
(
val
cmd
=
arrayListOf
(
File
((
service
as
Context
).
applicationInfo
.
nativeLibraryDir
,
Executable
.
SS_LOCAL
).
absolutePath
,
File
((
service
as
Context
).
applicationInfo
.
nativeLibraryDir
,
Executable
.
SS_LOCAL
).
absolutePath
,
"--stat-path"
,
stat
.
absolutePath
,
"-c"
,
configFile
.
absolutePath
)
"-c"
,
configFile
.
absolutePath
)
if
(
service
.
isVpnService
())
cmd
+=
arrayListOf
(
"--protect-path"
,
"protect_path
"
)
if
(
service
.
isVpnService
)
cmd
+=
arrayListOf
(
"--vpn
"
)
if
(
extraFlag
!=
null
)
cmd
.
add
(
extraFlag
)
if
(
extraFlag
!=
null
)
cmd
.
add
(
extraFlag
)
if
(
route
!=
Acl
.
ALL
)
{
if
(
route
!=
Acl
.
ALL
)
{
...
...
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
View file @
1ff8174e
...
@@ -187,7 +187,7 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
...
@@ -187,7 +187,7 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
sendFd
(
startVpn
())
sendFd
(
startVpn
())
}
}
override
fun
isVpnService
():
Boolean
=
true
override
val
isVpnService
get
()
=
true
private
suspend
fun
startVpn
():
FileDescriptor
{
private
suspend
fun
startVpn
():
FileDescriptor
{
val
profile
=
data
.
proxy
!!
.
profile
val
profile
=
data
.
proxy
!!
.
profile
...
...
shadowsocks-rust
@
ce05fb8a
Subproject commit
9a9cf76e892db52869bb4a90c7656571cbdfd5f4
Subproject commit
ce05fb8ad50c69976b7e63b713c32d8ed164250d
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