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/util/autofill/AutofillMatcher.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/util/autofill/AutofillMatcher.kt')
| -rw-r--r-- | app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillMatcher.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillMatcher.kt b/app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillMatcher.kt index ea10c1ac..206074fa 100644 --- a/app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillMatcher.kt +++ b/app/src/main/java/dev/msfjarvis/aps/util/autofill/AutofillMatcher.kt @@ -8,9 +8,6 @@ import android.content.Context import android.content.SharedPreferences import android.widget.Toast import androidx.core.content.edit -import com.github.ajalt.timberkt.Timber.e -import com.github.ajalt.timberkt.d -import com.github.ajalt.timberkt.w import com.github.androidpasswordstore.autofillparser.FormOrigin import com.github.androidpasswordstore.autofillparser.computeCertificatesHash import com.github.michaelbull.result.Err @@ -18,6 +15,9 @@ import com.github.michaelbull.result.Ok import com.github.michaelbull.result.Result import dev.msfjarvis.aps.R import java.io.File +import logcat.LogPriority.ERROR +import logcat.LogPriority.WARN +import logcat.logcat private const val PREFERENCES_AUTOFILL_APP_MATCHES = "oreo_autofill_app_matches" private val Context.autofillAppMatches @@ -69,7 +69,7 @@ class AutofillMatcher { context.autofillAppMatches.getString(tokenKey(formOrigin), null) ?: return false val hashHasChanged = certificatesHash != storedCertificatesHash if (hashHasChanged) { - e { "$packageName: stored=$storedCertificatesHash, new=$certificatesHash" } + logcat(ERROR) { "$packageName: stored=$storedCertificatesHash, new=$certificatesHash" } true } else { false @@ -134,7 +134,7 @@ class AutofillMatcher { if (hasFormOriginHashChanged(context, formOrigin)) { // This should never happen since we already verified the publisher in // getMatchesFor. - e { "App publisher changed between getMatchesFor and addMatchFor" } + logcat(ERROR) { "App publisher changed between getMatchesFor and addMatchFor" } throw AutofillPublisherChangedException(formOrigin) } val matchPreferences = context.matchPreferences(formOrigin) @@ -154,7 +154,7 @@ class AutofillMatcher { putStringSet(matchesKey(formOrigin), newFiles.map { it.absolutePath }.toSet()) } storeFormOriginHash(context, formOrigin) - d { "Stored match for $formOrigin" } + logcat { "Stored match for $formOrigin" } } /** @@ -176,7 +176,7 @@ class AutofillMatcher { // created with `putStringSet`. @Suppress("UNCHECKED_CAST") val oldMatches = value as? Set<String> if (oldMatches == null) { - w { "Failed to read matches for $key" } + logcat(WARN) { "Failed to read matches for $key" } continue } // Delete all matches for file locations that are going to be overwritten, then @@ -188,7 +188,7 @@ class AutofillMatcher { .minus(oldNewPathMap.values) .map { match -> val newPath = oldNewPathMap[match] ?: return@map match - d { "Updating match for $key: $match --> $newPath" } + logcat { "Updating match for $key: $match --> $newPath" } newPath } .toSet() |
