From c5a93b8b8168eead37f3f93a8e8378211c1d240b Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Wed, 1 Jul 2020 12:51:05 +0200 Subject: Run a treewide reformat (#908) Co-authored-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/crypto/DecryptActivity.kt | 2 -- .../java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java | 4 ++-- app/src/main/java/com/zeapo/pwdstore/utils/Otp.kt | 1 + app/src/main/java/com/zeapo/pwdstore/utils/UriTotpFinder.kt | 1 + app/src/main/res/drawable/ic_qr_code_scanner.xml | 6 +++--- app/src/main/res/layout/password_row_layout.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/DecryptActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/DecryptActivity.kt index 3c31a518..b48420fb 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/DecryptActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/DecryptActivity.kt @@ -20,7 +20,6 @@ import com.github.ajalt.timberkt.e import com.zeapo.pwdstore.R import com.zeapo.pwdstore.databinding.DecryptLayoutBinding import com.zeapo.pwdstore.model.PasswordEntry -import com.zeapo.pwdstore.utils.Otp import com.zeapo.pwdstore.utils.PreferenceKeys import com.zeapo.pwdstore.utils.viewBinding import kotlinx.coroutines.Dispatchers @@ -32,7 +31,6 @@ import me.msfjarvis.openpgpktx.util.OpenPgpServiceConnection import org.openintents.openpgp.IOpenPgpService2 import java.io.ByteArrayOutputStream import java.io.File -import java.util.Date import kotlin.time.ExperimentalTime import kotlin.time.seconds diff --git a/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java b/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java index 5ad12ef8..5a51d28a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java @@ -110,11 +110,11 @@ public class SshApiSessionFactory extends JschConfigSessionFactory { */ public static class IdentityBuilder { private final SshAuthenticationConnection connection; + private final BaseGitActivity callingActivity; + private final SharedPreferences settings; private SshAuthenticationApi api; private String keyId, description, alg; private byte[] publicKey; - private final BaseGitActivity callingActivity; - private final SharedPreferences settings; /** * Construct a new IdentityBuilder diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/Otp.kt b/app/src/main/java/com/zeapo/pwdstore/utils/Otp.kt index b95b9902..ace09bd2 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/Otp.kt +++ b/app/src/main/java/com/zeapo/pwdstore/utils/Otp.kt @@ -18,6 +18,7 @@ import kotlin.experimental.and object Otp { private val BASE_32 = Base32() private val STEAM_ALPHABET = "23456789BCDFGHJKMNPQRTVWXY".toCharArray() + init { check(STEAM_ALPHABET.size == 26) } diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/UriTotpFinder.kt b/app/src/main/java/com/zeapo/pwdstore/utils/UriTotpFinder.kt index faa349d1..57c8f580 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/UriTotpFinder.kt +++ b/app/src/main/java/com/zeapo/pwdstore/utils/UriTotpFinder.kt @@ -11,6 +11,7 @@ import android.net.Uri * [Uri] backed TOTP URL parser. */ class UriTotpFinder : TotpFinder { + override fun findSecret(content: String): String? { content.split("\n".toRegex()).forEach { line -> if (line.startsWith("otpauth://totp/")) { diff --git a/app/src/main/res/drawable/ic_qr_code_scanner.xml b/app/src/main/res/drawable/ic_qr_code_scanner.xml index 45a618ac..2af8a9bd 100644 --- a/app/src/main/res/drawable/ic_qr_code_scanner.xml +++ b/app/src/main/res/drawable/ic_qr_code_scanner.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/layout/password_row_layout.xml b/app/src/main/res/layout/password_row_layout.xml index 93da710e..81065fc2 100644 --- a/app/src/main/res/layout/password_row_layout.xml +++ b/app/src/main/res/layout/password_row_layout.xml @@ -31,8 +31,8 @@ android:layout_gravity="bottom" android:textSize="18sp" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/type_image" app:layout_constraintEnd_toStartOf="@id/child_count" + app:layout_constraintStart_toEndOf="@id/type_image" app:layout_constraintTop_toTopOf="parent" tools:text="FILE_NAME" /> -- cgit v1.2.3