Skip to content

feat: sms otp code autofill - #85

Merged
OffRange merged 12 commits into
v2from
feat/sms-code-autofill
Aug 27, 2026
Merged

feat: sms otp code autofill#85
OffRange merged 12 commits into
v2from
feat/sms-code-autofill

Conversation

@OffRange

Copy link
Copy Markdown
Owner

This addition allows users to automatically fill in codes a online service sends via sms. If a user chooses the option (suggestion just like any other autofill suggestion), KeyGo will wait for incoming codes, and automatically fill that code into the focused field for the online service.

OffRange and others added 12 commits August 27, 2026 10:36
A first run has permission state NONE, so the retrieval comes back
needing consent. Forward it to the activity as RequestSmsConsent, launch
the resolution with StartIntentSenderForResult, and retry once when the
user grants it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The play services retriever waits about five minutes, and the old dialog
had no button, no text and no dismiss, so a user whose message never
arrived was stuck for the whole window. Replace it with a real
AlertDialog that explains itself and aborts the autofill on cancel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Broaden canOfferSuggestion's catch and bound its play services calls with
a timeout, so a slow or unhappy play services costs at most the sms
suggestion rather than the whole fill response. Guard registerReceiver and
the consent resolution so a throw aborts the autofill instead of crashing
the activity. Fill the focused totp field rather than the first one, and
clear the pending flag on every terminal path.

Adds the first tests for the status code mapping, including the
USER_PERMISSION_REQUIRED branch the design inferred from the api surface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…elled

Rethrowing CancellationException propagated out of the callbackFlow block
and skipped the awaitClose call that followed it, so a receiver registered
before the cancellation was never unregistered. Move awaitClose into a
finally so it runs however the block exits.

Also suppress the unnecessary safe call warning on the consent resolution,
which is deliberate: the @nonnull annotation on getResolution is not kept
by its implementation, which delegates to a nullable Status.getResolution.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@OffRange
OffRange force-pushed the feat/sms-code-autofill branch from a8025cb to 9fe3b84 Compare August 27, 2026 08:53
@OffRange
OffRange merged commit 897b17c into v2 Aug 27, 2026
9 checks passed
@OffRange
OffRange deleted the feat/sms-code-autofill branch August 27, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant