Package-level declarations

Types

Link copied to clipboard
internal actual class CurrentPlatform
internal actual class CurrentPlatform
internal expect class CurrentPlatform
internal actual class CurrentPlatform
Link copied to clipboard
internal object DatabaseKeyLock

Serializes database-key state transitions across SDK instances in this process.

Link copied to clipboard
internal typealias DatabaseMigrator = suspend (rootDir: String, oldKey: String, passphrase: ByteArray) -> Unit
Link copied to clipboard
internal class DummyCallManager : CallManager
Link copied to clipboard
internal class EncodedMessageContent(val byteArray: ByteArray)
Link copied to clipboard
internal enum EventLoggingStatus : Enum<EventLoggingStatus>
Link copied to clipboard
internal class EventProcessingLogger(logger: KaliumLogger, event: Event, startOfProcessing: Instant)

The EventProcessingLogger class is responsible for logging event processing details.

Link copied to clipboard

Provides exponentially growing durations for retry backoff.

Link copied to clipboard
internal class ExponentialDurationHelperImpl(initialDuration: Duration, maxDuration: Duration, factor: Double = 2.0) : ExponentialDurationHelper
Link copied to clipboard
internal sealed interface ExtractFilesParam
Link copied to clipboard
internal class GlobalDBKeyMaterial(val rawKey: GlobalDatabaseSecret, val legacyKey: ByteArray? = null)

The key the global database should end up on, plus the key it may still be encrypted with.

Link copied to clipboard
internal data class KaliumMockEngine(val mockEngine: HttpClientEngine)
Link copied to clipboard
data class KaliumMockWebsocket(val session: MockWebSocketSession)
Link copied to clipboard
internal class MessageContentEncoder
Link copied to clipboard
internal class MutexProvider<K>

Creates a mutex associated with a key and locks it so that there's only one execution going for a given key at a given time. When the lock for the given key is executed for the first time, it will create a new entry in the map and lock the mutex. When another lock is executed for the same key while it's locked, it will increase the count and lock the mutex so that it'll wait and execute after the first execution unlocks the mutex. The count is there to keep the mutex in the map as long as it's needed. After the last unlock, the mutex is removed from the map.

Link copied to clipboard
internal actual class PlatformContext
internal actual class PlatformContext
internal expect class PlatformContext
internal actual class PlatformContext
Link copied to clipboard
actual data class PlatformRotation
actual class PlatformRotation
expect class PlatformRotation
actual class PlatformRotation
Link copied to clipboard
internal enum PlatformType : Enum<PlatformType>
Link copied to clipboard
actual class PlatformView
expect class PlatformView
actual class PlatformView

Native iOS view wrapper used by calling APIs that need a platform rendering surface.

actual class PlatformView
actual class PlatformView

Native macOS view wrapper used by calling APIs that need a platform rendering surface.

Link copied to clipboard
internal data class ProcessResult(val exitCode: Int, val stdout: String, val stderr: String)
Link copied to clipboard
Link copied to clipboard
internal actual class SecureRandom
internal actual class SecureRandom
internal expect class SecureRandom
internal actual class SecureRandom
Link copied to clipboard
internal interface SecurityHelper
Link copied to clipboard
internal class SecurityHelperImpl(passphraseStorage: PassphraseStorage, databaseMigrator: DatabaseMigrator = ::migrateDatabaseKey, isSqlCipherSaltStored: Boolean = false) : SecurityHelper
Link copied to clipboard
internal interface ServerTimeHandler
Link copied to clipboard
Link copied to clipboard
internal class TimeLogger(processName: String)

The TimeLogger class is designed to measure the duration of a process for benchmarking purposes. It takes a processName as a parameter to identify the process being timed.

Link copied to clipboard
internal class TriggerBuffer<T>(trigger: Flow<Boolean>, scope: CoroutineScope)

A buffer that will collect items and emit list of all items buffered since last emitted list only when trigger emits true.

Properties

Link copied to clipboard
val Duration.inWholeWeeks: Long

Functions

