aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/autofill
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-04-21 13:30:42 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-04-21 15:55:26 +0530
commit500ab609737c9f297962ed6a1cd935a27f39517d (patch)
tree56e93788cbc350b3f3bcaf27686ddb25c1faa7d1 /app/src/main/java/com/zeapo/pwdstore/autofill
parent72166c6912ea596e5087e553c64bfc5dd9ed3742 (diff)
downloadHardenedPass-500ab609737c9f297962ed6a1cd935a27f39517d.tar.gz
HardenedPass-500ab609737c9f297962ed6a1cd935a27f39517d.zip
treewide: switch to logging via timberkt
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/autofill')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt5
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt12
2 files changed, 10 insertions, 7 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt
index bd22f4a4..87881968 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillActivity.kt
@@ -12,10 +12,11 @@ import android.content.SharedPreferences
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.edit
+import com.github.ajalt.timberkt.Timber.tag
+import com.github.ajalt.timberkt.e
import com.zeapo.pwdstore.PasswordStore
import com.zeapo.pwdstore.utils.splitLines
import org.eclipse.jgit.util.StringUtils
-import timber.log.Timber
// blank activity started by service for calling startIntentSenderForResult
class AutofillActivity : AppCompatActivity() {
@@ -29,7 +30,7 @@ class AutofillActivity : AppCompatActivity() {
val pi = extras.getParcelable<PendingIntent>("pending_intent") ?: return
startIntentSenderForResult(pi.intentSender, REQUEST_CODE_DECRYPT_AND_VERIFY, null, 0, 0, 0)
} catch (e: IntentSender.SendIntentException) {
- Timber.tag(AutofillService.Constants.TAG).e(e, "SendIntentException")
+ tag(AutofillService.Constants.TAG).e(e) { "SendIntentException" }
}
} else if (extras != null && extras.containsKey("pick")) {
val intent = Intent(applicationContext, PasswordStore::class.java)
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
index 2d9eb813..7a2cc521 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
@@ -24,6 +24,9 @@ import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.core.os.bundleOf
import androidx.preference.PreferenceManager
+import com.github.ajalt.timberkt.Timber.tag
+import com.github.ajalt.timberkt.e
+import com.github.ajalt.timberkt.i
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.zeapo.pwdstore.PasswordEntry
import com.zeapo.pwdstore.R
@@ -48,7 +51,6 @@ import me.msfjarvis.openpgpktx.util.OpenPgpServiceConnection
import org.apache.commons.io.FileUtils
import org.openintents.openpgp.IOpenPgpService2
import org.openintents.openpgp.OpenPgpError
-import timber.log.Timber
class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope(Dispatchers.Default) {
private var serviceConnection: OpenPgpServiceConnection? = null
@@ -522,11 +524,11 @@ class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope
lastPasswordMaxDate = System.currentTimeMillis() + ttl * 1000L
}
} catch (e: UnsupportedEncodingException) {
- Timber.tag(Constants.TAG).e(e)
+ tag(Constants.TAG).e(e)
}
}
OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED -> {
- Timber.tag("PgpHandler").i("RESULT_CODE_USER_INTERACTION_REQUIRED")
+ tag("PgpHandler").i { "RESULT_CODE_USER_INTERACTION_REQUIRED" }
val pi = result.getParcelableExtra<PendingIntent>(OpenPgpApi.RESULT_INTENT)
// need to start a blank activity to call startIntentSenderForResult
val intent = Intent(applicationContext, AutofillActivity::class.java)
@@ -538,8 +540,8 @@ class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope
val error = result.getParcelableExtra<OpenPgpError>(OpenPgpApi.RESULT_ERROR)
if (error != null) {
withContext(Dispatchers.Main) { Toast.makeText(applicationContext, "Error from OpenKeyChain : ${error.message}", Toast.LENGTH_LONG).show() }
- Timber.tag(Constants.TAG).e("onError getErrorId: ${error.errorId}")
- Timber.tag(Constants.TAG).e("onError getMessage: ${error.message}")
+ tag(Constants.TAG).e { "onError getErrorId: ${error.errorId}" }
+ tag(Constants.TAG).e { "onError getMessage: ${error.message}" }
}
}
}