summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2023-01-12 07:45:54 +0000
committerGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2023-01-12 07:45:54 +0000
commit147782f1677ca71e5da486afb90beff0e122183f (patch)
tree02261d62fe73fa07ba2ae9a413a075242c3379a6
parent7cad75f498d1afbb69069b582bb75ebf7a8833aa (diff)
parent8fc2b39e12c247b16231f7421b8b9dcf863e24de (diff)
Merge branch '855-sentry' into 'main'
855: setup Sentry telemetry. See merge request e/os/advanced-privacy!112
-rw-r--r--.gitlab-ci.yml1
-rw-r--r--README.md4
-rw-r--r--app/build.gradle5
-rw-r--r--app/src/main/AndroidManifest.xml2
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt4
-rw-r--r--dependencies.gradle2
-rw-r--r--load-properties.gradle1
7 files changed, 15 insertions, 4 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1751251..1cddc6a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,6 +10,7 @@ stages:
variables:
MAPBOX_KEY: $MAPBOX_KEY_DEV
MAPBOX_SECRET_KEY: $MAPBOX_SECRET_KEY_DEV
+ SENTRY_DSN: $SENTRY_DSN
workflow:
rules:
diff --git a/README.md b/README.md
index 5cc125d..17d2c62 100644
--- a/README.md
+++ b/README.md
@@ -42,13 +42,14 @@ You can use any latest stable version of android studio to be able to build this
- Target SDK: 30 (Android R)
## API Keys
-This project uses [Mapbox](https://docs.mapbox.com/android/maps/guides/install/) sdk for displaying maps. To download and use the mapbox sdk, you need to supply API key and secret and set them as follows:
+This project uses [Sentry](https://sentry.io) for telemetry and crash reports, [Mapbox](https://docs.mapbox.com/android/maps/guides/install/) sdk for displaying maps. To download and use the mapbox sdk, you need to supply API key and secret and set them as follows:
### For local build
You can set them in local.properties
```
MAPBOX_KEY=<insert mapbox public key>
MAPBOX_SECRET_KEY=<insert mapbox secret key>
+SENTRY_DSN=<insert sentry dsn>
```
**IMP: Never add this file to version control.**
@@ -57,6 +58,7 @@ When building in CI environment, we don't have local.properties file. So the fol
```
export MAPBOX_KEY=<insert mapbox public key>
export MAPBOX_SECRET_KEY=<insert mapbox secret key>
+export SENTRY_DSN=<insert sentry dsn>
```
## Code Style and Quality
diff --git a/app/build.gradle b/app/build.gradle
index 12d1159..7f048d2 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -39,6 +39,7 @@ android {
]
resValue("string", "mapbox_key", MAPBOX_KEY)
+ buildConfigField("String", "SENTRY_DSN", "\"$SENTRY_DSN\"")
}
signingConfigs {
@@ -150,7 +151,9 @@ dependencies {
Libs.Retrofit.scalars,
Libs.MapBox.sdk,
- Libs.mpAndroidCharts
+ Libs.mpAndroidCharts,
+
+ Libs.telemetry
)
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3bcd764..c155aa5 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright (C) 2022 ECORP
+ Copyright (C) 2022 ECORP, 2022 MURENA SAS
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt b/app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt
index 28e96e0..639fec2 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/PrivacyCentralApplication.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 E FOUNDATION
+ * Copyright (C) 2021 E FOUNDATION, 2022 - 2023 MURENA SAS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@ package foundation.e.privacycentralapp
import android.app.Application
import com.mapbox.mapboxsdk.Mapbox
+import foundation.e.lib.telemetry.Telemetry
class PrivacyCentralApplication : Application() {
@@ -27,6 +28,7 @@ class PrivacyCentralApplication : Application() {
override fun onCreate() {
super.onCreate()
+ Telemetry.init(BuildConfig.SENTRY_DSN, this)
Mapbox.getTelemetry()?.setUserTelemetryRequestState(false)
dependencyContainer.initBackgroundSingletons()
diff --git a/dependencies.gradle b/dependencies.gradle
index 6c4acb3..352958e 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -118,3 +118,5 @@ libs.MapBox = [
]
libs.mpAndroidCharts = 'com.github.PhilJay:MPAndroidChart:v3.1.0'
+
+libs.telemetry = 'foundation.e.lib:telemetry:0.0.3-alpha'
diff --git a/load-properties.gradle b/load-properties.gradle
index 71c9fb5..2c0134e 100644
--- a/load-properties.gradle
+++ b/load-properties.gradle
@@ -30,4 +30,5 @@ if (localPropertiesFile.exists()) {
} else {
ext["MAPBOX_KEY"] = System.getenv('MAPBOX_KEY')
ext["MAPBOX_SECRET_KEY"] = System.getenv('MAPBOX_SECRET_KEY')
+ ext["SENTRY_DSN"] = System.getenv('SENTRY_DSN')
} \ No newline at end of file