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
27589723
Commit
27589723
authored
Jan 19, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix leaks after service switches
parent
24bd70a4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
114 deletions
+99
-114
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
+90
-96
core/src/main/java/com/github/shadowsocks/bg/ProxyService.kt
core/src/main/java/com/github/shadowsocks/bg/ProxyService.kt
+3
-6
core/src/main/java/com/github/shadowsocks/bg/TransproxyService.kt
.../main/java/com/github/shadowsocks/bg/TransproxyService.kt
+3
-6
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+3
-6
No files found.
core/src/main/java/com/github/shadowsocks/bg/BaseService.kt
View file @
27589723
This diff is collapsed.
Click to expand it.
core/src/main/java/com/github/shadowsocks/bg/ProxyService.kt
View file @
27589723
...
...
@@ -27,10 +27,7 @@ import android.content.Intent
* Shadowsocks service at its minimum.
*/
class
ProxyService
:
Service
(),
BaseService
.
Interface
{
init
{
BaseService
.
register
(
this
)
}
override
val
data
=
BaseService
.
Data
(
this
)
override
val
tag
:
String
get
()
=
"ShadowsocksProxyService"
override
fun
createNotification
(
profileName
:
String
):
ServiceNotification
=
ServiceNotification
(
this
,
profileName
,
"service-proxy"
,
true
)
...
...
@@ -39,7 +36,7 @@ class ProxyService : Service(), BaseService.Interface {
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
=
super
<
BaseService
.
Interface
>.
onStartCommand
(
intent
,
flags
,
startId
)
override
fun
onDestroy
()
{
super
<
Service
>
.
onDestroy
()
super
<
BaseService
.
Interface
>.
onDestroy
()
super
.
onDestroy
()
data
.
binder
.
close
()
}
}
core/src/main/java/com/github/shadowsocks/bg/TransproxyService.kt
View file @
27589723
...
...
@@ -27,10 +27,7 @@ import com.github.shadowsocks.preference.DataStore
import
java.io.File
class
TransproxyService
:
Service
(),
LocalDnsService
.
Interface
{
init
{
BaseService
.
register
(
this
)
}
override
val
data
=
BaseService
.
Data
(
this
)
override
val
tag
:
String
get
()
=
"ShadowsocksTransproxyService"
override
fun
createNotification
(
profileName
:
String
):
ServiceNotification
=
ServiceNotification
(
this
,
profileName
,
"service-transproxy"
,
true
)
...
...
@@ -79,7 +76,7 @@ redsocks {
}
override
fun
onDestroy
()
{
super
<
Service
>
.
onDestroy
()
super
<
LocalDnsService
.
Interface
>.
onDestroy
()
super
.
onDestroy
()
data
.
binder
.
close
()
}
}
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
View file @
27589723
...
...
@@ -108,10 +108,7 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
override
fun
getLocalizedMessage
()
=
getString
(
R
.
string
.
reboot_required
)
}
init
{
BaseService
.
register
(
this
)
}
override
val
data
=
BaseService
.
Data
(
this
)
override
val
tag
:
String
get
()
=
"ShadowsocksVpnService"
override
fun
createNotification
(
profileName
:
String
):
ServiceNotification
=
ServiceNotification
(
this
,
profileName
,
"service-vpn"
)
...
...
@@ -282,7 +279,7 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
}
override
fun
onDestroy
()
{
super
<
BaseVpnService
>
.
onDestroy
()
super
<
LocalDnsService
.
Interface
>.
onDestroy
()
super
.
onDestroy
()
data
.
binder
.
close
()
}
}
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