diff options
Diffstat (limited to 'app/src')
4 files changed, 8 insertions, 7 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index eb5895d5..03769198 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,6 +23,7 @@ android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" + android:requestLegacyExternalStorage="true" tools:ignore="GoogleAppIndexingWarning"> <activity diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt index 1b5da928..cd96e3d1 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt @@ -139,7 +139,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { crypto_password_file.text = name crypto_password_file.setOnLongClickListener { val clip = ClipData.newPlainText("pgp_handler_result_pm", name) - clipboard.primaryClip = clip + clipboard.setPrimaryClip(clip) showSnackbar(this.resources.getString(R.string.clipboard_username_toast_text)) true } @@ -813,7 +813,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { } val clip = ClipData.newPlainText("pgp_handler_result_pm", pass) - clipboard.primaryClip = clip + clipboard.setPrimaryClip(clip) var clearAfter = 45 try { @@ -832,13 +832,13 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { private fun copyUsernameToClipBoard(username: String) { val clip = ClipData.newPlainText("pgp_handler_result_pm", username) - clipboard.primaryClip = clip + clipboard.setPrimaryClip(clip) showSnackbar(resources.getString(R.string.clipboard_username_toast_text)) } private fun copyOtpToClipBoard(code: String) { val clip = ClipData.newPlainText("pgp_handler_result_pm", code) - clipboard.primaryClip = clip + clipboard.setPrimaryClip(clip) showSnackbar(resources.getString(R.string.clipboard_otp_toast_text)) } diff --git a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt index 7182aac0..e3395d41 100644 --- a/app/src/main/java/com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/sshkeygen/ShowSshKeyFragment.kt @@ -43,7 +43,7 @@ class ShowSshKeyFragment : DialogFragment() { b.setOnClickListener { val clipboard = activity.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clip = ClipData.newPlainText("public key", publicKey.text.toString()) - clipboard.primaryClip = clip + clipboard.setPrimaryClip(clip) } } return ad diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/ClipboardUtils.kt b/app/src/main/java/com/zeapo/pwdstore/utils/ClipboardUtils.kt index d173a519..174a1743 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/ClipboardUtils.kt +++ b/app/src/main/java/com/zeapo/pwdstore/utils/ClipboardUtils.kt @@ -15,12 +15,12 @@ object ClipboardUtils { suspend fun clearClipboard(clipboard: ClipboardManager, deepClear: Boolean = false) { Timber.d("Clearing the clipboard") val clip = ClipData.newPlainText("pgp_handler_result_pm", "") - clipboard.primaryClip = clip + clipboard.setPrimaryClip(clip) if (deepClear) { withContext(Dispatchers.IO) { repeat(20) { val count = (it * 500).toString() - clipboard.primaryClip = ClipData.newPlainText(count, count) + clipboard.setPrimaryClip(ClipData.newPlainText(count, count)) } } } |