Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 30, 2025

Biometric Authentication Implementation ✅

Completed Tasks

  • Add androidx.biometric dependency to build.gradle.kts and libs.versions.toml
  • Add biometric-related strings to strings.xml (English and German)
  • Create BiometricAuthService to handle authentication logic
  • Add biometric preference to PreferencesManager (enabled/disabled state)
  • Integrate biometric authentication in MainActivity onCreate
  • Add biometric settings toggle in About screen
  • Format code with ktfmt and build successfully
  • Address PR feedback (Round 1):
    • Remove USE_BIOMETRIC permission (already in library)
    • Add placeholder screen with app logo and retry button
    • Don't close app on auth failure - show retry option
    • Verify authentication before enabling biometric toggle
    • Keep user authenticated for 5 minutes in background
  • Address PR feedback (Round 2):
    • Use in-memory lastAuthTime instead of persisting
    • Extract BiometricPlaceholder into separate component with preview

Latest Changes (Round 2 Feedback)

1. In-Memory Authentication Time

  • Removed lastAuthTime persistence from PreferencesManager
  • Removed LAST_AUTH_TIME key and related methods
  • Changed to track lastAuthTime as a private property in MainActivity
  • Authentication time is now kept only in memory during app lifetime
  • Cleaner solution that resets on app restart

2. Extracted BiometricPlaceholder Component

  • Created new file: BiometricPlaceholder.kt in ui/components
  • Moved composable from MainActivity to dedicated component file
  • Added @Preview annotation for component preview
  • Follows existing component structure (see CardComponent.kt)
  • Cleaner separation of concerns
  • Better reusability and testability

Files Modified

  • PreferencesManager.kt - Removed lastAuthTime persistence
  • MainActivity.kt - Use in-memory lastAuthTime, removed inline BiometricPlaceholder
  • AboutScreen.kt - Removed call to saveLastAuthTime
  • BiometricPlaceholder.kt - NEW - Extracted component with preview

Build Status

✅ Code formatted with ktfmtFormat
✅ Build successful with assembleDebug
✅ All feedback addressed

Original prompt

This section details on the original issue you should resolve

<issue_title>Biometirc authentication</issue_title>
<issue_description>The cards stored inside the app should not contain any user data, but some users may want the option to secure the app with their fingerprint. So it would be super nice to prompt the users right when starting the app for their fingerprint / other biometric data.

Biometirc Docs: https://developer.android.com/identity/sign-in/biometric-auth
AndroidX Biometirc: https://developer.android.com/jetpack/androidx/releases/biometric</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #43

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Biometirc authentication feat(biometric): implement biometric authentication for app security Sep 30, 2025
@Copilot Copilot AI requested a review from pawcoding September 30, 2025 18:56
Copilot finished work on behalf of pawcoding September 30, 2025 18:56
@pawcoding pawcoding marked this pull request as ready for review September 30, 2025 19:48
@Copilot Copilot AI review requested due to automatic review settings September 30, 2025 19:48
@pawcoding pawcoding marked this pull request as draft September 30, 2025 19:49
Copilot

This comment was marked as outdated.

Copy link
Owner

@pawcoding pawcoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already looks pretty good, @copilot 🦾!

Just a few tweaks before this is ready to be shipped.

@Copilot Copilot AI requested a review from pawcoding October 3, 2025 16:52
Copilot finished work on behalf of pawcoding October 3, 2025 16:52
Copy link
Owner

@pawcoding pawcoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See review @copilot

@Copilot Copilot AI requested a review from pawcoding October 3, 2025 18:20
Copilot finished work on behalf of pawcoding October 3, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants