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
3429776c
Commit
3429776c
authored
Mar 07, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the vpn mode
parent
4bf784fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+5
-2
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
...main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
+1
-1
No files found.
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
3429776c
...
@@ -72,6 +72,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -72,6 +72,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
var
receiver
:
BroadcastReceiver
=
null
var
receiver
:
BroadcastReceiver
=
null
var
apps
:
Array
[
ProxiedApp
]
=
null
var
apps
:
Array
[
ProxiedApp
]
=
null
var
config
:
Config
=
null
var
config
:
Config
=
null
var
dns
=
Utils
.
getDNS
val
handler
:
Handler
=
new
Handler
()
val
handler
:
Handler
=
new
Handler
()
...
@@ -91,7 +92,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -91,7 +92,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
Path
.
BASE
+
"ss-tunnel.pid"
)
Path
.
BASE
+
"ss-tunnel.pid"
)
.
format
(
config
.
proxy
,
config
.
remotePort
,
8153
,
config
.
sitekey
,
config
.
encMethod
)
.
format
(
config
.
proxy
,
config
.
remotePort
,
8153
,
config
.
sitekey
,
config
.
encMethod
)
}
else
{
}
else
{
val
conf
=
ConfigUtils
.
PDNSD
.
format
(
"0.0.0.0"
,
getString
(
R
.
string
.
exclude
),
Utils
.
getDNS
)
val
conf
=
ConfigUtils
.
PDNSD
.
format
(
"0.0.0.0"
,
getString
(
R
.
string
.
exclude
),
dns
)
ConfigUtils
.
printToFile
(
new
File
(
Path
.
BASE
+
"pdnsd.conf"
))(
p
=>
{
ConfigUtils
.
printToFile
(
new
File
(
Path
.
BASE
+
"pdnsd.conf"
))(
p
=>
{
p
.
println
(
conf
)
p
.
println
(
conf
)
})
})
...
@@ -115,11 +116,13 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -115,11 +116,13 @@ class ShadowsocksVpnService extends VpnService with BaseService {
def
isByass
(
util
:
SubnetUtils
)
:
Boolean
=
{
def
isByass
(
util
:
SubnetUtils
)
:
Boolean
=
{
val
info
=
util
.
getInfo
val
info
=
util
.
getInfo
info
.
isInRange
(
config
.
proxy
)
||
info
.
isInRange
(
"114.114.114.114"
)
||
info
.
isInRange
(
Utils
.
getDNS
)
info
.
isInRange
(
config
.
proxy
)
||
info
.
isInRange
(
"114.114.114.114"
)
||
info
.
isInRange
(
dns
)
}
}
def
startVpn
()
{
def
startVpn
()
{
dns
=
Utils
.
getDNS
val
builder
=
new
Builder
()
val
builder
=
new
Builder
()
builder
builder
.
setSession
(
config
.
profileName
)
.
setSession
(
config
.
profileName
)
...
...
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
View file @
3429776c
...
@@ -79,7 +79,7 @@ object ConfigUtils {
...
@@ -79,7 +79,7 @@ object ConfigUtils {
|
|
|server {
|server {
| label = "google-servers";
| label = "google-servers";
| ip = 8.8.8.8, 8.8.4.4;
| ip = 8.8.8.8, 8.8.4.4
, 208.67.222.222, 208.67.220.220
;
| exclude = %s;
| exclude = %s;
| timeout = 5;
| 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