IntentResultWriter

Helper for naming, writing and finalizing Intent-based crypto results.

Functions

Link copied to clipboard
fun decryptedOutputName(encryptedFileName: String): String

Strips a known .gpg/.pgp/.asc suffix to derive the decrypted name.

Link copied to clipboard
fun finishCancel(activity: Activity)

Sets RESULT_CANCELED and finishes activity.

Link copied to clipboard
fun finishOk(activity: Activity)

Sets RESULT_OK and finishes activity.

Link copied to clipboard
fun gpgOutputName(sourceFileName: String): String

Returns the .gpg output name for an encrypted sourceFileName.

Link copied to clipboard

Returns true when the intent carries integration source paths (e.g. SFM).

Link copied to clipboard
fun writeDecryptedForCaller(intent: Intent, sourcePath: String, plaintext: ByteArray): File

Writes plaintext to the derived output location, optionally deleting the encrypted source, and returns the written file.

Link copied to clipboard
fun writeEncryptedForCaller(intent: Intent, sourcePath: String, ciphertext: ByteArray): File

Writes ciphertext next to (or into the caller's output path for) the source file, optionally deleting the plaintext source, and returns the file.