From d8fa280e221e0999904f1ad5cff80828573610b2 Mon Sep 17 00:00:00 2001 From: flaviuvsp Date: Fri, 8 Dec 2023 11:34:22 +0200 Subject: [PATCH] Go to login screen in case of an error during splash screen calls Fix deploy issues --- .github/workflows/deployRelease.yml | 5 +++-- .github/workflows/deployStaging.yml | 5 +++-- app/build.gradle | 4 ++-- .../org/permanent/permanent/EventsManager.kt | 2 +- .../permanent/ui/activities/SplashActivity.kt | 17 ++++++++++++----- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deployRelease.yml b/.github/workflows/deployRelease.yml index 098685af..9bd7b3a1 100644 --- a/.github/workflows/deployRelease.yml +++ b/.github/workflows/deployRelease.yml @@ -3,7 +3,7 @@ name: Release to Play store on: workflow_dispatch: push: - branches: [ "release-disabled/**" ] + branches: [ "release/**" ] jobs: build: @@ -52,12 +52,13 @@ jobs: KEYSTORE_FILE: '${{ github.workspace }}/permanent.keystore' KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }} - MIXPANEL_KEY: ${{ secrets.MIXPANEL_KEY }} + MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }} run: | touch local.properties echo GMP_KEY="$GMP_KEY" >> local.properties echo AUTH_CLIENT_ID="$AUTH_CLIENT_ID" >> local.properties echo AUTH_CLIENT_SECRET="$AUTH_CLIENT_SECRET" >> local.properties echo PUBLISHABLE_KEY="$PUBLISHABLE_KEY" >> local.properties + echo MIXPANEL_TOKEN="$MIXPANEL_TOKEN" >> local.properties bundle exec fastlane playStore shell: bash diff --git a/.github/workflows/deployStaging.yml b/.github/workflows/deployStaging.yml index 0073cc5f..0af2d762 100644 --- a/.github/workflows/deployStaging.yml +++ b/.github/workflows/deployStaging.yml @@ -3,7 +3,7 @@ name: Deploy to Staging on: workflow_dispatch: push: - branches: [ "master-disabled" ] + branches: [ "master" ] jobs: build: @@ -44,12 +44,13 @@ jobs: PUBLISHABLE_KEY: ${{ secrets.PUBLISHABLE_KEY }} APP_ID: ${{ secrets.APP_ID }} FIREBASEAPPDISTRO_CLI_TOKEN: ${{ secrets.FIREBASEAPPDISTRO_CLI_TOKEN }} - MIXPANEL_KEY: ${{ secrets.MIXPANEL_KEY }} + MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }} run: | touch local.properties echo GMP_KEY="$GMP_KEY" >> local.properties echo AUTH_CLIENT_ID="$AUTH_CLIENT_ID" >> local.properties echo AUTH_CLIENT_SECRET="$AUTH_CLIENT_SECRET" >> local.properties echo PUBLISHABLE_KEY="$PUBLISHABLE_KEY" >> local.properties + echo MIXPANEL_TOKEN="$MIXPANEL_TOKEN" >> local.properties bundle exec fastlane firebase shell: bash diff --git a/app/build.gradle b/app/build.gradle index 7f7626a5..15519a00 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { applicationId "org.permanent.PermanentArchive" minSdkVersion 26 targetSdkVersion 34 - versionCode 56 - versionName "1.8.2" + versionCode 62 + versionName "1.8.6" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/org/permanent/permanent/EventsManager.kt b/app/src/main/java/org/permanent/permanent/EventsManager.kt index f72f5365..e795abf0 100644 --- a/app/src/main/java/org/permanent/permanent/EventsManager.kt +++ b/app/src/main/java/org/permanent/permanent/EventsManager.kt @@ -5,7 +5,7 @@ import com.mixpanel.android.mpmetrics.MixpanelAPI import org.json.JSONObject class EventsManager(context: Context) { - private val mp: MixpanelAPI = MixpanelAPI.getInstance(context, BuildConfig.MIXPANEL_KEY, true) + private val mp: MixpanelAPI = MixpanelAPI.getInstance(context, BuildConfig.MIXPANEL_TOKEN, true) fun sendToMixpanel(event: EventType, properties: JSONObject? = null) { mp.track(event.value, properties) diff --git a/app/src/main/java/org/permanent/permanent/ui/activities/SplashActivity.kt b/app/src/main/java/org/permanent/permanent/ui/activities/SplashActivity.kt index 6e85e150..9fbc8bf0 100644 --- a/app/src/main/java/org/permanent/permanent/ui/activities/SplashActivity.kt +++ b/app/src/main/java/org/permanent/permanent/ui/activities/SplashActivity.kt @@ -6,6 +6,7 @@ import android.content.Context import android.content.Intent import android.os.Bundle import android.view.View +import android.widget.Toast import androidx.core.content.ContextCompat import androidx.databinding.DataBindingUtil import androidx.lifecycle.Observer @@ -32,11 +33,17 @@ class SplashActivity : PermanentBaseActivity() { private lateinit var viewModel: SplashViewModel private val errorObserver = Observer { - val snackBar = Snackbar.make(binding.root, it, Snackbar.LENGTH_LONG) - val view: View = snackBar.view - view.setBackgroundColor(ContextCompat.getColor(this, R.color.deepRed)) - snackBar.setTextColor(ContextCompat.getColor(this, R.color.white)) - snackBar.show() + prefsHelper.saveUserLoggedIn(false) + prefsHelper.saveDefaultArchiveId(0) + prefsHelper.saveBiometricsLogIn(true) // Setting back to default + + startLoginActivity() + + Toast.makeText( + this, + it, + Toast.LENGTH_SHORT + ).show() } override fun onCreate(savedInstanceState: Bundle?) {