e9158e9ae9dc

feat: Add passkey unlock action (v2.3.46)

- Return a Credential Manager authentication action when passkey get requests arrive while locked - Launch Peach through the existing lock flow from the system sheet - Document create-while-locked as a remaining AndroidX platform gap

time
2026-06-26 13:55 UTC · 4 months ago
machine
koh2
parent
363a93112668
3 files app/build.gradle+2 −2app/src/main/java/com/peachpasswords/passkeys/PasskeyUnlockIntent.kt+23 −0app/src/main/java/com/peachpasswords/passkeys/PeachCredentialProviderService.kt+15 −1
app/build.gradle+2 −2
@@ -16,8 +16,8 @@1616         applicationId "com.peachpasswords"1717         minSdk 261818         targetSdk 3519-        versionCode 23450020-        versionName "2.3.45"19+        versionCode 23460020+        versionName "2.3.46"2121 2222         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"2323         vectorDrawables {

view file

app/src/main/java/com/peachpasswords/passkeys/PasskeyUnlockIntent.kt+23 −0
@@ -0,0 +1,23 @@1+package com.peachpasswords.passkeys2+3+import android.app.PendingIntent4+import android.content.Context5+import android.content.Intent6+import com.peachpasswords.MainActivity7+8+object PasskeyUnlockIntent {9+    fun pendingIntent(context: Context): PendingIntent {10+        val intent = Intent(context, MainActivity::class.java)11+            .setAction(ACTION_PASSKEY_UNLOCK)12+            .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP)13+        return PendingIntent.getActivity(14+            context,15+            REQUEST_CODE,16+            intent,17+            PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,18+        )19+    }20+21+    private const val ACTION_PASSKEY_UNLOCK = "com.peachpasswords.passkeys.ACTION_PASSKEY_UNLOCK"22+    private const val REQUEST_CODE = 0x504b23+}

view file

app/src/main/java/com/peachpasswords/passkeys/PeachCredentialProviderService.kt+15 −1
@@ -10,6 +10,7 @@1010 import androidx.credentials.provider.BeginGetCredentialResponse1111 import androidx.credentials.provider.BeginGetPublicKeyCredentialOption1212 import androidx.credentials.provider.CreateEntry13+import androidx.credentials.provider.AuthenticationAction1314 import androidx.credentials.provider.CredentialProviderService1415 import androidx.credentials.provider.ProviderClearCredentialStateRequest1516 import androidx.credentials.provider.PublicKeyCredentialEntry@@ -47,8 +48,21 @@4748         cancellationSignal: CancellationSignal,4849         callback: OutcomeReceiver<BeginGetCredentialResponse, GetCredentialException>,4950     ) {50-        if (!vault.settings.value.passkeyProviderEnabled || !vault.isUnlocked.value) {51+        if (!vault.settings.value.passkeyProviderEnabled) {5152             callback.onResult(BeginGetCredentialResponse())53+            return54+        }55+        if (!vault.isUnlocked.value) {56+            callback.onResult(57+                BeginGetCredentialResponse(58+                    authenticationActions = listOf(59+                        AuthenticationAction(60+                            title = "Unlock Peach",61+                            pendingIntent = PasskeyUnlockIntent.pendingIntent(this),62+                        ),63+                    ),64+                ),65+            )5266             return5367         }5468         val passkeyOptions = request.beginGetCredentialOptions

view file