-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ class AndroidApplication : Application() { | |
override val model = "${Build.MANUFACTURER} ${Build.MODEL}" | ||
override val needsToRequestNotificationsPermission = | ||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU | ||
override val sentryDsn = "https://[email protected]/4508325642764288" | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,18 @@ import kotlinx.coroutines.flow.collect | |
import kotlinx.coroutines.flow.onEach | ||
import org.ooni.probe.data.models.SettingsKey | ||
import org.ooni.probe.data.repositories.PreferenceRepository | ||
import org.ooni.probe.shared.PlatformInfo | ||
|
||
class CrashMonitoring( | ||
private val preferencesRepository: PreferenceRepository, | ||
private val platformInfo: PlatformInfo, | ||
) { | ||
suspend fun setup() { | ||
preferencesRepository.getValueByKey(SettingsKey.SEND_CRASH) | ||
.onEach { sendCrash -> | ||
if (sendCrash == true) { | ||
Sentry.init { | ||
it.dsn = SENTRY_DSN | ||
it.dsn = platformInfo.sentryDsn | ||
} | ||
} else { | ||
Sentry.close() | ||
|
@@ -81,9 +83,4 @@ class CrashMonitoring( | |
) | ||
} | ||
} | ||
|
||
companion object { | ||
private const val SENTRY_DSN = | ||
"https://[email protected]/5619989" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,7 @@ class SetupDependencies( | |
override val osVersion = with(UIDevice.currentDevice) { "$systemName $systemVersion" } | ||
override val model = UIDevice.currentDevice.model | ||
override val needsToRequestNotificationsPermission = true | ||
override val sentryDsn = "https://[email protected]/4508325650235392" | ||
} | ||
|
||
private fun buildDatabaseDriver() = NativeSqliteDriver(schema = Database.Schema, name = "OONIProbe.db") | ||
|