Skip to content

Add Google Authenticator 2FA import#4

Merged
eupn merged 5 commits into
Foundation-Devices:contributorsfrom
immz4:2fa-import-google-auth
Apr 13, 2026
Merged

Add Google Authenticator 2FA import#4
eupn merged 5 commits into
Foundation-Devices:contributorsfrom
immz4:2fa-import-google-auth

Conversation

@immz4

@immz4 immz4 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds check to 2FA QR code scan for Google Authenticator export QR codes. It also includes logic for importing multiple 2FA accounts, which can be later used with other import types.

Test suite

Every Google Authenticator QR code contains up to 10 accounts. If export size is larger than 10, multiple QR codes are generated (which can be sequentially scanned).

image

This QR contains 4 test accounts, one of them is a duplicate, so only three will be imported.

Tests results

device_screenshot_1 device_screenshot_2

immz4 added 2 commits April 2, 2026 21:52
Add check to 2FA QR code scan for Google Auth export QR codes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for importing Google Authenticator “migration” (export) QR codes by parsing the migration URI into multiple TOTP entries and providing a UI confirmation flow before bulk-importing them.

Changes:

  • Detect and parse otpauth-migration://offline?... QR codes into multiple TOTP accounts (protobuf + base64 decode).
  • Add “import multiple accounts” confirmation modal and callback plumbing to proceed/cancel.
  • Add batch-import logic with label de-duplication/prefixing and supporting dependencies (prost/regex/base32/etc).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
Cargo.lock Adds/updates transitive deps to support migration parsing (prost/regex/url/etc).
apps/gui-app-authenticator/Cargo.toml Adds new dependencies needed for migration parsing and import.
apps/gui-app-authenticator/ui/pages/main/page.slint Shows a confirmation modal when a multi-account import is pending.
apps/gui-app-authenticator/ui/authenticator-callbacks.slint Adds callbacks/properties for multi-import flow.
apps/gui-app-authenticator/src/main.rs Detects migration QR codes, stores pending imports, and implements batch import/cancel callbacks.
apps/gui-app-authenticator/src/lib.rs Exposes migration module and shared helpers (timestamp + import label generation).
apps/gui-app-authenticator/src/google_migration.rs Implements migration URI parsing/decoding and converts payload entries to otpauth URLs.
apps/gui-app-authenticator/proto/google_auth_migration.proto Defines protobuf schema for Google Auth migration payload.
apps/gui-app-authenticator/proto/google_auth_migration.rs Generated protobuf Rust types used by prost decode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/gui-app-authenticator/src/main.rs
Comment thread apps/gui-app-authenticator/src/google_migration.rs
Comment thread apps/gui-app-authenticator/src/google_migration.rs
Comment thread apps/gui-app-authenticator/Cargo.toml Outdated
Comment thread apps/gui-app-authenticator/src/main.rs
Comment thread apps/gui-app-authenticator/src/main.rs Outdated
Comment thread apps/gui-app-authenticator/src/google_migration.rs
Comment thread apps/gui-app-authenticator/src/main.rs
Comment thread apps/gui-app-authenticator/src/google_migration.rs Outdated
Comment thread apps/gui-app-authenticator/src/google_migration.rs
Comment thread apps/gui-app-authenticator/src/google_migration.rs Outdated
@immz4 immz4 requested a review from mjg-foundation April 8, 2026 18:29
@eupn eupn changed the base branch from main to contributors April 13, 2026 19:11
@eupn eupn merged commit d0d7d18 into Foundation-Devices:contributors Apr 13, 2026
@eupn

eupn commented Apr 13, 2026

Copy link
Copy Markdown
Member

Thanks, slated for 1.3.0

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.

4 participants