diff --git a/app/src/main/java/com/amaze/filemanager/ui/dialogs/SftpConnectDialog.kt b/app/src/main/java/com/amaze/filemanager/ui/dialogs/SftpConnectDialog.kt index bf3c836077..eeb9c7ad01 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/dialogs/SftpConnectDialog.kt +++ b/app/src/main/java/com/amaze/filemanager/ui/dialogs/SftpConnectDialog.kt @@ -144,13 +144,15 @@ class SftpConnectDialog : DialogFragment() { val accentColor = (activity as ThemedActivity).accent - // Use system provided action to get Uri to PEM. + // Use system provided action to get Uri to PEM (mostly via DocumentsUI). binding.selectPemBTN.setOnClickListener { val intent = Intent() .setType(MimeTypes.ALL_MIME_TYPES) .setAction(Intent.ACTION_GET_CONTENT) - activityResultHandlerForPemSelection.launch(intent) + activityResultHandlerForPemSelection.launch( + Intent.createChooser(intent, getString(R.string.ssh_select_pem)), + ) } // Define action for buttons diff --git a/app/src/test/java/com/amaze/filemanager/ui/dialogs/SftpConnectDialogSshTest.kt b/app/src/test/java/com/amaze/filemanager/ui/dialogs/SftpConnectDialogSshTest.kt index 5d574e67ed..639cf3613d 100644 --- a/app/src/test/java/com/amaze/filemanager/ui/dialogs/SftpConnectDialogSshTest.kt +++ b/app/src/test/java/com/amaze/filemanager/ui/dialogs/SftpConnectDialogSshTest.kt @@ -112,7 +112,7 @@ class SftpConnectDialogSshTest : AbstractSftpConnectDialogTests() { /** * Test invoke [SftpConnectDialog] with arguments including password and URL encoded path. */ - @Suppress("ktlint:standard:max-line-length") + @Suppress("ktlint:standard:max-line-length", "ktlint:standard:no-single-line-block-comment") @Test @Throws(GeneralSecurityException::class, IOException::class) fun testInvokeSftpConnectionDialogWithPasswordAndEncodedDefaultPath() { @@ -163,7 +163,7 @@ class SftpConnectDialogSshTest : AbstractSftpConnectDialogTests() { val mocked = mc.constructed()[0] await().atMost(10, TimeUnit.SECONDS).until { mocked.arguments != null } for (key in BUNDLE_KEYS) { - if (mocked.arguments!!.getString(key) != null) { + if (mocked.arguments?.getString(key) != null) { if (key == ARG_PASSWORD) { assertEquals( verify.getString(key), @@ -179,4 +179,19 @@ class SftpConnectDialogSshTest : AbstractSftpConnectDialogTests() { } } } + + companion object { + @JvmStatic + private val BUNDLE_KEYS = + arrayOf( + "address", + "port", + "keypairName", + "name", + "username", + "password", + "edit", + "defaultPath", + ) + } } diff --git a/build.gradle b/build.gradle index 7058cd5be0..5b75cb7f2b 100644 --- a/build.gradle +++ b/build.gradle @@ -31,6 +31,7 @@ allprojects { mavenCentral() maven { url "https://jitpack.io" } maven { url "https://jcenter.bintray.com" } + maven { url "https://repository.liferay.com/nexus/content/repositories/public/"} } tasks.withType(Test).tap { configureEach { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3ed032aa09..db01563f45 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -42,7 +42,7 @@ apacheMina = "2.0.16" mockito = "4.11.0" mockitoInline = "4.11.0" mockitoKotlin = "4.1.0" -androidBilling = "5.0.0" +androidBilling = "6.0.1" cloudrailSiAndroid = "2.22.4" junrar = "7.4.0" vectordrawableAnimated = "1.1.0"