Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PublicAndroidApps
Nebulo
Commits
f3fc01ac
Commit
f3fc01ac
authored
Jul 11, 2019
by
Daniel Wolf
Browse files
Added LeakCanary to the services
parent
509f25fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/SmokeScreen.kt
View file @
f3fc01ac
...
...
@@ -15,6 +15,8 @@ import com.github.anrwatchdog.ANRWatchDog
import
io.sentry.Sentry
import
io.sentry.android.AndroidSentryClientFactory
import
io.sentry.event.User
import
leakcanary.LeakCanary
import
leakcanary.LeakSentry
import
java.util.*
import
kotlin.system.exitProcess
...
...
@@ -96,6 +98,7 @@ class SmokeScreen : Application() {
ANRWatchDog
().
setANRListener
{
log
(
RuntimeException
(
it
))
}
LeakSentry
.
refWatcher
.
watch
(
this
)
}
fun
initSentry
(
forceEnabled
:
Boolean
=
false
)
{
...
...
app/src/main/java/com/frostnerd/smokescreen/service/DnsVpnService.kt
View file @
f3fc01ac
...
...
@@ -36,6 +36,7 @@ import com.frostnerd.smokescreen.util.proxy.SmokeProxy
import
com.frostnerd.vpntunnelproxy.TrafficStats
import
com.frostnerd.vpntunnelproxy.VPNTunnelProxy
import
kotlinx.coroutines.*
import
leakcanary.LeakSentry
import
org.minidns.dnsmessage.DnsMessage
import
org.minidns.dnsmessage.Question
import
org.minidns.dnsname.DnsName
...
...
@@ -143,6 +144,7 @@ class DnsVpnService : VpnService(), Runnable {
override
fun
onCreate
()
{
super
.
onCreate
()
LeakSentry
.
refWatcher
.
watch
(
this
,
"DnsVpnService"
)
Thread
.
setDefaultUncaughtExceptionHandler
{
t
,
e
->
log
(
"Encountered an uncaught exception."
)
destroy
()
...
...
app/src/main/java/com/frostnerd/smokescreen/service/RuleExportService.kt
View file @
f3fc01ac
...
...
@@ -16,6 +16,7 @@ import com.frostnerd.smokescreen.util.Notifications
import
kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.launch
import
leakcanary.LeakSentry
import
java.io.BufferedWriter
import
java.io.OutputStreamWriter
import
java.io.Serializable
...
...
@@ -50,6 +51,11 @@ class RuleExportService : Service() {
const
val
BROADCAST_EXPORT_DONE
=
"com.frostnerd.nebulo.RULE_EXPORT_DONE"
}
override
fun
onCreate
()
{
super
.
onCreate
()
LeakSentry
.
refWatcher
.
watch
(
this
,
"RuleExportService"
)
}
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
{
createNotification
()
if
(
intent
?.
hasExtra
(
"params"
)
==
true
)
{
...
...
app/src/main/java/com/frostnerd/smokescreen/service/RuleImportService.kt
View file @
f3fc01ac
...
...
@@ -18,6 +18,7 @@ import com.frostnerd.smokescreen.util.Notifications
import
kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.launch
import
leakcanary.LeakSentry
import
okhttp3.OkHttpClient
import
okhttp3.Request
import
okhttp3.Response
...
...
@@ -67,6 +68,11 @@ class RuleImportService : Service() {
OkHttpClient
()
}
override
fun
onCreate
()
{
super
.
onCreate
()
LeakSentry
.
refWatcher
.
watch
(
this
,
"RuleImportService"
)
}
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
{
if
(
intent
!=
null
&&
intent
.
hasExtra
(
"abort"
))
{
abortImport
()
...
...
app/src/main/java/com/frostnerd/smokescreen/service/StartStopTileService.kt
View file @
f3fc01ac
...
...
@@ -11,6 +11,7 @@ import android.service.quicksettings.TileService
import
androidx.annotation.RequiresApi
import
com.frostnerd.general.service.isServiceRunning
import
com.frostnerd.smokescreen.R
import
leakcanary.LeakSentry
/*
* Copyright (C) 2019 Daniel Wolf (Ch4t4r)
...
...
@@ -39,6 +40,11 @@ fun Context.updateServiceTile() {
@RequiresApi
(
Build
.
VERSION_CODES
.
N
)
class
StartStopTileService
:
TileService
()
{
override
fun
onCreate
()
{
super
.
onCreate
()
LeakSentry
.
refWatcher
.
watch
(
this
,
"StartStopTileService"
)
}
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
{
updateTileState
()
return
Service
.
START_STICKY
...
...
app/src/main/java/com/frostnerd/smokescreen/service/VpnRestartService.kt
View file @
f3fc01ac
...
...
@@ -8,6 +8,7 @@ import com.frostnerd.smokescreen.R
import
com.frostnerd.smokescreen.activity.BackgroundVpnConfigureActivity
import
com.frostnerd.smokescreen.log
import
com.frostnerd.smokescreen.util.Notifications
import
leakcanary.LeakSentry
/*
* Copyright (C) 2019 Daniel Wolf (Ch4t4r)
...
...
@@ -38,6 +39,11 @@ class VpnRestartService : Service() {
return
null
}
override
fun
onCreate
()
{
super
.
onCreate
()
LeakSentry
.
refWatcher
.
watch
(
this
,
"VpnRestartService"
)
}
override
fun
onStartCommand
(
intent
:
Intent
?,
flags
:
Int
,
startId
:
Int
):
Int
{
log
(
"Trying to restart the VPN Service."
)
val
builder
=
NotificationCompat
.
Builder
(
this
,
Notifications
.
servicePersistentNotificationChannel
(
this
))
...
...
Write
Preview
Supports
Markdown
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