Skip to content

feat: app lock with biometrics or the device screen lock - #214

Merged
cevheri merged 6 commits into
mainfrom
feat/195-app-lock
Oct 24, 2026
Merged

cevheri merged 6 commits into
mainfrom
feat/195-app-lock

Conversation

@cevheri

@cevheri cevheri commented Oct 24, 2026

Copy link
Copy Markdown
Member

Adds an app lock: with it on, the app asks for the device's biometrics or screen lock on a cold start that restores a session and after the chosen time in the background (immediately, 1, 5 or 15 minutes), and never while signed out. When the time away also passes the idle period, the idle sign-out wins and no lock shows.

  • lib/features/app_lock/: device preferences for the switch and timeout, an authenticator over local_auth 3.0.2 (the Flutter team's plugin, biometrics with the device credential as fallback; local_auth_android 2.3.0 and local_auth_darwin 2.0.5 are pinned directly for the localized prompt texts), AppLockBloc with a droppable unlock, the lock screen and a Security section in Settings.
  • The lock screen sits above the router (lib/app/lock/app_lock_gate.dart): pages stay mounted offstage, back does nothing, a screen reader reads only the lock. Sign out uses the existing sign-out.
  • APP_LOCK_REQUIRED forces the lock on; the release pipeline does not set it.
  • While the lock is on the recent-apps preview hides the app: setRecentsScreenshotEnabled on Android 13+ through a small MainActivity channel, a FLAG_SECURE lease while away below 13.
  • MainActivity is now a FlutterFragmentActivity; the launch themes inherit Theme.AppCompat; NSFaceIDUsageDescription in English and Turkish.
  • docs/security.md gains "App lock".

Checked on the API 33 emulator (PIN and fingerprint) and API 30 against tool/studio-dev; details in the issue thread on request. The iOS prompt and snapshot are left to #199.

Closes #195

An app lock feature: settings kept as device preferences, an authenticator
over local_auth, AppLockBloc that locks a cold start that restores a session
and a resume after the chosen time in the background, and the lock screen
above the router with Unlock and Sign out. The settings get a Security
section, APP_LOCK_REQUIRED forces the lock on, and while it is on the
recent-apps preview hides the app. MainActivity becomes a
FlutterFragmentActivity, as local_auth needs.
…idden pages, and fail closed on a failed check

review#195: a restore that waited behind the preview switch let a signed-in
page show; the hidden editor kept the focus and the keyboard; the idle
sign-out and the lock screen's sign-out showed the pages before the login
page; and a failed device check counted as able.
@cevheri
cevheri merged commit 438663a into main Oct 24, 2026
6 checks passed
@cevheri
cevheri deleted the feat/195-app-lock branch October 24, 2026 17:06
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.

App lock with biometrics or the device screen lock

1 participant