From 66a8c7fbf8c7f46d40f3aabb3e007bacf0320c2a Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Wed, 20 May 2026 03:46:47 +0100 Subject: [PATCH] refactor: simplify forceGenerate dispatch gate Any attest-key request or BYO request goes software unconditionally. Drops the alias-Elvis lookup and the nspace fallback added by the d7dc5e0 -> 5f72acb -> 0b2c34f revert/restore churn, both of which silently missed when callers (Shizuku, post-restart sessions) did not share an in-memory KeyIdentifier(uid, alias) with the attest key originally registered in attestationKeys. The (shouldPatch && isAttestKeyRequest) clause is subsumed by the broader isAttestKeyRequest clause. D2 from /home/rootdev/.claude/plans/breezy-seeking-wozniak.md. --- .../keystore/shim/KeyMintSecurityLevelInterceptor.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/matrix/TEESimulator/interception/keystore/shim/KeyMintSecurityLevelInterceptor.kt b/app/src/main/java/org/matrix/TEESimulator/interception/keystore/shim/KeyMintSecurityLevelInterceptor.kt index 50a2a0b..f388a8c 100644 --- a/app/src/main/java/org/matrix/TEESimulator/interception/keystore/shim/KeyMintSecurityLevelInterceptor.kt +++ b/app/src/main/java/org/matrix/TEESimulator/interception/keystore/shim/KeyMintSecurityLevelInterceptor.kt @@ -495,10 +495,8 @@ class KeyMintSecurityLevelInterceptor( val forceGenerate = oversized || ConfigurationManager.shouldGenerate(callingUid) || - (ConfigurationManager.shouldPatch(callingUid) && isAttestKeyRequest) || - (attestationKey != null && - (attestationKey.alias?.let { isAttestationKey(KeyIdentifier(callingUid, it)) } - ?: attestationKeys.any { kid -> kid.uid == callingUid && generatedKeys[kid]?.nspace == attestationKey.nspace })) + isAttestKeyRequest || + attestationKey != null SystemLogger.trace { "[TRACE-$txId] dispatch: forceGen=$forceGenerate hasChallenge=${challenge != null} isSymmetric=$isSymmetric isAttestKey=$isAttestKeyRequest" }