aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/git/sshj
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-11-01 22:51:02 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-11-01 22:51:02 +0530
commitcff8d41c91a73371f7eb65b08730fa548ce510a4 (patch)
treec35846b7c5b89f1e16b976993f9b2ca54d697482 /app/src/main/java/com/zeapo/pwdstore/git/sshj
parent18b6e93bb5b3fb95ce1076ecc232db109523e635 (diff)
downloadHardenedPass-cff8d41c91a73371f7eb65b08730fa548ce510a4.tar.gz
HardenedPass-cff8d41c91a73371f7eb65b08730fa548ce510a4.zip
build: compile against SDK 30 and resolve deprecations
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/git/sshj')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/git/sshj/SshKey.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/sshj/SshKey.kt b/app/src/main/java/com/zeapo/pwdstore/git/sshj/SshKey.kt
index 5e6cfb1b..52297133 100644
--- a/app/src/main/java/com/zeapo/pwdstore/git/sshj/SshKey.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/git/sshj/SshKey.kt
@@ -262,7 +262,12 @@ object SshKey {
apply(algorithm.applyToSpec)
if (requireAuthentication) {
setUserAuthenticationRequired(true)
- setUserAuthenticationValidityDurationSeconds(30)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
+ setUserAuthenticationParameters(30, KeyProperties.AUTH_DEVICE_CREDENTIAL)
+ } else {
+ @Suppress("DEPRECATION")
+ setUserAuthenticationValidityDurationSeconds(30)
+ }
}
build()
}