From 2cbef484842ac6a0a4d64725e05afade236cd24c Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 3 Jan 2025 10:09:50 +0100 Subject: [PATCH] Fix crash on `About` The intent's `targetPackage` needs to be set dynamically as the application ID is different for nightly builds. --- .../me/henneke/wearauthn/ui/main/AuthenticatorMainMenu.kt | 5 +++++ .../src/main/res/xml/preferences_authenticator.xml | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/authenticator/src/main/java/me/henneke/wearauthn/ui/main/AuthenticatorMainMenu.kt b/authenticator/src/main/java/me/henneke/wearauthn/ui/main/AuthenticatorMainMenu.kt index d7c2e3a..e7b2290 100644 --- a/authenticator/src/main/java/me/henneke/wearauthn/ui/main/AuthenticatorMainMenu.kt +++ b/authenticator/src/main/java/me/henneke/wearauthn/ui/main/AuthenticatorMainMenu.kt @@ -31,6 +31,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch +import me.henneke.wearauthn.BuildConfig import me.henneke.wearauthn.LogLevel import me.henneke.wearauthn.Logging import me.henneke.wearauthn.R @@ -123,6 +124,10 @@ class AuthenticatorMainMenu : PreferenceFragment(), CoroutineScope, Logging { findPreference(getString(R.string.preference_single_factor_mode_key)) as SwitchPreference manageCredentialsPreference = findPreference(getString(R.string.preference_credential_management_key)) + with(findPreference(getString(R.string.preference_about_key))) { + intent = Intent(context, AboutActivity::class.java) + intent.`package` = BuildConfig.APPLICATION_ID + } supportPreference = findPreference(getString(R.string.preference_support_key)) } diff --git a/authenticator/src/main/res/xml/preferences_authenticator.xml b/authenticator/src/main/res/xml/preferences_authenticator.xml index ad8b669..4be7080 100644 --- a/authenticator/src/main/res/xml/preferences_authenticator.xml +++ b/authenticator/src/main/res/xml/preferences_authenticator.xml @@ -65,13 +65,7 @@ android:key="@string/preference_about_key" android:order="@integer/order_device_list_about" android:persistent="false" - android:title="@string/preference_about_title"> - - - - + android:title="@string/preference_about_title" />