Skip to content

Commit

Permalink
Fix crash on About (#39)
Browse files Browse the repository at this point in the history
The intent's `targetPackage` needs to be set dynamically as the
application ID is different for nightly builds.
  • Loading branch information
fmeum authored Jan 3, 2025
1 parent eff23d4 commit cad7111
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
}

Expand Down
8 changes: 1 addition & 7 deletions authenticator/src/main/res/xml/preferences_authenticator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<!-- Inspection is unhappy about the package, but it's required for the intent to work -->
<!--suppress AndroidDomInspection -->
<intent
android:targetClass="me.henneke.wearauthn.ui.main.AboutActivity"
android:targetPackage="me.henneke.wearauthn.authenticator" />
</Preference>
android:title="@string/preference_about_title" />

<Preference
android:icon="@drawable/ic_launcher_outline"
Expand Down

0 comments on commit cad7111

Please sign in to comment.