diff --git a/app/src/main/java/app/passwordstore/util/services/PasswordExportService.kt b/app/src/main/java/app/passwordstore/util/services/PasswordExportService.kt index 2854ebca..f7515826 100644 --- a/app/src/main/java/app/passwordstore/util/services/PasswordExportService.kt +++ b/app/src/main/java/app/passwordstore/util/services/PasswordExportService.kt @@ -87,7 +87,7 @@ class PasswordExportService : Service() { val targetPasswordFile = targetDirectory.createFile( "application/octet-stream", - requireNotNull(name) { "File name cannot be null" } + requireNotNull(name) { "File name cannot be null" }, ) if (targetPasswordFile?.exists() == true) { val destOutputStream = contentResolver.openOutputStream(targetPasswordFile.uri) @@ -108,13 +108,13 @@ class PasswordExportService : Service() { sourceDirectory.listFiles().forEach { file -> if (file.isDirectory) { // Create new directory and recurse - val newDir = - targetDirectory.createDirectory( + val newDir = + targetDirectory.createDirectory( requireNotNull(file.name) { "File name cannot be null when creating directory" } ) copyDirToDir( - file, - requireNotNull(newDir) { "Target directory cannot be null when copying directories" } + file, + requireNotNull(newDir) { "Target directory cannot be null when copying directories" }, ) } else { copyFileToDir(file, targetDirectory) diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt index 2da3a102..d531dd49 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt @@ -8,11 +8,11 @@ import android.content.Context import android.content.Intent import android.content.pm.PackageManager import android.content.pm.PackageManager.ResolveInfoFlags -import android.net.Uri import android.os.Build import android.provider.Settings import android.service.autofill.SaveInfo import androidx.annotation.RequiresApi +import androidx.core.net.toUri /** * In order to add a new browser, do the following: @@ -244,7 +244,7 @@ private fun getBrowserAutofillSupportLevel( public fun getInstalledBrowsersWithAutofillSupportLevel( context: Context ): List> { - val testWebIntent = Intent(Intent.ACTION_VIEW).apply { data = Uri.parse("https://example.org") } + val testWebIntent = Intent(Intent.ACTION_VIEW).apply { data = "https://example.org".toUri() } val installedBrowsers = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { context.packageManager.queryIntentActivities( diff --git a/crypto/pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt b/crypto/pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt index 7e2ea39a..eef2957d 100644 --- a/crypto/pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt +++ b/crypto/pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt @@ -86,9 +86,9 @@ class PGPKeyManagerTest { // Add key using KeyManager keyManager.addKey(secretKey).unwrap() // Remove key - keyManager.removeKey( - requireNotNull(tryGetId(secretKey)) { "Failed to get ID from secret key" } - ).unwrap() + keyManager + .removeKey(requireNotNull(tryGetId(secretKey)) { "Failed to get ID from secret key" }) + .unwrap() // Check that no keys remain val keys = keyManager.getAllKeys().unwrap() assertEquals(0, keys.size) @@ -209,15 +209,17 @@ class PGPKeyManagerTest { runTest(dispatcher) { val alice = PGPKey( - requireNotNull(this::class.java.classLoader.getResource("alice_owner@example_com")) { - "Resource 'alice_owner@example_com' not found" - }.readBytes() + requireNotNull(this::class.java.classLoader.getResource("alice_owner@example_com")) { + "Resource 'alice_owner@example_com' not found" + } + .readBytes() ) val bobby = PGPKey( - requireNotNull(this::class.java.classLoader.getResource("bobby_owner@example_com")) { - "Resource 'bobby_owner@example_com' not found" - }.readBytes() + requireNotNull(this::class.java.classLoader.getResource("bobby_owner@example_com")) { + "Resource 'bobby_owner@example_com' not found" + } + .readBytes() ) assertTrue(keyManager.addKey(alice).isOk) assertTrue(keyManager.addKey(bobby).isOk)