Link copied to clipboard
fun buildFileName(name: String, extension: String? = null, copyCounter: Int = 0): String
Link copied to clipboard
internal actual fun checkIfCompressedFileContainsFileTypes(compressedFilePath: Path, fileSystem: KaliumFileSystem, expectedFileExtensions: List<String>): Either<CoreFailure, Map<String, Boolean>>
internal expect fun checkIfCompressedFileContainsFileTypes(compressedFilePath: Path, fileSystem: KaliumFileSystem, expectedFileExtensions: List<String>): Either<CoreFailure, Map<String, Boolean>>
internal actual fun checkIfCompressedFileContainsFileTypes(compressedFilePath: Path, fileSystem: KaliumFileSystem, expectedFileExtensions: List<String>): Either<CoreFailure, Map<String, Boolean>>
Link copied to clipboard
internal actual fun createCompressedFile(files: List<Pair<Source, String>>, outputSink: Sink): Either<CoreFailure, Long>
internal expect fun createCompressedFile(files: List<Pair<Source, String>>, outputSink: Sink): Either<CoreFailure, Long>
internal actual fun createCompressedFile(files: List<Pair<Source, String>>, outputSink: Sink): Either<CoreFailure, Long>
Link copied to clipboard
internal fun <T : Any> databaseKey(databasePath: String, existingKey: () -> T?, newKey: () -> T): T

The key of the Apple database at databasePath.

Link copied to clipboard
internal fun databaseSecurityHelper(passphraseStorage: PassphraseStorage): SecurityHelper

The SecurityHelper of the Apple databases. On iOS, their header stays readable instead of keeping the SQLCipher salt, so the salt is stored in the Keychain with their key, in the same item, see the persistence databaseDriver.

Link copied to clipboard
internal actual inline fun <T> decodeBufferSequence(bufferedSource: BufferedSource): Sequence<T>
internal expect inline fun <T> decodeBufferSequence(bufferedSource: BufferedSource): Sequence<T>
internal actual inline fun <T> decodeBufferSequence(bufferedSource: BufferedSource): Sequence<T>
Link copied to clipboard
internal fun execCommand(args: List<String>, workingDirectory: Path? = null): ProcessResult
Link copied to clipboard
fun ExponentialDurationHelper(initialDuration: Duration, maxDuration: Duration): ExponentialDurationHelper
Link copied to clipboard
internal actual fun extractCompressedFile(inputSource: Source, outputRootPath: Path, param: ExtractFilesParam, fileSystem: KaliumFileSystem): Either<CoreFailure, Long>
internal expect fun extractCompressedFile(inputSource: Source, outputRootPath: Path, param: ExtractFilesParam, fileSystem: KaliumFileSystem): Either<CoreFailure, Long>
internal actual fun extractCompressedFile(inputSource: Source, outputRootPath: Path, param: ExtractFilesParam, fileSystem: KaliumFileSystem): Either<CoreFailure, Long>
Link copied to clipboard
fun String.fileExtension(): String?
Link copied to clipboard
fun Int?.isGreaterThan(other: Int?): Boolean
Link copied to clipboard
internal fun isInvalidEntryPathDestination(entryName: String): Boolean
Link copied to clipboard
fun Duration?.isPositiveNotNull(): Boolean
Link copied to clipboard
internal actual fun mockPlatformRotation(): PlatformRotation
internal actual fun mockPlatformRotation(): PlatformRotation
internal expect fun mockPlatformRotation(): PlatformRotation
internal actual fun mockPlatformRotation(): PlatformRotation
Link copied to clipboard
internal fun <K, V> ConcurrentMutableMap<K, MutableSet<V>>.safeComputeAndMutateSetValue(key: K, f: () -> V): MutableSet<V>

Convenience method to compute a {K, Set} map mutating the collection with f() if the key is present.

Link copied to clipboard
internal fun String.serialNumber(): String

This extension function is used to format the serial number of the certificate. output will be in the format of 2 bytes separated by a colon. e.g. 01:02:03:04:05:06:07:08:09:0A:0B:0C:0D:0E:0F:10

Link copied to clipboard
fun String.splitFileExtension(): Pair<String, String?>
Link copied to clipboard
fun String.splitFileExtensionAndCopyCounter(): Triple<String, Int, String?>
Link copied to clipboard
internal fun Boolean.toInt(): Int