Skip to content

fix: prevent crash when device Keystore fails during token persistence#190

Merged
YkSix merged 2 commits into
line:masterfrom
fukuchancat:fix/keystore-init-crash-186
Jun 8, 2026
Merged

fix: prevent crash when device Keystore fails during token persistence#190
YkSix merged 2 commits into
line:masterfrom
fukuchancat:fix/keystore-init-crash-186

Conversation

@fukuchancat

@fukuchancat fukuchancat commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #186.

Minimal hotfix to stop the crash from a broken device Keystore
(ProviderException: Keystore key generation failed). Two unguarded
StringAesCipher init paths are wrapped:

  • EncryptorHolder pre-init (background, latency optimization only) catches and logs.
  • LineAuthenticationController returns INTERNAL_ERROR instead of crashing on saveAccessToken failure.

Scope is limited to preventing the crash; on affected devices login fails gracefully rather than succeeding.

Test: testKeystoreErrorOfSavingAccessToken injects a throwing cipher and asserts login finishes with INTERNAL_ERROR.

Related: #189.

@fukuchancat fukuchancat force-pushed the fix/keystore-init-crash-186 branch from 833bacc to d1919bd Compare June 8, 2026 06:05

@YkSix YkSix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks

@YkSix YkSix merged commit a6adfc8 into line:master Jun 8, 2026
3 checks passed
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.

The app crashes with java.security.ProviderException: Keystore key generation failed

2 participants