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
d734e9fd
Commit
d734e9fd
authored
Jan 20, 2017
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix socket protect in simple-obfs
parent
0e85514c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
mobile/src/main/scala/com/github/shadowsocks/BaseService.scala
...e/src/main/scala/com/github/shadowsocks/BaseService.scala
+8
-2
mobile/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+2
-2
No files found.
mobile/src/main/scala/com/github/shadowsocks/BaseService.scala
View file @
d734e9fd
...
@@ -313,7 +313,7 @@ trait BaseService extends Service {
...
@@ -313,7 +313,7 @@ trait BaseService extends Service {
}
}
}
}
protected
def
buildShadowsocksConfig
(
file
:
String
,
localPortOffset
:
Int
=
0
)
:
String
=
{
protected
def
buildShadowsocksConfig
(
file
:
String
,
localPortOffset
:
Int
=
0
,
vpn
:
Boolean
=
false
)
:
String
=
{
val
config
=
new
JSONObject
()
val
config
=
new
JSONObject
()
config
.
put
(
"server"
,
profile
.
host
)
config
.
put
(
"server"
,
profile
.
host
)
config
.
put
(
"server_port"
,
profile
.
remotePort
)
config
.
put
(
"server_port"
,
profile
.
remotePort
)
...
@@ -323,7 +323,13 @@ trait BaseService extends Service {
...
@@ -323,7 +323,13 @@ trait BaseService extends Service {
if
(
profile
.
auth
)
config
.
put
(
"auth"
,
true
)
if
(
profile
.
auth
)
config
.
put
(
"auth"
,
true
)
if
(
pluginPath
!=
null
)
{
if
(
pluginPath
!=
null
)
{
config
.
put
(
"plugin"
,
pluginPath
)
config
.
put
(
"plugin"
,
pluginPath
)
config
.
put
(
"plugin_opts"
,
plugin
.
toString
)
val
plugin_opts
=
if
(
vpn
)
{
"V;P="
+
getApplicationInfo
.
dataDir
+
";"
+
plugin
.
toString
}
else
{
plugin
.
toString
}
Log
.
d
(
"shadowsocks"
,
plugin_opts
)
config
.
put
(
"plugin_opts"
,
plugin_opts
)
}
}
IOUtils
.
writeString
(
file
,
config
.
toString
)
IOUtils
.
writeString
(
file
,
config
.
toString
)
file
file
...
...
mobile/src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
d734e9fd
...
@@ -167,7 +167,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -167,7 +167,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
,
"-b"
,
"127.0.0.1"
,
"-b"
,
"127.0.0.1"
,
"-t"
,
"600"
,
"-t"
,
"600"
,
"-P"
,
getApplicationInfo
.
dataDir
,
"-P"
,
getApplicationInfo
.
dataDir
,
"-c"
,
buildShadowsocksConfig
(
getApplicationInfo
.
dataDir
+
"/ss-local-vpn.conf"
))
,
"-c"
,
buildShadowsocksConfig
(
getApplicationInfo
.
dataDir
+
"/ss-local-vpn.conf"
,
0
,
true
))
if
(
profile
.
udpdns
)
cmd
+=
"-u"
if
(
profile
.
udpdns
)
cmd
+=
"-u"
...
@@ -190,7 +190,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -190,7 +190,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
,
"-b"
,
"127.0.0.1"
,
"-b"
,
"127.0.0.1"
,
"-L"
,
if
(
profile
.
remoteDns
==
null
)
"8.8.8.8:53"
else
profile
.
remoteDns
+
":53"
,
"-L"
,
if
(
profile
.
remoteDns
==
null
)
"8.8.8.8:53"
else
profile
.
remoteDns
+
":53"
,
"-P"
,
getApplicationInfo
.
dataDir
,
"-P"
,
getApplicationInfo
.
dataDir
,
"-c"
,
buildShadowsocksConfig
(
getApplicationInfo
.
dataDir
+
"/ss-tunnel-vpn.conf"
,
53
))
,
"-c"
,
buildShadowsocksConfig
(
getApplicationInfo
.
dataDir
+
"/ss-tunnel-vpn.conf"
,
53
,
true
))
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
Commandline
.
toString
(
cmd
))
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
Commandline
.
toString
(
cmd
))
sstunnelProcess
=
new
GuardedProcess
(
cmd
).
start
()
sstunnelProcess
=
new
GuardedProcess
(
cmd
).
start
()
}
}
...
...
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