From aaae2ad00808273d29e54c28ac5e44a4fa8c6397 Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Tue, 17 Dec 2024 18:46:00 +0100 Subject: [PATCH 1/3] chore: Refactor MainScaffold --- .../swisstransfer/ui/screen/main/components/MainScaffold.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt index b063606ca..563d53799 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt @@ -23,7 +23,8 @@ import androidx.compose.foundation.layout.Column import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.adaptive.WindowAdaptiveInfo import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteType -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.navigation.NavController import androidx.navigation.NavGraph.Companion.findStartDestination From c326f3a832ca55856619449b7583b94c87189f6f Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Tue, 17 Dec 2024 18:47:09 +0100 Subject: [PATCH 2/3] chore: Add support for sentry with proguard --- .gitignore | 1 + app/build.gradle.kts | 20 ++++++++++++-------- env.example.properties | 21 +++++++++++++++++++++ 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 env.example.properties diff --git a/.gitignore b/.gitignore index f6f376f8a..f38d8f5f2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ build/ local.properties *.apk *.aab +env.properties diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c94c0626a..b6e880afd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.konan.properties.loadProperties + plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) @@ -13,6 +15,10 @@ val sharedCompileSdk: Int by rootProject.extra val sharedMinSdk: Int by rootProject.extra val sharedJavaVersion: JavaVersion by rootProject.extra +val envProperties = loadProperties("env.properties") +val sentryAuthToken = envProperties.getProperty("sentryAuthToken").takeIf { it.isNotEmpty() } + ?: error("The property must be defined and not empty") + android { namespace = "com.infomaniak.swisstransfer" compileSdk = sharedCompileSdk @@ -79,15 +85,13 @@ kapt { } sentry { - // Enables or disables the automatic upload of mapping files during a build. - // If you disable this, you'll need to manually upload the mapping files with sentry-cli when you do a release. - // Default is enabled. - autoUploadProguardMapping = true - - // Does or doesn't include the source code of native code for Sentry. - // This executes sentry-cli with the --include-sources param. automatically so you don't need to do it manually. - // Default is disabled. + org = "sentry" + projectName = "swisstransfer-android" + authToken = sentryAuthToken + url = "https://sentry-mobile.infomaniak.com" + uploadNativeSymbols = true includeNativeSources = true + includeSourceContext = true } dependencies { diff --git a/env.example.properties b/env.example.properties new file mode 100644 index 000000000..334e4598f --- /dev/null +++ b/env.example.properties @@ -0,0 +1,21 @@ +# +# Infomaniak SwissTransfer - Android +# Copyright (C) 2024 Infomaniak Network SA +# +# 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# +# This is a sample file, create your own, named `env.properties`. +# You can create your token here: https://sentry-mobile.infomaniak.com/settings/sentry/auth-tokens +sentryAuthToken=YOUR_SENTRY_AUTH_TOKEN_HERE From 315406d5a008a372a164a897b5ecb42bfa28d2b2 Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Tue, 17 Dec 2024 18:56:30 +0100 Subject: [PATCH 3/3] chore: Add dummy env properties for the ci --- .github/workflows/android.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 7daeea895..1438f91b1 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -29,6 +29,11 @@ jobs: token: ${{ github.token }} submodules: recursive + - name: Create test env.properties + run: | + touch env.properties + echo "sentryAuthToken=DummyToken" > env.properties + # Setup Gradle and Run tests - name: Grant execute permission for gradlew run: chmod +x gradlew