mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-02 15:25:39 +00:00
@@ -120,23 +120,29 @@ class AutofillSaveActivity : Activity() {
|
|||||||
AutofillMatcher.addMatchFor(this, it, File(createdPath))
|
AutofillMatcher.addMatchFor(this, it, File(createdPath))
|
||||||
}
|
}
|
||||||
val longName = data.getStringExtra("LONG_NAME")!!
|
val longName = data.getStringExtra("LONG_NAME")!!
|
||||||
val password = data.getStringExtra("PASSWORD")!!
|
val password = data.getStringExtra("PASSWORD")
|
||||||
val username = data.getStringExtra("USERNAME")
|
val result = if (password != null) {
|
||||||
val clientState =
|
// Password was generated and should be filled into a form.
|
||||||
intent?.getBundleExtra(AutofillManager.EXTRA_CLIENT_STATE) ?: run {
|
val username = data.getStringExtra("USERNAME")
|
||||||
e { "AutofillDecryptActivity started without EXTRA_CLIENT_STATE" }
|
val clientState =
|
||||||
finish()
|
intent?.getBundleExtra(AutofillManager.EXTRA_CLIENT_STATE) ?: run {
|
||||||
return
|
e { "AutofillDecryptActivity started without EXTRA_CLIENT_STATE" }
|
||||||
|
finish()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val credentials = Credentials(username, password)
|
||||||
|
val fillInDataset = FillableForm.makeFillInDataset(
|
||||||
|
this,
|
||||||
|
credentials,
|
||||||
|
clientState,
|
||||||
|
AutofillAction.Generate
|
||||||
|
)
|
||||||
|
Intent().apply {
|
||||||
|
putExtra(AutofillManager.EXTRA_AUTHENTICATION_RESULT, fillInDataset)
|
||||||
}
|
}
|
||||||
val credentials = Credentials(username, password)
|
} else {
|
||||||
val fillInDataset = FillableForm.makeFillInDataset(
|
// Password was extracted from a form, there is nothing to fill.
|
||||||
this,
|
Intent()
|
||||||
credentials,
|
|
||||||
clientState,
|
|
||||||
AutofillAction.Generate
|
|
||||||
)
|
|
||||||
val result = Intent().apply {
|
|
||||||
putExtra(AutofillManager.EXTRA_AUTHENTICATION_RESULT, fillInDataset)
|
|
||||||
}
|
}
|
||||||
// PgpActivity delegates committing the added file to PasswordStore. Since PasswordStore
|
// PgpActivity delegates committing the added file to PasswordStore. Since PasswordStore
|
||||||
// is not involved in an AutofillScenario, we have to commit the file ourselves.
|
// is not involved in an AutofillScenario, we have to commit the file ourselves.
|
||||||
|
Reference in New Issue
Block a user