diff options
| author | Harsh Shandilya <msfjarvis@gmail.com> | 2020-05-10 19:21:39 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-10 19:21:39 +0530 |
| commit | 041cf00510a75042223d1857660fc7f1dff958ef (patch) | |
| tree | 1b56e67e2b71afe23ac51b680b62ad778272f162 /app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt | |
| parent | 94dc92f8d70870b57a7f8c4fe8adef152c1211ce (diff) | |
| download | HardenedPass-041cf00510a75042223d1857660fc7f1dff958ef.tar.gz HardenedPass-041cf00510a75042223d1857660fc7f1dff958ef.zip | |
Treewide codestyle cleanup (#765)
- Updated gitignore and checked in the IDE's codestyle config
- Removed spotless as the underlying ktlint backend has failed to resolve the super frustrating import order bug[1] in nearly a year
- Reformat the entire codebase based on the previously committed code style configuration.
1: https://github.com/pinterest/ktlint/issues/527
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt | 36 |
1 files changed, 18 insertions, 18 deletions
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 7a2cc521..0e8809e7 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt @@ -32,15 +32,6 @@ import com.zeapo.pwdstore.PasswordEntry import com.zeapo.pwdstore.R import com.zeapo.pwdstore.utils.PasswordRepository import com.zeapo.pwdstore.utils.splitLines -import java.io.ByteArrayOutputStream -import java.io.File -import java.io.IOException -import java.io.InputStream -import java.io.UnsupportedEncodingException -import java.net.MalformedURLException -import java.net.URL -import java.util.ArrayList -import java.util.Locale import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel @@ -51,6 +42,15 @@ import me.msfjarvis.openpgpktx.util.OpenPgpServiceConnection import org.apache.commons.io.FileUtils import org.openintents.openpgp.IOpenPgpService2 import org.openintents.openpgp.OpenPgpError +import java.io.ByteArrayOutputStream +import java.io.File +import java.io.IOException +import java.io.InputStream +import java.io.UnsupportedEncodingException +import java.net.MalformedURLException +import java.net.URL +import java.util.ArrayList +import java.util.Locale class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope(Dispatchers.Default) { private var serviceConnection: OpenPgpServiceConnection? = null @@ -103,16 +103,16 @@ class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope // if returning to the source app from a successful AutofillActivity if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED && - event.packageName != null && event.packageName == packageName && - resultData != null) { + event.packageName != null && event.packageName == packageName && + resultData != null) { bindDecryptAndVerify() } // look for webView and trigger accessibility events if window changes // or if page changes in chrome if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED || (event.eventType == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED && - event.packageName != null && - (event.packageName == "com.android.chrome" || event.packageName == "com.android.browser"))) { + event.packageName != null && + (event.packageName == "com.android.chrome" || event.packageName == "com.android.browser"))) { // there is a chance for getRootInActiveWindow() to return null at any time. save it. try { val root = rootInActiveWindow @@ -145,8 +145,8 @@ class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope // nothing to do if field is keychain app or system ui if (event.eventType == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED || - event.packageName != null && event.packageName == "org.sufficientlysecure.keychain" || - event.packageName != null && event.packageName == "com.android.systemui") { + event.packageName != null && event.packageName == "org.sufficientlysecure.keychain" || + event.packageName != null && event.packageName == "com.android.systemui") { dismissDialog() return } @@ -182,7 +182,7 @@ class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope // need to request permission before attempting to draw dialog if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) { val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, - Uri.parse("package:" + getPackageName())) + Uri.parse("package:" + getPackageName())) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) startActivity(intent) return @@ -283,7 +283,7 @@ class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope val value = prefs.getString(key, null) val keyLowerCase = key.toLowerCase(Locale.ROOT) if (value != null && value != "" && - (webViewUrlLowerCase.contains(keyLowerCase) || keyLowerCase.contains(webViewUrlLowerCase))) { + (webViewUrlLowerCase.contains(keyLowerCase) || keyLowerCase.contains(webViewUrlLowerCase))) { preference = value settingsURL = key } @@ -419,7 +419,7 @@ class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope for (i in items.indices) { if (autofillFullPath) { itemNames[i] = items[i].path.replace(".gpg", "") - .replace("$passwordDirectory/", "") + .replace("$passwordDirectory/", "") } else { itemNames[i] = items[i].name.replace(".gpg", "") } |
