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
10238707
Commit
10238707
authored
Nov 05, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine DNS resolver on Lollipop
parent
72824eb8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
jni/shadowsocks
jni/shadowsocks
+1
-1
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+11
-7
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
...main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
+4
-3
No files found.
shadowsocks
@
1008cf1f
Subproject commit
271d55942c943c3813638a19a7194ca062ba6fe3
Subproject commit
1008cf1f5bb0004c64a86b103c157ec98c177cd6
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
10238707
...
...
@@ -75,7 +75,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
private
lazy
val
application
=
getApplication
.
asInstanceOf
[
ShadowsocksApplication
]
def
is
ACLEnabled
:
Boolean
=
{
def
is
LollipopOrAbove
:
Boolean
=
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
true
}
else
{
...
...
@@ -90,7 +90,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
def
startShadowsocksDaemon
()
{
if
(
is
ACLEnabled
&&
config
.
isGFWList
)
{
if
(
is
LollipopOrAbove
&&
config
.
isGFWList
)
{
val
chn_list
:
Array
[
String
]
=
getResources
.
getStringArray
(
R
.
array
.
chn_list_full
)
ConfigUtils
.
printToFile
(
new
File
(
Path
.
BASE
+
"chn.acl"
))(
p
=>
{
chn_list
.
foreach
(
item
=>
p
.
println
(
item
))
...
...
@@ -107,7 +107,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
,
"-m"
,
config
.
encMethod
,
"-f"
,
Path
.
BASE
+
"ss-local.pid"
)
if
(
config
.
isGFWList
&&
is
ACLEnabled
)
{
if
(
config
.
isGFWList
&&
is
LollipopOrAbove
)
{
cmd
+=
"--acl"
cmd
+=
(
Path
.
BASE
+
"chn.acl"
)
}
...
...
@@ -133,7 +133,11 @@ class ShadowsocksVpnService extends VpnService with BaseService {
def
startDnsDaemon
()
{
val
conf
=
{
ConfigUtils
.
PDNSD_LOCAL
.
format
(
"0.0.0.0"
,
8163
)
if
(
isLollipopOrAbove
)
{
ConfigUtils
.
PDNSD_BYPASS
.
format
(
"0.0.0.0"
,
getString
(
R
.
string
.
exclude
),
8163
)
}
else
{
ConfigUtils
.
PDNSD_LOCAL
.
format
(
"0.0.0.0"
,
8163
)
}
}
ConfigUtils
.
printToFile
(
new
File
(
Path
.
BASE
+
"pdnsd.conf"
))(
p
=>
{
p
.
println
(
conf
)
...
...
@@ -164,7 +168,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
.
addAddress
(
PRIVATE_VLAN
.
format
(
"1"
),
24
)
.
addDnsServer
(
"8.8.8.8"
)
if
(
Build
.
VERSION
.
SDK_INT
==
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
if
(
isLollipopOrAbove
)
{
if
(!
config
.
isGlobalProxy
)
{
val
apps
=
AppManager
.
getProxiedApps
(
this
,
config
.
proxiedAppString
)
val
pkgSet
:
mutable.HashSet
[
String
]
=
new
mutable
.
HashSet
[
String
]
...
...
@@ -191,7 +195,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
if
(
InetAddressUtils
.
isIPv6Address
(
config
.
proxy
))
{
builder
.
addRoute
(
"0.0.0.0"
,
0
)
}
else
if
(!
is
ACLEnabled
&&
config
.
isGFWList
)
{
}
else
if
(!
is
LollipopOrAbove
&&
config
.
isGFWList
)
{
val
gfwList
=
{
if
(
Build
.
VERSION
.
SDK_INT
==
Build
.
VERSION_CODES
.
KITKAT
)
{
getResources
.
getStringArray
(
R
.
array
.
simple_list
)
...
...
@@ -207,7 +211,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
}
})
}
else
{
if
(
is
ACLEnabled
)
{
if
(
is
LollipopOrAbove
)
{
builder
.
addRoute
(
"0.0.0.0"
,
0
)
}
else
{
for
(
i
<-
1
to
223
)
{
...
...
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
View file @
10238707
...
...
@@ -142,7 +142,7 @@ object ConfigUtils {
|
|server {
| label = "china-servers";
| ip = 114.114.114.114,
114.114.115.11
5;
| ip = 114.114.114.114,
223.5.5.
5;
| uptest = none;
| preset = on;
| include = %s;
...
...
@@ -151,8 +151,9 @@ object ConfigUtils {
|}
|
|server {
| label = "google-servers";
| ip = 8.8.8.8, 8.8.4.4;
| label = "local-server";
| ip = 127.0.0.1;
| port = %d;
| timeout = 5;
|}
|
...
...
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