Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file

## [Unreleased]

### Fixed

- Autofill no longer crashes when decrypting an entry

## [1.25.1] - 2026-09-28

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AutofillDecryptActivity : BasePGPActivity() {
override fun onStart() {
super.onStart()
filePath =
intent?.getStringExtra(EXTRA_FILE_PATH)
intent?.getStringExtra(BasePGPActivity.EXTRA_FILE_PATH)
?: run {
logcat(ERROR) { "AutofillDecryptActivity started without EXTRA_FILE_PATH" }
finish()
Expand Down Expand Up @@ -251,7 +251,6 @@ class AutofillDecryptActivity : BasePGPActivity() {

companion object {

private const val EXTRA_FILE_PATH = "app.passwordstore.autofill.oreo.EXTRA_FILE_PATH"
private const val EXTRA_SEARCH_ACTION = "app.passwordstore.autofill.oreo.EXTRA_SEARCH_ACTION"

private var decryptFileRequestCode = 1
Expand All @@ -261,15 +260,15 @@ class AutofillDecryptActivity : BasePGPActivity() {
return Intent(context, AutofillDecryptActivity::class.java).apply {
putExtras(forwardedExtras)
putExtra(EXTRA_SEARCH_ACTION, true)
putExtra(EXTRA_FILE_PATH, file.absolutePath)
putExtra(BasePGPActivity.EXTRA_FILE_PATH, file.absolutePath)
}
}

fun makeDecryptFileIntentSender(file: File, context: Context): IntentSender {
val intent =
Intent(context, AutofillDecryptActivity::class.java).apply {
putExtra(EXTRA_SEARCH_ACTION, false)
putExtra(EXTRA_FILE_PATH, file.absolutePath)
putExtra(BasePGPActivity.EXTRA_FILE_PATH, file.absolutePath)
}
return PendingIntent.getActivity(
context,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright © 2014-2026 The Android Password Store Authors. All Rights Reserved.
* SPDX-License-Identifier: GPL-3.0-only
*/
package app.passwordstore.ui.autofill

import android.os.Bundle
import app.passwordstore.ui.crypto.BasePGPActivity
import java.io.File
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
@Config(sdk = [23])
class AutofillDecryptActivityTest {

@Test
fun makeDecryptFileIntentCarriesFilePathExtra() {
val context = RuntimeEnvironment.getApplication()
val file = File("/tmp/test-entry.gpg")
val forwardedExtras = Bundle()

val intent = AutofillDecryptActivity.makeDecryptFileIntent(file, forwardedExtras, context)

val filePathExtra = intent.getStringExtra(BasePGPActivity.EXTRA_FILE_PATH)
assertNotNull(filePathExtra)
assertEquals(file.absolutePath, filePathExtra)
}
}
Loading