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
f38981e5
Commit
f38981e5
authored
May 07, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump version
parent
9c3b97b4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
project/Build.scala
project/Build.scala
+3
-2
src/main/scala/com/github/shadowsocks/ShadowVpnService.scala
src/main/scala/com/github/shadowsocks/ShadowVpnService.scala
+20
-6
No files found.
project/Build.scala
View file @
f38981e5
...
...
@@ -5,7 +5,8 @@ import org.scalasbt.androidplugin._
import
org.scalasbt.androidplugin.AndroidKeys._
object
App
{
val
version
=
"1.4.0"
val
version
=
"1.4.1"
val
versionCode
=
23
}
object
General
{
...
...
@@ -13,7 +14,7 @@ object General {
val
settings
=
Defaults
.
defaultSettings
++
Seq
(
name
:=
"shadowsocks"
,
version
:=
App
.
version
,
versionCode
:=
22
,
versionCode
:=
App
.
versionCode
,
scalaVersion
:=
"2.9.2"
,
compileOrder
:=
CompileOrder
.
JavaThenScala
,
platformName
in
Android
:=
"android-16"
,
...
...
src/main/scala/com/github/shadowsocks/ShadowVpnService.scala
View file @
f38981e5
...
...
@@ -244,6 +244,11 @@ class ShadowVpnService extends VpnService {
def
startVpn
()
{
val
address
=
appHost
.
split
(
'.'
)
val
prefix1
=
address
(
0
)
val
prefix2
=
address
.
slice
(
0
,
2
).
mkString
(
"."
)
val
prefix3
=
address
.
slice
(
0
,
3
).
mkString
(
"."
)
val
builder
=
new
Builder
()
builder
.
setSession
(
getString
(
R
.
string
.
app_name
))
...
...
@@ -256,19 +261,28 @@ class ShadowVpnService extends VpnService {
builder
.
addRoute
(
"0.0.0.0"
,
0
)
}
else
if
(
isGFWList
)
{
val
gfwList
=
getResources
.
getStringArray
(
R
.
array
.
gfw_list
)
val
address
=
appHost
.
split
(
'.'
)
val
prefix
=
address
(
0
)
+
"."
+
address
(
1
)
gfwList
.
foreach
(
addr
=>
if
(
addr
!=
prefix
)
{
if
(
addr
!=
prefix
2
)
{
builder
.
addRoute
(
addr
+
".0.0"
,
16
)
}
else
{
for
(
i
<-
0
to
255
)
{
val
prefix
=
Array
(
addr
,
i
.
toString
).
mkString
(
"."
)
if
(
prefix
!=
prefix3
)
builder
.
addRoute
(
prefix
+
".0"
,
24
)
}
}
)
builder
.
addRoute
(
"8.8.0.0"
,
16
)
}
else
{
val
prefix
=
appHost
.
split
(
'.'
)(
0
).
toInt
for
(
i
<-
1
to
254
)
{
if
(
i
!=
prefix
&&
i
!=
127
&&
i
!=
172
&&
i
!=
192
&&
i
!=
10
)
builder
.
addRoute
(
i
+
".0.0.0"
,
8
)
if
(
i
!=
127
&&
i
!=
172
&&
i
!=
192
&&
i
!=
10
&&
i
.
toString
!=
prefix1
)
{
builder
.
addRoute
(
i
+
".0.0.0"
,
8
)
}
else
if
(
i
.
toString
==
prefix1
)
{
for
(
j
<-
0
to
255
)
{
val
prefix
=
Array
(
i
.
toString
,
j
.
toString
).
mkString
(
"."
)
if
(
prefix
!=
prefix2
)
builder
.
addRoute
(
prefix
+
".0.0"
,
16
)
}
}
builder
.
addRoute
(
"8.8.0.0"
,
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