Merge remote-tracking branch 'origin/main' into claude/concord-quartz-amethyst-plan-0oy779

# Conflicts:
#	amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt
#	amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/model/AuthCoordinator.kt
This commit is contained in:
Claude
2026-07-13 01:44:54 +00:00
55 changed files with 3022 additions and 333 deletions
@@ -21,6 +21,7 @@
package com.vitorpamplona.amethyst.commons.blurhash
import android.graphics.Bitmap
import androidx.core.graphics.scale
actual class PlatformImage(
val bitmap: Bitmap,
@@ -43,7 +44,7 @@ actual class PlatformImage(
actual fun scale(
width: Int,
height: Int,
): PlatformImage = PlatformImage(Bitmap.createScaledBitmap(bitmap, width, height, false))
): PlatformImage = PlatformImage(bitmap.scale(width, height, false))
actual companion object {
actual fun create(
@@ -21,6 +21,7 @@
package com.vitorpamplona.amethyst.commons.keystorage
import android.content.Context
import androidx.core.content.edit
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey
import kotlinx.coroutines.Dispatchers
@@ -86,7 +87,7 @@ actual class SecureKeyStorage private actual constructor() {
) {
withContext(Dispatchers.IO) {
try {
encryptedPrefs.edit().putString(KEY_PREFIX + npub, privKeyHex).apply()
encryptedPrefs.edit { putString(KEY_PREFIX + npub, privKeyHex) }
} catch (e: Exception) {
throw SecureStorageException("Failed to save private key", e)
}
@@ -108,7 +109,7 @@ actual class SecureKeyStorage private actual constructor() {
val key = KEY_PREFIX + npub
val existed = encryptedPrefs.contains(key)
if (existed) {
encryptedPrefs.edit().remove(key).apply()
encryptedPrefs.edit { remove(key) }
}
existed
} catch (e: Exception) {
@@ -22,6 +22,7 @@ package com.vitorpamplona.amethyst.commons.nip64Chess
import android.content.Context
import android.content.SharedPreferences
import androidx.core.content.edit
actual class ChessDismissedGamesStorage private actual constructor() {
private var prefs: SharedPreferences? = null
@@ -48,6 +49,6 @@ actual class ChessDismissedGamesStorage private actual constructor() {
userPubkey: String,
ids: Set<String>,
) {
prefs?.edit()?.putStringSet(prefsKey(userPubkey), ids)?.apply()
prefs?.edit { putStringSet(prefsKey(userPubkey), ids) }
}
}