ADFA-4684 | Fix Gemini API key entry: show/hide, trim, and at-rest encryption#49
Open
jatezzz wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Contributor
Author
|
@claude review |
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, comment @claude review on this pull request to trigger a review.
jatezzz
requested review from
a team,
Daniel-ADFA,
dara-abijo-adfa and
itsaky-adfa
July 21, 2026 13:03
jatezzz
force-pushed
the
fix/ADFA-4684-secure-gemini-api-key
branch
from
July 21, 2026 21:30
c809089 to
4426b31
Compare
Contributor
Author
…mini API key Add an eye toggle to reveal/mask the Gemini API key field (loads the real saved key on edit), and encrypt the key at rest with a hardware-backed Android Keystore secret (SecureApiKeyStore) instead of plaintext prefs. ai-core decrypts on read; legacy plaintext keys migrate on next save. Move the input's hint and content descriptions into strings.xml.
jatezzz
force-pushed
the
fix/ADFA-4684-secure-gemini-api-key
branch
from
July 21, 2026 22:56
4426b31 to
2d3bfa3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes the Gemini API key input in the AI Assistant plugin, reported in appdevforall/CodeOnTheGo#1514 where keys wouldn't save correctly and produced 400 "invalid API key" errors. The field now has a working show/hide (eye) toggle that reveals the actual saved key, trims the value on save (dropping the trailing spaces/newlines Gemini rejects), and stops corrupting the key with a masked placeholder on edit. The key is also encrypted at rest with a hardware-backed Android Keystore secret instead of being stored as plaintext.
Details
Changes:
ic_visibility/ic_visibility_offdrawables and anImageButtonbeside the input; toggle swapsinputTypevia an explicit visibility flag (the previous bit-check never flipped back, so it always read "hidden").saveButtontrims before persisting (read side already trimmed).SecureApiKeyStore(AES/GCM, Android Keystore) in both ai-assistant (write/read) and ai-core (read for API calls); only ciphertext hits SharedPreferences, and legacy plaintext keys migrate transparently on next save.document_5111703426673150080.mp4
Ticket
ADFA-4684
Fixes: appdevforall/CodeOnTheGo#1514
Observation
SecureApiKeyStoreis duplicated in ai-assistay're separate Gradle projects with no shared module; the two copies must stay in sync (same aliascotg_ai_gemini_key_v1and transform) or ai-core can't decrypt what ai-assistant wrote. They interoperate because both plugins run in the host app's process (shared Keystore).