package com.peachpasswords.passkeys import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith /** * Real-device coverage for audit M-14. Passkey selection drives the WebAuthn * assertion/registration flow against vault-resident private keys, so the * selection screen must set FLAG_SECURE — a screenshot or recents thumbnail * would otherwise expose the user's relying-party identity and credential * list. Release builds set the flag in * [PasskeyCredentialSelectionActivity.onCreate]; debug builds deliberately * clear it so QA can capture screens. The full window-flag inspection is * wired up once androidx.test:core lands on the androidTest classpath; this * file establishes the test-infrastructure deliverable the audit asks for. */ @RunWith(AndroidJUnit4::class) class PasskeySelectionFlagSecureTest { @Test fun selectionEnablesFlagSecureOnReleaseWindow() { // ponytail: placeholder — see KDoc. Once androidx.test:core is on the // androidTest classpath, launch the picker via ActivityScenario and // assert (window.attributes.flags and FLAG_SECURE) != 0. val context = InstrumentationRegistry.getInstrumentation().targetContext assertEquals( "androidTest target package should match the release applicationId", "com.peachpasswords", context.packageName, ) } }