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
028c5a64
Commit
028c5a64
authored
Jul 25, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #100
parent
4e39705a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+2
-2
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+6
-6
No files found.
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
028c5a64
...
...
@@ -507,7 +507,7 @@ class Shadowsocks
val
intent
=
new
Intent
(
this
,
s
)
intent
.
setAction
(
Action
.
SERVICE
)
bindService
(
intent
,
connection
,
Context
.
BIND_AUTO_CREATE
)
startService
(
new
Intent
(
this
,
s
))
if
(!
isVpnEnabled
)
startService
(
new
Intent
(
this
,
s
))
}
}
...
...
@@ -518,9 +518,9 @@ class Shadowsocks
}
catch
{
case
ignored
:
RemoteException
=>
// Nothing
}
unbindService
(
connection
)
bgService
=
null
}
unbindService
(
connection
)
}
override
def
onRestoreInstanceState
(
inState
:
Bundle
)
{
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
028c5a64
...
...
@@ -52,12 +52,12 @@ import org.apache.http.conn.util.InetAddressUtils
import
android.os.Message
import
scala.concurrent.ops._
import
org.apache.commons.net.util.SubnetUtils
import
java.net.InetAddress
import
com.github.shadowsocks.utils._
import
scala.Some
import
com.github.shadowsocks.aidl.
{
IShadowsocksService
,
Config
}
import
scala.collection.mutable.ArrayBuffer
import
java.io.File
import
java.net.InetAddress
class
ShadowsocksVpnService
extends
VpnService
with
BaseService
{
...
...
@@ -118,8 +118,13 @@ class ShadowsocksVpnService extends VpnService with BaseService {
def
startVpn
()
{
val
openIntent
:
Intent
=
new
Intent
(
this
,
classOf
[
Shadowsocks
])
openIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
)
val
configIntent
=
PendingIntent
.
getActivity
(
this
,
0
,
openIntent
,
0
)
val
builder
=
new
Builder
()
builder
.
setConfigureIntent
(
configIntent
)
.
setSession
(
config
.
profileName
)
.
setMtu
(
VPN_MTU
)
.
addAddress
(
PRIVATE_VLAN
.
format
(
"1"
),
24
)
...
...
@@ -265,10 +270,6 @@ class ShadowsocksVpnService extends VpnService with BaseService {
Console
.
runCommand
(
ab
.
toArray
)
}
override
def
onStartCommand
(
intent
:
Intent
,
flags
:
Int
,
startId
:
Int
)
:
Int
=
{
Service
.
START_STICKY
}
override
def
startRunner
(
c
:
Config
)
{
config
=
c
...
...
@@ -383,7 +384,6 @@ class ShadowsocksVpnService extends VpnService with BaseService {
override
def
stopBackgroundService
()
{
stopRunner
()
stopSelf
()
}
override
def
getTag
=
TAG
...
...
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