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
056bd56d
Commit
056bd56d
authored
Mar 07, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the build
parent
1beb1759
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
src/main/res/values/configs.xml
src/main/res/values/configs.xml
+4
-3
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+6
-6
No files found.
src/main/res/values/configs.xml
View file @
056bd56d
This diff is collapsed.
Click to expand it.
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
056bd56d
...
@@ -113,9 +113,9 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -113,9 +113,9 @@ class ShadowsocksVpnService extends VpnService with BaseService {
version
version
}
}
def
isByass
(
info
:
SubnetUtils.SubnetInfo
)
:
Boolean
=
{
def
isByass
(
util
:
SubnetUtils
)
:
Boolean
=
{
info
.
isInRange
(
config
.
proxy
)
||
info
.
isInRange
(
"114.114.114.114"
)
val
info
=
util
.
getInfo
||
info
.
isInRange
(
"114.114.115.115"
)
info
.
isInRange
(
config
.
proxy
)
||
info
.
isInRange
(
"114.114.114.114"
)
||
info
.
isInRange
(
"114.114.115.115"
)
}
}
def
startVpn
()
{
def
startVpn
()
{
...
@@ -138,7 +138,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -138,7 +138,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
}
}
}
}
gfwList
.
foreach
(
cidr
=>
{
gfwList
.
foreach
(
cidr
=>
{
val
net
=
new
SubnetUtils
(
cidr
)
.
getInfo
val
net
=
new
SubnetUtils
(
cidr
)
if
(!
isByass
(
net
))
{
if
(!
isByass
(
net
))
{
val
addr
=
cidr
.
split
(
'/'
)
val
addr
=
cidr
.
split
(
'/'
)
builder
.
addRoute
(
addr
(
0
),
addr
(
1
).
toInt
)
builder
.
addRoute
(
addr
(
0
),
addr
(
1
).
toInt
)
...
@@ -149,7 +149,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -149,7 +149,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
if
(
i
!=
26
&&
i
!=
127
)
{
if
(
i
!=
26
&&
i
!=
127
)
{
val
addr
=
i
.
toString
+
".0.0.0"
val
addr
=
i
.
toString
+
".0.0.0"
val
cidr
=
addr
+
"/8"
val
cidr
=
addr
+
"/8"
val
net
=
new
SubnetUtils
(
cidr
)
.
getInfo
val
net
=
new
SubnetUtils
(
cidr
)
if
(!
isByass
(
net
))
{
if
(!
isByass
(
net
))
{
if
(!
InetAddress
.
getByName
(
addr
).
isSiteLocalAddress
)
{
if
(!
InetAddress
.
getByName
(
addr
).
isSiteLocalAddress
)
{
...
@@ -159,7 +159,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -159,7 +159,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
for
(
j
<-
0
to
255
)
{
for
(
j
<-
0
to
255
)
{
val
subAddr
=
i
.
toString
+
"."
+
j
.
toString
+
".0.0"
val
subAddr
=
i
.
toString
+
"."
+
j
.
toString
+
".0.0"
val
subCidr
=
subAddr
+
"/16"
val
subCidr
=
subAddr
+
"/16"
val
subNet
=
new
SubnetUtils
(
subCidr
)
.
getInfo
val
subNet
=
new
SubnetUtils
(
subCidr
)
if
(!
isByass
(
subNet
))
{
if
(!
isByass
(
subNet
))
{
if
(!
InetAddress
.
getByName
(
subAddr
).
isSiteLocalAddress
)
{
if
(!
InetAddress
.
getByName
(
subAddr
).
isSiteLocalAddress
)
{
builder
.
addRoute
(
subAddr
,
16
)
builder
.
addRoute
(
subAddr
,
16
)
...
...
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