diff --git a/AGENTS.md b/AGENTS.md index 0e6e8a7fb..98580058c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -164,7 +164,8 @@ suspend fun getData(): Result = withContext(Dispatchers.IO) { - ALWAYS when fixing lint or test failures prefer to do the minimal amount of changes to fix the issues - USE single-line commit messages under 50 chars; use conventional commit messages template format: `feat: add something new` - USE `git diff HEAD sourceFilePath` to diff an uncommitted file against the last commit -- ALWAYS run `git status` to check ALL uncommitted changes after completing any code edits, then provide exactly 3 commit message suggestions covering the ENTIRE uncommitted diff +- NEVER capitalize words in commit messages +- ALWAYS run `git status` to check ALL uncommitted changes after completing any code edits, then reply with 3 commit message suggestions covering the ENTIRE uncommitted diff - ALWAYS check existing code patterns before implementing new features - USE existing extensions and utilities rather than creating new ones - ALWAYS consider applying YAGNI (You Ain't Gonna Need It) principle for new code diff --git a/app/src/main/java/to/bitkit/data/keychain/AndroidKeyStore.kt b/app/src/main/java/to/bitkit/data/keychain/AndroidKeyStore.kt index 8f9226669..f60108f8e 100644 --- a/app/src/main/java/to/bitkit/data/keychain/AndroidKeyStore.kt +++ b/app/src/main/java/to/bitkit/data/keychain/AndroidKeyStore.kt @@ -80,4 +80,10 @@ class AndroidKeyStore( val decryptedDataBytes = cipher.doFinal(actualEncryptedData) return decryptedDataBytes } + + fun deleteEncryptionKey() { + if (keyStore.containsAlias(alias)) { + keyStore.deleteEntry(alias) + } + } } diff --git a/app/src/main/java/to/bitkit/data/keychain/Keychain.kt b/app/src/main/java/to/bitkit/data/keychain/Keychain.kt index ad6e82997..7e81ff50f 100644 --- a/app/src/main/java/to/bitkit/data/keychain/Keychain.kt +++ b/app/src/main/java/to/bitkit/data/keychain/Keychain.kt @@ -96,6 +96,7 @@ class Keychain @Inject constructor( suspend fun wipe() { val keys = snapshot.asMap().keys keychain.edit { it.clear() } + keyStore.deleteEncryptionKey() Logger.info("Deleted all keychain entries: ${keys.joinToString()}") }