mirror of
https://github.com/android-password-store/Android-Password-Store.git
synced 2026-05-04 13:59:27 +02:00
Merge branch 'master' into feature/revamp-git-setup
* master: Raise targetSdk to 29 (#682) Request WRITE_EXTERNAL_STORAGE for external password repository (#698)
This commit is contained in:
commit
5df3514c7b
|
|
@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
### Fixed
|
||||
- Text input box theming
|
||||
- Password repository held in non-hidden storage no longer fails
|
||||
|
||||
## [1.6.0] - 2020-03-20
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
|
||||
<activity
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class PasswordStore : AppCompatActivity() {
|
|||
var savedInstance = savedInstanceState
|
||||
if (savedInstanceState != null && (!settings.getBoolean("git_external", false) ||
|
||||
ContextCompat.checkSelfPermission(
|
||||
activity, Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
activity, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED)) {
|
||||
savedInstance = null
|
||||
}
|
||||
|
|
@ -131,9 +131,9 @@ class PasswordStore : AppCompatActivity() {
|
|||
super.onResume()
|
||||
// do not attempt to checkLocalRepository() if no storage permission: immediate crash
|
||||
if (settings.getBoolean("git_external", false)) {
|
||||
if (ContextCompat.checkSelfPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
if (ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.READ_EXTERNAL_STORAGE)) {
|
||||
if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
val snack = Snackbar.make(
|
||||
findViewById(R.id.main_layout),
|
||||
getString(R.string.access_sdcard_text),
|
||||
|
|
@ -141,7 +141,7 @@ class PasswordStore : AppCompatActivity() {
|
|||
.setAction(R.string.dialog_ok) {
|
||||
ActivityCompat.requestPermissions(
|
||||
activity,
|
||||
arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
|
||||
arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
|
||||
REQUEST_EXTERNAL_STORAGE)
|
||||
}
|
||||
snack.show()
|
||||
|
|
@ -153,7 +153,7 @@ class PasswordStore : AppCompatActivity() {
|
|||
// No explanation needed, we can request the permission.
|
||||
ActivityCompat.requestPermissions(
|
||||
activity,
|
||||
arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
|
||||
arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
|
||||
REQUEST_EXTERNAL_STORAGE)
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
*/
|
||||
ext.versions = [
|
||||
minSdk: 23,
|
||||
targetSdk: 28,
|
||||
compileSdk: 28,
|
||||
targetSdk: 29,
|
||||
compileSdk: 29,
|
||||
versionCode: 10601,
|
||||
versionName: '1.7.0-SNAPSHOT',
|
||||
buildTools: '29.0.3',
|
||||
|
|
|
|||
Loading…
Reference in a new issue