From cff8d41c91a73371f7eb65b08730fa548ce510a4 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 1 Nov 2020 22:51:02 +0530 Subject: build: compile against SDK 30 and resolve deprecations Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/git/sshj/SshKey.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/git/sshj') 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() } -- cgit v1.2.3