diff options
| author | (´⌣`ʃƪ) <pt2121@users.noreply.github.com> | 2021-10-03 01:32:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-03 14:02:15 +0530 |
| commit | 2cef6a5bb4cb4afb1b1f1b704f83c1565e441825 (patch) | |
| tree | 92db72d9578a0093d09e83d8c244b51b38cab10c /app/src/main/java/dev/msfjarvis/aps/ui/autofill/AutofillDecryptActivityV2.kt | |
| parent | c4df226cfd4efcfdd4aae332d1ac598336821fa7 (diff) | |
| download | HardenedPass-2cef6a5bb4cb4afb1b1f1b704f83c1565e441825.tar.gz HardenedPass-2cef6a5bb4cb4afb1b1f1b704f83c1565e441825.zip | |
Replace Timber with logcat (#1509)
* Replace Timber with logcat (#1505)
* Add extension for asLog which takes a message param
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Diffstat (limited to 'app/src/main/java/dev/msfjarvis/aps/ui/autofill/AutofillDecryptActivityV2.kt')
| -rw-r--r-- | app/src/main/java/dev/msfjarvis/aps/ui/autofill/AutofillDecryptActivityV2.kt | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/autofill/AutofillDecryptActivityV2.kt b/app/src/main/java/dev/msfjarvis/aps/ui/autofill/AutofillDecryptActivityV2.kt index 27a12867..bb2e6492 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/autofill/AutofillDecryptActivityV2.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/autofill/AutofillDecryptActivityV2.kt @@ -14,8 +14,6 @@ import android.view.autofill.AutofillManager import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.lifecycleScope -import com.github.ajalt.timberkt.d -import com.github.ajalt.timberkt.e import com.github.androidpasswordstore.autofillparser.AutofillAction import com.github.androidpasswordstore.autofillparser.Credentials import com.github.michaelbull.result.getOrElse @@ -29,11 +27,15 @@ import dev.msfjarvis.aps.ui.crypto.DecryptActivityV2 import dev.msfjarvis.aps.util.autofill.AutofillPreferences import dev.msfjarvis.aps.util.autofill.AutofillResponseBuilder import dev.msfjarvis.aps.util.autofill.DirectoryStructure +import dev.msfjarvis.aps.util.extensions.asLog import java.io.File import javax.inject.Inject import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import logcat.LogPriority.ERROR +import logcat.asLog +import logcat.logcat @RequiresApi(Build.VERSION_CODES.O) @AndroidEntryPoint @@ -80,21 +82,21 @@ class AutofillDecryptActivityV2 : AppCompatActivity() { val filePath = intent?.getStringExtra(EXTRA_FILE_PATH) ?: run { - e { "AutofillDecryptActivityV2 started without EXTRA_FILE_PATH" } + logcat(ERROR) { "AutofillDecryptActivityV2 started without EXTRA_FILE_PATH" } finish() return } val clientState = intent?.getBundleExtra(AutofillManager.EXTRA_CLIENT_STATE) ?: run { - e { "AutofillDecryptActivityV2 started without EXTRA_CLIENT_STATE" } + logcat(ERROR) { "AutofillDecryptActivityV2 started without EXTRA_CLIENT_STATE" } finish() return } val isSearchAction = intent?.getBooleanExtra(EXTRA_SEARCH_ACTION, true)!! val action = if (isSearchAction) AutofillAction.Search else AutofillAction.Match directoryStructure = AutofillPreferences.directoryStructure(this) - d { action.toString() } + logcat { action.toString() } lifecycleScope.launch { val credentials = decryptCredential(File(filePath)) if (credentials == null) { @@ -121,7 +123,7 @@ class AutofillDecryptActivityV2 : AppCompatActivity() { private suspend fun decryptCredential(file: File): Credentials? { runCatching { file.inputStream() } .onFailure { e -> - e(e) { "File to decrypt not found" } + logcat(ERROR) { e.asLog("File to decrypt not found") } return null } .onSuccess { encryptedInput -> @@ -136,7 +138,7 @@ class AutofillDecryptActivityV2 : AppCompatActivity() { } } .onFailure { e -> - e(e) { "Decryption failed" } + logcat(ERROR) { e.asLog("Decryption failed") } return null } .onSuccess { result -> @@ -145,7 +147,7 @@ class AutofillDecryptActivityV2 : AppCompatActivity() { AutofillPreferences.credentialsFromStoreEntry(this, file, entry, directoryStructure) } .getOrElse { e -> - e(e) { "Failed to parse password entry" } + logcat(ERROR) { e.asLog("Failed to parse password entry") } return null } } |
