mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 03:18:23 +00:00
Instead of storing permissions as nip04_encrypt, nip44_encrypt, etc. (grouped by encryption algorithm), permissions are now stored based on the type of data being encrypted or decrypted: - ENCRYPT_CLEAR_TEXT / DECRYPT_CLEAR_TEXT (text messages) - ENCRYPT_EVENT / DECRYPT_EVENT (nostr events) - ENCRYPT_TAG_ARRAY / DECRYPT_TAG_ARRAY (tag arrays) - DECRYPT_ZAP_EVENT (private zap events, unchanged) This allows more granular permission control based on what data is being processed rather than which NIP algorithm is used. Backward compatibility is maintained by falling back to old NIP-based permission types during lookup. Key changes: - EncryptedDataKind.kt: add toPermissionType(), toPermissionTypeString(), permissionTypeFromContent() helpers - AmberUtils.acceptPermission(): use EncryptedDataKind-based type when storing - BunkerRequestUtils/IntentUtils: pass encryptedData to acceptPermission - BunkerSingleEventHomeScreen/IntentSingleEventHomeScreen: look up permissions by EncryptedDataKind type with NIP-based fallbacks - SignerProvider: classify content to determine permission type before lookup - BasicPermissions/Permission: add new permission types and string resources https://claude.ai/code/session_01Q7XBgjPSfeVdiQ3smLw7YC