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
0647ef4c
Commit
0647ef4c
authored
Sep 19, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #121
parent
97c6ff95
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
35 deletions
+50
-35
jni/shadowsocks
jni/shadowsocks
+1
-1
src/main/AndroidManifest.xml
src/main/AndroidManifest.xml
+2
-2
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
.../scala/com/github/shadowsocks/ShadowsocksNatService.scala
+36
-26
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+11
-6
No files found.
shadowsocks
@
d7005579
Subproject commit
06f1a57c9bd5a4ff96966a616ab3f1ec330f4c4c
Subproject commit
d7005579784ffb7723aaa6d69cb034e5b07109d5
src/main/AndroidManifest.xml
View file @
0647ef4c
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.github.shadowsocks"
android:versionCode=
"7
2
"
android:versionName=
"2.2.
4
"
>
android:versionCode=
"7
3
"
android:versionName=
"2.2.
5
"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
View file @
0647ef4c
...
...
@@ -114,25 +114,40 @@ class ShadowsocksNatService extends Service with BaseService {
})
}
val
raw_args
=
(
"ss-local -b 127.0.0.1 -s %s -p %d -l %d -k %s -m %s -f "
+
Path
.
BASE
+
"ss-local.pid"
)
.
format
(
config
.
proxy
,
config
.
remotePort
,
config
.
localPort
,
config
.
sitekey
,
config
.
encMethod
)
val
args
=
if
(
Build
.
VERSION
.
SDK_INT
>=
20
)
{
raw_args
}
else
{
Path
.
BASE
+
raw_args
val
cmd
=
new
ArrayBuffer
[
String
]
cmd
+=
(
"ss-local"
,
"-b"
,
"127.0.0.1"
,
"-s"
,
config
.
proxy
,
"-p"
,
config
.
remotePort
.
toString
,
"-l"
,
config
.
localPort
.
toString
,
"-k"
,
config
.
sitekey
,
"-m"
,
config
.
encMethod
,
"-f"
,
(
Path
.
BASE
+
"ss-local.pid"
))
if
(
config
.
isGFWList
&&
isACLEnabled
)
{
cmd
+=
"--acl"
cmd
+=
(
Path
.
BASE
+
"chn.acl"
)
}
val
cmd
=
if
(
config
.
isGFWList
&&
isACLEnabled
)
args
+
" --acl "
+
Path
.
BASE
+
"chn.acl"
else
args
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
)
Core
.
sslocal
(
cmd
.
split
(
" "
))
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
.
mkString
(
" "
))
Core
.
sslocal
(
cmd
.
toArray
)
}
def
startDnsDaemon
()
{
val
args
=
if
(
config
.
isUdpDns
)
{
(
"ss-tunnel -b 127.0.0.1 -s %s -p %d -l %d -k %s -m %s -L 8.8.8.8:53 -u -f "
+
Path
.
BASE
+
"ss-tunnel.pid"
)
.
format
(
config
.
proxy
,
config
.
remotePort
,
8153
,
config
.
sitekey
,
config
.
encMethod
)
if
(
config
.
isUdpDns
)
{
val
cmd
=
new
ArrayBuffer
[
String
]
cmd
+=
(
"ss-tunnel"
,
"-u"
,
"-b"
,
"127.0.0.1"
,
"-l"
,
"8153"
,
"-L"
,
"8.8.8.8:53"
,
"-s"
,
config
.
proxy
,
"-p"
,
config
.
remotePort
.
toString
,
"-k"
,
config
.
sitekey
,
"-m"
,
config
.
encMethod
,
"-f"
,
(
Path
.
BASE
+
"ss-tunnel.pid"
))
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
.
mkString
(
" "
))
Core
.
sstunnel
(
cmd
.
toArray
)
}
else
{
val
conf
=
{
if
(
config
.
isGFWList
)
...
...
@@ -143,20 +158,15 @@ class ShadowsocksNatService extends Service with BaseService {
ConfigUtils
.
printToFile
(
new
File
(
Path
.
BASE
+
"pdnsd.conf"
))(
p
=>
{
p
.
println
(
conf
)
})
"pdnsd -c "
+
Path
.
BASE
+
"pdnsd.conf"
}
val
cmd
=
if
(
Build
.
VERSION
.
SDK_INT
>=
20
)
{
"/system/bin/"
+
args
}
else
{
Path
.
BASE
+
args
}
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
)
val
args
=
"pdnsd -c "
+
Path
.
BASE
+
"pdnsd.conf"
if
(
config
.
isUdpDns
)
{
Core
.
sstunnel
(
cmd
.
split
(
" "
))
}
else
{
val
cmd
=
if
(
Build
.
VERSION
.
SDK_INT
>=
20
)
{
"/system/bin/"
+
args
}
else
{
Path
.
BASE
+
args
}
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
)
Console
.
runRootCommand
(
cmd
)
}
}
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
0647ef4c
...
...
@@ -80,12 +80,17 @@ class ShadowsocksVpnService extends VpnService with BaseService {
}
def
startShadowsocksDaemon
()
{
val
cmd
:
String
=
(
Path
.
BASE
+
"ss-local -b 127.0.0.1 -s %s -p %d -l %d -k %s -m %s -u -f "
+
Path
.
BASE
+
"ss-local.pid"
)
.
format
(
config
.
proxy
,
config
.
remotePort
,
config
.
localPort
,
config
.
sitekey
,
config
.
encMethod
)
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
)
Core
.
sslocal
(
cmd
.
split
(
" "
))
val
cmd
=
new
ArrayBuffer
[
String
]
cmd
+=
(
"ss-local"
,
"-u"
,
"-b"
,
"127.0.0.1"
,
"-s"
,
config
.
proxy
,
"-p"
,
config
.
remotePort
.
toString
,
"-l"
,
config
.
localPort
.
toString
,
"-k"
,
config
.
sitekey
,
"-m"
,
config
.
encMethod
,
"-f"
,
(
Path
.
BASE
+
"ss-local.pid"
))
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
.
mkString
(
" "
))
Core
.
sslocal
(
cmd
.
toArray
)
}
def
startDnsDaemon
()
{
...
...
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