IntentIoHelper

Off-main-thread helpers that back the Intent activities.

Functions

Link copied to clipboard
suspend fun loadDecryptSecretKey(keyRepository: KeyRepository, settingsRepository: SettingsRepository): ByteArray

Resolves the secret key used for decryption (default sign key or the first available secret key).

Link copied to clipboard
suspend fun loadEncryptPublicKey(keyRepository: KeyRepository, settingsRepository: SettingsRepository): ByteArray

Resolves the recipient public key to encrypt to (default encrypt key or the first available key).

Link copied to clipboard
suspend fun readBytes(intent: Intent, activity: ComponentActivity): ByteArray?

Reads binary payload bytes from the intent on Dispatchers.IO.

Link copied to clipboard
suspend fun readText(intent: Intent, activity: ComponentActivity): String?

Reads text from the intent on Dispatchers.IO; see IntentPayloadReader.readText.

Link copied to clipboard
suspend fun readUriBytes(context: Context, uri: Uri): ByteArray

Reads all bytes from uri (size-limited).

Link copied to clipboard
suspend fun readUriNamed(context: Context, uri: Uri): Pair<String, ByteArray>?

Reads uri returning its display name paired with its bytes, or null on failure.

Link copied to clipboard
suspend fun writeShareFile(context: Context, data: ByteArray, name: String): Uri

Writes data into the app's shared cache directory and returns a FileProvider URI suitable for sharing to other apps.