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
616603a2
Commit
616603a2
authored
Feb 28, 2020
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the plugin issue
parent
d46b3b3c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
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
+4
-3
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+2
-0
core/src/main/rust
core/src/main/rust
+1
-1
No files found.
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
View file @
616603a2
...
@@ -232,7 +232,7 @@ object BaseService {
...
@@ -232,7 +232,7 @@ object BaseService {
}
}
}
}
fun
buildAdditionalArguments
(
cmd
:
ArrayList
<
String
>):
ArrayList
<
String
>
=
cmd
fun
isVpnService
():
Boolean
=
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 @
616603a2
...
@@ -114,16 +114,17 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -114,16 +114,17 @@ 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
())
}
val
vpnFlags
=
if
(
service
.
isVpnService
())
";V"
else
""
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
)
configFile
.
writeText
(
config
.
toString
())
configFile
.
writeText
(
config
.
toString
())
val
cmd
=
service
.
buildAdditionalArguments
(
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
,
"--stat-path"
,
stat
.
absolutePath
,
"--protect-path"
,
"protect_path"
,
"-c"
,
configFile
.
absolutePath
))
"-c"
,
configFile
.
absolutePath
))
if
(
service
.
isVpnService
())
cmd
+=
arrayListOf
(
"--protect-path"
,
"protect_path"
)
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 @
616603a2
...
@@ -151,6 +151,8 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
...
@@ -151,6 +151,8 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
sendFd
(
startVpn
())
sendFd
(
startVpn
())
}
}
override
fun
isVpnService
():
Boolean
=
true
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
()
...
...
rust
@
f39954ac
Subproject commit
8db01506d6c7b221abe6837417d8be87db1e7d7e
Subproject commit
f39954ac74d6e7a5343a07610c1dd156c0d60fab
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