diff --git a/Cargo.lock b/Cargo.lock index 291cee8..48ab6d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5437,17 +5437,19 @@ dependencies = [ name = "ironstorage-android" version = "1.0.1" dependencies = [ - "ironstorage-apple", + "ironstorage-mobile", ] [[package]] name = "ironstorage-android-build" version = "1.0.1" dependencies = [ + "camino", "ironstorage", "object", "regex", "uniffi", + "uniffi_bindgen", "zip", ] @@ -5455,8 +5457,7 @@ dependencies = [ name = "ironstorage-apple" version = "1.0.1" dependencies = [ - "ironstorage", - "uniffi", + "ironstorage-mobile", ] [[package]] @@ -5506,6 +5507,14 @@ dependencies = [ "simple-file-manifest", ] +[[package]] +name = "ironstorage-mobile" +version = "1.0.1" +dependencies = [ + "ironstorage", + "uniffi", +] + [[package]] name = "ironstorage-tui" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index 5287b06..bc43490 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "apps/tui", "crates/apple", "crates/android", + "crates/mobile-bridge", "crates/storage", "crates/watch-apple", "tools/android-build", diff --git a/android/app/src/androidTest/kotlin/de/rfc1437/ironstorage/ShellScreenTest.kt b/android/app/src/androidTest/kotlin/de/rfc1437/ironstorage/ShellScreenTest.kt index 7b6d406..0f49971 100644 --- a/android/app/src/androidTest/kotlin/de/rfc1437/ironstorage/ShellScreenTest.kt +++ b/android/app/src/androidTest/kotlin/de/rfc1437/ironstorage/ShellScreenTest.kt @@ -21,10 +21,10 @@ class ShellScreenTest { ShellState.entries.forEach { state -> compose.onNodeWithText("Fixture: ${state.name}").performScrollTo().performClick() ShellTab.entries.forEach { tab -> - compose.onNode( - hasText(tab.name) and androidx.compose.ui.test.isSelectable() - ).performClick() val page = ShellFixtures.all.getValue(state).first { it.tab == tab } + compose.onNode( + hasText(page.title) and androidx.compose.ui.test.isSelectable() + ).performClick() compose.waitUntil(timeoutMillis = 10_000) { compose.onAllNodes(hasText(page.stateTitle) and isHeading()) .fetchSemanticsNodes().size == 1 diff --git a/android/core/src/main/kotlin/de/rfc1437/ironstorage/core/NativeFixtureShellRepository.kt b/android/core/src/main/kotlin/de/rfc1437/ironstorage/core/NativeFixtureShellRepository.kt index 38de42d..070fa9b 100644 --- a/android/core/src/main/kotlin/de/rfc1437/ironstorage/core/NativeFixtureShellRepository.kt +++ b/android/core/src/main/kotlin/de/rfc1437/ironstorage/core/NativeFixtureShellRepository.kt @@ -4,6 +4,7 @@ import android.content.Context import de.rfc1437.ironstorage.bridge.NativeBridgeException import de.rfc1437.ironstorage.bridge.NativeFailureKind import de.rfc1437.ironstorage.bridge.NativeRuntime +import de.rfc1437.ironstorage.bridge.generated.MobileIcon import de.rfc1437.ironstorage.bridge.generated.MobileShellState import de.rfc1437.ironstorage.bridge.generated.MobileTab import java.util.concurrent.atomic.AtomicLong @@ -57,7 +58,13 @@ private fun nativeLoader(context: Context): suspend (ShellState) -> ShellSnapsho withContext(Dispatchers.IO) { val shell = runtime.fixture(state.toNative()) val pages = shell.pages.map { page -> - ShellPage(page.tab.toFacade(), page.title, page.stateTitle, page.stateDetail) + ShellPage( + page.tab.toFacade(), + page.title, + page.stateTitle, + page.stateDetail, + page.icon.toFacade() + ) } val actual = shell.pages.firstOrNull()?.state ?: throw NativeBridgeException(NativeFailureKind.RustFailure) @@ -99,3 +106,31 @@ private fun NativeFailureKind.toFacade(): NativeFailure = when (this) { NativeFailureKind.RustFailure -> NativeFailure.RustFailure NativeFailureKind.MainThreadCall -> NativeFailure.MainThreadCall } + +private fun MobileIcon.toFacade(): ShellIcon = when (this) { + MobileIcon.HOME -> ShellIcon.Home + MobileIcon.KEY -> ShellIcon.Key + MobileIcon.SEARCH -> ShellIcon.Search + MobileIcon.TIMER -> ShellIcon.Timer + MobileIcon.SETTINGS -> ShellIcon.Settings + MobileIcon.WARNING -> ShellIcon.Warning + MobileIcon.BRANCH -> ShellIcon.Branch + MobileIcon.SUCCESS -> ShellIcon.Success + MobileIcon.SYNC -> ShellIcon.Sync + MobileIcon.PROTECTED -> ShellIcon.Protected + MobileIcon.REPOSITORY -> ShellIcon.Repository + MobileIcon.HISTORY -> ShellIcon.History + MobileIcon.INCOMING -> ShellIcon.Incoming + MobileIcon.OUTGOING -> ShellIcon.Outgoing + MobileIcon.RECIPIENTS -> ShellIcon.Recipients + MobileIcon.SIGNATURE -> ShellIcon.Signature + MobileIcon.FILE -> ShellIcon.File + MobileIcon.MERGE -> ShellIcon.Merge + MobileIcon.REFRESH -> ShellIcon.Refresh + MobileIcon.FOLDER -> ShellIcon.Folder + MobileIcon.USER -> ShellIcon.User + MobileIcon.EMAIL -> ShellIcon.Email + MobileIcon.WEBSITE -> ShellIcon.Website + MobileIcon.TEXT -> ShellIcon.Text + MobileIcon.NOTE -> ShellIcon.Note +} diff --git a/android/core/src/main/kotlin/de/rfc1437/ironstorage/core/ShellRepository.kt b/android/core/src/main/kotlin/de/rfc1437/ironstorage/core/ShellRepository.kt index 0401cfd..297524c 100644 --- a/android/core/src/main/kotlin/de/rfc1437/ironstorage/core/ShellRepository.kt +++ b/android/core/src/main/kotlin/de/rfc1437/ironstorage/core/ShellRepository.kt @@ -5,11 +5,40 @@ import kotlinx.coroutines.flow.StateFlow enum class ShellState { Loading, Empty, Ready, Locked, Error } enum class ShellTab { Home, Passwords, Search, Totp, Preferences } +enum class ShellIcon { + Home, + Key, + Search, + Timer, + Settings, + Warning, + Branch, + Success, + Sync, + Protected, + Repository, + History, + Incoming, + Outgoing, + Recipients, + Signature, + File, + Merge, + Refresh, + Folder, + User, + Email, + Website, + Text, + Note +} + data class ShellPage( val tab: ShellTab, val title: String, val stateTitle: String, - val detail: String + val detail: String, + val icon: ShellIcon ) data class ShellSnapshot( val state: ShellState, diff --git a/android/core/src/test/kotlin/de/rfc1437/ironstorage/core/NativeFixtureShellRepositoryTest.kt b/android/core/src/test/kotlin/de/rfc1437/ironstorage/core/NativeFixtureShellRepositoryTest.kt index 1a79e47..68d5066 100644 --- a/android/core/src/test/kotlin/de/rfc1437/ironstorage/core/NativeFixtureShellRepositoryTest.kt +++ b/android/core/src/test/kotlin/de/rfc1437/ironstorage/core/NativeFixtureShellRepositoryTest.kt @@ -15,7 +15,10 @@ class NativeFixtureShellRepositoryTest { val pending = CompletableDeferred() val repository = NativeFixtureShellRepository(backgroundScope) { state -> if (state == ShellState.Ready) withContext(NonCancellable) { pending.await() } - ShellSnapshot(state, listOf(ShellPage(ShellTab.Home, "Home", state.name, "Fixture"))) + ShellSnapshot( + state, + listOf(ShellPage(ShellTab.Home, "Home", state.name, "Fixture", ShellIcon.Home)) + ) } runCurrent() repository.showFixture(ShellState.Ready) diff --git a/android/features/src/main/kotlin/de/rfc1437/ironstorage/features/ShellScreen.kt b/android/features/src/main/kotlin/de/rfc1437/ironstorage/features/ShellScreen.kt index 1d35d97..0fd2464 100644 --- a/android/features/src/main/kotlin/de/rfc1437/ironstorage/features/ShellScreen.kt +++ b/android/features/src/main/kotlin/de/rfc1437/ironstorage/features/ShellScreen.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.NavigationBar import androidx.compose.material3.NavigationBarItem @@ -13,12 +14,14 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.heading import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import de.rfc1437.ironstorage.core.NativeFailure +import de.rfc1437.ironstorage.core.ShellIcon import de.rfc1437.ironstorage.core.ShellState import de.rfc1437.ironstorage.core.ShellTab @@ -28,12 +31,18 @@ fun ShellScreen(viewModel: ShellViewModel) { Scaffold( bottomBar = { NavigationBar { - ShellTab.entries.forEach { tab -> + snapshot.pages.forEach { page -> + val tab = page.tab NavigationBarItem( selected = snapshot.selectedTab == tab, onClick = { viewModel.selectTab(tab) }, - icon = {}, - label = { Text(tab.name) } + icon = { + Icon( + painterResource(navigationIcon(page.icon)), + contentDescription = null + ) + }, + label = { Text(page.title) } ) } } @@ -76,3 +85,12 @@ fun ShellScreen(viewModel: ShellViewModel) { } } } + +private fun navigationIcon(icon: ShellIcon): Int = when (icon) { + ShellIcon.Home -> R.drawable.ic_home + ShellIcon.Key -> R.drawable.ic_key + ShellIcon.Search -> R.drawable.ic_search + ShellIcon.Timer -> R.drawable.ic_timer + ShellIcon.Settings -> R.drawable.ic_settings + else -> error("Rust returned a non-navigation icon for a navigation page") +} diff --git a/android/features/src/main/res/drawable/ic_home.xml b/android/features/src/main/res/drawable/ic_home.xml new file mode 100644 index 0000000..895ce67 --- /dev/null +++ b/android/features/src/main/res/drawable/ic_home.xml @@ -0,0 +1 @@ + diff --git a/android/features/src/main/res/drawable/ic_key.xml b/android/features/src/main/res/drawable/ic_key.xml new file mode 100644 index 0000000..57a6778 --- /dev/null +++ b/android/features/src/main/res/drawable/ic_key.xml @@ -0,0 +1 @@ + diff --git a/android/features/src/main/res/drawable/ic_search.xml b/android/features/src/main/res/drawable/ic_search.xml new file mode 100644 index 0000000..22ca14e --- /dev/null +++ b/android/features/src/main/res/drawable/ic_search.xml @@ -0,0 +1 @@ + diff --git a/android/features/src/main/res/drawable/ic_settings.xml b/android/features/src/main/res/drawable/ic_settings.xml new file mode 100644 index 0000000..9749a2e --- /dev/null +++ b/android/features/src/main/res/drawable/ic_settings.xml @@ -0,0 +1 @@ + diff --git a/android/features/src/main/res/drawable/ic_timer.xml b/android/features/src/main/res/drawable/ic_timer.xml new file mode 100644 index 0000000..fbeab49 --- /dev/null +++ b/android/features/src/main/res/drawable/ic_timer.xml @@ -0,0 +1 @@ + diff --git a/android/rust-bridge/build.gradle.kts b/android/rust-bridge/build.gradle.kts index e00380f..f8e42d8 100644 --- a/android/rust-bridge/build.gradle.kts +++ b/android/rust-bridge/build.gradle.kts @@ -46,6 +46,9 @@ val cargoExecutable = providers.environmentVariable("CARGO").orElse( } ) val rustVersion = libs.versions.rust.get() +val rustcExecutable = providers.exec { + commandLine("rustup", "which", "--toolchain", rustVersion, "rustc") +}.standardOutput.asText.map { it.trim() } val ndkDirectory = androidComponents.sdkComponents.ndkDirectory val sdkDirectory = androidComponents.sdkComponents.sdkDirectory val rustInputs = files( @@ -79,6 +82,8 @@ androidComponents.onVariants { variant -> inputs.property("ndkVersion", libs.versions.ndk.get()) inputs.property("minSdk", libs.versions.minSdk.get()) outputs.dir(rawNative) + environment("RUSTUP_TOOLCHAIN", rustVersion) + environment("RUSTC", rustcExecutable.get()) environment("ANDROID_NDK_HOME", ndkDirectory.get().asFile.absolutePath) environment("ANDROID_HOME", sdkDirectory.get().asFile.absolutePath) environment( @@ -128,16 +133,10 @@ androidComponents.onVariants { variant -> outputs.dir(rawBindings) commandLine( cargoExecutable.get(), "+$rustVersion", "run", "--locked", - "--package", "ironstorage-android-build", "--bin", "ironstorage-uniffi-bindgen", - "--", "generate", "--library", - nativeOutput.get().file( - "arm64-v8a/libironstorage_android.so" - ).asFile.absolutePath, - "--language", "kotlin", "--config", - rootProject.file( - "uniffi.toml" - ).absolutePath, - "--out-dir", rawBindings.get().asFile.absolutePath, "--no-format" + "--package", "ironstorage-android-build", "--", "contract-bindings", + nativeOutput.get().file("arm64-v8a/libironstorage_android.so").asFile.absolutePath, + rootProject.file("uniffi.toml").absolutePath, + rawBindings.get().asFile.absolutePath, "phone" ) } val prepare = tasks.register("prepare${title}RustBindings") { @@ -153,7 +152,7 @@ androidComponents.onVariants { variant -> commandLine( cargoExecutable.get(), "+$rustVersion", "run", "--locked", "--package", "ironstorage-android-build", "--", "prepare-bindings", - rawBindings.get().asFile.absolutePath, bindings.get().asFile.absolutePath + rawBindings.get().dir("kotlin").asFile.absolutePath, bindings.get().asFile.absolutePath ) } variant.sources.kotlin!!.addStaticSourceDirectory(bindings.get().asFile.absolutePath) @@ -162,3 +161,8 @@ androidComponents.onVariants { variant -> it.name == "pre${title}Build" || it.name == "compile${title}Kotlin" }.configureEach { dependsOn(prepare) } } + +// Instrumentation suites share persistent emulators and must not compete for input focus. +tasks.matching { it.name == "connectedDebugAndroidTest" }.configureEach { + mustRunAfter(":app:connectedDebugAndroidTest") +} diff --git a/android/rust-bridge/src/androidTest/kotlin/de/rfc1437/ironstorage/bridge/MobileContractTest.kt b/android/rust-bridge/src/androidTest/kotlin/de/rfc1437/ironstorage/bridge/MobileContractTest.kt new file mode 100644 index 0000000..68e2b1f --- /dev/null +++ b/android/rust-bridge/src/androidTest/kotlin/de/rfc1437/ironstorage/bridge/MobileContractTest.kt @@ -0,0 +1,138 @@ +package de.rfc1437.ironstorage.bridge + +import androidx.test.platform.app.InstrumentationRegistry +import de.rfc1437.ironstorage.bridge.generated.MobileCameraFrame +import de.rfc1437.ironstorage.bridge.generated.MobileClipboard +import de.rfc1437.ironstorage.bridge.generated.MobileClipboardContent +import de.rfc1437.ironstorage.bridge.generated.MobileClipboardDisposition +import de.rfc1437.ironstorage.bridge.generated.MobileClipboardWait +import de.rfc1437.ironstorage.bridge.generated.MobileCredentialRequest +import de.rfc1437.ironstorage.bridge.generated.MobileEntryCopy +import de.rfc1437.ironstorage.bridge.generated.MobilePlatformFfiException +import de.rfc1437.ironstorage.bridge.generated.MobilePlatformPaths +import de.rfc1437.ironstorage.bridge.generated.MobileSecretLocator +import de.rfc1437.ironstorage.bridge.generated.MobileShellState +import de.rfc1437.ironstorage.bridge.generated.MobileTotpDiscoveryPhase +import de.rfc1437.ironstorage.bridge.generated.copyMobileEntry +import de.rfc1437.ironstorage.bridge.generated.decodeMobileCameraFrame +import de.rfc1437.ironstorage.bridge.generated.mobilePlatformLayout +import de.rfc1437.ironstorage.bridge.generated.mobileTotpOperation +import de.rfc1437.ironstorage.bridge.generated.validateMobileCredentialRequest +import java.util.concurrent.Executors +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertThrows +import org.junit.Test + +class MobileContractTest { + private val context = InstrumentationRegistry.getInstrumentation().targetContext + + private fun initialize() { + NativeRuntime(context).fixture(MobileShellState.EMPTY) + } + + @Test + fun privatePathsAndProviderFactsAreValidatedInRust() { + initialize() + val layout = mobilePlatformLayout( + MobilePlatformPaths(context.noBackupFilesDir.path, context.cacheDir.path) + ) + assertEquals("${context.noBackupFilesDir.path}/config.toml", layout.configuration) + assertThrows(MobilePlatformFfiException.InvalidPaths::class.java) { + mobilePlatformLayout(MobilePlatformPaths("relative", context.cacheDir.path)) + } + val request = validateMobileCredentialRequest( + MobileCredentialRequest( + "opaque-request", + "de.example.app", + "A".repeat(64), + listOf("https://EXAMPLE.test:443/") + ) + ) + assertEquals(listOf("https://example.test"), request.origins) + assertThrows(MobilePlatformFfiException.InvalidCredentialRequest::class.java) { + validateMobileCredentialRequest(request.copy(origins = listOf("file:///tmp"))) + } + assertFalse(request.toString().contains("opaque-request")) + assertFalse( + MobileSecretLocator.OpenPgpPassphrase("SecretReferenceMarker") + .toString().contains("SecretReferenceMarker") + ) + } + + @Test + fun foreignClipboardCallbackTransfersLargeSecretsAndPreservesNewerContent() { + initialize() + val secret = "binding-payload-".repeat(70_000) + val clipboard = Clipboard() + assertEquals( + MobileClipboardDisposition.RESTORED_PREVIOUS, + copyMobileEntry(MobileEntryCopy(secret, 45uL), clipboard) + ) + assertEquals("previous", clipboard.text) + assertEquals(secret.length, clipboard.writtenBytes) + assertEquals(45_000uL, clipboard.timeout) + clipboard.newer = "newer content" + assertEquals( + MobileClipboardDisposition.PRESERVED_NEWER, + copyMobileEntry(MobileEntryCopy(secret, 45uL), clipboard) + ) + assertEquals("newer content", clipboard.text) + clipboard.newer = null + clipboard.cancelled = true + assertThrows(MobilePlatformFfiException.Cancelled::class.java) { + copyMobileEntry(MobileEntryCopy(secret, 45uL), clipboard) + } + assertEquals("newer content", clipboard.text) + assertFalse(MobileClipboardContent.Text(secret.toByteArray()).toString().contains(secret)) + } + + @Test + fun cameraPlaneBoundsAndConcurrentOperationCancellationSurviveNativeOwnership() { + initialize() + assertThrows(MobilePlatformFfiException.InvalidCameraFrame::class.java) { + decodeMobileCameraFrame(MobileCameraFrame(UInt.MAX_VALUE, 1u, 1u, 1u, byteArrayOf(0))) + } + assertThrows(MobilePlatformFfiException.QrNotFound::class.java) { + decodeMobileCameraFrame( + MobileCameraFrame(1024u, 1024u, 2048u, 1u, ByteArray(2 * 1024 * 1024) { -1 }) + ) + } + val executor = Executors.newFixedThreadPool(4) + try { + val operations = List(16) { mobileTotpOperation() } + val tasks = operations.map { operation -> + executor.submit { + operation.cancel() + assertEquals(MobileTotpDiscoveryPhase.CANCELLED, operation.progress().phase) + } + } + tasks.forEach { it.get() } + operations.forEach { it.close() } + } finally { + executor.shutdownNow() + } + } + + private class Clipboard : MobileClipboard { + var text = "previous" + var writtenBytes = 0 + var timeout = 0uL + var newer: String? = null + var cancelled = false + override fun read(): MobileClipboardContent = + MobileClipboardContent.Text(text.toByteArray()) + override fun write(value: ByteArray) { + writtenBytes = maxOf(writtenBytes, value.size) + text = value.decodeToString() + } + override fun clear() { + text = "" + } + override fun waitForTimeout(milliseconds: ULong): MobileClipboardWait { + timeout = milliseconds + newer?.let { text = it } + return if (cancelled) MobileClipboardWait.CANCELLED else MobileClipboardWait.ELAPSED + } + } +} diff --git a/android/rust-bridge/src/androidTest/kotlin/de/rfc1437/ironstorage/bridge/NativeRuntimeTest.kt b/android/rust-bridge/src/androidTest/kotlin/de/rfc1437/ironstorage/bridge/NativeRuntimeTest.kt index 34c40a1..4dbb720 100644 --- a/android/rust-bridge/src/androidTest/kotlin/de/rfc1437/ironstorage/bridge/NativeRuntimeTest.kt +++ b/android/rust-bridge/src/androidTest/kotlin/de/rfc1437/ironstorage/bridge/NativeRuntimeTest.kt @@ -55,9 +55,9 @@ class NativeRuntimeTest { fun wrongNativeContractAndChecksumFailWithTypedRedactedErrors() { NativeRuntime(context).fixture(MobileShellState.EMPTY) val version = IntegrityCheckingUniffiLib - .ffi_ironstorage_apple_uniffi_contract_version().toLong() + .ffi_ironstorage_mobile_uniffi_contract_version().toLong() val checksum = IntegrityCheckingUniffiLib - .uniffi_ironstorage_apple_checksum_func_mobile_shell_fixture().toLong() and 0xffffL + .uniffi_ironstorage_mobile_checksum_func_mobile_shell_fixture().toLong() and 0xffffL NativeBindingChecks.requireMatch(-27278, 38258, NativeFailureKind.ChecksumMismatch) for ((actual, kind) in listOf( version to NativeFailureKind.ContractMismatch, diff --git a/apple/Generated/ironstorage_appleFFI.h b/apple/Generated/ironstorage_appleFFI.h deleted file mode 100644 index 0d7bfa5..0000000 --- a/apple/Generated/ironstorage_appleFFI.h +++ /dev/null @@ -1,1468 +0,0 @@ -// This file was autogenerated by some hot garbage in the `uniffi` crate. -// Trust me, you don't want to mess with it! - -#pragma once - -#include -#include -#include - -// The following structs are used to implement the lowest level -// of the FFI, and thus useful to multiple uniffied crates. -// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. -#ifdef UNIFFI_SHARED_H - // We also try to prevent mixing versions of shared uniffi header structs. - // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 - #ifndef UNIFFI_SHARED_HEADER_V4 - #error Combining helper code from multiple versions of uniffi is not supported - #endif // ndef UNIFFI_SHARED_HEADER_V4 -#else -#define UNIFFI_SHARED_H -#define UNIFFI_SHARED_HEADER_V4 -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ - -typedef struct RustBuffer -{ - uint64_t capacity; - uint64_t len; - uint8_t *_Nullable data; -} RustBuffer; - -typedef struct ForeignBytes -{ - int32_t len; - const uint8_t *_Nullable data; -} ForeignBytes; - -// Error definitions -typedef struct RustCallStatus { - int8_t code; - RustBuffer errorBuf; -} RustCallStatus; - -// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ -// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ -#endif // def UNIFFI_SHARED_H -#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK -#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK -typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK -typedef void (*UniffiForeignFutureDroppedCallback)(uint64_t - ); - -#endif -#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE -#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE -typedef void (*UniffiCallbackInterfaceFree)(uint64_t - ); - -#endif -#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLONE -#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLONE -typedef uint64_t (*UniffiCallbackInterfaceClone)(uint64_t - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK_STRUCT -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK_STRUCT -typedef struct UniffiForeignFutureDroppedCallbackStruct { - uint64_t handle; - UniffiForeignFutureDroppedCallback _Nonnull free; -} UniffiForeignFutureDroppedCallbackStruct; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U8 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U8 -typedef struct UniffiForeignFutureResultU8 { - uint8_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultU8; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 -typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureResultU8 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I8 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I8 -typedef struct UniffiForeignFutureResultI8 { - int8_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultI8; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 -typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureResultI8 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U16 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U16 -typedef struct UniffiForeignFutureResultU16 { - uint16_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultU16; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 -typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureResultU16 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I16 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I16 -typedef struct UniffiForeignFutureResultI16 { - int16_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultI16; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 -typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureResultI16 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U32 -typedef struct UniffiForeignFutureResultU32 { - uint32_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultU32; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 -typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureResultU32 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I32 -typedef struct UniffiForeignFutureResultI32 { - int32_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultI32; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 -typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureResultI32 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U64 -typedef struct UniffiForeignFutureResultU64 { - uint64_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultU64; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 -typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureResultU64 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I64 -typedef struct UniffiForeignFutureResultI64 { - int64_t returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultI64; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 -typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureResultI64 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F32 -typedef struct UniffiForeignFutureResultF32 { - float returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultF32; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 -typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureResultF32 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F64 -typedef struct UniffiForeignFutureResultF64 { - double returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultF64; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 -typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureResultF64 - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_RUST_BUFFER -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_RUST_BUFFER -typedef struct UniffiForeignFutureResultRustBuffer { - RustBuffer returnValue; - RustCallStatus callStatus; -} UniffiForeignFutureResultRustBuffer; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER -typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureResultRustBuffer - ); - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_VOID -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_VOID -typedef struct UniffiForeignFutureResultVoid { - RustCallStatus callStatus; -} UniffiForeignFutureResultVoid; - -#endif -#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID -#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID -typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureResultVoid - ); - -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEAUTHENTICATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEAUTHENTICATION -uint64_t uniffi_ironstorage_apple_fn_clone_mobileauthentication(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEAUTHENTICATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEAUTHENTICATION -void uniffi_ironstorage_apple_fn_free_mobileauthentication(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ACKNOWLEDGE_WATCH_SNAPSHOT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ACKNOWLEDGE_WATCH_SNAPSHOT -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_acknowledge_watch_snapshot(uint64_t ptr, RustBuffer receipt, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_FIELD -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_add_entry_editor_field(uint64_t ptr, uint64_t editor, RustBuffer kind, RustBuffer name, RustBuffer value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_OTP_IMAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_OTP_IMAGE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_add_entry_editor_otp_image(uint64_t ptr, uint64_t editor, RustBuffer image, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_BEGIN_CREATE_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_BEGIN_CREATE_ENTRY -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_begin_create_entry(uint64_t ptr, RustBuffer directory, RustBuffer name, RustBuffer passphrase, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_BEGIN_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_BEGIN_ENTRY_EDITOR -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_begin_entry_editor(uint64_t ptr, RustBuffer path, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_CACHED_TOTP_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_CACHED_TOTP_PAGE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_cached_totp_page(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_CANCEL -void uniffi_ironstorage_apple_fn_method_mobileauthentication_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_COPY_ENTRY_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_COPY_ENTRY_FIELD -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_copy_entry_field(uint64_t ptr, RustBuffer path, uint64_t field, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_COPY_TOTP_CODE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_COPY_TOTP_CODE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_copy_totp_code(uint64_t ptr, RustBuffer path, uint64_t unix_seconds, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_CREATE_DIRECTORY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_CREATE_DIRECTORY -void uniffi_ironstorage_apple_fn_method_mobileauthentication_create_directory(uint64_t ptr, RustBuffer parent, RustBuffer name, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_DISCARD_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_DISCARD_ENTRY_EDITOR -void uniffi_ironstorage_apple_fn_method_mobileauthentication_discard_entry_editor(uint64_t ptr, uint64_t editor, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ENTRY_EDITOR -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_entry_editor(uint64_t ptr, uint64_t editor, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ENTRY_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_ENTRY_PAGE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_entry_page(uint64_t ptr, RustBuffer path, uint64_t unix_seconds, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_FAIL_WATCH_SNAPSHOT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_FAIL_WATCH_SNAPSHOT -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_fail_watch_snapshot(uint64_t ptr, uint64_t revision, RustBuffer detail, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_GENERATE_ENTRY_EDITOR_PASSWORD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_GENERATE_ENTRY_EDITOR_PASSWORD -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_generate_entry_editor_password(uint64_t ptr, uint64_t editor, RustBuffer length, int8_t no_symbols, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_GIT_IDENTITY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_GIT_IDENTITY -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_git_identity(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK -void uniffi_ironstorage_apple_fn_method_mobileauthentication_manual_lock(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_MOBILE_APPEARANCE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_MOBILE_APPEARANCE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_mobile_appearance(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_perform_entry_mutation(uint64_t ptr, RustBuffer request, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PREFERENCES -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PREFERENCES -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_preferences(uint64_t ptr, int8_t watch_supported, int8_t watch_paired, int8_t watch_app_installed, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_prepare_entry_mutation(uint64_t ptr, RustBuffer path, RustBuffer action, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_WATCH_SNAPSHOT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_WATCH_SNAPSHOT -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_prepare_watch_snapshot(uint64_t ptr, RustBuffer platform_pairing_identity, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_APPLICATION_TOKEN -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_APPLICATION_TOKEN -void uniffi_ironstorage_apple_fn_method_mobileauthentication_remove_application_token(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_remove_entry_editor_field(uint64_t ptr, uint64_t editor, uint64_t field, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REORDER_ENTRY_EDITOR_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REORDER_ENTRY_EDITOR_FIELD -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_reorder_entry_editor_field(uint64_t ptr, uint64_t editor, uint64_t field, uint32_t index, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REPLACE_ENTRY_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REPLACE_ENTRY_FIELD -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_replace_entry_field(uint64_t ptr, RustBuffer path, uint64_t field, RustBuffer value, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REVEAL_ENTRY_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REVEAL_ENTRY_FIELD -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_reveal_entry_field(uint64_t ptr, RustBuffer path, uint64_t field, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SAVE_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SAVE_ENTRY_EDITOR -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_save_entry_editor(uint64_t ptr, uint64_t editor, RustBuffer fields, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SEARCH_CACHED_TOTP_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SEARCH_CACHED_TOTP_PAGE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_search_cached_totp_page(uint64_t ptr, RustBuffer query, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_AUTHENTICATION_TIMEOUT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_AUTHENTICATION_TIMEOUT -void uniffi_ironstorage_apple_fn_method_mobileauthentication_set_authentication_timeout(uint64_t ptr, uint64_t seconds, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_BIOMETRIC_UNLOCK -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_BIOMETRIC_UNLOCK -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_set_biometric_unlock(uint64_t ptr, int8_t enabled, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_GIT_IDENTITY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_GIT_IDENTITY -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_set_git_identity(uint64_t ptr, RustBuffer name, RustBuffer email, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_MOBILE_APPEARANCE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_MOBILE_APPEARANCE -void uniffi_ironstorage_apple_fn_method_mobileauthentication_set_mobile_appearance(uint64_t ptr, RustBuffer appearance, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_TOTP_WATCH_SHARED -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_TOTP_WATCH_SHARED -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_set_totp_watch_shared(uint64_t ptr, RustBuffer path, int8_t shared, uint64_t unix_seconds, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_WATCH_SNAPSHOT_UNAVAILABLE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_SET_WATCH_SNAPSHOT_UNAVAILABLE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_set_watch_snapshot_unavailable(uint64_t ptr, int8_t unpaired, RustBuffer detail, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_STATE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_STATE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_state(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_TOTP_DETAIL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_TOTP_DETAIL -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_totp_detail(uint64_t ptr, RustBuffer path, uint64_t unix_seconds, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_TOTP_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_TOTP_PAGE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_totp_page(uint64_t ptr, uint64_t operation, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_TOUCH_USER_ACTIVITY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_TOUCH_USER_ACTIVITY -void uniffi_ironstorage_apple_fn_method_mobileauthentication_touch_user_activity(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_UNLOCK_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_UNLOCK_ENTRY -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_unlock_entry(uint64_t ptr, RustBuffer path, RustBuffer passphrase, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_UNLOCK_TOTP -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_UNLOCK_TOTP -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_unlock_totp(uint64_t ptr, RustBuffer passphrase, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_UPDATE_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_UPDATE_ENTRY_EDITOR -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_update_entry_editor(uint64_t ptr, uint64_t editor, RustBuffer fields, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_WATCH_SNAPSHOT_STATUS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_WATCH_SNAPSHOT_STATUS -RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_watch_snapshot_status(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEHOMEOPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEHOMEOPERATION -uint64_t uniffi_ironstorage_apple_fn_clone_mobilehomeoperation(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEHOMEOPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEHOMEOPERATION -void uniffi_ironstorage_apple_fn_free_mobilehomeoperation(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_CACHED -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_CACHED -RustBuffer uniffi_ironstorage_apple_fn_method_mobilehomeoperation_cached(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_CANCEL -void uniffi_ironstorage_apple_fn_method_mobilehomeoperation_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_COMMIT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_COMMIT -RustBuffer uniffi_ironstorage_apple_fn_method_mobilehomeoperation_commit(uint64_t ptr, RustBuffer message, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_FETCH -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_FETCH -RustBuffer uniffi_ironstorage_apple_fn_method_mobilehomeoperation_fetch(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_PROGRESS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_PROGRESS -RustBuffer uniffi_ironstorage_apple_fn_method_mobilehomeoperation_progress(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_PULL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_PULL -RustBuffer uniffi_ironstorage_apple_fn_method_mobilehomeoperation_pull(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_PUSH -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_PUSH -RustBuffer uniffi_ironstorage_apple_fn_method_mobilehomeoperation_push(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_REFRESH_IF_STALE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_REFRESH_IF_STALE -RustBuffer uniffi_ironstorage_apple_fn_method_mobilehomeoperation_refresh_if_stale(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_SYNC -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEHOMEOPERATION_SYNC -RustBuffer uniffi_ironstorage_apple_fn_method_mobilehomeoperation_sync(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEKEYTRANSFER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEKEYTRANSFER -uint64_t uniffi_ironstorage_apple_fn_clone_mobilekeytransfer(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEKEYTRANSFER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEKEYTRANSFER -void uniffi_ironstorage_apple_fn_free_mobilekeytransfer(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFER_EXPORT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFER_EXPORT -RustBuffer uniffi_ironstorage_apple_fn_method_mobilekeytransfer_export(uint64_t ptr, RustBuffer fingerprint, RustBuffer kind, RustBuffer passphrase, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFER_IMPORTER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFER_IMPORTER -uint64_t uniffi_ironstorage_apple_fn_method_mobilekeytransfer_importer(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFER_KEYS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFER_KEYS -RustBuffer uniffi_ironstorage_apple_fn_method_mobilekeytransfer_keys(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEKEYTRANSFERIMPORT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEKEYTRANSFERIMPORT -uint64_t uniffi_ironstorage_apple_fn_clone_mobilekeytransferimport(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEKEYTRANSFERIMPORT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEKEYTRANSFERIMPORT -void uniffi_ironstorage_apple_fn_free_mobilekeytransferimport(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFERIMPORT_ADD_FRAME -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFERIMPORT_ADD_FRAME -RustBuffer uniffi_ironstorage_apple_fn_method_mobilekeytransferimport_add_frame(uint64_t ptr, RustBuffer payload, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFERIMPORT_IMPORT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEKEYTRANSFERIMPORT_IMPORT -RustBuffer uniffi_ironstorage_apple_fn_method_mobilekeytransferimport_import(uint64_t ptr, RustBuffer passphrase, int8_t make_default, int8_t overwrite, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILELOCALONBOARDINGOPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILELOCALONBOARDINGOPERATION -uint64_t uniffi_ironstorage_apple_fn_clone_mobilelocalonboardingoperation(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILELOCALONBOARDINGOPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILELOCALONBOARDINGOPERATION -void uniffi_ironstorage_apple_fn_free_mobilelocalonboardingoperation(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILELOCALONBOARDINGOPERATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILELOCALONBOARDINGOPERATION_CANCEL -void uniffi_ironstorage_apple_fn_method_mobilelocalonboardingoperation_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILELOCALONBOARDINGOPERATION_GENERATE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILELOCALONBOARDINGOPERATION_GENERATE -RustBuffer uniffi_ironstorage_apple_fn_method_mobilelocalonboardingoperation_generate(uint64_t ptr, RustBuffer user_id, RustBuffer passphrase, int8_t replace_existing_key, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEONBOARDINGOPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILEONBOARDINGOPERATION -uint64_t uniffi_ironstorage_apple_fn_clone_mobileonboardingoperation(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEONBOARDINGOPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILEONBOARDINGOPERATION -void uniffi_ironstorage_apple_fn_free_mobileonboardingoperation(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_CANCEL -void uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_CONNECT_LOCAL_STORE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_CONNECT_LOCAL_STORE -RustBuffer uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_connect_local_store(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_DISCOVER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_DISCOVER -RustBuffer uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_discover(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_PROGRESS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_PROGRESS -RustBuffer uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_progress(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_SETUP -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEONBOARDINGOPERATION_SETUP -RustBuffer uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_setup(uint64_t ptr, RustBuffer branch, int8_t use_existing, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILETOTPOPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_CLONE_MOBILETOTPOPERATION -uint64_t uniffi_ironstorage_apple_fn_clone_mobiletotpoperation(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILETOTPOPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FREE_MOBILETOTPOPERATION -void uniffi_ironstorage_apple_fn_free_mobiletotpoperation(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILETOTPOPERATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILETOTPOPERATION_CANCEL -void uniffi_ironstorage_apple_fn_method_mobiletotpoperation_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILETOTPOPERATION_PROGRESS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILETOTPOPERATION_PROGRESS -RustBuffer uniffi_ironstorage_apple_fn_method_mobiletotpoperation_progress(uint64_t ptr, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_AUTHENTICATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_AUTHENTICATION -uint64_t uniffi_ironstorage_apple_fn_func_mobile_authentication(RustCallStatus *_Nonnull out_status - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_HOME_OPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_HOME_OPERATION -uint64_t uniffi_ironstorage_apple_fn_func_mobile_home_operation(RustBuffer authentication, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_KEY_TRANSFER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_KEY_TRANSFER -uint64_t uniffi_ironstorage_apple_fn_func_mobile_key_transfer(RustCallStatus *_Nonnull out_status - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_LOCAL_KEY_TRANSFER_IMPORTER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_LOCAL_KEY_TRANSFER_IMPORTER -uint64_t uniffi_ironstorage_apple_fn_func_mobile_local_key_transfer_importer(RustCallStatus *_Nonnull out_status - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_LOCAL_ONBOARDING_OPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_LOCAL_ONBOARDING_OPERATION -uint64_t uniffi_ironstorage_apple_fn_func_mobile_local_onboarding_operation(RustCallStatus *_Nonnull out_status - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_ONBOARDING_OPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_ONBOARDING_OPERATION -uint64_t uniffi_ironstorage_apple_fn_func_mobile_onboarding_operation(RustBuffer server_url, RustBuffer account, RustBuffer repository_path, RustBuffer application_token, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_PASSWORD_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_PASSWORD_PAGE -RustBuffer uniffi_ironstorage_apple_fn_func_mobile_password_page(RustBuffer path, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_PASSWORD_SEARCH -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_PASSWORD_SEARCH -RustBuffer uniffi_ironstorage_apple_fn_func_mobile_password_search(RustBuffer query, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_SHELL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_SHELL -RustBuffer uniffi_ironstorage_apple_fn_func_mobile_shell(RustCallStatus *_Nonnull out_status - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_SHELL_FIXTURE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_SHELL_FIXTURE -RustBuffer uniffi_ironstorage_apple_fn_func_mobile_shell_fixture(RustBuffer state, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_TOTP_OPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_MOBILE_TOTP_OPERATION -uint64_t uniffi_ironstorage_apple_fn_func_mobile_totp_operation(RustCallStatus *_Nonnull out_status - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_PRODUCT_NAME -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_PRODUCT_NAME -RustBuffer uniffi_ironstorage_apple_fn_func_product_name(RustCallStatus *_Nonnull out_status - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_REPLACE_CONFIGURED_MOBILE_APPLICATION_TOKEN -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_REPLACE_CONFIGURED_MOBILE_APPLICATION_TOKEN -void uniffi_ironstorage_apple_fn_func_replace_configured_mobile_application_token(RustBuffer account, RustBuffer application_token, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_SET_SELECTED_MOBILE_TAB -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_FUNC_SET_SELECTED_MOBILE_TAB -void uniffi_ironstorage_apple_fn_func_set_selected_mobile_tab(RustBuffer tab, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUSTBUFFER_ALLOC -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUSTBUFFER_ALLOC -RustBuffer ffi_ironstorage_apple_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUSTBUFFER_FROM_BYTES -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUSTBUFFER_FROM_BYTES -RustBuffer ffi_ironstorage_apple_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUSTBUFFER_FREE -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUSTBUFFER_FREE -void ffi_ironstorage_apple_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUSTBUFFER_RESERVE -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUSTBUFFER_RESERVE -RustBuffer ffi_ironstorage_apple_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_U8 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_U8 -void ffi_ironstorage_apple_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_U8 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_U8 -void ffi_ironstorage_apple_rust_future_cancel_u8(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_U8 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_U8 -void ffi_ironstorage_apple_rust_future_free_u8(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_U8 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_U8 -uint8_t ffi_ironstorage_apple_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_I8 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_I8 -void ffi_ironstorage_apple_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_I8 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_I8 -void ffi_ironstorage_apple_rust_future_cancel_i8(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_I8 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_I8 -void ffi_ironstorage_apple_rust_future_free_i8(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_I8 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_I8 -int8_t ffi_ironstorage_apple_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_U16 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_U16 -void ffi_ironstorage_apple_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_U16 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_U16 -void ffi_ironstorage_apple_rust_future_cancel_u16(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_U16 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_U16 -void ffi_ironstorage_apple_rust_future_free_u16(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_U16 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_U16 -uint16_t ffi_ironstorage_apple_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_I16 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_I16 -void ffi_ironstorage_apple_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_I16 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_I16 -void ffi_ironstorage_apple_rust_future_cancel_i16(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_I16 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_I16 -void ffi_ironstorage_apple_rust_future_free_i16(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_I16 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_I16 -int16_t ffi_ironstorage_apple_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_U32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_U32 -void ffi_ironstorage_apple_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_U32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_U32 -void ffi_ironstorage_apple_rust_future_cancel_u32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_U32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_U32 -void ffi_ironstorage_apple_rust_future_free_u32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_U32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_U32 -uint32_t ffi_ironstorage_apple_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_I32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_I32 -void ffi_ironstorage_apple_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_I32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_I32 -void ffi_ironstorage_apple_rust_future_cancel_i32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_I32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_I32 -void ffi_ironstorage_apple_rust_future_free_i32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_I32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_I32 -int32_t ffi_ironstorage_apple_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_U64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_U64 -void ffi_ironstorage_apple_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_U64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_U64 -void ffi_ironstorage_apple_rust_future_cancel_u64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_U64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_U64 -void ffi_ironstorage_apple_rust_future_free_u64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_U64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_U64 -uint64_t ffi_ironstorage_apple_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_I64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_I64 -void ffi_ironstorage_apple_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_I64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_I64 -void ffi_ironstorage_apple_rust_future_cancel_i64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_I64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_I64 -void ffi_ironstorage_apple_rust_future_free_i64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_I64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_I64 -int64_t ffi_ironstorage_apple_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_F32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_F32 -void ffi_ironstorage_apple_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_F32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_F32 -void ffi_ironstorage_apple_rust_future_cancel_f32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_F32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_F32 -void ffi_ironstorage_apple_rust_future_free_f32(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_F32 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_F32 -float ffi_ironstorage_apple_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_F64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_F64 -void ffi_ironstorage_apple_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_F64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_F64 -void ffi_ironstorage_apple_rust_future_cancel_f64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_F64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_F64 -void ffi_ironstorage_apple_rust_future_free_f64(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_F64 -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_F64 -double ffi_ironstorage_apple_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_RUST_BUFFER -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_RUST_BUFFER -void ffi_ironstorage_apple_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_RUST_BUFFER -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_RUST_BUFFER -void ffi_ironstorage_apple_rust_future_cancel_rust_buffer(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_RUST_BUFFER -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_RUST_BUFFER -void ffi_ironstorage_apple_rust_future_free_rust_buffer(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_RUST_BUFFER -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_RUST_BUFFER -RustBuffer ffi_ironstorage_apple_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_VOID -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_POLL_VOID -void ffi_ironstorage_apple_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_VOID -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_CANCEL_VOID -void ffi_ironstorage_apple_rust_future_cancel_void(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_VOID -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_FREE_VOID -void ffi_ironstorage_apple_rust_future_free_void(uint64_t handle -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_VOID -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_RUST_FUTURE_COMPLETE_VOID -void ffi_ironstorage_apple_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_AUTHENTICATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_AUTHENTICATION -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_authentication(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_HOME_OPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_HOME_OPERATION -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_home_operation(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_KEY_TRANSFER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_KEY_TRANSFER -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_key_transfer(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_LOCAL_KEY_TRANSFER_IMPORTER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_LOCAL_KEY_TRANSFER_IMPORTER -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_local_key_transfer_importer(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_LOCAL_ONBOARDING_OPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_LOCAL_ONBOARDING_OPERATION -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_local_onboarding_operation(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_ONBOARDING_OPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_ONBOARDING_OPERATION -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_onboarding_operation(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_PASSWORD_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_PASSWORD_PAGE -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_password_page(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_PASSWORD_SEARCH -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_PASSWORD_SEARCH -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_password_search(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_SHELL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_SHELL -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_shell(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_SHELL_FIXTURE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_SHELL_FIXTURE -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_shell_fixture(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_TOTP_OPERATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_MOBILE_TOTP_OPERATION -uint16_t uniffi_ironstorage_apple_checksum_func_mobile_totp_operation(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_PRODUCT_NAME -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_PRODUCT_NAME -uint16_t uniffi_ironstorage_apple_checksum_func_product_name(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_REPLACE_CONFIGURED_MOBILE_APPLICATION_TOKEN -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_REPLACE_CONFIGURED_MOBILE_APPLICATION_TOKEN -uint16_t uniffi_ironstorage_apple_checksum_func_replace_configured_mobile_application_token(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_SET_SELECTED_MOBILE_TAB -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_FUNC_SET_SELECTED_MOBILE_TAB -uint16_t uniffi_ironstorage_apple_checksum_func_set_selected_mobile_tab(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ACKNOWLEDGE_WATCH_SNAPSHOT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ACKNOWLEDGE_WATCH_SNAPSHOT -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_acknowledge_watch_snapshot(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_FIELD -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_add_entry_editor_field(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_OTP_IMAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_OTP_IMAGE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_add_entry_editor_otp_image(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_BEGIN_CREATE_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_BEGIN_CREATE_ENTRY -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_begin_create_entry(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_BEGIN_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_BEGIN_ENTRY_EDITOR -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_begin_entry_editor(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CACHED_TOTP_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CACHED_TOTP_PAGE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_cached_totp_page(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CANCEL -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_cancel(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_COPY_ENTRY_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_COPY_ENTRY_FIELD -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_copy_entry_field(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_COPY_TOTP_CODE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_COPY_TOTP_CODE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_copy_totp_code(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CREATE_DIRECTORY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CREATE_DIRECTORY -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_create_directory(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_DISCARD_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_DISCARD_ENTRY_EDITOR -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_discard_entry_editor(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ENTRY_EDITOR -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_entry_editor(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ENTRY_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ENTRY_PAGE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_entry_page(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_FAIL_WATCH_SNAPSHOT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_FAIL_WATCH_SNAPSHOT -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_fail_watch_snapshot(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_GENERATE_ENTRY_EDITOR_PASSWORD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_GENERATE_ENTRY_EDITOR_PASSWORD -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_generate_entry_editor_password(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_GIT_IDENTITY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_GIT_IDENTITY -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_git_identity(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_manual_lock(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MOBILE_APPEARANCE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MOBILE_APPEARANCE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_mobile_appearance(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_perform_entry_mutation(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREFERENCES -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREFERENCES -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_preferences(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_prepare_entry_mutation(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_WATCH_SNAPSHOT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_WATCH_SNAPSHOT -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_prepare_watch_snapshot(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_APPLICATION_TOKEN -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_APPLICATION_TOKEN -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_remove_application_token(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_remove_entry_editor_field(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REORDER_ENTRY_EDITOR_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REORDER_ENTRY_EDITOR_FIELD -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_reorder_entry_editor_field(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REPLACE_ENTRY_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REPLACE_ENTRY_FIELD -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_replace_entry_field(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REVEAL_ENTRY_FIELD -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REVEAL_ENTRY_FIELD -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_reveal_entry_field(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SAVE_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SAVE_ENTRY_EDITOR -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_save_entry_editor(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SEARCH_CACHED_TOTP_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SEARCH_CACHED_TOTP_PAGE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_search_cached_totp_page(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_AUTHENTICATION_TIMEOUT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_AUTHENTICATION_TIMEOUT -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_authentication_timeout(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_BIOMETRIC_UNLOCK -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_BIOMETRIC_UNLOCK -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_biometric_unlock(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_GIT_IDENTITY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_GIT_IDENTITY -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_git_identity(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_MOBILE_APPEARANCE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_MOBILE_APPEARANCE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_mobile_appearance(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_TOTP_WATCH_SHARED -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_TOTP_WATCH_SHARED -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_totp_watch_shared(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_WATCH_SNAPSHOT_UNAVAILABLE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_WATCH_SNAPSHOT_UNAVAILABLE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_watch_snapshot_unavailable(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_STATE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_STATE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_state(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOTP_DETAIL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOTP_DETAIL -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_totp_detail(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOTP_PAGE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOTP_PAGE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_totp_page(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOUCH_USER_ACTIVITY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOUCH_USER_ACTIVITY -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_touch_user_activity(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UNLOCK_ENTRY -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UNLOCK_ENTRY -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_unlock_entry(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UNLOCK_TOTP -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UNLOCK_TOTP -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_unlock_totp(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UPDATE_ENTRY_EDITOR -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UPDATE_ENTRY_EDITOR -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_update_entry_editor(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_WATCH_SNAPSHOT_STATUS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_WATCH_SNAPSHOT_STATUS -uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_watch_snapshot_status(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_CACHED -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_CACHED -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_cached(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_CANCEL -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_cancel(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_COMMIT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_COMMIT -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_commit(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_FETCH -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_FETCH -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_fetch(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PROGRESS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PROGRESS -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_progress(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PULL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PULL -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_pull(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PUSH -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PUSH -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_push(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_REFRESH_IF_STALE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_REFRESH_IF_STALE -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_refresh_if_stale(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_SYNC -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_SYNC -uint16_t uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_sync(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_EXPORT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_EXPORT -uint16_t uniffi_ironstorage_apple_checksum_method_mobilekeytransfer_export(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_IMPORTER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_IMPORTER -uint16_t uniffi_ironstorage_apple_checksum_method_mobilekeytransfer_importer(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_KEYS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_KEYS -uint16_t uniffi_ironstorage_apple_checksum_method_mobilekeytransfer_keys(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFERIMPORT_ADD_FRAME -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFERIMPORT_ADD_FRAME -uint16_t uniffi_ironstorage_apple_checksum_method_mobilekeytransferimport_add_frame(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFERIMPORT_IMPORT -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEKEYTRANSFERIMPORT_IMPORT -uint16_t uniffi_ironstorage_apple_checksum_method_mobilekeytransferimport_import(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILELOCALONBOARDINGOPERATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILELOCALONBOARDINGOPERATION_CANCEL -uint16_t uniffi_ironstorage_apple_checksum_method_mobilelocalonboardingoperation_cancel(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILELOCALONBOARDINGOPERATION_GENERATE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILELOCALONBOARDINGOPERATION_GENERATE -uint16_t uniffi_ironstorage_apple_checksum_method_mobilelocalonboardingoperation_generate(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_CANCEL -uint16_t uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_cancel(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_CONNECT_LOCAL_STORE -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_CONNECT_LOCAL_STORE -uint16_t uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_connect_local_store(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_DISCOVER -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_DISCOVER -uint16_t uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_discover(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_PROGRESS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_PROGRESS -uint16_t uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_progress(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_SETUP -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_SETUP -uint16_t uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_setup(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILETOTPOPERATION_CANCEL -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILETOTPOPERATION_CANCEL -uint16_t uniffi_ironstorage_apple_checksum_method_mobiletotpoperation_cancel(void - -); -#endif -#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILETOTPOPERATION_PROGRESS -#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILETOTPOPERATION_PROGRESS -uint16_t uniffi_ironstorage_apple_checksum_method_mobiletotpoperation_progress(void - -); -#endif -#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_UNIFFI_CONTRACT_VERSION -#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_APPLE_UNIFFI_CONTRACT_VERSION -uint32_t ffi_ironstorage_apple_uniffi_contract_version(void - -); -#endif diff --git a/apple/Generated/ironstorage_apple.swift b/apple/Generated/ironstorage_mobile.swift similarity index 71% rename from apple/Generated/ironstorage_apple.swift rename to apple/Generated/ironstorage_mobile.swift index 2bb9894..6382060 100644 --- a/apple/Generated/ironstorage_apple.swift +++ b/apple/Generated/ironstorage_mobile.swift @@ -7,8 +7,8 @@ import Foundation // Depending on the consumer's build setup, the low-level FFI code // might be in a separate module, or it might be compiled inline into // this module. This is a bit of light hackery to work with both. -#if canImport(ironstorage_appleFFI) -import ironstorage_appleFFI +#if canImport(ironstorage_mobileFFI) +import ironstorage_mobileFFI #endif fileprivate extension RustBuffer { @@ -25,13 +25,13 @@ fileprivate extension RustBuffer { } static func from(_ ptr: UnsafeBufferPointer) -> RustBuffer { - try! rustCall { ffi_ironstorage_apple_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } + try! rustCall { ffi_ironstorage_mobile_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) } } // Frees the buffer in place. // The buffer must not be used after this is called. func deallocate() { - try! rustCall { ffi_ironstorage_apple_rustbuffer_free(self, $0) } + try! rustCall { ffi_ironstorage_mobile_rustbuffer_free(self, $0) } } } @@ -281,7 +281,7 @@ fileprivate enum UniffiInternalError: LocalizedError { case .unexpectedRustCallStatusCode: return "Unexpected RustCallStatus code" case .unexpectedRustCallError: return "CALL_ERROR but no errorClass specified" case .unexpectedStaleHandle: return "The object in the handle map has been dropped already" - case let .rustPanic(message): return message + case .rustPanic: return "Native Rust failure ([REDACTED])" } } } @@ -327,7 +327,7 @@ private func makeRustCall( _ callback: (UnsafeMutablePointer) -> T, errorHandler: ((RustBuffer) throws -> E)? ) throws -> T { - uniffiEnsureIronstorageAppleInitialized() + uniffiEnsureIronstorageMobileInitialized() var callStatus = RustCallStatus.init() let returnedVal = callback(&callStatus) try uniffiCheckCallStatus(callStatus: callStatus, errorHandler: errorHandler) @@ -355,7 +355,8 @@ private func uniffiCheckCallStatus( // with the message. But if that code panics, then it just sends back // an empty buffer. if callStatus.errorBuf.len > 0 { - throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf)) + _ = try FfiConverterString.lift(callStatus.errorBuf) + throw UniffiInternalError.rustPanic("Native Rust failure ([REDACTED])") } else { callStatus.errorBuf.deallocate() throw UniffiInternalError.rustPanic("Rust panic") @@ -376,9 +377,9 @@ private func uniffiTraitInterfaceCall( ) { do { try writeReturn(makeCall()) - } catch let error { + } catch { callStatus.pointee.code = CALL_UNEXPECTED_ERROR - callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) + callStatus.pointee.errorBuf = FfiConverterString.lower("Native callback failed ([REDACTED])") } } @@ -395,7 +396,7 @@ private func uniffiTraitInterfaceCallWithError( callStatus.pointee.errorBuf = lowerError(error) } catch { callStatus.pointee.code = CALL_UNEXPECTED_ERROR - callStatus.pointee.errorBuf = FfiConverterString.lower(String(describing: error)) + callStatus.pointee.errorBuf = FfiConverterString.lower("Native callback failed ([REDACTED])") } } // Initial value and increment amount for handles. @@ -460,7 +461,13 @@ fileprivate final class UniffiHandleMap: @unchecked Sendable { // Public interface members begin here. - +// Magic number for the Rust proxy to call using the same mechanism as every other method, +// to free the callback once it's dropped by Rust. +private let IDX_CALLBACK_FREE: Int32 = 0 +// Callback return codes +private let UNIFFI_CALLBACK_SUCCESS: Int32 = 0 +private let UNIFFI_CALLBACK_ERROR: Int32 = 1 +private let UNIFFI_CALLBACK_UNEXPECTED_ERROR: Int32 = 2 #if swift(>=5.8) @_documentation(visibility: private) @@ -689,6 +696,8 @@ public protocol MobileAuthenticationProtocol: AnyObject, Sendable { func watchSnapshotStatus() throws -> MobileWatchSnapshotStatus + func lifecycle(event: MobileLifecycleEvent) throws -> MobileAuthenticationState + } open class MobileAuthentication: MobileAuthenticationProtocol, @unchecked Sendable { fileprivate let handle: UInt64 @@ -727,7 +736,7 @@ open class MobileAuthentication: MobileAuthenticationProtocol, @unchecked Sendab @_documentation(visibility: private) #endif public func uniffiCloneHandle() -> UInt64 { - return try! rustCall { uniffi_ironstorage_apple_fn_clone_mobileauthentication(self.handle, $0) } + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobileauthentication(self.handle, $0) } } // No primary constructor declared for this class. @@ -737,7 +746,7 @@ open class MobileAuthentication: MobileAuthenticationProtocol, @unchecked Sendab return } - try! rustCall { uniffi_ironstorage_apple_fn_free_mobileauthentication(handle, $0) } + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobileauthentication(handle, $0) } } @@ -746,7 +755,7 @@ open class MobileAuthentication: MobileAuthenticationProtocol, @unchecked Sendab open func acknowledgeWatchSnapshot(receipt: Data)throws -> MobileWatchSnapshotStatus { return try FfiConverterTypeMobileWatchSnapshotStatus_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_acknowledge_watch_snapshot( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_acknowledge_watch_snapshot( self.uniffiCloneHandle(), FfiConverterData.lower(receipt),uniffiCallStatus ) @@ -756,7 +765,7 @@ open func acknowledgeWatchSnapshot(receipt: Data)throws -> MobileWatchSnapshotS open func addEntryEditorField(editor: UInt64, kind: MobileEntryEditorFieldKind, name: String?, value: String)throws -> MobileEntryEditorPage { return try FfiConverterTypeMobileEntryEditorPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_add_entry_editor_field( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_add_entry_editor_field( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor), FfiConverterTypeMobileEntryEditorFieldKind_lower(kind), @@ -769,7 +778,7 @@ open func addEntryEditorField(editor: UInt64, kind: MobileEntryEditorFieldKind, open func addEntryEditorOtpImage(editor: UInt64, image: Data)throws -> MobileEntryEditorPage { return try FfiConverterTypeMobileEntryEditorPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_add_entry_editor_otp_image( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_add_entry_editor_otp_image( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor), FfiConverterData.lower(image),uniffiCallStatus @@ -780,7 +789,7 @@ open func addEntryEditorOtpImage(editor: UInt64, image: Data)throws -> MobileEn open func beginCreateEntry(directory: String, name: String, passphrase: String?)throws -> MobileEntryEditorSession { return try FfiConverterTypeMobileEntryEditorSession_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_begin_create_entry( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_begin_create_entry( self.uniffiCloneHandle(), FfiConverterString.lower(directory), FfiConverterString.lower(name), @@ -792,7 +801,7 @@ open func beginCreateEntry(directory: String, name: String, passphrase: String?) open func beginEntryEditor(path: String)throws -> MobileEntryEditorSession { return try FfiConverterTypeMobileEntryEditorSession_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_begin_entry_editor( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_begin_entry_editor( self.uniffiCloneHandle(), FfiConverterString.lower(path),uniffiCallStatus ) @@ -802,7 +811,7 @@ open func beginEntryEditor(path: String)throws -> MobileEntryEditorSession { open func cachedTotpPage()throws -> MobileTotpPage? { return try FfiConverterOptionTypeMobileTotpPage.lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_cached_totp_page( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_cached_totp_page( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -810,7 +819,7 @@ open func cachedTotpPage()throws -> MobileTotpPage? { open func cancel()throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_cancel( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_cancel( self.uniffiCloneHandle(),uniffiCallStatus ) } @@ -819,7 +828,7 @@ open func cancel()throws {try rustCallWithError(FfiConverterTypeMobileAuthenti open func copyEntryField(path: String, field: UInt64)throws -> MobileEntryCopy { return try FfiConverterTypeMobileEntryCopy_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_copy_entry_field( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_copy_entry_field( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterUInt64.lower(field),uniffiCallStatus @@ -830,7 +839,7 @@ open func copyEntryField(path: String, field: UInt64)throws -> MobileEntryCopy open func copyTotpCode(path: String, unixSeconds: UInt64)throws -> MobileEntryCopy { return try FfiConverterTypeMobileEntryCopy_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_copy_totp_code( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_copy_totp_code( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterUInt64.lower(unixSeconds),uniffiCallStatus @@ -840,7 +849,7 @@ open func copyTotpCode(path: String, unixSeconds: UInt64)throws -> MobileEntryC open func createDirectory(parent: String, name: String)throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_create_directory( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_create_directory( self.uniffiCloneHandle(), FfiConverterString.lower(parent), FfiConverterString.lower(name),uniffiCallStatus @@ -850,7 +859,7 @@ open func createDirectory(parent: String, name: String)throws {try rustCallWit open func discardEntryEditor(editor: UInt64)throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_discard_entry_editor( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_discard_entry_editor( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor),uniffiCallStatus ) @@ -860,7 +869,7 @@ open func discardEntryEditor(editor: UInt64)throws {try rustCallWithError(FfiC open func entryEditor(editor: UInt64)throws -> MobileEntryEditorPage { return try FfiConverterTypeMobileEntryEditorPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_entry_editor( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_entry_editor( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor),uniffiCallStatus ) @@ -870,7 +879,7 @@ open func entryEditor(editor: UInt64)throws -> MobileEntryEditorPage { open func entryPage(path: String, unixSeconds: UInt64)throws -> MobileEntryPresentation { return try FfiConverterTypeMobileEntryPresentation_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_entry_page( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_entry_page( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterUInt64.lower(unixSeconds),uniffiCallStatus @@ -881,7 +890,7 @@ open func entryPage(path: String, unixSeconds: UInt64)throws -> MobileEntryPres open func failWatchSnapshot(revision: UInt64, detail: String)throws -> MobileWatchSnapshotStatus { return try FfiConverterTypeMobileWatchSnapshotStatus_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_fail_watch_snapshot( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_fail_watch_snapshot( self.uniffiCloneHandle(), FfiConverterUInt64.lower(revision), FfiConverterString.lower(detail),uniffiCallStatus @@ -892,7 +901,7 @@ open func failWatchSnapshot(revision: UInt64, detail: String)throws -> MobileWa open func generateEntryEditorPassword(editor: UInt64, length: UInt32?, noSymbols: Bool)throws -> MobileEntryEditorPage { return try FfiConverterTypeMobileEntryEditorPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_generate_entry_editor_password( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_generate_entry_editor_password( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor), FfiConverterOptionUInt32.lower(length), @@ -904,7 +913,7 @@ open func generateEntryEditorPassword(editor: UInt64, length: UInt32?, noSymbols open func gitIdentity()throws -> MobileGitIdentity { return try FfiConverterTypeMobileGitIdentity_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_git_identity( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_git_identity( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -912,7 +921,7 @@ open func gitIdentity()throws -> MobileGitIdentity { open func manualLock()throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_manual_lock( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_manual_lock( self.uniffiCloneHandle(),uniffiCallStatus ) } @@ -921,7 +930,7 @@ open func manualLock()throws {try rustCallWithError(FfiConverterTypeMobileAuth open func mobileAppearance()throws -> MobileAppearance { return try FfiConverterTypeMobileAppearance_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_mobile_appearance( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_mobile_appearance( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -930,7 +939,7 @@ open func mobileAppearance()throws -> MobileAppearance { open func performEntryMutation(request: MobileMutationRequest)throws -> MobileMutationOutcome { return try FfiConverterTypeMobileMutationOutcome_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_perform_entry_mutation( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_perform_entry_mutation( self.uniffiCloneHandle(), FfiConverterTypeMobileMutationRequest_lower(request),uniffiCallStatus ) @@ -940,7 +949,7 @@ open func performEntryMutation(request: MobileMutationRequest)throws -> MobileM open func preferences(watchSupported: Bool, watchPaired: Bool, watchAppInstalled: Bool)throws -> MobilePreferences { return try FfiConverterTypeMobilePreferences_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_preferences( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_preferences( self.uniffiCloneHandle(), FfiConverterBool.lower(watchSupported), FfiConverterBool.lower(watchPaired), @@ -952,7 +961,7 @@ open func preferences(watchSupported: Bool, watchPaired: Bool, watchAppInstalled open func prepareEntryMutation(path: String, action: MobileMutationAction)throws -> MobileMutationPlan { return try FfiConverterTypeMobileMutationPlan_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_prepare_entry_mutation( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_prepare_entry_mutation( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterTypeMobileMutationAction_lower(action),uniffiCallStatus @@ -963,7 +972,7 @@ open func prepareEntryMutation(path: String, action: MobileMutationAction)throws open func prepareWatchSnapshot(platformPairingIdentity: String)throws -> MobileWatchSnapshotTransfer { return try FfiConverterTypeMobileWatchSnapshotTransfer_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_prepare_watch_snapshot( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_prepare_watch_snapshot( self.uniffiCloneHandle(), FfiConverterString.lower(platformPairingIdentity),uniffiCallStatus ) @@ -972,7 +981,7 @@ open func prepareWatchSnapshot(platformPairingIdentity: String)throws -> Mobile open func removeApplicationToken()throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_remove_application_token( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_remove_application_token( self.uniffiCloneHandle(),uniffiCallStatus ) } @@ -981,7 +990,7 @@ open func removeApplicationToken()throws {try rustCallWithError(FfiConverterTy open func removeEntryEditorField(editor: UInt64, field: UInt64)throws -> MobileEntryEditorPage { return try FfiConverterTypeMobileEntryEditorPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_remove_entry_editor_field( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_remove_entry_editor_field( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor), FfiConverterUInt64.lower(field),uniffiCallStatus @@ -992,7 +1001,7 @@ open func removeEntryEditorField(editor: UInt64, field: UInt64)throws -> Mobile open func reorderEntryEditorField(editor: UInt64, field: UInt64, index: UInt32)throws -> MobileEntryEditorPage { return try FfiConverterTypeMobileEntryEditorPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_reorder_entry_editor_field( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_reorder_entry_editor_field( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor), FfiConverterUInt64.lower(field), @@ -1004,7 +1013,7 @@ open func reorderEntryEditorField(editor: UInt64, field: UInt64, index: UInt32)t open func replaceEntryField(path: String, field: UInt64, value: String)throws -> MobileEntryPage { return try FfiConverterTypeMobileEntryPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_replace_entry_field( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_replace_entry_field( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterUInt64.lower(field), @@ -1016,7 +1025,7 @@ open func replaceEntryField(path: String, field: UInt64, value: String)throws - open func revealEntryField(path: String, field: UInt64)throws -> String { return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_reveal_entry_field( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_reveal_entry_field( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterUInt64.lower(field),uniffiCallStatus @@ -1027,7 +1036,7 @@ open func revealEntryField(path: String, field: UInt64)throws -> String { open func saveEntryEditor(editor: UInt64, fields: [MobileEntryEditorInput])throws -> MobileEntryPage { return try FfiConverterTypeMobileEntryPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_save_entry_editor( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_save_entry_editor( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor), FfiConverterSequenceTypeMobileEntryEditorInput.lower(fields),uniffiCallStatus @@ -1038,7 +1047,7 @@ open func saveEntryEditor(editor: UInt64, fields: [MobileEntryEditorInput])throw open func searchCachedTotpPage(query: String)throws -> MobileTotpPage? { return try FfiConverterOptionTypeMobileTotpPage.lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_search_cached_totp_page( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_search_cached_totp_page( self.uniffiCloneHandle(), FfiConverterString.lower(query),uniffiCallStatus ) @@ -1047,7 +1056,7 @@ open func searchCachedTotpPage(query: String)throws -> MobileTotpPage? { open func setAuthenticationTimeout(seconds: UInt64)throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_set_authentication_timeout( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_authentication_timeout( self.uniffiCloneHandle(), FfiConverterUInt64.lower(seconds),uniffiCallStatus ) @@ -1057,7 +1066,7 @@ open func setAuthenticationTimeout(seconds: UInt64)throws {try rustCallWithErr open func setBiometricUnlock(enabled: Bool)throws -> MobileAuthenticationState { return try FfiConverterTypeMobileAuthenticationState_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_set_biometric_unlock( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_biometric_unlock( self.uniffiCloneHandle(), FfiConverterBool.lower(enabled),uniffiCallStatus ) @@ -1067,7 +1076,7 @@ open func setBiometricUnlock(enabled: Bool)throws -> MobileAuthenticationState open func setGitIdentity(name: String, email: String)throws -> MobileGitIdentity { return try FfiConverterTypeMobileGitIdentity_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_set_git_identity( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_git_identity( self.uniffiCloneHandle(), FfiConverterString.lower(name), FfiConverterString.lower(email),uniffiCallStatus @@ -1077,7 +1086,7 @@ open func setGitIdentity(name: String, email: String)throws -> MobileGitIdentit open func setMobileAppearance(appearance: MobileAppearance)throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_set_mobile_appearance( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_mobile_appearance( self.uniffiCloneHandle(), FfiConverterTypeMobileAppearance_lower(appearance),uniffiCallStatus ) @@ -1087,7 +1096,7 @@ open func setMobileAppearance(appearance: MobileAppearance)throws {try rustCal open func setTotpWatchShared(path: String, shared: Bool, unixSeconds: UInt64)throws -> MobileTotpDetail { return try FfiConverterTypeMobileTotpDetail_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_set_totp_watch_shared( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_totp_watch_shared( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterBool.lower(shared), @@ -1099,7 +1108,7 @@ open func setTotpWatchShared(path: String, shared: Bool, unixSeconds: UInt64)thr open func setWatchSnapshotUnavailable(unpaired: Bool, detail: String)throws -> MobileWatchSnapshotStatus { return try FfiConverterTypeMobileWatchSnapshotStatus_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_set_watch_snapshot_unavailable( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_watch_snapshot_unavailable( self.uniffiCloneHandle(), FfiConverterBool.lower(unpaired), FfiConverterString.lower(detail),uniffiCallStatus @@ -1110,7 +1119,7 @@ open func setWatchSnapshotUnavailable(unpaired: Bool, detail: String)throws -> open func state()throws -> MobileAuthenticationState { return try FfiConverterTypeMobileAuthenticationState_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_state( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_state( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1119,7 +1128,7 @@ open func state()throws -> MobileAuthenticationState { open func totpDetail(path: String, unixSeconds: UInt64)throws -> MobileTotpDetail { return try FfiConverterTypeMobileTotpDetail_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_totp_detail( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_totp_detail( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterUInt64.lower(unixSeconds),uniffiCallStatus @@ -1130,7 +1139,7 @@ open func totpDetail(path: String, unixSeconds: UInt64)throws -> MobileTotpDeta open func totpPage(operation: MobileTotpOperation)throws -> MobileTotpPage { return try FfiConverterTypeMobileTotpPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_totp_page( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_totp_page( self.uniffiCloneHandle(), FfiConverterTypeMobileTotpOperation_lower(operation),uniffiCallStatus ) @@ -1139,7 +1148,7 @@ open func totpPage(operation: MobileTotpOperation)throws -> MobileTotpPage { open func touchUserActivity()throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_touch_user_activity( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_touch_user_activity( self.uniffiCloneHandle(),uniffiCallStatus ) } @@ -1148,7 +1157,7 @@ open func touchUserActivity()throws {try rustCallWithError(FfiConverterTypeMob open func unlockEntry(path: String, passphrase: String?)throws -> MobileAuthenticationState { return try FfiConverterTypeMobileAuthenticationState_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_unlock_entry( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_unlock_entry( self.uniffiCloneHandle(), FfiConverterString.lower(path), FfiConverterOptionString.lower(passphrase),uniffiCallStatus @@ -1159,7 +1168,7 @@ open func unlockEntry(path: String, passphrase: String?)throws -> MobileAuthent open func unlockTotp(passphrase: String?)throws -> MobileAuthenticationState { return try FfiConverterTypeMobileAuthenticationState_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_unlock_totp( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_unlock_totp( self.uniffiCloneHandle(), FfiConverterOptionString.lower(passphrase),uniffiCallStatus ) @@ -1169,7 +1178,7 @@ open func unlockTotp(passphrase: String?)throws -> MobileAuthenticationState { open func updateEntryEditor(editor: UInt64, fields: [MobileEntryEditorInput])throws -> MobileEntryEditorPage { return try FfiConverterTypeMobileEntryEditorPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_update_entry_editor( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_update_entry_editor( self.uniffiCloneHandle(), FfiConverterUInt64.lower(editor), FfiConverterSequenceTypeMobileEntryEditorInput.lower(fields),uniffiCallStatus @@ -1180,12 +1189,22 @@ open func updateEntryEditor(editor: UInt64, fields: [MobileEntryEditorInput])thr open func watchSnapshotStatus()throws -> MobileWatchSnapshotStatus { return try FfiConverterTypeMobileWatchSnapshotStatus_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileauthentication_watch_snapshot_status( + uniffi_ironstorage_mobile_fn_method_mobileauthentication_watch_snapshot_status( self.uniffiCloneHandle(),uniffiCallStatus ) }) } +open func lifecycle(event: MobileLifecycleEvent)throws -> MobileAuthenticationState { + return try FfiConverterTypeMobileAuthenticationState_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobileauthentication_lifecycle( + self.uniffiCloneHandle(), + FfiConverterTypeMobileLifecycleEvent_lower(event),uniffiCallStatus + ) +}) +} + } @@ -1236,6 +1255,504 @@ public func FfiConverterTypeMobileAuthentication_lower(_ value: MobileAuthentica +public protocol MobileClipboard: AnyObject, Sendable { + + func read() throws -> MobileClipboardContent + + func write(value: Data) throws + + func clear() throws + + func waitForTimeout(milliseconds: UInt64) -> MobileClipboardWait + +} +open class MobileClipboardImpl: MobileClipboard, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobileclipboard(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobileclipboard(handle, $0) } + } + + + + +open func read()throws -> MobileClipboardContent { + return try FfiConverterTypeMobileClipboardContent_lift(try rustCallWithError(FfiConverterTypeMobilePlatformFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobileclipboard_read( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + +open func write(value: Data)throws {try rustCallWithError(FfiConverterTypeMobilePlatformFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobileclipboard_write( + self.uniffiCloneHandle(), + FfiConverterData.lower(value),uniffiCallStatus + ) +} +} + +open func clear()throws {try rustCallWithError(FfiConverterTypeMobilePlatformFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobileclipboard_clear( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + +open func waitForTimeout(milliseconds: UInt64) -> MobileClipboardWait { + return try! FfiConverterTypeMobileClipboardWait_lift(try! rustCall() { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobileclipboard_wait_for_timeout( + self.uniffiCloneHandle(), + FfiConverterUInt64.lower(milliseconds),uniffiCallStatus + ) +}) +} + + + +} + + + +// Put the implementation in a struct so we don't pollute the top-level namespace +fileprivate struct UniffiCallbackInterfaceMobileClipboard { + + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + // + // Store the vtable directly. + static let vtable: UniffiVTableCallbackInterfaceMobileClipboard = UniffiVTableCallbackInterfaceMobileClipboard( + uniffiFree: { (uniffiHandle: UInt64) -> () in + do { + try FfiConverterTypeMobileClipboard.handleMap.remove(handle: uniffiHandle) + } catch { + print("Uniffi callback interface MobileClipboard: handle missing in uniffiFree") + } + }, + uniffiClone: { (uniffiHandle: UInt64) -> UInt64 in + do { + return try FfiConverterTypeMobileClipboard.handleMap.clone(handle: uniffiHandle) + } catch { + fatalError("Uniffi callback interface MobileClipboard: handle missing in uniffiClone") + } + }, + read: { ( + uniffiHandle: UInt64, + uniffiOutReturn: UnsafeMutablePointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> MobileClipboardContent in + guard let uniffiObj = try? FfiConverterTypeMobileClipboard.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.read( + ) + } + + + let writeReturn = { uniffiOutReturn.pointee = FfiConverterTypeMobileClipboardContent_lower($0) } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobilePlatformFfiError_lower + ) + }, + write: { ( + uniffiHandle: UInt64, + value: RustBuffer, + uniffiOutReturn: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> () in + guard let uniffiObj = try? FfiConverterTypeMobileClipboard.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.write( + value: try FfiConverterData.lift(value) + ) + } + + + let writeReturn = { () } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobilePlatformFfiError_lower + ) + }, + clear: { ( + uniffiHandle: UInt64, + uniffiOutReturn: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> () in + guard let uniffiObj = try? FfiConverterTypeMobileClipboard.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.clear( + ) + } + + + let writeReturn = { () } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobilePlatformFfiError_lower + ) + }, + waitForTimeout: { ( + uniffiHandle: UInt64, + milliseconds: UInt64, + uniffiOutReturn: UnsafeMutablePointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> MobileClipboardWait in + guard let uniffiObj = try? FfiConverterTypeMobileClipboard.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return uniffiObj.waitForTimeout( + milliseconds: try FfiConverterUInt64.lift(milliseconds) + ) + } + + + let writeReturn = { uniffiOutReturn.pointee = FfiConverterTypeMobileClipboardWait_lower($0) } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn + ) + } + ) + + // Rust stores this pointer for future callback invocations, so it must live + // for the process lifetime (not just for the init function call). + // + // `nonisolated(unsafe)` is needed under Swift 6 strict concurrency. + // This is safe because the pointee is initialized once during static init + // and never mutated by either side of the FFI. Its fields are C function pointers. + nonisolated(unsafe) static let vtablePtr: UnsafePointer = { + let ptr = UnsafeMutablePointer.allocate(capacity: 1) + ptr.initialize(to: vtable) + return UnsafePointer(ptr) + }() +} + +private func uniffiCallbackInitMobileClipboard() { + uniffi_ironstorage_mobile_fn_init_callback_vtable_mobileclipboard(UniffiCallbackInterfaceMobileClipboard.vtablePtr) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileClipboard: FfiConverter { + fileprivate static let handleMap = UniffiHandleMap() + + typealias FfiType = UInt64 + typealias SwiftType = MobileClipboard + + public static func lift(_ handle: UInt64) throws -> MobileClipboard { + if ((handle & 1) == 0) { + // Rust-generated handle, construct a new class that uses the handle to implement the + // interface + return MobileClipboardImpl(unsafeFromHandle: handle) + } else { + // Swift-generated handle, get the object from the handle map + return try handleMap.remove(handle: handle) + } + } + + public static func lower(_ value: MobileClipboard) -> UInt64 { + if let rustImpl = value as? MobileClipboardImpl { + // Rust-implemented object. Clone the handle and return it + return rustImpl.uniffiCloneHandle() + } else { + // Swift object, generate a new vtable handle and return that. + return handleMap.insert(obj: value) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileClipboard { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: MobileClipboard, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClipboard_lift(_ handle: UInt64) throws -> MobileClipboard { + return try FfiConverterTypeMobileClipboard.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClipboard_lower(_ value: MobileClipboard) -> UInt64 { + return FfiConverterTypeMobileClipboard.lower(value) +} + + + + + + +public protocol MobileClock: AnyObject, Sendable { + + func monotonicMilliseconds() -> UInt64 + +} +open class MobileClockImpl: MobileClock, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobileclock(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobileclock(handle, $0) } + } + + + + +open func monotonicMilliseconds() -> UInt64 { + return try! FfiConverterUInt64.lift(try! rustCall() { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobileclock_monotonic_milliseconds( + self.uniffiCloneHandle(),uniffiCallStatus + ) +}) +} + + + +} + + + +// Put the implementation in a struct so we don't pollute the top-level namespace +fileprivate struct UniffiCallbackInterfaceMobileClock { + + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + // + // Store the vtable directly. + static let vtable: UniffiVTableCallbackInterfaceMobileClock = UniffiVTableCallbackInterfaceMobileClock( + uniffiFree: { (uniffiHandle: UInt64) -> () in + do { + try FfiConverterTypeMobileClock.handleMap.remove(handle: uniffiHandle) + } catch { + print("Uniffi callback interface MobileClock: handle missing in uniffiFree") + } + }, + uniffiClone: { (uniffiHandle: UInt64) -> UInt64 in + do { + return try FfiConverterTypeMobileClock.handleMap.clone(handle: uniffiHandle) + } catch { + fatalError("Uniffi callback interface MobileClock: handle missing in uniffiClone") + } + }, + monotonicMilliseconds: { ( + uniffiHandle: UInt64, + uniffiOutReturn: UnsafeMutablePointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> UInt64 in + guard let uniffiObj = try? FfiConverterTypeMobileClock.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return uniffiObj.monotonicMilliseconds( + ) + } + + + let writeReturn = { uniffiOutReturn.pointee = FfiConverterUInt64.lower($0) } + uniffiTraitInterfaceCall( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn + ) + } + ) + + // Rust stores this pointer for future callback invocations, so it must live + // for the process lifetime (not just for the init function call). + // + // `nonisolated(unsafe)` is needed under Swift 6 strict concurrency. + // This is safe because the pointee is initialized once during static init + // and never mutated by either side of the FFI. Its fields are C function pointers. + nonisolated(unsafe) static let vtablePtr: UnsafePointer = { + let ptr = UnsafeMutablePointer.allocate(capacity: 1) + ptr.initialize(to: vtable) + return UnsafePointer(ptr) + }() +} + +private func uniffiCallbackInitMobileClock() { + uniffi_ironstorage_mobile_fn_init_callback_vtable_mobileclock(UniffiCallbackInterfaceMobileClock.vtablePtr) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileClock: FfiConverter { + fileprivate static let handleMap = UniffiHandleMap() + + typealias FfiType = UInt64 + typealias SwiftType = MobileClock + + public static func lift(_ handle: UInt64) throws -> MobileClock { + if ((handle & 1) == 0) { + // Rust-generated handle, construct a new class that uses the handle to implement the + // interface + return MobileClockImpl(unsafeFromHandle: handle) + } else { + // Swift-generated handle, get the object from the handle map + return try handleMap.remove(handle: handle) + } + } + + public static func lower(_ value: MobileClock) -> UInt64 { + if let rustImpl = value as? MobileClockImpl { + // Rust-implemented object. Clone the handle and return it + return rustImpl.uniffiCloneHandle() + } else { + // Swift object, generate a new vtable handle and return that. + return handleMap.insert(obj: value) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileClock { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: MobileClock, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClock_lift(_ handle: UInt64) throws -> MobileClock { + return try FfiConverterTypeMobileClock.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClock_lower(_ value: MobileClock) -> UInt64 { + return FfiConverterTypeMobileClock.lower(value) +} + + + + + + public protocol MobileHomeOperationProtocol: AnyObject, Sendable { func cached() throws -> MobileHomePage @@ -1294,7 +1811,7 @@ open class MobileHomeOperation: MobileHomeOperationProtocol, @unchecked Sendable @_documentation(visibility: private) #endif public func uniffiCloneHandle() -> UInt64 { - return try! rustCall { uniffi_ironstorage_apple_fn_clone_mobilehomeoperation(self.handle, $0) } + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobilehomeoperation(self.handle, $0) } } // No primary constructor declared for this class. @@ -1304,7 +1821,7 @@ open class MobileHomeOperation: MobileHomeOperationProtocol, @unchecked Sendable return } - try! rustCall { uniffi_ironstorage_apple_fn_free_mobilehomeoperation(handle, $0) } + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobilehomeoperation(handle, $0) } } @@ -1313,7 +1830,7 @@ open class MobileHomeOperation: MobileHomeOperationProtocol, @unchecked Sendable open func cached()throws -> MobileHomePage { return try FfiConverterTypeMobileHomePage_lift(try rustCallWithError(FfiConverterTypeMobileHomeFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_cached( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_cached( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1321,7 +1838,7 @@ open func cached()throws -> MobileHomePage { open func cancel() {try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_cancel( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_cancel( self.uniffiCloneHandle(),uniffiCallStatus ) } @@ -1330,7 +1847,7 @@ open func cancel() {try! rustCall() { open func commit(message: String)throws -> MobileHomePage { return try FfiConverterTypeMobileHomePage_lift(try rustCallWithError(FfiConverterTypeMobileHomeFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_commit( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_commit( self.uniffiCloneHandle(), FfiConverterString.lower(message),uniffiCallStatus ) @@ -1340,7 +1857,7 @@ open func commit(message: String)throws -> MobileHomePage { open func fetch()throws -> MobileHomePage { return try FfiConverterTypeMobileHomePage_lift(try rustCallWithError(FfiConverterTypeMobileHomeFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_fetch( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_fetch( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1349,7 +1866,7 @@ open func fetch()throws -> MobileHomePage { open func progress() -> MobileHomeProgress { return try! FfiConverterTypeMobileHomeProgress_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_progress( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_progress( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1358,7 +1875,7 @@ open func progress() -> MobileHomeProgress { open func pull()throws -> MobileHomePage { return try FfiConverterTypeMobileHomePage_lift(try rustCallWithError(FfiConverterTypeMobileHomeFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_pull( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_pull( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1367,7 +1884,7 @@ open func pull()throws -> MobileHomePage { open func push()throws -> MobileHomePage { return try FfiConverterTypeMobileHomePage_lift(try rustCallWithError(FfiConverterTypeMobileHomeFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_push( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_push( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1376,7 +1893,7 @@ open func push()throws -> MobileHomePage { open func refreshIfStale()throws -> MobileHomePage { return try FfiConverterTypeMobileHomePage_lift(try rustCallWithError(FfiConverterTypeMobileHomeFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_refresh_if_stale( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_refresh_if_stale( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1385,7 +1902,7 @@ open func refreshIfStale()throws -> MobileHomePage { open func sync()throws -> MobileHomePage { return try FfiConverterTypeMobileHomePage_lift(try rustCallWithError(FfiConverterTypeMobileHomeFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilehomeoperation_sync( + uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_sync( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1487,7 +2004,7 @@ open class MobileKeyTransfer: MobileKeyTransferProtocol, @unchecked Sendable { @_documentation(visibility: private) #endif public func uniffiCloneHandle() -> UInt64 { - return try! rustCall { uniffi_ironstorage_apple_fn_clone_mobilekeytransfer(self.handle, $0) } + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobilekeytransfer(self.handle, $0) } } // No primary constructor declared for this class. @@ -1497,7 +2014,7 @@ open class MobileKeyTransfer: MobileKeyTransferProtocol, @unchecked Sendable { return } - try! rustCall { uniffi_ironstorage_apple_fn_free_mobilekeytransfer(handle, $0) } + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobilekeytransfer(handle, $0) } } @@ -1506,7 +2023,7 @@ open class MobileKeyTransfer: MobileKeyTransferProtocol, @unchecked Sendable { open func export(fingerprint: String, kind: MobileKeyTransferKind, passphrase: String?)throws -> MobileKeyTransferExport { return try FfiConverterTypeMobileKeyTransferExport_lift(try rustCallWithError(FfiConverterTypeMobileKeyTransferFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilekeytransfer_export( + uniffi_ironstorage_mobile_fn_method_mobilekeytransfer_export( self.uniffiCloneHandle(), FfiConverterString.lower(fingerprint), FfiConverterTypeMobileKeyTransferKind_lower(kind), @@ -1518,7 +2035,7 @@ open func export(fingerprint: String, kind: MobileKeyTransferKind, passphrase: S open func importer() -> MobileKeyTransferImport { return try! FfiConverterTypeMobileKeyTransferImport_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilekeytransfer_importer( + uniffi_ironstorage_mobile_fn_method_mobilekeytransfer_importer( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1527,7 +2044,7 @@ open func importer() -> MobileKeyTransferImport { open func keys() -> [MobileKeyTransferKey] { return try! FfiConverterSequenceTypeMobileKeyTransferKey.lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilekeytransfer_keys( + uniffi_ironstorage_mobile_fn_method_mobilekeytransfer_keys( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1627,7 +2144,7 @@ open class MobileKeyTransferImport: MobileKeyTransferImportProtocol, @unchecked @_documentation(visibility: private) #endif public func uniffiCloneHandle() -> UInt64 { - return try! rustCall { uniffi_ironstorage_apple_fn_clone_mobilekeytransferimport(self.handle, $0) } + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobilekeytransferimport(self.handle, $0) } } // No primary constructor declared for this class. @@ -1637,7 +2154,7 @@ open class MobileKeyTransferImport: MobileKeyTransferImportProtocol, @unchecked return } - try! rustCall { uniffi_ironstorage_apple_fn_free_mobilekeytransferimport(handle, $0) } + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobilekeytransferimport(handle, $0) } } @@ -1646,7 +2163,7 @@ open class MobileKeyTransferImport: MobileKeyTransferImportProtocol, @unchecked open func addFrame(payload: String)throws -> MobileKeyTransferProgress { return try FfiConverterTypeMobileKeyTransferProgress_lift(try rustCallWithError(FfiConverterTypeMobileKeyTransferFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilekeytransferimport_add_frame( + uniffi_ironstorage_mobile_fn_method_mobilekeytransferimport_add_frame( self.uniffiCloneHandle(), FfiConverterString.lower(payload),uniffiCallStatus ) @@ -1656,7 +2173,7 @@ open func addFrame(payload: String)throws -> MobileKeyTransferProgress { open func `import`(passphrase: String?, makeDefault: Bool, overwrite: Bool)throws -> MobileKeyTransferOutcome { return try FfiConverterTypeMobileKeyTransferOutcome_lift(try rustCallWithError(FfiConverterTypeMobileKeyTransferFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilekeytransferimport_import( + uniffi_ironstorage_mobile_fn_method_mobilekeytransferimport_import( self.uniffiCloneHandle(), FfiConverterOptionString.lower(passphrase), FfiConverterBool.lower(makeDefault), @@ -1759,7 +2276,7 @@ open class MobileLocalOnboardingOperation: MobileLocalOnboardingOperationProtoco @_documentation(visibility: private) #endif public func uniffiCloneHandle() -> UInt64 { - return try! rustCall { uniffi_ironstorage_apple_fn_clone_mobilelocalonboardingoperation(self.handle, $0) } + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobilelocalonboardingoperation(self.handle, $0) } } // No primary constructor declared for this class. @@ -1769,7 +2286,7 @@ open class MobileLocalOnboardingOperation: MobileLocalOnboardingOperationProtoco return } - try! rustCall { uniffi_ironstorage_apple_fn_free_mobilelocalonboardingoperation(handle, $0) } + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobilelocalonboardingoperation(handle, $0) } } @@ -1777,7 +2294,7 @@ open class MobileLocalOnboardingOperation: MobileLocalOnboardingOperationProtoco open func cancel() {try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilelocalonboardingoperation_cancel( + uniffi_ironstorage_mobile_fn_method_mobilelocalonboardingoperation_cancel( self.uniffiCloneHandle(),uniffiCallStatus ) } @@ -1786,7 +2303,7 @@ open func cancel() {try! rustCall() { open func generate(userId: String, passphrase: String, replaceExistingKey: Bool)throws -> MobileOnboardingOutcome { return try FfiConverterTypeMobileOnboardingOutcome_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobilelocalonboardingoperation_generate( + uniffi_ironstorage_mobile_fn_method_mobilelocalonboardingoperation_generate( self.uniffiCloneHandle(), FfiConverterString.lower(userId), FfiConverterString.lower(passphrase), @@ -1895,7 +2412,7 @@ open class MobileOnboardingOperation: MobileOnboardingOperationProtocol, @unchec @_documentation(visibility: private) #endif public func uniffiCloneHandle() -> UInt64 { - return try! rustCall { uniffi_ironstorage_apple_fn_clone_mobileonboardingoperation(self.handle, $0) } + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobileonboardingoperation(self.handle, $0) } } // No primary constructor declared for this class. @@ -1905,7 +2422,7 @@ open class MobileOnboardingOperation: MobileOnboardingOperationProtocol, @unchec return } - try! rustCall { uniffi_ironstorage_apple_fn_free_mobileonboardingoperation(handle, $0) } + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobileonboardingoperation(handle, $0) } } @@ -1913,7 +2430,7 @@ open class MobileOnboardingOperation: MobileOnboardingOperationProtocol, @unchec open func cancel() {try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_cancel( + uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_cancel( self.uniffiCloneHandle(),uniffiCallStatus ) } @@ -1922,7 +2439,7 @@ open func cancel() {try! rustCall() { open func connectLocalStore()throws -> MobileOnboardingOutcome { return try FfiConverterTypeMobileOnboardingOutcome_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_connect_local_store( + uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_connect_local_store( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1931,7 +2448,7 @@ open func connectLocalStore()throws -> MobileOnboardingOutcome { open func discover()throws -> MobileOnboardingDiscovery { return try FfiConverterTypeMobileOnboardingDiscovery_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_discover( + uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_discover( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1940,7 +2457,7 @@ open func discover()throws -> MobileOnboardingDiscovery { open func progress() -> MobileOnboardingProgress { return try! FfiConverterTypeMobileOnboardingProgress_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_progress( + uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_progress( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -1949,7 +2466,7 @@ open func progress() -> MobileOnboardingProgress { open func setup(branch: String, useExisting: Bool)throws -> MobileOnboardingOutcome { return try FfiConverterTypeMobileOnboardingOutcome_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_setup( + uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_setup( self.uniffiCloneHandle(), FfiConverterString.lower(branch), FfiConverterBool.lower(useExisting),uniffiCallStatus @@ -2007,6 +2524,404 @@ public func FfiConverterTypeMobileOnboardingOperation_lower(_ value: MobileOnboa +/** + * Receives storage-encoded opaque bytes; cannot select accounts, leases or protection. + */ +public protocol MobileSecretBackend: AnyObject, Sendable { + + func create(locator: MobileSecretLocator, protection: MobileSecretProtection, value: Data) throws + + func retrieve(locator: MobileSecretLocator, protection: MobileSecretProtection) throws -> Data + + func replace(locator: MobileSecretLocator, protection: MobileSecretProtection, value: Data) throws + + func delete(locator: MobileSecretLocator, protection: MobileSecretProtection) throws + + func lock() throws + + func unlock() throws + +} +/** + * Receives storage-encoded opaque bytes; cannot select accounts, leases or protection. + */ +open class MobileSecretBackendImpl: MobileSecretBackend, @unchecked Sendable { + fileprivate let handle: UInt64 + + /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public struct NoHandle { + public init() {} + } + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + required public init(unsafeFromHandle handle: UInt64) { + self.handle = handle + } + + // This constructor can be used to instantiate a fake object. + // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject]. + // + // - Warning: + // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash. +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public init(noHandle: NoHandle) { + self.handle = 0 + } + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif + public func uniffiCloneHandle() -> UInt64 { + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobilesecretbackend(self.handle, $0) } + } + // No primary constructor declared for this class. + + deinit { + if handle == 0 { + // Mock objects have handle=0 don't try to free them + return + } + + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobilesecretbackend(handle, $0) } + } + + + + +open func create(locator: MobileSecretLocator, protection: MobileSecretProtection, value: Data)throws {try rustCallWithError(FfiConverterTypeMobileSecretError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_create( + self.uniffiCloneHandle(), + FfiConverterTypeMobileSecretLocator_lower(locator), + FfiConverterTypeMobileSecretProtection_lower(protection), + FfiConverterData.lower(value),uniffiCallStatus + ) +} +} + +open func retrieve(locator: MobileSecretLocator, protection: MobileSecretProtection)throws -> Data { + return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeMobileSecretError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_retrieve( + self.uniffiCloneHandle(), + FfiConverterTypeMobileSecretLocator_lower(locator), + FfiConverterTypeMobileSecretProtection_lower(protection),uniffiCallStatus + ) +}) +} + +open func replace(locator: MobileSecretLocator, protection: MobileSecretProtection, value: Data)throws {try rustCallWithError(FfiConverterTypeMobileSecretError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_replace( + self.uniffiCloneHandle(), + FfiConverterTypeMobileSecretLocator_lower(locator), + FfiConverterTypeMobileSecretProtection_lower(protection), + FfiConverterData.lower(value),uniffiCallStatus + ) +} +} + +open func delete(locator: MobileSecretLocator, protection: MobileSecretProtection)throws {try rustCallWithError(FfiConverterTypeMobileSecretError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_delete( + self.uniffiCloneHandle(), + FfiConverterTypeMobileSecretLocator_lower(locator), + FfiConverterTypeMobileSecretProtection_lower(protection),uniffiCallStatus + ) +} +} + +open func lock()throws {try rustCallWithError(FfiConverterTypeMobileSecretError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_lock( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + +open func unlock()throws {try rustCallWithError(FfiConverterTypeMobileSecretError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_unlock( + self.uniffiCloneHandle(),uniffiCallStatus + ) +} +} + + + +} + + + +// Put the implementation in a struct so we don't pollute the top-level namespace +fileprivate struct UniffiCallbackInterfaceMobileSecretBackend { + + // Create the VTable using a series of closures. + // Swift automatically converts these into C callback functions. + // + // Store the vtable directly. + static let vtable: UniffiVTableCallbackInterfaceMobileSecretBackend = UniffiVTableCallbackInterfaceMobileSecretBackend( + uniffiFree: { (uniffiHandle: UInt64) -> () in + do { + try FfiConverterTypeMobileSecretBackend.handleMap.remove(handle: uniffiHandle) + } catch { + print("Uniffi callback interface MobileSecretBackend: handle missing in uniffiFree") + } + }, + uniffiClone: { (uniffiHandle: UInt64) -> UInt64 in + do { + return try FfiConverterTypeMobileSecretBackend.handleMap.clone(handle: uniffiHandle) + } catch { + fatalError("Uniffi callback interface MobileSecretBackend: handle missing in uniffiClone") + } + }, + create: { ( + uniffiHandle: UInt64, + locator: RustBuffer, + protection: RustBuffer, + value: RustBuffer, + uniffiOutReturn: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> () in + guard let uniffiObj = try? FfiConverterTypeMobileSecretBackend.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.create( + locator: try FfiConverterTypeMobileSecretLocator_lift(locator), + protection: try FfiConverterTypeMobileSecretProtection_lift(protection), + value: try FfiConverterData.lift(value) + ) + } + + + let writeReturn = { () } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobileSecretError_lower + ) + }, + retrieve: { ( + uniffiHandle: UInt64, + locator: RustBuffer, + protection: RustBuffer, + uniffiOutReturn: UnsafeMutablePointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> Data in + guard let uniffiObj = try? FfiConverterTypeMobileSecretBackend.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.retrieve( + locator: try FfiConverterTypeMobileSecretLocator_lift(locator), + protection: try FfiConverterTypeMobileSecretProtection_lift(protection) + ) + } + + + let writeReturn = { uniffiOutReturn.pointee = FfiConverterData.lower($0) } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobileSecretError_lower + ) + }, + replace: { ( + uniffiHandle: UInt64, + locator: RustBuffer, + protection: RustBuffer, + value: RustBuffer, + uniffiOutReturn: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> () in + guard let uniffiObj = try? FfiConverterTypeMobileSecretBackend.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.replace( + locator: try FfiConverterTypeMobileSecretLocator_lift(locator), + protection: try FfiConverterTypeMobileSecretProtection_lift(protection), + value: try FfiConverterData.lift(value) + ) + } + + + let writeReturn = { () } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobileSecretError_lower + ) + }, + delete: { ( + uniffiHandle: UInt64, + locator: RustBuffer, + protection: RustBuffer, + uniffiOutReturn: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> () in + guard let uniffiObj = try? FfiConverterTypeMobileSecretBackend.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.delete( + locator: try FfiConverterTypeMobileSecretLocator_lift(locator), + protection: try FfiConverterTypeMobileSecretProtection_lift(protection) + ) + } + + + let writeReturn = { () } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobileSecretError_lower + ) + }, + lock: { ( + uniffiHandle: UInt64, + uniffiOutReturn: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> () in + guard let uniffiObj = try? FfiConverterTypeMobileSecretBackend.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.lock( + ) + } + + + let writeReturn = { () } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobileSecretError_lower + ) + }, + unlock: { ( + uniffiHandle: UInt64, + uniffiOutReturn: UnsafeMutableRawPointer, + uniffiCallStatus: UnsafeMutablePointer + ) in + let makeCall = { + () throws -> () in + guard let uniffiObj = try? FfiConverterTypeMobileSecretBackend.handleMap.get(handle: uniffiHandle) else { + throw UniffiInternalError.unexpectedStaleHandle + } + return try uniffiObj.unlock( + ) + } + + + let writeReturn = { () } + uniffiTraitInterfaceCallWithError( + callStatus: uniffiCallStatus, + makeCall: makeCall, + writeReturn: writeReturn, + lowerError: FfiConverterTypeMobileSecretError_lower + ) + } + ) + + // Rust stores this pointer for future callback invocations, so it must live + // for the process lifetime (not just for the init function call). + // + // `nonisolated(unsafe)` is needed under Swift 6 strict concurrency. + // This is safe because the pointee is initialized once during static init + // and never mutated by either side of the FFI. Its fields are C function pointers. + nonisolated(unsafe) static let vtablePtr: UnsafePointer = { + let ptr = UnsafeMutablePointer.allocate(capacity: 1) + ptr.initialize(to: vtable) + return UnsafePointer(ptr) + }() +} + +private func uniffiCallbackInitMobileSecretBackend() { + uniffi_ironstorage_mobile_fn_init_callback_vtable_mobilesecretbackend(UniffiCallbackInterfaceMobileSecretBackend.vtablePtr) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileSecretBackend: FfiConverter { + fileprivate static let handleMap = UniffiHandleMap() + + typealias FfiType = UInt64 + typealias SwiftType = MobileSecretBackend + + public static func lift(_ handle: UInt64) throws -> MobileSecretBackend { + if ((handle & 1) == 0) { + // Rust-generated handle, construct a new class that uses the handle to implement the + // interface + return MobileSecretBackendImpl(unsafeFromHandle: handle) + } else { + // Swift-generated handle, get the object from the handle map + return try handleMap.remove(handle: handle) + } + } + + public static func lower(_ value: MobileSecretBackend) -> UInt64 { + if let rustImpl = value as? MobileSecretBackendImpl { + // Rust-implemented object. Clone the handle and return it + return rustImpl.uniffiCloneHandle() + } else { + // Swift object, generate a new vtable handle and return that. + return handleMap.insert(obj: value) + } + } + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileSecretBackend { + let handle: UInt64 = try readInt(&buf) + return try lift(handle) + } + + public static func write(_ value: MobileSecretBackend, into buf: inout [UInt8]) { + writeInt(&buf, lower(value)) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileSecretBackend_lift(_ handle: UInt64) throws -> MobileSecretBackend { + return try FfiConverterTypeMobileSecretBackend.lift(handle) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileSecretBackend_lower(_ value: MobileSecretBackend) -> UInt64 { + return FfiConverterTypeMobileSecretBackend.lower(value) +} + + + + + + public protocol MobileTotpOperationProtocol: AnyObject, Sendable { func cancel() @@ -2051,7 +2966,7 @@ open class MobileTotpOperation: MobileTotpOperationProtocol, @unchecked Sendable @_documentation(visibility: private) #endif public func uniffiCloneHandle() -> UInt64 { - return try! rustCall { uniffi_ironstorage_apple_fn_clone_mobiletotpoperation(self.handle, $0) } + return try! rustCall { uniffi_ironstorage_mobile_fn_clone_mobiletotpoperation(self.handle, $0) } } // No primary constructor declared for this class. @@ -2061,7 +2976,7 @@ open class MobileTotpOperation: MobileTotpOperationProtocol, @unchecked Sendable return } - try! rustCall { uniffi_ironstorage_apple_fn_free_mobiletotpoperation(handle, $0) } + try! rustCall { uniffi_ironstorage_mobile_fn_free_mobiletotpoperation(handle, $0) } } @@ -2069,7 +2984,7 @@ open class MobileTotpOperation: MobileTotpOperationProtocol, @unchecked Sendable open func cancel() {try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobiletotpoperation_cancel( + uniffi_ironstorage_mobile_fn_method_mobiletotpoperation_cancel( self.uniffiCloneHandle(),uniffiCallStatus ) } @@ -2078,7 +2993,7 @@ open func cancel() {try! rustCall() { open func progress() -> MobileTotpDiscoveryProgress { return try! FfiConverterTypeMobileTotpDiscoveryProgress_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_method_mobiletotpoperation_progress( + uniffi_ironstorage_mobile_fn_method_mobiletotpoperation_progress( self.uniffiCloneHandle(),uniffiCallStatus ) }) @@ -2190,6 +3105,134 @@ public func FfiConverterTypeMobileAuthenticationState_lower(_ value: MobileAuthe } +public struct MobileCameraFrame: Equatable, Hashable { + public var width: UInt32 + public var height: UInt32 + public var rowStride: UInt32 + public var pixelStride: UInt32 + public var luminance: Data + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(width: UInt32, height: UInt32, rowStride: UInt32, pixelStride: UInt32, luminance: Data) { + self.width = width + self.height = height + self.rowStride = rowStride + self.pixelStride = pixelStride + self.luminance = luminance + } + + + + +} + +#if compiler(>=6) +extension MobileCameraFrame: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileCameraFrame: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileCameraFrame { + return + try MobileCameraFrame( + width: FfiConverterUInt32.read(from: &buf), + height: FfiConverterUInt32.read(from: &buf), + rowStride: FfiConverterUInt32.read(from: &buf), + pixelStride: FfiConverterUInt32.read(from: &buf), + luminance: FfiConverterData.read(from: &buf) + ) + } + + public static func write(_ value: MobileCameraFrame, into buf: inout [UInt8]) { + FfiConverterUInt32.write(value.width, into: &buf) + FfiConverterUInt32.write(value.height, into: &buf) + FfiConverterUInt32.write(value.rowStride, into: &buf) + FfiConverterUInt32.write(value.pixelStride, into: &buf) + FfiConverterData.write(value.luminance, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileCameraFrame_lift(_ buf: RustBuffer) throws -> MobileCameraFrame { + return try FfiConverterTypeMobileCameraFrame.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileCameraFrame_lower(_ value: MobileCameraFrame) -> RustBuffer { + return FfiConverterTypeMobileCameraFrame.lower(value) +} + + +public struct MobileCredentialRequest: Equatable, Hashable { + public var requestId: String + public var package: String + public var signingCertificateSha256: String + public var origins: [String] + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(requestId: String, package: String, signingCertificateSha256: String, origins: [String]) { + self.requestId = requestId + self.package = package + self.signingCertificateSha256 = signingCertificateSha256 + self.origins = origins + } + + + + +} + +#if compiler(>=6) +extension MobileCredentialRequest: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileCredentialRequest: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileCredentialRequest { + return + try MobileCredentialRequest( + requestId: FfiConverterString.read(from: &buf), + package: FfiConverterString.read(from: &buf), + signingCertificateSha256: FfiConverterString.read(from: &buf), + origins: FfiConverterSequenceString.read(from: &buf) + ) + } + + public static func write(_ value: MobileCredentialRequest, into buf: inout [UInt8]) { + FfiConverterString.write(value.requestId, into: &buf) + FfiConverterString.write(value.package, into: &buf) + FfiConverterString.write(value.signingCertificateSha256, into: &buf) + FfiConverterSequenceString.write(value.origins, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileCredentialRequest_lift(_ buf: RustBuffer) throws -> MobileCredentialRequest { + return try FfiConverterTypeMobileCredentialRequest.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileCredentialRequest_lower(_ value: MobileCredentialRequest) -> RustBuffer { + return FfiConverterTypeMobileCredentialRequest.lower(value) +} + + public struct MobileEntryCopy: Equatable, Hashable { public var value: String public var timeoutSeconds: UInt64 @@ -2249,7 +3292,7 @@ public struct MobileEntryEditorField: Equatable, Hashable { public var kind: MobileEntryEditorFieldKind public var name: String? public var label: String - public var systemImage: String + public var icon: MobileIcon public var value: String? public var maskedValue: String public var diagnostic: String? @@ -2261,12 +3304,12 @@ public struct MobileEntryEditorField: Equatable, Hashable { // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: UInt64, kind: MobileEntryEditorFieldKind, name: String?, label: String, systemImage: String, value: String?, maskedValue: String, diagnostic: String?, sensitive: Bool, multiline: Bool, nameEditable: Bool, removable: Bool, reorderable: Bool) { + public init(id: UInt64, kind: MobileEntryEditorFieldKind, name: String?, label: String, icon: MobileIcon, value: String?, maskedValue: String, diagnostic: String?, sensitive: Bool, multiline: Bool, nameEditable: Bool, removable: Bool, reorderable: Bool) { self.id = id self.kind = kind self.name = name self.label = label - self.systemImage = systemImage + self.icon = icon self.value = value self.maskedValue = maskedValue self.diagnostic = diagnostic @@ -2297,7 +3340,7 @@ public struct FfiConverterTypeMobileEntryEditorField: FfiConverterRustBuffer { kind: FfiConverterTypeMobileEntryEditorFieldKind.read(from: &buf), name: FfiConverterOptionString.read(from: &buf), label: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf), + icon: FfiConverterTypeMobileIcon.read(from: &buf), value: FfiConverterOptionString.read(from: &buf), maskedValue: FfiConverterString.read(from: &buf), diagnostic: FfiConverterOptionString.read(from: &buf), @@ -2314,7 +3357,7 @@ public struct FfiConverterTypeMobileEntryEditorField: FfiConverterRustBuffer { FfiConverterTypeMobileEntryEditorFieldKind.write(value.kind, into: &buf) FfiConverterOptionString.write(value.name, into: &buf) FfiConverterString.write(value.label, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) FfiConverterOptionString.write(value.value, into: &buf) FfiConverterString.write(value.maskedValue, into: &buf) FfiConverterOptionString.write(value.diagnostic, into: &buf) @@ -2531,7 +3574,7 @@ public func FfiConverterTypeMobileEntryEditorSession_lower(_ value: MobileEntryE public struct MobileEntryField: Equatable, Hashable { public var id: UInt64 public var label: String - public var systemImage: String + public var icon: MobileIcon public var value: String? public var maskedValue: String public var detail: String? @@ -2543,10 +3586,10 @@ public struct MobileEntryField: Equatable, Hashable { // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: UInt64, label: String, systemImage: String, value: String?, maskedValue: String, detail: String?, diagnostic: String?, sensitive: Bool, multiline: Bool, selectable: Bool, editable: Bool) { + public init(id: UInt64, label: String, icon: MobileIcon, value: String?, maskedValue: String, detail: String?, diagnostic: String?, sensitive: Bool, multiline: Bool, selectable: Bool, editable: Bool) { self.id = id self.label = label - self.systemImage = systemImage + self.icon = icon self.value = value self.maskedValue = maskedValue self.detail = detail @@ -2575,7 +3618,7 @@ public struct FfiConverterTypeMobileEntryField: FfiConverterRustBuffer { try MobileEntryField( id: FfiConverterUInt64.read(from: &buf), label: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf), + icon: FfiConverterTypeMobileIcon.read(from: &buf), value: FfiConverterOptionString.read(from: &buf), maskedValue: FfiConverterString.read(from: &buf), detail: FfiConverterOptionString.read(from: &buf), @@ -2590,7 +3633,7 @@ public struct FfiConverterTypeMobileEntryField: FfiConverterRustBuffer { public static func write(_ value: MobileEntryField, into buf: inout [UInt8]) { FfiConverterUInt64.write(value.id, into: &buf) FfiConverterString.write(value.label, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) FfiConverterOptionString.write(value.value, into: &buf) FfiConverterString.write(value.maskedValue, into: &buf) FfiConverterOptionString.write(value.detail, into: &buf) @@ -2849,14 +3892,14 @@ public func FfiConverterTypeMobileGitIdentity_lower(_ value: MobileGitIdentity) public struct MobileHomeAction: Equatable, Hashable { public var kind: MobileHomeActionKind public var title: String - public var systemImage: String + public var icon: MobileIcon // Default memberwise initializers are never public by default, so we // declare one manually. - public init(kind: MobileHomeActionKind, title: String, systemImage: String) { + public init(kind: MobileHomeActionKind, title: String, icon: MobileIcon) { self.kind = kind self.title = title - self.systemImage = systemImage + self.icon = icon } @@ -2877,14 +3920,14 @@ public struct FfiConverterTypeMobileHomeAction: FfiConverterRustBuffer { try MobileHomeAction( kind: FfiConverterTypeMobileHomeActionKind.read(from: &buf), title: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf) + icon: FfiConverterTypeMobileIcon.read(from: &buf) ) } public static func write(_ value: MobileHomeAction, into buf: inout [UInt8]) { FfiConverterTypeMobileHomeActionKind.write(value.kind, into: &buf) FfiConverterString.write(value.title, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) } } @@ -2908,17 +3951,17 @@ public struct MobileHomeChange: Equatable, Hashable { public var id: String public var title: String public var detail: String - public var systemImage: String + public var icon: MobileIcon public var kind: MobileHomeChangeKind public var status: MobileHomeChangeStatus // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: String, title: String, detail: String, systemImage: String, kind: MobileHomeChangeKind, status: MobileHomeChangeStatus) { + public init(id: String, title: String, detail: String, icon: MobileIcon, kind: MobileHomeChangeKind, status: MobileHomeChangeStatus) { self.id = id self.title = title self.detail = detail - self.systemImage = systemImage + self.icon = icon self.kind = kind self.status = status } @@ -2942,7 +3985,7 @@ public struct FfiConverterTypeMobileHomeChange: FfiConverterRustBuffer { id: FfiConverterString.read(from: &buf), title: FfiConverterString.read(from: &buf), detail: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf), + icon: FfiConverterTypeMobileIcon.read(from: &buf), kind: FfiConverterTypeMobileHomeChangeKind.read(from: &buf), status: FfiConverterTypeMobileHomeChangeStatus.read(from: &buf) ) @@ -2952,7 +3995,7 @@ public struct FfiConverterTypeMobileHomeChange: FfiConverterRustBuffer { FfiConverterString.write(value.id, into: &buf) FfiConverterString.write(value.title, into: &buf) FfiConverterString.write(value.detail, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) FfiConverterTypeMobileHomeChangeKind.write(value.kind, into: &buf) FfiConverterTypeMobileHomeChangeStatus.write(value.status, into: &buf) } @@ -2978,18 +4021,18 @@ public struct MobileHomeCommit: Equatable, Hashable { public var id: String public var title: String public var detail: String - public var systemImage: String + public var icon: MobileIcon public var timestamp: Int64 public var changes: [MobileHomeChange] public var actions: [MobileHomeAction] // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: String, title: String, detail: String, systemImage: String, timestamp: Int64, changes: [MobileHomeChange], actions: [MobileHomeAction]) { + public init(id: String, title: String, detail: String, icon: MobileIcon, timestamp: Int64, changes: [MobileHomeChange], actions: [MobileHomeAction]) { self.id = id self.title = title self.detail = detail - self.systemImage = systemImage + self.icon = icon self.timestamp = timestamp self.changes = changes self.actions = actions @@ -3014,7 +4057,7 @@ public struct FfiConverterTypeMobileHomeCommit: FfiConverterRustBuffer { id: FfiConverterString.read(from: &buf), title: FfiConverterString.read(from: &buf), detail: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf), + icon: FfiConverterTypeMobileIcon.read(from: &buf), timestamp: FfiConverterInt64.read(from: &buf), changes: FfiConverterSequenceTypeMobileHomeChange.read(from: &buf), actions: FfiConverterSequenceTypeMobileHomeAction.read(from: &buf) @@ -3025,7 +4068,7 @@ public struct FfiConverterTypeMobileHomeCommit: FfiConverterRustBuffer { FfiConverterString.write(value.id, into: &buf) FfiConverterString.write(value.title, into: &buf) FfiConverterString.write(value.detail, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) FfiConverterInt64.write(value.timestamp, into: &buf) FfiConverterSequenceTypeMobileHomeChange.write(value.changes, into: &buf) FfiConverterSequenceTypeMobileHomeAction.write(value.actions, into: &buf) @@ -3051,14 +4094,14 @@ public func FfiConverterTypeMobileHomeCommit_lower(_ value: MobileHomeCommit) -> public struct MobileHomeNotice: Equatable, Hashable { public var title: String public var detail: String - public var systemImage: String + public var icon: MobileIcon // Default memberwise initializers are never public by default, so we // declare one manually. - public init(title: String, detail: String, systemImage: String) { + public init(title: String, detail: String, icon: MobileIcon) { self.title = title self.detail = detail - self.systemImage = systemImage + self.icon = icon } @@ -3079,14 +4122,14 @@ public struct FfiConverterTypeMobileHomeNotice: FfiConverterRustBuffer { try MobileHomeNotice( title: FfiConverterString.read(from: &buf), detail: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf) + icon: FfiConverterTypeMobileIcon.read(from: &buf) ) } public static func write(_ value: MobileHomeNotice, into buf: inout [UInt8]) { FfiConverterString.write(value.title, into: &buf) FfiConverterString.write(value.detail, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) } } @@ -3254,16 +4297,16 @@ public struct MobileHomeSummaryRow: Equatable, Hashable { public var id: String public var title: String public var detail: String - public var systemImage: String + public var icon: MobileIcon public var actions: [MobileHomeAction] // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: String, title: String, detail: String, systemImage: String, actions: [MobileHomeAction]) { + public init(id: String, title: String, detail: String, icon: MobileIcon, actions: [MobileHomeAction]) { self.id = id self.title = title self.detail = detail - self.systemImage = systemImage + self.icon = icon self.actions = actions } @@ -3286,7 +4329,7 @@ public struct FfiConverterTypeMobileHomeSummaryRow: FfiConverterRustBuffer { id: FfiConverterString.read(from: &buf), title: FfiConverterString.read(from: &buf), detail: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf), + icon: FfiConverterTypeMobileIcon.read(from: &buf), actions: FfiConverterSequenceTypeMobileHomeAction.read(from: &buf) ) } @@ -3295,7 +4338,7 @@ public struct FfiConverterTypeMobileHomeSummaryRow: FfiConverterRustBuffer { FfiConverterString.write(value.id, into: &buf) FfiConverterString.write(value.title, into: &buf) FfiConverterString.write(value.detail, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) FfiConverterSequenceTypeMobileHomeAction.write(value.actions, into: &buf) } } @@ -4059,19 +5102,17 @@ public func FfiConverterTypeMobileOnboardingProgress_lower(_ value: MobileOnboar public struct MobilePage: Equatable, Hashable { public var tab: MobileTab public var title: String - public var systemImage: String - public var selectedSystemImage: String + public var icon: MobileIcon public var state: MobileShellState public var stateTitle: String public var stateDetail: String // Default memberwise initializers are never public by default, so we // declare one manually. - public init(tab: MobileTab, title: String, systemImage: String, selectedSystemImage: String, state: MobileShellState, stateTitle: String, stateDetail: String) { + public init(tab: MobileTab, title: String, icon: MobileIcon, state: MobileShellState, stateTitle: String, stateDetail: String) { self.tab = tab self.title = title - self.systemImage = systemImage - self.selectedSystemImage = selectedSystemImage + self.icon = icon self.state = state self.stateTitle = stateTitle self.stateDetail = stateDetail @@ -4095,8 +5136,7 @@ public struct FfiConverterTypeMobilePage: FfiConverterRustBuffer { try MobilePage( tab: FfiConverterTypeMobileTab.read(from: &buf), title: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf), - selectedSystemImage: FfiConverterString.read(from: &buf), + icon: FfiConverterTypeMobileIcon.read(from: &buf), state: FfiConverterTypeMobileShellState.read(from: &buf), stateTitle: FfiConverterString.read(from: &buf), stateDetail: FfiConverterString.read(from: &buf) @@ -4106,8 +5146,7 @@ public struct FfiConverterTypeMobilePage: FfiConverterRustBuffer { public static func write(_ value: MobilePage, into buf: inout [UInt8]) { FfiConverterTypeMobileTab.write(value.tab, into: &buf) FfiConverterString.write(value.title, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) - FfiConverterString.write(value.selectedSystemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) FfiConverterTypeMobileShellState.write(value.state, into: &buf) FfiConverterString.write(value.stateTitle, into: &buf) FfiConverterString.write(value.stateDetail, into: &buf) @@ -4197,17 +5236,17 @@ public struct MobilePasswordRow: Equatable, Hashable { public var path: String public var title: String public var detail: String - public var systemImage: String + public var icon: MobileIcon public var kind: MobilePasswordRowKind // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: String, path: String, title: String, detail: String, systemImage: String, kind: MobilePasswordRowKind) { + public init(id: String, path: String, title: String, detail: String, icon: MobileIcon, kind: MobilePasswordRowKind) { self.id = id self.path = path self.title = title self.detail = detail - self.systemImage = systemImage + self.icon = icon self.kind = kind } @@ -4231,7 +5270,7 @@ public struct FfiConverterTypeMobilePasswordRow: FfiConverterRustBuffer { path: FfiConverterString.read(from: &buf), title: FfiConverterString.read(from: &buf), detail: FfiConverterString.read(from: &buf), - systemImage: FfiConverterString.read(from: &buf), + icon: FfiConverterTypeMobileIcon.read(from: &buf), kind: FfiConverterTypeMobilePasswordRowKind.read(from: &buf) ) } @@ -4241,7 +5280,7 @@ public struct FfiConverterTypeMobilePasswordRow: FfiConverterRustBuffer { FfiConverterString.write(value.path, into: &buf) FfiConverterString.write(value.title, into: &buf) FfiConverterString.write(value.detail, into: &buf) - FfiConverterString.write(value.systemImage, into: &buf) + FfiConverterTypeMobileIcon.write(value.icon, into: &buf) FfiConverterTypeMobilePasswordRowKind.write(value.kind, into: &buf) } } @@ -4262,6 +5301,122 @@ public func FfiConverterTypeMobilePasswordRow_lower(_ value: MobilePasswordRow) } +public struct MobilePlatformLayout: Equatable, Hashable { + public var configuration: String + public var vault: String + public var keys: String + public var cache: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(configuration: String, vault: String, keys: String, cache: String) { + self.configuration = configuration + self.vault = vault + self.keys = keys + self.cache = cache + } + + + + +} + +#if compiler(>=6) +extension MobilePlatformLayout: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobilePlatformLayout: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobilePlatformLayout { + return + try MobilePlatformLayout( + configuration: FfiConverterString.read(from: &buf), + vault: FfiConverterString.read(from: &buf), + keys: FfiConverterString.read(from: &buf), + cache: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: MobilePlatformLayout, into buf: inout [UInt8]) { + FfiConverterString.write(value.configuration, into: &buf) + FfiConverterString.write(value.vault, into: &buf) + FfiConverterString.write(value.keys, into: &buf) + FfiConverterString.write(value.cache, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobilePlatformLayout_lift(_ buf: RustBuffer) throws -> MobilePlatformLayout { + return try FfiConverterTypeMobilePlatformLayout.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobilePlatformLayout_lower(_ value: MobilePlatformLayout) -> RustBuffer { + return FfiConverterTypeMobilePlatformLayout.lower(value) +} + + +public struct MobilePlatformPaths: Equatable, Hashable { + public var dataRoot: String + public var cacheRoot: String + + // Default memberwise initializers are never public by default, so we + // declare one manually. + public init(dataRoot: String, cacheRoot: String) { + self.dataRoot = dataRoot + self.cacheRoot = cacheRoot + } + + + + +} + +#if compiler(>=6) +extension MobilePlatformPaths: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobilePlatformPaths: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobilePlatformPaths { + return + try MobilePlatformPaths( + dataRoot: FfiConverterString.read(from: &buf), + cacheRoot: FfiConverterString.read(from: &buf) + ) + } + + public static func write(_ value: MobilePlatformPaths, into buf: inout [UInt8]) { + FfiConverterString.write(value.dataRoot, into: &buf) + FfiConverterString.write(value.cacheRoot, into: &buf) + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobilePlatformPaths_lift(_ buf: RustBuffer) throws -> MobilePlatformPaths { + return try FfiConverterTypeMobilePlatformPaths.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobilePlatformPaths_lower(_ value: MobilePlatformPaths) -> RustBuffer { + return FfiConverterTypeMobilePlatformPaths.lower(value) +} + + public struct MobilePreferences: Equatable, Hashable { public var syncConfigured: Bool public var repositoryTitle: String @@ -5093,6 +6248,214 @@ public func FfiConverterTypeMobileAuthenticationFfiError_lower(_ value: MobileAu +public enum MobileClipboardContent: Equatable, Hashable { + + case text(value: Data + ) + case emptyOrNonText + + + + + +} + +#if compiler(>=6) +extension MobileClipboardContent: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileClipboardContent: FfiConverterRustBuffer { + typealias SwiftType = MobileClipboardContent + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileClipboardContent { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .text(value: try FfiConverterData.read(from: &buf) + ) + + case 2: return .emptyOrNonText + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobileClipboardContent, into buf: inout [UInt8]) { + switch value { + + + case let .text(value): + writeInt(&buf, Int32(1)) + FfiConverterData.write(value, into: &buf) + + + case .emptyOrNonText: + writeInt(&buf, Int32(2)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClipboardContent_lift(_ buf: RustBuffer) throws -> MobileClipboardContent { + return try FfiConverterTypeMobileClipboardContent.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClipboardContent_lower(_ value: MobileClipboardContent) -> RustBuffer { + return FfiConverterTypeMobileClipboardContent.lower(value) +} + + + + +public enum MobileClipboardDisposition: Equatable, Hashable { + + case restoredPrevious + case cleared + case preservedNewer + + + + + +} + +#if compiler(>=6) +extension MobileClipboardDisposition: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileClipboardDisposition: FfiConverterRustBuffer { + typealias SwiftType = MobileClipboardDisposition + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileClipboardDisposition { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .restoredPrevious + + case 2: return .cleared + + case 3: return .preservedNewer + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobileClipboardDisposition, into buf: inout [UInt8]) { + switch value { + + + case .restoredPrevious: + writeInt(&buf, Int32(1)) + + + case .cleared: + writeInt(&buf, Int32(2)) + + + case .preservedNewer: + writeInt(&buf, Int32(3)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClipboardDisposition_lift(_ buf: RustBuffer) throws -> MobileClipboardDisposition { + return try FfiConverterTypeMobileClipboardDisposition.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClipboardDisposition_lower(_ value: MobileClipboardDisposition) -> RustBuffer { + return FfiConverterTypeMobileClipboardDisposition.lower(value) +} + + + + +public enum MobileClipboardWait: Equatable, Hashable { + + case elapsed + case cancelled + + + + + +} + +#if compiler(>=6) +extension MobileClipboardWait: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileClipboardWait: FfiConverterRustBuffer { + typealias SwiftType = MobileClipboardWait + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileClipboardWait { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .elapsed + + case 2: return .cancelled + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobileClipboardWait, into buf: inout [UInt8]) { + switch value { + + + case .elapsed: + writeInt(&buf, Int32(1)) + + + case .cancelled: + writeInt(&buf, Int32(2)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClipboardWait_lift(_ buf: RustBuffer) throws -> MobileClipboardWait { + return try FfiConverterTypeMobileClipboardWait.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileClipboardWait_lower(_ value: MobileClipboardWait) -> RustBuffer { + return FfiConverterTypeMobileClipboardWait.lower(value) +} + + + + public enum MobileEntryEditorFieldKind: Equatable, Hashable { case password @@ -5861,6 +7224,233 @@ public func FfiConverterTypeMobileHomePhase_lower(_ value: MobileHomePhase) -> R +public enum MobileIcon: Equatable, Hashable { + + case home + case key + case search + case timer + case settings + case warning + case branch + case success + case sync + case protected + case repository + case history + case incoming + case outgoing + case recipients + case signature + case file + case merge + case refresh + case folder + case user + case email + case website + case text + case note + + + + + +} + +#if compiler(>=6) +extension MobileIcon: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileIcon: FfiConverterRustBuffer { + typealias SwiftType = MobileIcon + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileIcon { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .home + + case 2: return .key + + case 3: return .search + + case 4: return .timer + + case 5: return .settings + + case 6: return .warning + + case 7: return .branch + + case 8: return .success + + case 9: return .sync + + case 10: return .protected + + case 11: return .repository + + case 12: return .history + + case 13: return .incoming + + case 14: return .outgoing + + case 15: return .recipients + + case 16: return .signature + + case 17: return .file + + case 18: return .merge + + case 19: return .refresh + + case 20: return .folder + + case 21: return .user + + case 22: return .email + + case 23: return .website + + case 24: return .text + + case 25: return .note + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobileIcon, into buf: inout [UInt8]) { + switch value { + + + case .home: + writeInt(&buf, Int32(1)) + + + case .key: + writeInt(&buf, Int32(2)) + + + case .search: + writeInt(&buf, Int32(3)) + + + case .timer: + writeInt(&buf, Int32(4)) + + + case .settings: + writeInt(&buf, Int32(5)) + + + case .warning: + writeInt(&buf, Int32(6)) + + + case .branch: + writeInt(&buf, Int32(7)) + + + case .success: + writeInt(&buf, Int32(8)) + + + case .sync: + writeInt(&buf, Int32(9)) + + + case .protected: + writeInt(&buf, Int32(10)) + + + case .repository: + writeInt(&buf, Int32(11)) + + + case .history: + writeInt(&buf, Int32(12)) + + + case .incoming: + writeInt(&buf, Int32(13)) + + + case .outgoing: + writeInt(&buf, Int32(14)) + + + case .recipients: + writeInt(&buf, Int32(15)) + + + case .signature: + writeInt(&buf, Int32(16)) + + + case .file: + writeInt(&buf, Int32(17)) + + + case .merge: + writeInt(&buf, Int32(18)) + + + case .refresh: + writeInt(&buf, Int32(19)) + + + case .folder: + writeInt(&buf, Int32(20)) + + + case .user: + writeInt(&buf, Int32(21)) + + + case .email: + writeInt(&buf, Int32(22)) + + + case .website: + writeInt(&buf, Int32(23)) + + + case .text: + writeInt(&buf, Int32(24)) + + + case .note: + writeInt(&buf, Int32(25)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileIcon_lift(_ buf: RustBuffer) throws -> MobileIcon { + return try FfiConverterTypeMobileIcon.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileIcon_lower(_ value: MobileIcon) -> RustBuffer { + return FfiConverterTypeMobileIcon.lower(value) +} + + + + public enum MobileKeyTransferErrorKind: Equatable, Hashable { case existingKey @@ -6070,6 +7660,93 @@ public func FfiConverterTypeMobileKeyTransferKind_lower(_ value: MobileKeyTransf +public enum MobileLifecycleEvent: Equatable, Hashable { + + case foreground + case background + case deviceLocked + case userActivity + case cancel + + + + + +} + +#if compiler(>=6) +extension MobileLifecycleEvent: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileLifecycleEvent: FfiConverterRustBuffer { + typealias SwiftType = MobileLifecycleEvent + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileLifecycleEvent { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .foreground + + case 2: return .background + + case 3: return .deviceLocked + + case 4: return .userActivity + + case 5: return .cancel + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobileLifecycleEvent, into buf: inout [UInt8]) { + switch value { + + + case .foreground: + writeInt(&buf, Int32(1)) + + + case .background: + writeInt(&buf, Int32(2)) + + + case .deviceLocked: + writeInt(&buf, Int32(3)) + + + case .userActivity: + writeInt(&buf, Int32(4)) + + + case .cancel: + writeInt(&buf, Int32(5)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileLifecycleEvent_lift(_ buf: RustBuffer) throws -> MobileLifecycleEvent { + return try FfiConverterTypeMobileLifecycleEvent.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileLifecycleEvent_lower(_ value: MobileLifecycleEvent) -> RustBuffer { + return FfiConverterTypeMobileLifecycleEvent.lower(value) +} + + + + public enum MobileMutationAction: Equatable, Hashable { case move @@ -6662,6 +8339,113 @@ public func FfiConverterTypeMobilePasswordRowKind_lower(_ value: MobilePasswordR +public +enum MobilePlatformFfiError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError { + + + + case InvalidPaths + case InvalidCameraFrame + case QrNotFound + case InvalidQrPayload + case InvalidCredentialRequest + case ClipboardFailed + case Cancelled + + + + + + + public var errorDescription: String? { + String(reflecting: self) + } + +} + +#if compiler(>=6) +extension MobilePlatformFfiError: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobilePlatformFfiError: FfiConverterRustBuffer { + typealias SwiftType = MobilePlatformFfiError + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobilePlatformFfiError { + let variant: Int32 = try readInt(&buf) + switch variant { + + + + + case 1: return .InvalidPaths + case 2: return .InvalidCameraFrame + case 3: return .QrNotFound + case 4: return .InvalidQrPayload + case 5: return .InvalidCredentialRequest + case 6: return .ClipboardFailed + case 7: return .Cancelled + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobilePlatformFfiError, into buf: inout [UInt8]) { + switch value { + + + + + + case .InvalidPaths: + writeInt(&buf, Int32(1)) + + + case .InvalidCameraFrame: + writeInt(&buf, Int32(2)) + + + case .QrNotFound: + writeInt(&buf, Int32(3)) + + + case .InvalidQrPayload: + writeInt(&buf, Int32(4)) + + + case .InvalidCredentialRequest: + writeInt(&buf, Int32(5)) + + + case .ClipboardFailed: + writeInt(&buf, Int32(6)) + + + case .Cancelled: + writeInt(&buf, Int32(7)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobilePlatformFfiError_lift(_ buf: RustBuffer) throws -> MobilePlatformFfiError { + return try FfiConverterTypeMobilePlatformFfiError.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobilePlatformFfiError_lower(_ value: MobilePlatformFfiError) -> RustBuffer { + return FfiConverterTypeMobilePlatformFfiError.lower(value) +} + + public enum MobilePreferenceError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError { @@ -6737,6 +8521,275 @@ public func FfiConverterTypeMobilePreferenceError_lower(_ value: MobilePreferenc } +public +enum MobileSecretError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError { + + + + case AlreadyExists + case Missing + case Locked + case Denied + case Cancelled + case Corrupted + case UnsupportedProtection + case Unavailable + + + + + + + public var errorDescription: String? { + String(reflecting: self) + } + +} + +#if compiler(>=6) +extension MobileSecretError: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileSecretError: FfiConverterRustBuffer { + typealias SwiftType = MobileSecretError + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileSecretError { + let variant: Int32 = try readInt(&buf) + switch variant { + + + + + case 1: return .AlreadyExists + case 2: return .Missing + case 3: return .Locked + case 4: return .Denied + case 5: return .Cancelled + case 6: return .Corrupted + case 7: return .UnsupportedProtection + case 8: return .Unavailable + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobileSecretError, into buf: inout [UInt8]) { + switch value { + + + + + + case .AlreadyExists: + writeInt(&buf, Int32(1)) + + + case .Missing: + writeInt(&buf, Int32(2)) + + + case .Locked: + writeInt(&buf, Int32(3)) + + + case .Denied: + writeInt(&buf, Int32(4)) + + + case .Cancelled: + writeInt(&buf, Int32(5)) + + + case .Corrupted: + writeInt(&buf, Int32(6)) + + + case .UnsupportedProtection: + writeInt(&buf, Int32(7)) + + + case .Unavailable: + writeInt(&buf, Int32(8)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileSecretError_lift(_ buf: RustBuffer) throws -> MobileSecretError { + return try FfiConverterTypeMobileSecretError.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileSecretError_lower(_ value: MobileSecretError) -> RustBuffer { + return FfiConverterTypeMobileSecretError.lower(value) +} + + + +public enum MobileSecretLocator: Equatable, Hashable { + + case openPgpPassphrase(fingerprint: String + ) + case httpsGitCredential(serverId: String, applicationId: String + ) + case sshKeyPassphrase(fingerprint: String + ) + + + + + +} + +#if compiler(>=6) +extension MobileSecretLocator: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileSecretLocator: FfiConverterRustBuffer { + typealias SwiftType = MobileSecretLocator + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileSecretLocator { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .openPgpPassphrase(fingerprint: try FfiConverterString.read(from: &buf) + ) + + case 2: return .httpsGitCredential(serverId: try FfiConverterString.read(from: &buf), applicationId: try FfiConverterString.read(from: &buf) + ) + + case 3: return .sshKeyPassphrase(fingerprint: try FfiConverterString.read(from: &buf) + ) + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobileSecretLocator, into buf: inout [UInt8]) { + switch value { + + + case let .openPgpPassphrase(fingerprint): + writeInt(&buf, Int32(1)) + FfiConverterString.write(fingerprint, into: &buf) + + + case let .httpsGitCredential(serverId,applicationId): + writeInt(&buf, Int32(2)) + FfiConverterString.write(serverId, into: &buf) + FfiConverterString.write(applicationId, into: &buf) + + + case let .sshKeyPassphrase(fingerprint): + writeInt(&buf, Int32(3)) + FfiConverterString.write(fingerprint, into: &buf) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileSecretLocator_lift(_ buf: RustBuffer) throws -> MobileSecretLocator { + return try FfiConverterTypeMobileSecretLocator.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileSecretLocator_lower(_ value: MobileSecretLocator) -> RustBuffer { + return FfiConverterTypeMobileSecretLocator.lower(value) +} + + + + +public enum MobileSecretProtection: Equatable, Hashable { + + case deviceUnlocked + case requireUserPresence + case biometryCurrentSet + + + + + +} + +#if compiler(>=6) +extension MobileSecretProtection: Sendable {} +#endif + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public struct FfiConverterTypeMobileSecretProtection: FfiConverterRustBuffer { + typealias SwiftType = MobileSecretProtection + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileSecretProtection { + let variant: Int32 = try readInt(&buf) + switch variant { + + case 1: return .deviceUnlocked + + case 2: return .requireUserPresence + + case 3: return .biometryCurrentSet + + default: throw UniffiInternalError.unexpectedEnumCase + } + } + + public static func write(_ value: MobileSecretProtection, into buf: inout [UInt8]) { + switch value { + + + case .deviceUnlocked: + writeInt(&buf, Int32(1)) + + + case .requireUserPresence: + writeInt(&buf, Int32(2)) + + + case .biometryCurrentSet: + writeInt(&buf, Int32(3)) + + } + } +} + + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileSecretProtection_lift(_ buf: RustBuffer) throws -> MobileSecretProtection { + return try FfiConverterTypeMobileSecretProtection.lift(buf) +} + +#if swift(>=5.8) +@_documentation(visibility: private) +#endif +public func FfiConverterTypeMobileSecretProtection_lower(_ value: MobileSecretProtection) -> RustBuffer { + return FfiConverterTypeMobileSecretProtection.lower(value) +} + + + public enum MobileShellState: Equatable, Hashable { @@ -7816,14 +9869,14 @@ fileprivate struct FfiConverterSequenceTypeMobileTotpRow: FfiConverterRustBuffer public func mobileAuthentication()throws -> MobileAuthentication { return try FfiConverterTypeMobileAuthentication_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_authentication(uniffiCallStatus + uniffi_ironstorage_mobile_fn_func_mobile_authentication(uniffiCallStatus ) }) } public func mobileHomeOperation(authentication: MobileAuthentication?) -> MobileHomeOperation { return try! FfiConverterTypeMobileHomeOperation_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_home_operation( + uniffi_ironstorage_mobile_fn_func_mobile_home_operation( FfiConverterOptionTypeMobileAuthentication.lower(authentication),uniffiCallStatus ) }) @@ -7831,28 +9884,28 @@ public func mobileHomeOperation(authentication: MobileAuthentication?) -> Mobile public func mobileKeyTransfer()throws -> MobileKeyTransfer { return try FfiConverterTypeMobileKeyTransfer_lift(try rustCallWithError(FfiConverterTypeMobileKeyTransferFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_key_transfer(uniffiCallStatus + uniffi_ironstorage_mobile_fn_func_mobile_key_transfer(uniffiCallStatus ) }) } public func mobileLocalKeyTransferImporter() -> MobileKeyTransferImport { return try! FfiConverterTypeMobileKeyTransferImport_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_local_key_transfer_importer(uniffiCallStatus + uniffi_ironstorage_mobile_fn_func_mobile_local_key_transfer_importer(uniffiCallStatus ) }) } public func mobileLocalOnboardingOperation() -> MobileLocalOnboardingOperation { return try! FfiConverterTypeMobileLocalOnboardingOperation_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_local_onboarding_operation(uniffiCallStatus + uniffi_ironstorage_mobile_fn_func_mobile_local_onboarding_operation(uniffiCallStatus ) }) } public func mobileOnboardingOperation(serverUrl: String, account: String, repositoryPath: String, applicationToken: String)throws -> MobileOnboardingOperation { return try FfiConverterTypeMobileOnboardingOperation_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_onboarding_operation( + uniffi_ironstorage_mobile_fn_func_mobile_onboarding_operation( FfiConverterString.lower(serverUrl), FfiConverterString.lower(account), FfiConverterString.lower(repositoryPath), @@ -7863,7 +9916,7 @@ public func mobileOnboardingOperation(serverUrl: String, account: String, reposi public func mobilePasswordPage(path: String?)throws -> MobilePasswordPage { return try FfiConverterTypeMobilePasswordPage_lift(try rustCallWithError(FfiConverterTypeMobilePasswordFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_password_page( + uniffi_ironstorage_mobile_fn_func_mobile_password_page( FfiConverterOptionString.lower(path),uniffiCallStatus ) }) @@ -7871,7 +9924,7 @@ public func mobilePasswordPage(path: String?)throws -> MobilePasswordPage { public func mobilePasswordSearch(query: String)throws -> MobilePasswordPage { return try FfiConverterTypeMobilePasswordPage_lift(try rustCallWithError(FfiConverterTypeMobilePasswordFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_password_search( + uniffi_ironstorage_mobile_fn_func_mobile_password_search( FfiConverterString.lower(query),uniffiCallStatus ) }) @@ -7879,14 +9932,14 @@ public func mobilePasswordSearch(query: String)throws -> MobilePasswordPage { public func mobileShell() -> MobileShell { return try! FfiConverterTypeMobileShell_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_shell(uniffiCallStatus + uniffi_ironstorage_mobile_fn_func_mobile_shell(uniffiCallStatus ) }) } public func mobileShellFixture(state: MobileShellState) -> MobileShell { return try! FfiConverterTypeMobileShell_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_shell_fixture( + uniffi_ironstorage_mobile_fn_func_mobile_shell_fixture( FfiConverterTypeMobileShellState_lower(state),uniffiCallStatus ) }) @@ -7894,20 +9947,20 @@ public func mobileShellFixture(state: MobileShellState) -> MobileShell { public func mobileTotpOperation() -> MobileTotpOperation { return try! FfiConverterTypeMobileTotpOperation_lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_mobile_totp_operation(uniffiCallStatus + uniffi_ironstorage_mobile_fn_func_mobile_totp_operation(uniffiCallStatus ) }) } public func productName() -> String { return try! FfiConverterString.lift(try! rustCall() { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_product_name(uniffiCallStatus + uniffi_ironstorage_mobile_fn_func_product_name(uniffiCallStatus ) }) } public func replaceConfiguredMobileApplicationToken(account: String, applicationToken: String)throws {try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_replace_configured_mobile_application_token( + uniffi_ironstorage_mobile_fn_func_replace_configured_mobile_application_token( FfiConverterString.lower(account), FfiConverterString.lower(applicationToken),uniffiCallStatus ) @@ -7915,11 +9968,54 @@ public func replaceConfiguredMobileApplicationToken(account: String, application } public func setSelectedMobileTab(tab: MobileTab)throws {try rustCallWithError(FfiConverterTypeMobilePreferenceError_lift) { uniffiCallStatus in - uniffi_ironstorage_apple_fn_func_set_selected_mobile_tab( + uniffi_ironstorage_mobile_fn_func_set_selected_mobile_tab( FfiConverterTypeMobileTab_lower(tab),uniffiCallStatus ) } } +public func copyMobileEntry(copy: MobileEntryCopy, clipboard: MobileClipboard)throws -> MobileClipboardDisposition { + return try FfiConverterTypeMobileClipboardDisposition_lift(try rustCallWithError(FfiConverterTypeMobilePlatformFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_func_copy_mobile_entry( + FfiConverterTypeMobileEntryCopy_lower(copy), + FfiConverterTypeMobileClipboard_lower(clipboard),uniffiCallStatus + ) +}) +} +public func decodeMobileCameraFrame(frame: MobileCameraFrame)throws -> Data { + return try FfiConverterData.lift(try rustCallWithError(FfiConverterTypeMobilePlatformFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_func_decode_mobile_camera_frame( + FfiConverterTypeMobileCameraFrame_lower(frame),uniffiCallStatus + ) +}) +} +public func mobileAuthenticationWithPlatform(paths: MobilePlatformPaths, backend: MobileSecretBackend, clock: MobileClock)throws -> MobileAuthentication { + return try FfiConverterTypeMobileAuthentication_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_func_mobile_authentication_with_platform( + FfiConverterTypeMobilePlatformPaths_lower(paths), + FfiConverterTypeMobileSecretBackend_lower(backend), + FfiConverterTypeMobileClock_lower(clock),uniffiCallStatus + ) +}) +} +public func mobilePlatformLayout(paths: MobilePlatformPaths)throws -> MobilePlatformLayout { + return try FfiConverterTypeMobilePlatformLayout_lift(try rustCallWithError(FfiConverterTypeMobilePlatformFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_func_mobile_platform_layout( + FfiConverterTypeMobilePlatformPaths_lower(paths),uniffiCallStatus + ) +}) +} +public func validateMobileCredentialRequest(request: MobileCredentialRequest)throws -> MobileCredentialRequest { + return try FfiConverterTypeMobileCredentialRequest_lift(try rustCallWithError(FfiConverterTypeMobilePlatformFfiError_lift) { + uniffiCallStatus in + uniffi_ironstorage_mobile_fn_func_validate_mobile_credential_request( + FfiConverterTypeMobileCredentialRequest_lower(request),uniffiCallStatus + ) +}) +} private enum InitializationResult { case ok @@ -7932,257 +10028,311 @@ private let initializationResult: InitializationResult = { // Get the bindings contract version from our ComponentInterface let bindings_contract_version = 30 // Get the scaffolding contract version by calling the into the dylib - let scaffolding_contract_version = ffi_ironstorage_apple_uniffi_contract_version() + let scaffolding_contract_version = ffi_ironstorage_mobile_uniffi_contract_version() if bindings_contract_version != scaffolding_contract_version { return InitializationResult.contractVersionMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_authentication() != 38258) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_authentication() != 54684) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_home_operation() != 26980) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_home_operation() != 10726) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_key_transfer() != 57389) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_key_transfer() != 24461) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_local_key_transfer_importer() != 50238) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_local_key_transfer_importer() != 45641) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_local_onboarding_operation() != 18004) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_local_onboarding_operation() != 21270) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_onboarding_operation() != 8354) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_onboarding_operation() != 61078) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_password_page() != 64312) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_password_page() != 35214) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_password_search() != 23429) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_password_search() != 32796) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_shell() != 42687) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_shell() != 1601) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_shell_fixture() != 1649) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_shell_fixture() != 50477) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_mobile_totp_operation() != 22350) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_totp_operation() != 64534) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_product_name() != 43533) { + if (uniffi_ironstorage_mobile_checksum_func_product_name() != 4441) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_replace_configured_mobile_application_token() != 32386) { + if (uniffi_ironstorage_mobile_checksum_func_replace_configured_mobile_application_token() != 21971) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_func_set_selected_mobile_tab() != 65280) { + if (uniffi_ironstorage_mobile_checksum_func_set_selected_mobile_tab() != 23876) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_acknowledge_watch_snapshot() != 12885) { + if (uniffi_ironstorage_mobile_checksum_func_copy_mobile_entry() != 39081) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_add_entry_editor_field() != 58790) { + if (uniffi_ironstorage_mobile_checksum_func_decode_mobile_camera_frame() != 45472) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_add_entry_editor_otp_image() != 41339) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_authentication_with_platform() != 48013) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_begin_create_entry() != 21567) { + if (uniffi_ironstorage_mobile_checksum_func_mobile_platform_layout() != 25741) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_begin_entry_editor() != 63281) { + if (uniffi_ironstorage_mobile_checksum_func_validate_mobile_credential_request() != 60738) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_cached_totp_page() != 36629) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_acknowledge_watch_snapshot() != 21391) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_cancel() != 6512) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_add_entry_editor_field() != 47914) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_copy_entry_field() != 17773) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_add_entry_editor_otp_image() != 54235) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_copy_totp_code() != 8344) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_begin_create_entry() != 47677) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_create_directory() != 25476) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_begin_entry_editor() != 3082) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_discard_entry_editor() != 28195) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_cached_totp_page() != 49580) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_entry_editor() != 65179) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_cancel() != 40449) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_entry_page() != 9073) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_copy_entry_field() != 46283) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_fail_watch_snapshot() != 56313) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_copy_totp_code() != 51013) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_generate_entry_editor_password() != 34289) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_create_directory() != 45979) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_git_identity() != 29496) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_discard_entry_editor() != 59865) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_manual_lock() != 57220) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_entry_editor() != 40530) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_mobile_appearance() != 3564) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_entry_page() != 7262) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_perform_entry_mutation() != 7053) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_fail_watch_snapshot() != 5556) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_preferences() != 16444) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_generate_entry_editor_password() != 13589) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_prepare_entry_mutation() != 6234) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_git_identity() != 35303) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_prepare_watch_snapshot() != 14176) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_manual_lock() != 54277) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_remove_application_token() != 11452) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_mobile_appearance() != 38885) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_remove_entry_editor_field() != 12238) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_perform_entry_mutation() != 36745) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_reorder_entry_editor_field() != 62124) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_preferences() != 16343) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_replace_entry_field() != 15315) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_prepare_entry_mutation() != 24463) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_reveal_entry_field() != 13396) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_prepare_watch_snapshot() != 63315) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_save_entry_editor() != 30971) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_remove_application_token() != 34406) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_search_cached_totp_page() != 13608) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_remove_entry_editor_field() != 27871) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_authentication_timeout() != 48083) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_reorder_entry_editor_field() != 30542) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_biometric_unlock() != 9486) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_replace_entry_field() != 5390) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_git_identity() != 62371) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_reveal_entry_field() != 13272) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_mobile_appearance() != 12133) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_save_entry_editor() != 9869) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_totp_watch_shared() != 57472) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_search_cached_totp_page() != 41925) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_set_watch_snapshot_unavailable() != 49094) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_authentication_timeout() != 28648) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_state() != 60826) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_biometric_unlock() != 30931) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_totp_detail() != 42762) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_git_identity() != 30660) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_totp_page() != 15475) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_mobile_appearance() != 4454) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_touch_user_activity() != 18402) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_totp_watch_shared() != 15677) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_unlock_entry() != 28139) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_watch_snapshot_unavailable() != 56751) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_unlock_totp() != 816) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_state() != 55462) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_update_entry_editor() != 30139) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_totp_detail() != 1912) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_watch_snapshot_status() != 17344) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_totp_page() != 46420) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_cached() != 32436) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_touch_user_activity() != 36477) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_cancel() != 13921) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_unlock_entry() != 6320) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_commit() != 28659) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_unlock_totp() != 3673) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_fetch() != 29855) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_update_entry_editor() != 1037) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_progress() != 4980) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_watch_snapshot_status() != 21716) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_pull() != 9011) { + if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_lifecycle() != 7147) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_push() != 33176) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_cached() != 29336) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_refresh_if_stale() != 27818) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_cancel() != 47907) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilehomeoperation_sync() != 48214) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_commit() != 26020) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilekeytransfer_export() != 50467) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_fetch() != 25832) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilekeytransfer_importer() != 55825) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_progress() != 21317) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilekeytransfer_keys() != 1261) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_pull() != 38293) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilekeytransferimport_add_frame() != 27319) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_push() != 23745) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilekeytransferimport_import() != 44529) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_refresh_if_stale() != 39139) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilelocalonboardingoperation_cancel() != 26455) { + if (uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_sync() != 13675) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobilelocalonboardingoperation_generate() != 58931) { + if (uniffi_ironstorage_mobile_checksum_method_mobilekeytransfer_export() != 52660) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_cancel() != 49755) { + if (uniffi_ironstorage_mobile_checksum_method_mobilekeytransfer_importer() != 12105) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_connect_local_store() != 57886) { + if (uniffi_ironstorage_mobile_checksum_method_mobilekeytransfer_keys() != 3804) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_discover() != 2309) { + if (uniffi_ironstorage_mobile_checksum_method_mobilekeytransferimport_add_frame() != 62030) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_progress() != 28201) { + if (uniffi_ironstorage_mobile_checksum_method_mobilekeytransferimport_import() != 64195) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_setup() != 3525) { + if (uniffi_ironstorage_mobile_checksum_method_mobilelocalonboardingoperation_cancel() != 35729) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobiletotpoperation_cancel() != 30179) { + if (uniffi_ironstorage_mobile_checksum_method_mobilelocalonboardingoperation_generate() != 25292) { return InitializationResult.apiChecksumMismatch } - if (uniffi_ironstorage_apple_checksum_method_mobiletotpoperation_progress() != 54435) { + if (uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_cancel() != 7349) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_connect_local_store() != 14357) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_discover() != 45767) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_progress() != 42063) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_setup() != 27093) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobiletotpoperation_cancel() != 6026) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobiletotpoperation_progress() != 30340) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileclipboard_read() != 47092) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileclipboard_write() != 39923) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileclipboard_clear() != 60674) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileclipboard_wait_for_timeout() != 37177) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobileclock_monotonic_milliseconds() != 57973) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_create() != 58960) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_retrieve() != 14295) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_replace() != 59075) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_delete() != 19766) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_lock() != 22370) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_unlock() != 2737) { return InitializationResult.apiChecksumMismatch } + uniffiCallbackInitMobileClipboard() + uniffiCallbackInitMobileClock() + uniffiCallbackInitMobileSecretBackend() return InitializationResult.ok }() // Make the ensure init function public so that other modules which have external type references to // our types can call it. -public func uniffiEnsureIronstorageAppleInitialized() { +public func uniffiEnsureIronstorageMobileInitialized() { switch initializationResult { case .ok: break @@ -8194,3 +10344,224 @@ public func uniffiEnsureIronstorageAppleInitialized() { } // swiftlint:enable all +// IronStorage diagnostic redaction; wire values and checksums remain generated. +extension MobileAuthenticationFfiError: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileAuthenticationFfiError([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileAuthenticationState: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileAuthenticationState([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileCameraFrame: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileCameraFrame([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileClipboardContent: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileClipboardContent([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileCredentialRequest: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileCredentialRequest([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntryCopy: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntryCopy([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntryEditorField: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntryEditorField([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntryEditorInput: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntryEditorInput([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntryEditorPage: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntryEditorPage([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntryEditorSession: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntryEditorSession([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntryField: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntryField([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntryPage: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntryPage([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntryPresentation: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntryPresentation([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileEntrySection: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileEntrySection([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileGitIdentity: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileGitIdentity([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileHomeAction: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileHomeAction([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileHomeChange: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileHomeChange([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileHomeCommit: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileHomeCommit([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileHomeFfiError: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileHomeFfiError([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileHomeNotice: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileHomeNotice([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileHomePage: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileHomePage([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileHomeProgress: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileHomeProgress([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileHomeSummaryRow: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileHomeSummaryRow([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileKeyTransferExport: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileKeyTransferExport([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileKeyTransferFfiError: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileKeyTransferFfiError([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileKeyTransferFrame: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileKeyTransferFrame([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileKeyTransferKey: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileKeyTransferKey([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileKeyTransferOutcome: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileKeyTransferOutcome([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileKeyTransferProgress: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileKeyTransferProgress([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileMutationDestination: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileMutationDestination([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileMutationOutcome: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileMutationOutcome([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileMutationPlan: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileMutationPlan([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileMutationRequest: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileMutationRequest([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileOnboardingDiscovery: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileOnboardingDiscovery([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileOnboardingFfiError: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileOnboardingFfiError([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileOnboardingOutcome: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileOnboardingOutcome([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileOnboardingProgress: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileOnboardingProgress([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePage: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePage([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePasswordFfiError: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePasswordFfiError([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePasswordPage: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePasswordPage([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePasswordRow: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePasswordRow([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePlatformFfiError: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePlatformFfiError([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePlatformLayout: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePlatformLayout([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePlatformPaths: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePlatformPaths([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePreferenceError: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePreferenceError([REDACTED])" } + public var debugDescription: String { description } +} +extension MobilePreferences: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobilePreferences([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileSecretError: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileSecretError([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileSecretLocator: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileSecretLocator([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileShell: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileShell([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileTotpDetail: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileTotpDetail([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileTotpDiscoveryProgress: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileTotpDiscoveryProgress([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileTotpPage: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileTotpPage([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileTotpRow: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileTotpRow([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileWatchSnapshotStatus: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileWatchSnapshotStatus([REDACTED])" } + public var debugDescription: String { description } +} +extension MobileWatchSnapshotTransfer: CustomStringConvertible, CustomDebugStringConvertible { + public var description: String { "MobileWatchSnapshotTransfer([REDACTED])" } + public var debugDescription: String { description } +} diff --git a/apple/Generated/ironstorage_mobileFFI.h b/apple/Generated/ironstorage_mobileFFI.h new file mode 100644 index 0000000..74ee1b7 --- /dev/null +++ b/apple/Generated/ironstorage_mobileFFI.h @@ -0,0 +1,1812 @@ +// This file was autogenerated by some hot garbage in the `uniffi` crate. +// Trust me, you don't want to mess with it! + +#pragma once + +#include +#include +#include + +// The following structs are used to implement the lowest level +// of the FFI, and thus useful to multiple uniffied crates. +// We ensure they are declared exactly once, with a header guard, UNIFFI_SHARED_H. +#ifdef UNIFFI_SHARED_H + // We also try to prevent mixing versions of shared uniffi header structs. + // If you add anything to the #else block, you must increment the version suffix in UNIFFI_SHARED_HEADER_V4 + #ifndef UNIFFI_SHARED_HEADER_V4 + #error Combining helper code from multiple versions of uniffi is not supported + #endif // ndef UNIFFI_SHARED_HEADER_V4 +#else +#define UNIFFI_SHARED_H +#define UNIFFI_SHARED_HEADER_V4 +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ + +typedef struct RustBuffer +{ + uint64_t capacity; + uint64_t len; + uint8_t *_Nullable data; +} RustBuffer; + +typedef struct ForeignBytes +{ + int32_t len; + const uint8_t *_Nullable data; +} ForeignBytes; + +// Error definitions +typedef struct RustCallStatus { + int8_t code; + RustBuffer errorBuf; +} RustCallStatus; + +// ⚠️ Attention: If you change this #else block (ending in `#endif // def UNIFFI_SHARED_H`) you *must* ⚠️ +// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ +#endif // def UNIFFI_SHARED_H +#ifndef UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +#define UNIFFI_FFIDEF_RUST_FUTURE_CONTINUATION_CALLBACK +typedef void (*UniffiRustFutureContinuationCallback)(uint64_t, int8_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK +typedef void (*UniffiForeignFutureDroppedCallback)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_FREE +typedef void (*UniffiCallbackInterfaceFree)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLONE +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_CLONE +typedef uint64_t (*UniffiCallbackInterfaceClone)(uint64_t + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK_STRUCT +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_DROPPED_CALLBACK_STRUCT +typedef struct UniffiForeignFutureDroppedCallbackStruct { + uint64_t handle; + UniffiForeignFutureDroppedCallback _Nonnull free; +} UniffiForeignFutureDroppedCallbackStruct; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U8 +typedef struct UniffiForeignFutureResultU8 { + uint8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U8 +typedef void (*UniffiForeignFutureCompleteU8)(uint64_t, UniffiForeignFutureResultU8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I8 +typedef struct UniffiForeignFutureResultI8 { + int8_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI8; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I8 +typedef void (*UniffiForeignFutureCompleteI8)(uint64_t, UniffiForeignFutureResultI8 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U16 +typedef struct UniffiForeignFutureResultU16 { + uint16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U16 +typedef void (*UniffiForeignFutureCompleteU16)(uint64_t, UniffiForeignFutureResultU16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I16 +typedef struct UniffiForeignFutureResultI16 { + int16_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI16; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I16 +typedef void (*UniffiForeignFutureCompleteI16)(uint64_t, UniffiForeignFutureResultI16 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U32 +typedef struct UniffiForeignFutureResultU32 { + uint32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U32 +typedef void (*UniffiForeignFutureCompleteU32)(uint64_t, UniffiForeignFutureResultU32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I32 +typedef struct UniffiForeignFutureResultI32 { + int32_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I32 +typedef void (*UniffiForeignFutureCompleteI32)(uint64_t, UniffiForeignFutureResultI32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_U64 +typedef struct UniffiForeignFutureResultU64 { + uint64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultU64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_U64 +typedef void (*UniffiForeignFutureCompleteU64)(uint64_t, UniffiForeignFutureResultU64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_I64 +typedef struct UniffiForeignFutureResultI64 { + int64_t returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultI64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_I64 +typedef void (*UniffiForeignFutureCompleteI64)(uint64_t, UniffiForeignFutureResultI64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F32 +typedef struct UniffiForeignFutureResultF32 { + float returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultF32; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F32 +typedef void (*UniffiForeignFutureCompleteF32)(uint64_t, UniffiForeignFutureResultF32 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_F64 +typedef struct UniffiForeignFutureResultF64 { + double returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultF64; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_F64 +typedef void (*UniffiForeignFutureCompleteF64)(uint64_t, UniffiForeignFutureResultF64 + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_RUST_BUFFER +typedef struct UniffiForeignFutureResultRustBuffer { + RustBuffer returnValue; + RustCallStatus callStatus; +} UniffiForeignFutureResultRustBuffer; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER +typedef void (*UniffiForeignFutureCompleteRustBuffer)(uint64_t, UniffiForeignFutureResultRustBuffer + ); + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_RESULT_VOID +typedef struct UniffiForeignFutureResultVoid { + RustCallStatus callStatus; +} UniffiForeignFutureResultVoid; + +#endif +#ifndef UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FOREIGN_FUTURE_COMPLETE_VOID +typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureResultVoid + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLIPBOARD_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLIPBOARD_METHOD0 +typedef void (*UniffiCallbackInterfaceMobileClipboardMethod0)(uint64_t, RustBuffer* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLIPBOARD_METHOD1 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLIPBOARD_METHOD1 +typedef void (*UniffiCallbackInterfaceMobileClipboardMethod1)(uint64_t, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLIPBOARD_METHOD2 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLIPBOARD_METHOD2 +typedef void (*UniffiCallbackInterfaceMobileClipboardMethod2)(uint64_t, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLIPBOARD_METHOD3 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLIPBOARD_METHOD3 +typedef void (*UniffiCallbackInterfaceMobileClipboardMethod3)(uint64_t, uint64_t, RustBuffer* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLOCK_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_CLOCK_METHOD0 +typedef void (*UniffiCallbackInterfaceMobileClockMethod0)(uint64_t, uint64_t* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD0 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD0 +typedef void (*UniffiCallbackInterfaceMobileSecretBackendMethod0)(uint64_t, RustBuffer, RustBuffer, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD1 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD1 +typedef void (*UniffiCallbackInterfaceMobileSecretBackendMethod1)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD2 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD2 +typedef void (*UniffiCallbackInterfaceMobileSecretBackendMethod2)(uint64_t, RustBuffer, RustBuffer, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD3 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD3 +typedef void (*UniffiCallbackInterfaceMobileSecretBackendMethod3)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD4 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD4 +typedef void (*UniffiCallbackInterfaceMobileSecretBackendMethod4)(uint64_t, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD5 +#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND_METHOD5 +typedef void (*UniffiCallbackInterfaceMobileSecretBackendMethod5)(uint64_t, void* _Nonnull, + RustCallStatus *_Nonnull uniffiCallStatus + ); + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_MOBILE_CLIPBOARD +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_MOBILE_CLIPBOARD +typedef struct UniffiVTableCallbackInterfaceMobileClipboard { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceMobileClipboardMethod0 _Nonnull read; + UniffiCallbackInterfaceMobileClipboardMethod1 _Nonnull write; + UniffiCallbackInterfaceMobileClipboardMethod2 _Nonnull clear; + UniffiCallbackInterfaceMobileClipboardMethod3 _Nonnull waitForTimeout; +} UniffiVTableCallbackInterfaceMobileClipboard; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_MOBILE_CLOCK +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_MOBILE_CLOCK +typedef struct UniffiVTableCallbackInterfaceMobileClock { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceMobileClockMethod0 _Nonnull monotonicMilliseconds; +} UniffiVTableCallbackInterfaceMobileClock; + +#endif +#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND +#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_MOBILE_SECRET_BACKEND +typedef struct UniffiVTableCallbackInterfaceMobileSecretBackend { + UniffiCallbackInterfaceFree _Nonnull uniffiFree; + UniffiCallbackInterfaceClone _Nonnull uniffiClone; + UniffiCallbackInterfaceMobileSecretBackendMethod0 _Nonnull create; + UniffiCallbackInterfaceMobileSecretBackendMethod1 _Nonnull retrieve; + UniffiCallbackInterfaceMobileSecretBackendMethod2 _Nonnull replace; + UniffiCallbackInterfaceMobileSecretBackendMethod3 _Nonnull delete; + UniffiCallbackInterfaceMobileSecretBackendMethod4 _Nonnull lock; + UniffiCallbackInterfaceMobileSecretBackendMethod5 _Nonnull unlock; +} UniffiVTableCallbackInterfaceMobileSecretBackend; + +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEAUTHENTICATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEAUTHENTICATION +uint64_t uniffi_ironstorage_mobile_fn_clone_mobileauthentication(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEAUTHENTICATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEAUTHENTICATION +void uniffi_ironstorage_mobile_fn_free_mobileauthentication(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ACKNOWLEDGE_WATCH_SNAPSHOT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ACKNOWLEDGE_WATCH_SNAPSHOT +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_acknowledge_watch_snapshot(uint64_t ptr, RustBuffer receipt, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_FIELD +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_add_entry_editor_field(uint64_t ptr, uint64_t editor, RustBuffer kind, RustBuffer name, RustBuffer value, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_OTP_IMAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_OTP_IMAGE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_add_entry_editor_otp_image(uint64_t ptr, uint64_t editor, RustBuffer image, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_BEGIN_CREATE_ENTRY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_BEGIN_CREATE_ENTRY +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_begin_create_entry(uint64_t ptr, RustBuffer directory, RustBuffer name, RustBuffer passphrase, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_BEGIN_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_BEGIN_ENTRY_EDITOR +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_begin_entry_editor(uint64_t ptr, RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_CACHED_TOTP_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_CACHED_TOTP_PAGE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_cached_totp_page(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_CANCEL +void uniffi_ironstorage_mobile_fn_method_mobileauthentication_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_COPY_ENTRY_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_COPY_ENTRY_FIELD +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_copy_entry_field(uint64_t ptr, RustBuffer path, uint64_t field, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_COPY_TOTP_CODE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_COPY_TOTP_CODE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_copy_totp_code(uint64_t ptr, RustBuffer path, uint64_t unix_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_CREATE_DIRECTORY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_CREATE_DIRECTORY +void uniffi_ironstorage_mobile_fn_method_mobileauthentication_create_directory(uint64_t ptr, RustBuffer parent, RustBuffer name, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_DISCARD_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_DISCARD_ENTRY_EDITOR +void uniffi_ironstorage_mobile_fn_method_mobileauthentication_discard_entry_editor(uint64_t ptr, uint64_t editor, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ENTRY_EDITOR +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_entry_editor(uint64_t ptr, uint64_t editor, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ENTRY_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_ENTRY_PAGE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_entry_page(uint64_t ptr, RustBuffer path, uint64_t unix_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_FAIL_WATCH_SNAPSHOT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_FAIL_WATCH_SNAPSHOT +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_fail_watch_snapshot(uint64_t ptr, uint64_t revision, RustBuffer detail, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_GENERATE_ENTRY_EDITOR_PASSWORD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_GENERATE_ENTRY_EDITOR_PASSWORD +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_generate_entry_editor_password(uint64_t ptr, uint64_t editor, RustBuffer length, int8_t no_symbols, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_GIT_IDENTITY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_GIT_IDENTITY +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_git_identity(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK +void uniffi_ironstorage_mobile_fn_method_mobileauthentication_manual_lock(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_MOBILE_APPEARANCE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_MOBILE_APPEARANCE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_mobile_appearance(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_perform_entry_mutation(uint64_t ptr, RustBuffer request, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_PREFERENCES +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_PREFERENCES +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_preferences(uint64_t ptr, int8_t watch_supported, int8_t watch_paired, int8_t watch_app_installed, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_prepare_entry_mutation(uint64_t ptr, RustBuffer path, RustBuffer action, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_WATCH_SNAPSHOT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_WATCH_SNAPSHOT +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_prepare_watch_snapshot(uint64_t ptr, RustBuffer platform_pairing_identity, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_APPLICATION_TOKEN +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_APPLICATION_TOKEN +void uniffi_ironstorage_mobile_fn_method_mobileauthentication_remove_application_token(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_remove_entry_editor_field(uint64_t ptr, uint64_t editor, uint64_t field, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REORDER_ENTRY_EDITOR_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REORDER_ENTRY_EDITOR_FIELD +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_reorder_entry_editor_field(uint64_t ptr, uint64_t editor, uint64_t field, uint32_t index, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REPLACE_ENTRY_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REPLACE_ENTRY_FIELD +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_replace_entry_field(uint64_t ptr, RustBuffer path, uint64_t field, RustBuffer value, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REVEAL_ENTRY_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_REVEAL_ENTRY_FIELD +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_reveal_entry_field(uint64_t ptr, RustBuffer path, uint64_t field, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SAVE_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SAVE_ENTRY_EDITOR +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_save_entry_editor(uint64_t ptr, uint64_t editor, RustBuffer fields, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SEARCH_CACHED_TOTP_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SEARCH_CACHED_TOTP_PAGE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_search_cached_totp_page(uint64_t ptr, RustBuffer query, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_AUTHENTICATION_TIMEOUT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_AUTHENTICATION_TIMEOUT +void uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_authentication_timeout(uint64_t ptr, uint64_t seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_BIOMETRIC_UNLOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_BIOMETRIC_UNLOCK +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_biometric_unlock(uint64_t ptr, int8_t enabled, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_GIT_IDENTITY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_GIT_IDENTITY +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_git_identity(uint64_t ptr, RustBuffer name, RustBuffer email, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_MOBILE_APPEARANCE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_MOBILE_APPEARANCE +void uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_mobile_appearance(uint64_t ptr, RustBuffer appearance, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_TOTP_WATCH_SHARED +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_TOTP_WATCH_SHARED +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_totp_watch_shared(uint64_t ptr, RustBuffer path, int8_t shared, uint64_t unix_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_WATCH_SNAPSHOT_UNAVAILABLE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_SET_WATCH_SNAPSHOT_UNAVAILABLE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_set_watch_snapshot_unavailable(uint64_t ptr, int8_t unpaired, RustBuffer detail, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_STATE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_STATE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_state(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_TOTP_DETAIL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_TOTP_DETAIL +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_totp_detail(uint64_t ptr, RustBuffer path, uint64_t unix_seconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_TOTP_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_TOTP_PAGE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_totp_page(uint64_t ptr, uint64_t operation, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_TOUCH_USER_ACTIVITY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_TOUCH_USER_ACTIVITY +void uniffi_ironstorage_mobile_fn_method_mobileauthentication_touch_user_activity(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_UNLOCK_ENTRY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_UNLOCK_ENTRY +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_unlock_entry(uint64_t ptr, RustBuffer path, RustBuffer passphrase, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_UNLOCK_TOTP +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_UNLOCK_TOTP +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_unlock_totp(uint64_t ptr, RustBuffer passphrase, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_UPDATE_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_UPDATE_ENTRY_EDITOR +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_update_entry_editor(uint64_t ptr, uint64_t editor, RustBuffer fields, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_WATCH_SNAPSHOT_STATUS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_WATCH_SNAPSHOT_STATUS +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_watch_snapshot_status(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_LIFECYCLE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEAUTHENTICATION_LIFECYCLE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileauthentication_lifecycle(uint64_t ptr, RustBuffer event, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEHOMEOPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEHOMEOPERATION +uint64_t uniffi_ironstorage_mobile_fn_clone_mobilehomeoperation(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEHOMEOPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEHOMEOPERATION +void uniffi_ironstorage_mobile_fn_free_mobilehomeoperation(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_CACHED +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_CACHED +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_cached(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_CANCEL +void uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_COMMIT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_COMMIT +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_commit(uint64_t ptr, RustBuffer message, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_FETCH +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_FETCH +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_fetch(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_PROGRESS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_PROGRESS +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_progress(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_PULL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_PULL +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_pull(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_PUSH +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_PUSH +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_push(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_REFRESH_IF_STALE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_REFRESH_IF_STALE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_refresh_if_stale(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_SYNC +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEHOMEOPERATION_SYNC +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilehomeoperation_sync(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEKEYTRANSFER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEKEYTRANSFER +uint64_t uniffi_ironstorage_mobile_fn_clone_mobilekeytransfer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEKEYTRANSFER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEKEYTRANSFER +void uniffi_ironstorage_mobile_fn_free_mobilekeytransfer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFER_EXPORT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFER_EXPORT +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilekeytransfer_export(uint64_t ptr, RustBuffer fingerprint, RustBuffer kind, RustBuffer passphrase, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFER_IMPORTER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFER_IMPORTER +uint64_t uniffi_ironstorage_mobile_fn_method_mobilekeytransfer_importer(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFER_KEYS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFER_KEYS +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilekeytransfer_keys(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEKEYTRANSFERIMPORT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEKEYTRANSFERIMPORT +uint64_t uniffi_ironstorage_mobile_fn_clone_mobilekeytransferimport(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEKEYTRANSFERIMPORT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEKEYTRANSFERIMPORT +void uniffi_ironstorage_mobile_fn_free_mobilekeytransferimport(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFERIMPORT_ADD_FRAME +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFERIMPORT_ADD_FRAME +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilekeytransferimport_add_frame(uint64_t ptr, RustBuffer payload, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFERIMPORT_IMPORT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEKEYTRANSFERIMPORT_IMPORT +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilekeytransferimport_import(uint64_t ptr, RustBuffer passphrase, int8_t make_default, int8_t overwrite, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILELOCALONBOARDINGOPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILELOCALONBOARDINGOPERATION +uint64_t uniffi_ironstorage_mobile_fn_clone_mobilelocalonboardingoperation(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILELOCALONBOARDINGOPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILELOCALONBOARDINGOPERATION +void uniffi_ironstorage_mobile_fn_free_mobilelocalonboardingoperation(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILELOCALONBOARDINGOPERATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILELOCALONBOARDINGOPERATION_CANCEL +void uniffi_ironstorage_mobile_fn_method_mobilelocalonboardingoperation_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILELOCALONBOARDINGOPERATION_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILELOCALONBOARDINGOPERATION_GENERATE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilelocalonboardingoperation_generate(uint64_t ptr, RustBuffer user_id, RustBuffer passphrase, int8_t replace_existing_key, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEONBOARDINGOPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILEONBOARDINGOPERATION +uint64_t uniffi_ironstorage_mobile_fn_clone_mobileonboardingoperation(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEONBOARDINGOPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILEONBOARDINGOPERATION +void uniffi_ironstorage_mobile_fn_free_mobileonboardingoperation(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_CANCEL +void uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_CONNECT_LOCAL_STORE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_CONNECT_LOCAL_STORE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_connect_local_store(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_DISCOVER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_DISCOVER +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_discover(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_PROGRESS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_PROGRESS +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_progress(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_SETUP +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILEONBOARDINGOPERATION_SETUP +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileonboardingoperation_setup(uint64_t ptr, RustBuffer branch, int8_t use_existing, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILETOTPOPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILETOTPOPERATION +uint64_t uniffi_ironstorage_mobile_fn_clone_mobiletotpoperation(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILETOTPOPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILETOTPOPERATION +void uniffi_ironstorage_mobile_fn_free_mobiletotpoperation(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILETOTPOPERATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILETOTPOPERATION_CANCEL +void uniffi_ironstorage_mobile_fn_method_mobiletotpoperation_cancel(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILETOTPOPERATION_PROGRESS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILETOTPOPERATION_PROGRESS +RustBuffer uniffi_ironstorage_mobile_fn_method_mobiletotpoperation_progress(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILECLIPBOARD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILECLIPBOARD +uint64_t uniffi_ironstorage_mobile_fn_clone_mobileclipboard(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILECLIPBOARD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILECLIPBOARD +void uniffi_ironstorage_mobile_fn_free_mobileclipboard(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_INIT_CALLBACK_VTABLE_MOBILECLIPBOARD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_INIT_CALLBACK_VTABLE_MOBILECLIPBOARD +void uniffi_ironstorage_mobile_fn_init_callback_vtable_mobileclipboard(const UniffiVTableCallbackInterfaceMobileClipboard* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLIPBOARD_READ +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLIPBOARD_READ +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileclipboard_read(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLIPBOARD_WRITE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLIPBOARD_WRITE +void uniffi_ironstorage_mobile_fn_method_mobileclipboard_write(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLIPBOARD_CLEAR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLIPBOARD_CLEAR +void uniffi_ironstorage_mobile_fn_method_mobileclipboard_clear(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLIPBOARD_WAIT_FOR_TIMEOUT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLIPBOARD_WAIT_FOR_TIMEOUT +RustBuffer uniffi_ironstorage_mobile_fn_method_mobileclipboard_wait_for_timeout(uint64_t ptr, uint64_t milliseconds, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILECLOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILECLOCK +uint64_t uniffi_ironstorage_mobile_fn_clone_mobileclock(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILECLOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILECLOCK +void uniffi_ironstorage_mobile_fn_free_mobileclock(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_INIT_CALLBACK_VTABLE_MOBILECLOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_INIT_CALLBACK_VTABLE_MOBILECLOCK +void uniffi_ironstorage_mobile_fn_init_callback_vtable_mobileclock(const UniffiVTableCallbackInterfaceMobileClock* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLOCK_MONOTONIC_MILLISECONDS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILECLOCK_MONOTONIC_MILLISECONDS +uint64_t uniffi_ironstorage_mobile_fn_method_mobileclock_monotonic_milliseconds(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILESECRETBACKEND +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_CLONE_MOBILESECRETBACKEND +uint64_t uniffi_ironstorage_mobile_fn_clone_mobilesecretbackend(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILESECRETBACKEND +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FREE_MOBILESECRETBACKEND +void uniffi_ironstorage_mobile_fn_free_mobilesecretbackend(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_INIT_CALLBACK_VTABLE_MOBILESECRETBACKEND +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_INIT_CALLBACK_VTABLE_MOBILESECRETBACKEND +void uniffi_ironstorage_mobile_fn_init_callback_vtable_mobilesecretbackend(const UniffiVTableCallbackInterfaceMobileSecretBackend* _Nonnull vtable +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_CREATE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_CREATE +void uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_create(uint64_t ptr, RustBuffer locator, RustBuffer protection, RustBuffer value, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_RETRIEVE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_RETRIEVE +RustBuffer uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_retrieve(uint64_t ptr, RustBuffer locator, RustBuffer protection, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_REPLACE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_REPLACE +void uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_replace(uint64_t ptr, RustBuffer locator, RustBuffer protection, RustBuffer value, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_DELETE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_DELETE +void uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_delete(uint64_t ptr, RustBuffer locator, RustBuffer protection, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_LOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_LOCK +void uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_lock(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_UNLOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_METHOD_MOBILESECRETBACKEND_UNLOCK +void uniffi_ironstorage_mobile_fn_method_mobilesecretbackend_unlock(uint64_t ptr, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_AUTHENTICATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_AUTHENTICATION +uint64_t uniffi_ironstorage_mobile_fn_func_mobile_authentication(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_HOME_OPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_HOME_OPERATION +uint64_t uniffi_ironstorage_mobile_fn_func_mobile_home_operation(RustBuffer authentication, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_KEY_TRANSFER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_KEY_TRANSFER +uint64_t uniffi_ironstorage_mobile_fn_func_mobile_key_transfer(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_LOCAL_KEY_TRANSFER_IMPORTER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_LOCAL_KEY_TRANSFER_IMPORTER +uint64_t uniffi_ironstorage_mobile_fn_func_mobile_local_key_transfer_importer(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_LOCAL_ONBOARDING_OPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_LOCAL_ONBOARDING_OPERATION +uint64_t uniffi_ironstorage_mobile_fn_func_mobile_local_onboarding_operation(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_ONBOARDING_OPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_ONBOARDING_OPERATION +uint64_t uniffi_ironstorage_mobile_fn_func_mobile_onboarding_operation(RustBuffer server_url, RustBuffer account, RustBuffer repository_path, RustBuffer application_token, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_PASSWORD_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_PASSWORD_PAGE +RustBuffer uniffi_ironstorage_mobile_fn_func_mobile_password_page(RustBuffer path, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_PASSWORD_SEARCH +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_PASSWORD_SEARCH +RustBuffer uniffi_ironstorage_mobile_fn_func_mobile_password_search(RustBuffer query, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_SHELL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_SHELL +RustBuffer uniffi_ironstorage_mobile_fn_func_mobile_shell(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_SHELL_FIXTURE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_SHELL_FIXTURE +RustBuffer uniffi_ironstorage_mobile_fn_func_mobile_shell_fixture(RustBuffer state, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_TOTP_OPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_TOTP_OPERATION +uint64_t uniffi_ironstorage_mobile_fn_func_mobile_totp_operation(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_PRODUCT_NAME +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_PRODUCT_NAME +RustBuffer uniffi_ironstorage_mobile_fn_func_product_name(RustCallStatus *_Nonnull out_status + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_REPLACE_CONFIGURED_MOBILE_APPLICATION_TOKEN +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_REPLACE_CONFIGURED_MOBILE_APPLICATION_TOKEN +void uniffi_ironstorage_mobile_fn_func_replace_configured_mobile_application_token(RustBuffer account, RustBuffer application_token, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_SET_SELECTED_MOBILE_TAB +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_SET_SELECTED_MOBILE_TAB +void uniffi_ironstorage_mobile_fn_func_set_selected_mobile_tab(RustBuffer tab, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_COPY_MOBILE_ENTRY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_COPY_MOBILE_ENTRY +RustBuffer uniffi_ironstorage_mobile_fn_func_copy_mobile_entry(RustBuffer copy, uint64_t clipboard, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_DECODE_MOBILE_CAMERA_FRAME +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_DECODE_MOBILE_CAMERA_FRAME +RustBuffer uniffi_ironstorage_mobile_fn_func_decode_mobile_camera_frame(RustBuffer frame, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_AUTHENTICATION_WITH_PLATFORM +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_AUTHENTICATION_WITH_PLATFORM +uint64_t uniffi_ironstorage_mobile_fn_func_mobile_authentication_with_platform(RustBuffer paths, uint64_t backend, uint64_t clock, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_PLATFORM_LAYOUT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_MOBILE_PLATFORM_LAYOUT +RustBuffer uniffi_ironstorage_mobile_fn_func_mobile_platform_layout(RustBuffer paths, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_VALIDATE_MOBILE_CREDENTIAL_REQUEST +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_FN_FUNC_VALIDATE_MOBILE_CREDENTIAL_REQUEST +RustBuffer uniffi_ironstorage_mobile_fn_func_validate_mobile_credential_request(RustBuffer request, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUSTBUFFER_ALLOC +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUSTBUFFER_ALLOC +RustBuffer ffi_ironstorage_mobile_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUSTBUFFER_FROM_BYTES +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUSTBUFFER_FROM_BYTES +RustBuffer ffi_ironstorage_mobile_rustbuffer_from_bytes(ForeignBytes bytes, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUSTBUFFER_FREE +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUSTBUFFER_FREE +void ffi_ironstorage_mobile_rustbuffer_free(RustBuffer buf, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUSTBUFFER_RESERVE +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUSTBUFFER_RESERVE +RustBuffer ffi_ironstorage_mobile_rustbuffer_reserve(RustBuffer buf, uint64_t additional, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_U8 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_U8 +void ffi_ironstorage_mobile_rust_future_poll_u8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_U8 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_U8 +void ffi_ironstorage_mobile_rust_future_cancel_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_U8 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_U8 +void ffi_ironstorage_mobile_rust_future_free_u8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_U8 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_U8 +uint8_t ffi_ironstorage_mobile_rust_future_complete_u8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_I8 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_I8 +void ffi_ironstorage_mobile_rust_future_poll_i8(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_I8 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_I8 +void ffi_ironstorage_mobile_rust_future_cancel_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_I8 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_I8 +void ffi_ironstorage_mobile_rust_future_free_i8(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_I8 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_I8 +int8_t ffi_ironstorage_mobile_rust_future_complete_i8(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_U16 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_U16 +void ffi_ironstorage_mobile_rust_future_poll_u16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_U16 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_U16 +void ffi_ironstorage_mobile_rust_future_cancel_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_U16 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_U16 +void ffi_ironstorage_mobile_rust_future_free_u16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_U16 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_U16 +uint16_t ffi_ironstorage_mobile_rust_future_complete_u16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_I16 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_I16 +void ffi_ironstorage_mobile_rust_future_poll_i16(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_I16 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_I16 +void ffi_ironstorage_mobile_rust_future_cancel_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_I16 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_I16 +void ffi_ironstorage_mobile_rust_future_free_i16(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_I16 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_I16 +int16_t ffi_ironstorage_mobile_rust_future_complete_i16(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_U32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_U32 +void ffi_ironstorage_mobile_rust_future_poll_u32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_U32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_U32 +void ffi_ironstorage_mobile_rust_future_cancel_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_U32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_U32 +void ffi_ironstorage_mobile_rust_future_free_u32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_U32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_U32 +uint32_t ffi_ironstorage_mobile_rust_future_complete_u32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_I32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_I32 +void ffi_ironstorage_mobile_rust_future_poll_i32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_I32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_I32 +void ffi_ironstorage_mobile_rust_future_cancel_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_I32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_I32 +void ffi_ironstorage_mobile_rust_future_free_i32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_I32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_I32 +int32_t ffi_ironstorage_mobile_rust_future_complete_i32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_U64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_U64 +void ffi_ironstorage_mobile_rust_future_poll_u64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_U64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_U64 +void ffi_ironstorage_mobile_rust_future_cancel_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_U64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_U64 +void ffi_ironstorage_mobile_rust_future_free_u64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_U64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_U64 +uint64_t ffi_ironstorage_mobile_rust_future_complete_u64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_I64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_I64 +void ffi_ironstorage_mobile_rust_future_poll_i64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_I64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_I64 +void ffi_ironstorage_mobile_rust_future_cancel_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_I64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_I64 +void ffi_ironstorage_mobile_rust_future_free_i64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_I64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_I64 +int64_t ffi_ironstorage_mobile_rust_future_complete_i64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_F32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_F32 +void ffi_ironstorage_mobile_rust_future_poll_f32(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_F32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_F32 +void ffi_ironstorage_mobile_rust_future_cancel_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_F32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_F32 +void ffi_ironstorage_mobile_rust_future_free_f32(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_F32 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_F32 +float ffi_ironstorage_mobile_rust_future_complete_f32(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_F64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_F64 +void ffi_ironstorage_mobile_rust_future_poll_f64(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_F64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_F64 +void ffi_ironstorage_mobile_rust_future_cancel_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_F64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_F64 +void ffi_ironstorage_mobile_rust_future_free_f64(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_F64 +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_F64 +double ffi_ironstorage_mobile_rust_future_complete_f64(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_RUST_BUFFER +void ffi_ironstorage_mobile_rust_future_poll_rust_buffer(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_RUST_BUFFER +void ffi_ironstorage_mobile_rust_future_cancel_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_RUST_BUFFER +void ffi_ironstorage_mobile_rust_future_free_rust_buffer(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_RUST_BUFFER +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_RUST_BUFFER +RustBuffer ffi_ironstorage_mobile_rust_future_complete_rust_buffer(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_VOID +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_POLL_VOID +void ffi_ironstorage_mobile_rust_future_poll_void(uint64_t handle, UniffiRustFutureContinuationCallback _Nonnull callback, uint64_t callback_data +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_VOID +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_CANCEL_VOID +void ffi_ironstorage_mobile_rust_future_cancel_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_VOID +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_FREE_VOID +void ffi_ironstorage_mobile_rust_future_free_void(uint64_t handle +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_VOID +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_RUST_FUTURE_COMPLETE_VOID +void ffi_ironstorage_mobile_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_AUTHENTICATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_AUTHENTICATION +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_authentication(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_HOME_OPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_HOME_OPERATION +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_home_operation(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_KEY_TRANSFER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_KEY_TRANSFER +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_key_transfer(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_LOCAL_KEY_TRANSFER_IMPORTER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_LOCAL_KEY_TRANSFER_IMPORTER +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_local_key_transfer_importer(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_LOCAL_ONBOARDING_OPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_LOCAL_ONBOARDING_OPERATION +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_local_onboarding_operation(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_ONBOARDING_OPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_ONBOARDING_OPERATION +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_onboarding_operation(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_PASSWORD_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_PASSWORD_PAGE +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_password_page(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_PASSWORD_SEARCH +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_PASSWORD_SEARCH +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_password_search(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_SHELL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_SHELL +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_shell(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_SHELL_FIXTURE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_SHELL_FIXTURE +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_shell_fixture(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_TOTP_OPERATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_TOTP_OPERATION +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_totp_operation(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_PRODUCT_NAME +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_PRODUCT_NAME +uint16_t uniffi_ironstorage_mobile_checksum_func_product_name(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_REPLACE_CONFIGURED_MOBILE_APPLICATION_TOKEN +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_REPLACE_CONFIGURED_MOBILE_APPLICATION_TOKEN +uint16_t uniffi_ironstorage_mobile_checksum_func_replace_configured_mobile_application_token(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_SET_SELECTED_MOBILE_TAB +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_SET_SELECTED_MOBILE_TAB +uint16_t uniffi_ironstorage_mobile_checksum_func_set_selected_mobile_tab(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_COPY_MOBILE_ENTRY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_COPY_MOBILE_ENTRY +uint16_t uniffi_ironstorage_mobile_checksum_func_copy_mobile_entry(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_DECODE_MOBILE_CAMERA_FRAME +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_DECODE_MOBILE_CAMERA_FRAME +uint16_t uniffi_ironstorage_mobile_checksum_func_decode_mobile_camera_frame(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_AUTHENTICATION_WITH_PLATFORM +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_AUTHENTICATION_WITH_PLATFORM +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_authentication_with_platform(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_PLATFORM_LAYOUT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_MOBILE_PLATFORM_LAYOUT +uint16_t uniffi_ironstorage_mobile_checksum_func_mobile_platform_layout(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_VALIDATE_MOBILE_CREDENTIAL_REQUEST +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_FUNC_VALIDATE_MOBILE_CREDENTIAL_REQUEST +uint16_t uniffi_ironstorage_mobile_checksum_func_validate_mobile_credential_request(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ACKNOWLEDGE_WATCH_SNAPSHOT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ACKNOWLEDGE_WATCH_SNAPSHOT +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_acknowledge_watch_snapshot(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_FIELD +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_add_entry_editor_field(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_OTP_IMAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ADD_ENTRY_EDITOR_OTP_IMAGE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_add_entry_editor_otp_image(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_BEGIN_CREATE_ENTRY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_BEGIN_CREATE_ENTRY +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_begin_create_entry(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_BEGIN_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_BEGIN_ENTRY_EDITOR +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_begin_entry_editor(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CACHED_TOTP_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CACHED_TOTP_PAGE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_cached_totp_page(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CANCEL +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_COPY_ENTRY_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_COPY_ENTRY_FIELD +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_copy_entry_field(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_COPY_TOTP_CODE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_COPY_TOTP_CODE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_copy_totp_code(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CREATE_DIRECTORY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_CREATE_DIRECTORY +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_create_directory(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_DISCARD_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_DISCARD_ENTRY_EDITOR +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_discard_entry_editor(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ENTRY_EDITOR +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_entry_editor(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ENTRY_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_ENTRY_PAGE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_entry_page(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_FAIL_WATCH_SNAPSHOT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_FAIL_WATCH_SNAPSHOT +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_fail_watch_snapshot(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_GENERATE_ENTRY_EDITOR_PASSWORD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_GENERATE_ENTRY_EDITOR_PASSWORD +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_generate_entry_editor_password(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_GIT_IDENTITY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_GIT_IDENTITY +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_git_identity(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_manual_lock(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MOBILE_APPEARANCE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MOBILE_APPEARANCE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_mobile_appearance(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_perform_entry_mutation(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREFERENCES +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREFERENCES +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_preferences(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_prepare_entry_mutation(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_WATCH_SNAPSHOT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_WATCH_SNAPSHOT +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_prepare_watch_snapshot(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_APPLICATION_TOKEN +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_APPLICATION_TOKEN +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_remove_application_token(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_remove_entry_editor_field(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REORDER_ENTRY_EDITOR_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REORDER_ENTRY_EDITOR_FIELD +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_reorder_entry_editor_field(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REPLACE_ENTRY_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REPLACE_ENTRY_FIELD +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_replace_entry_field(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REVEAL_ENTRY_FIELD +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REVEAL_ENTRY_FIELD +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_reveal_entry_field(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SAVE_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SAVE_ENTRY_EDITOR +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_save_entry_editor(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SEARCH_CACHED_TOTP_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SEARCH_CACHED_TOTP_PAGE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_search_cached_totp_page(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_AUTHENTICATION_TIMEOUT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_AUTHENTICATION_TIMEOUT +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_authentication_timeout(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_BIOMETRIC_UNLOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_BIOMETRIC_UNLOCK +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_biometric_unlock(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_GIT_IDENTITY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_GIT_IDENTITY +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_git_identity(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_MOBILE_APPEARANCE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_MOBILE_APPEARANCE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_mobile_appearance(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_TOTP_WATCH_SHARED +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_TOTP_WATCH_SHARED +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_totp_watch_shared(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_WATCH_SNAPSHOT_UNAVAILABLE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_SET_WATCH_SNAPSHOT_UNAVAILABLE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_set_watch_snapshot_unavailable(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_STATE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_STATE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_state(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOTP_DETAIL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOTP_DETAIL +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_totp_detail(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOTP_PAGE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOTP_PAGE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_totp_page(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOUCH_USER_ACTIVITY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_TOUCH_USER_ACTIVITY +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_touch_user_activity(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UNLOCK_ENTRY +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UNLOCK_ENTRY +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_unlock_entry(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UNLOCK_TOTP +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UNLOCK_TOTP +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_unlock_totp(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UPDATE_ENTRY_EDITOR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_UPDATE_ENTRY_EDITOR +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_update_entry_editor(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_WATCH_SNAPSHOT_STATUS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_WATCH_SNAPSHOT_STATUS +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_watch_snapshot_status(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_LIFECYCLE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_LIFECYCLE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileauthentication_lifecycle(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_CACHED +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_CACHED +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_cached(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_CANCEL +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_COMMIT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_COMMIT +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_commit(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_FETCH +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_FETCH +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_fetch(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PROGRESS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PROGRESS +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_progress(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PULL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PULL +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_pull(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PUSH +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_PUSH +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_push(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_REFRESH_IF_STALE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_REFRESH_IF_STALE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_refresh_if_stale(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_SYNC +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEHOMEOPERATION_SYNC +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilehomeoperation_sync(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_EXPORT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_EXPORT +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilekeytransfer_export(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_IMPORTER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_IMPORTER +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilekeytransfer_importer(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_KEYS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFER_KEYS +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilekeytransfer_keys(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFERIMPORT_ADD_FRAME +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFERIMPORT_ADD_FRAME +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilekeytransferimport_add_frame(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFERIMPORT_IMPORT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEKEYTRANSFERIMPORT_IMPORT +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilekeytransferimport_import(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILELOCALONBOARDINGOPERATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILELOCALONBOARDINGOPERATION_CANCEL +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilelocalonboardingoperation_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILELOCALONBOARDINGOPERATION_GENERATE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILELOCALONBOARDINGOPERATION_GENERATE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilelocalonboardingoperation_generate(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_CANCEL +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_CONNECT_LOCAL_STORE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_CONNECT_LOCAL_STORE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_connect_local_store(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_DISCOVER +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_DISCOVER +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_discover(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_PROGRESS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_PROGRESS +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_progress(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_SETUP +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILEONBOARDINGOPERATION_SETUP +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileonboardingoperation_setup(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILETOTPOPERATION_CANCEL +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILETOTPOPERATION_CANCEL +uint16_t uniffi_ironstorage_mobile_checksum_method_mobiletotpoperation_cancel(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILETOTPOPERATION_PROGRESS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILETOTPOPERATION_PROGRESS +uint16_t uniffi_ironstorage_mobile_checksum_method_mobiletotpoperation_progress(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLIPBOARD_READ +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLIPBOARD_READ +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileclipboard_read(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLIPBOARD_WRITE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLIPBOARD_WRITE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileclipboard_write(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLIPBOARD_CLEAR +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLIPBOARD_CLEAR +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileclipboard_clear(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLIPBOARD_WAIT_FOR_TIMEOUT +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLIPBOARD_WAIT_FOR_TIMEOUT +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileclipboard_wait_for_timeout(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLOCK_MONOTONIC_MILLISECONDS +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILECLOCK_MONOTONIC_MILLISECONDS +uint16_t uniffi_ironstorage_mobile_checksum_method_mobileclock_monotonic_milliseconds(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_CREATE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_CREATE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_create(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_RETRIEVE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_RETRIEVE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_retrieve(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_REPLACE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_REPLACE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_replace(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_DELETE +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_DELETE +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_delete(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_LOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_LOCK +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_lock(void + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_UNLOCK +#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_MOBILE_CHECKSUM_METHOD_MOBILESECRETBACKEND_UNLOCK +uint16_t uniffi_ironstorage_mobile_checksum_method_mobilesecretbackend_unlock(void + +); +#endif +#ifndef UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_UNIFFI_CONTRACT_VERSION +#define UNIFFI_FFIDEF_FFI_IRONSTORAGE_MOBILE_UNIFFI_CONTRACT_VERSION +uint32_t ffi_ironstorage_mobile_uniffi_contract_version(void + +); +#endif diff --git a/apple/Generated/ironstorage_appleFFI.modulemap b/apple/Generated/ironstorage_mobileFFI.modulemap similarity index 55% rename from apple/Generated/ironstorage_appleFFI.modulemap rename to apple/Generated/ironstorage_mobileFFI.modulemap index 3537e4e..5836142 100644 --- a/apple/Generated/ironstorage_appleFFI.modulemap +++ b/apple/Generated/ironstorage_mobileFFI.modulemap @@ -1,5 +1,5 @@ -module ironstorage_appleFFI { - header "ironstorage_appleFFI.h" +module ironstorage_mobileFFI { + header "ironstorage_mobileFFI.h" export * use "Darwin" use "_Builtin_stdbool" diff --git a/apple/IronStorage-Bridging-Header.h b/apple/IronStorage-Bridging-Header.h index d485c36..b83b100 100644 --- a/apple/IronStorage-Bridging-Header.h +++ b/apple/IronStorage-Bridging-Header.h @@ -1 +1 @@ -#include "Generated/ironstorage_appleFFI.h" +#include "Generated/ironstorage_mobileFFI.h" diff --git a/apple/Sources/App/MobileIcons.swift b/apple/Sources/App/MobileIcons.swift new file mode 100644 index 0000000..694e5c8 --- /dev/null +++ b/apple/Sources/App/MobileIcons.swift @@ -0,0 +1,82 @@ +import UIKit + +extension MobileIcon { + var systemImage: String { + switch self { + case .home: return "house" + case .key: return "key" + case .search: return "magnifyingglass" + case .timer: return "timer" + case .settings: return "gearshape" + case .warning: return "exclamationmark.triangle" + case .branch: return "point.3.connected.trianglepath.dotted" + case .success: return "checkmark.circle" + case .sync: return "arrow.triangle.2.circlepath" + case .protected: return "checkmark.shield" + case .repository: return "externaldrive.fill" + case .history: return "clock.arrow.circlepath" + case .incoming: return "arrow.down.circle" + case .outgoing: return "arrow.up.circle" + case .recipients: return "person.2" + case .signature: return "signature" + case .file: return "doc" + case .merge: return "arrow.triangle.merge" + case .refresh: return "arrow.clockwise.circle" + case .folder: return "folder" + case .user: return "person.fill" + case .email: return "envelope.fill" + case .website: return "globe" + case .text: return "text.alignleft" + case .note: return "note.text" + } + } + + var selectedSystemImage: String { + switch self { + case .home: return "house.fill" + case .key: return "key.fill" + case .settings: return "gearshape.fill" + default: return systemImage + } + } +} + +extension MobilePage { + var systemImage: String { icon.systemImage } +} + +extension MobileHomeAction { + var systemImage: String { icon.systemImage } +} + +extension MobileHomeSummaryRow { + var systemImage: String { icon.systemImage } +} + +extension MobileHomeChange { + var systemImage: String { icon.systemImage } +} + +extension MobileHomeCommit { + var systemImage: String { icon.systemImage } +} + +extension MobileHomeNotice { + var systemImage: String { icon.systemImage } +} + +extension MobilePasswordRow { + var systemImage: String { icon.systemImage } +} + +extension MobileEntryField { + var systemImage: String { icon.systemImage } +} + +extension MobileEntryEditorField { + var systemImage: String { icon.systemImage } +} + +extension MobilePage { + var selectedSystemImage: String { icon.selectedSystemImage } +} diff --git a/apple/project.yml b/apple/project.yml index cd701f3..0196fe0 100644 --- a/apple/project.yml +++ b/apple/project.yml @@ -37,7 +37,7 @@ targets: - Resources/App/PrivacyInfo.xcprivacy - Resources/App/ThirdPartyLicenses.txt - Sources/App - - Generated/ironstorage_apple.swift + - Generated/ironstorage_mobile.swift dependencies: - target: IronStorageWatch embed: true @@ -72,7 +72,7 @@ targets: sources: - Resources/AutoFill/PrivacyInfo.xcprivacy - Sources/AutoFill - - Generated/ironstorage_apple.swift + - Generated/ironstorage_mobile.swift preBuildScripts: - name: Build Rust core basedOnDependencyAnalysis: false diff --git a/crates/android/Cargo.toml b/crates/android/Cargo.toml index 0aba70f..28e7226 100644 --- a/crates/android/Cargo.toml +++ b/crates/android/Cargo.toml @@ -13,4 +13,4 @@ name = "ironstorage_android" crate-type = ["lib", "cdylib"] [dependencies] -ironstorage-apple = { path = "../apple" } +ironstorage-mobile = { path = "../mobile-bridge" } diff --git a/crates/android/src/lib.rs b/crates/android/src/lib.rs index ce9dd37..9787e72 100644 --- a/crates/android/src/lib.rs +++ b/crates/android/src/lib.rs @@ -1,6 +1,6 @@ #![forbid(unsafe_code)] -//! Android packaging of the existing mobile UniFFI component. +//! Android packaging of the shared phone UniFFI component. //! The shared component owns every conversion; no interface is copied here. -ironstorage_apple::uniffi_reexport_scaffolding!(); +ironstorage_mobile::uniffi_reexport_scaffolding!(); diff --git a/crates/apple/Cargo.toml b/crates/apple/Cargo.toml index 6546119..1cec0e9 100644 --- a/crates/apple/Cargo.toml +++ b/crates/apple/Cargo.toml @@ -13,5 +13,4 @@ name = "ironstorage_apple" crate-type = ["lib", "staticlib", "cdylib"] [dependencies] -ironstorage = { path = "../storage", default-features = false, features = ["full"] } -uniffi.workspace = true +ironstorage-mobile = { path = "../mobile-bridge", features = ["watch"] } diff --git a/crates/apple/src/lib.rs b/crates/apple/src/lib.rs index 9875dcd..59229e1 100644 --- a/crates/apple/src/lib.rs +++ b/crates/apple/src/lib.rs @@ -1,2378 +1,6 @@ #![forbid(unsafe_code)] -#![deny(clippy::disallowed_types)] -//! Mechanical UniFFI exports for Apple presentation code. +//! Apple packaging of the shared mobile contract, including opt-in Watch support. -use std::{ - error::Error, - fmt, - sync::{Arc, Mutex}, -}; - -use ironstorage::{ - config::{ConfigError, MobileAppearance as StorageMobileAppearance}, - mobile::{self, MobileShellState as StorageShellState, MobileTab as StorageTab}, - mobile_authentication::{ - MobileAuthenticationError as StorageAuthenticationError, - MobileAuthenticationErrorKind as StorageAuthenticationErrorKind, - MobileAuthenticationState as StorageAuthenticationState, - MobileEntryCopy as StorageEntryCopy, MobileEntryPresentation as StorageEntryPresentation, - MobilePreferences as StorageMobilePreferences, - MobileWatchPreferenceState as StorageWatchPreferenceState, - }, - mobile_entry::{ - MobileEntryEditorFieldKind as StorageEntryEditorFieldKind, - MobileEntryEditorInput as StorageEntryEditorInput, - MobileEntryEditorPage as StorageEntryEditorPage, - MobileEntryEditorSession as StorageEntryEditorSession, MobileEntryPage as StorageEntryPage, - MobileEntrySectionKind as StorageEntrySectionKind, - }, - mobile_home::{ - self, MobileHomeActionKind as StorageHomeActionKind, - MobileHomeChangeKind as StorageHomeChangeKind, - MobileHomeChangeStatus as StorageHomeChangeStatus, MobileHomeError as StorageHomeError, - MobileHomeErrorKind as StorageHomeErrorKind, MobileHomeFreshness as StorageHomeFreshness, - MobileHomePhase as StorageHomePhase, - }, - mobile_key_transfer::{ - MobileKeyTransferError as StorageKeyTransferError, - MobileKeyTransferKey as StorageKeyTransferKey, - MobileKeyTransferKind as StorageKeyTransferKind, - MobileKeyTransferProgress as StorageKeyTransferProgress, - }, - mobile_mutation::{ - MobileMutationAction as StorageMutationAction, - MobileMutationOutcome as StorageMutationOutcome, MobileMutationPlan as StorageMutationPlan, - MobileMutationRequest as StorageMutationRequest, - }, - mobile_onboarding::{ - self, MobileOnboardingError as StorageOnboardingError, - MobileOnboardingErrorKind as StorageOnboardingErrorKind, - MobileOnboardingPhase as StorageOnboardingPhase, - }, - mobile_passwords::{ - MobilePasswordError as StoragePasswordError, - MobilePasswordErrorKind as StoragePasswordErrorKind, - MobilePasswordRowKind as StoragePasswordRowKind, - }, - mobile_totp::{ - MobileTotpDetail as StorageTotpDetail, - MobileTotpDiscoveryPhase as StorageTotpDiscoveryPhase, - MobileTotpOperation as StorageTotpOperation, MobileTotpPage as StorageTotpPage, - }, - mobile_watch::{ - MobileWatchSnapshotState as StorageWatchSnapshotState, - MobileWatchSnapshotStatus as StorageWatchSnapshotStatus, - WatchSnapshotTransfer as StorageWatchSnapshotTransfer, - }, -}; - -uniffi::setup_scaffolding!(); - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileTab { - Home, - Passwords, - Search, - Totp, - Preferences, -} - -impl From for MobileTab { - fn from(tab: StorageTab) -> Self { - match tab { - StorageTab::Home => Self::Home, - StorageTab::Passwords => Self::Passwords, - StorageTab::Search => Self::Search, - StorageTab::Totp => Self::Totp, - StorageTab::Preferences => Self::Preferences, - } - } -} - -impl From for StorageTab { - fn from(tab: MobileTab) -> Self { - match tab { - MobileTab::Home => Self::Home, - MobileTab::Passwords => Self::Passwords, - MobileTab::Search => Self::Search, - MobileTab::Totp => Self::Totp, - MobileTab::Preferences => Self::Preferences, - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileShellState { - Loading, - Empty, - Ready, - Locked, - Error, -} - -impl From for MobileShellState { - fn from(state: StorageShellState) -> Self { - match state { - StorageShellState::Loading => Self::Loading, - StorageShellState::Empty => Self::Empty, - StorageShellState::Ready => Self::Ready, - StorageShellState::Locked => Self::Locked, - StorageShellState::Error => Self::Error, - } - } -} - -impl From for StorageShellState { - fn from(state: MobileShellState) -> Self { - match state { - MobileShellState::Loading => Self::Loading, - MobileShellState::Empty => Self::Empty, - MobileShellState::Ready => Self::Ready, - MobileShellState::Locked => Self::Locked, - MobileShellState::Error => Self::Error, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobilePage { - pub tab: MobileTab, - pub title: String, - pub system_image: String, - pub selected_system_image: String, - pub state: MobileShellState, - pub state_title: String, - pub state_detail: String, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileShell { - pub selected_tab: MobileTab, - pub pages: Vec, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileHomeFreshness { - NeverRefreshed, - Cached, - Current, -} - -impl From for MobileHomeFreshness { - fn from(freshness: StorageHomeFreshness) -> Self { - match freshness { - StorageHomeFreshness::NeverRefreshed => Self::NeverRefreshed, - StorageHomeFreshness::Cached => Self::Cached, - StorageHomeFreshness::Current => Self::Current, - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileHomeChangeKind { - PasswordEntry, - RecipientPolicy, - RecipientSignature, - RepositoryFile, -} - -impl From for MobileHomeChangeKind { - fn from(kind: StorageHomeChangeKind) -> Self { - match kind { - StorageHomeChangeKind::PasswordEntry => Self::PasswordEntry, - StorageHomeChangeKind::RecipientPolicy => Self::RecipientPolicy, - StorageHomeChangeKind::RecipientSignature => Self::RecipientSignature, - StorageHomeChangeKind::RepositoryFile => Self::RepositoryFile, - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileHomeChangeStatus { - Added, - Modified, - Deleted, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileHomeActionKind { - Commit, - Fetch, - Pull, - Push, -} - -impl From for MobileHomeActionKind { - fn from(kind: StorageHomeActionKind) -> Self { - match kind { - StorageHomeActionKind::Commit => Self::Commit, - StorageHomeActionKind::Fetch => Self::Fetch, - StorageHomeActionKind::Pull => Self::Pull, - StorageHomeActionKind::Push => Self::Push, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileHomeAction { - pub kind: MobileHomeActionKind, - pub title: String, - pub system_image: String, -} - -impl From for MobileHomeChangeStatus { - fn from(status: StorageHomeChangeStatus) -> Self { - match status { - StorageHomeChangeStatus::Added => Self::Added, - StorageHomeChangeStatus::Modified => Self::Modified, - StorageHomeChangeStatus::Deleted => Self::Deleted, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileHomeSummaryRow { - pub id: String, - pub title: String, - pub detail: String, - pub system_image: String, - pub actions: Vec, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileHomeChange { - pub id: String, - pub title: String, - pub detail: String, - pub system_image: String, - pub kind: MobileHomeChangeKind, - pub status: MobileHomeChangeStatus, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileHomeCommit { - pub id: String, - pub title: String, - pub detail: String, - pub system_image: String, - pub timestamp: i64, - pub changes: Vec, - pub actions: Vec, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileHomeNotice { - pub title: String, - pub detail: String, - pub system_image: String, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileHomePage { - pub remote_configured: bool, - pub freshness: MobileHomeFreshness, - pub refreshed_at: Option, - pub summaries: Vec, - pub incoming: Vec, - pub outgoing: Vec, - pub incoming_total: u32, - pub outgoing_total: u32, - pub notice: Option, -} - -impl From for MobileHomePage { - fn from(page: mobile_home::MobileHomePage) -> Self { - Self { - remote_configured: page.remote_configured(), - freshness: page.freshness().into(), - refreshed_at: page.refreshed_at(), - summaries: page - .summaries() - .iter() - .map(|row| MobileHomeSummaryRow { - id: row.id().to_owned(), - title: row.title().to_owned(), - detail: row.detail().to_owned(), - system_image: row.system_image().to_owned(), - actions: row.actions().iter().map(mobile_home_action).collect(), - }) - .collect(), - incoming: page.incoming().iter().map(mobile_home_commit).collect(), - outgoing: page.outgoing().iter().map(mobile_home_commit).collect(), - incoming_total: u32::try_from(page.incoming_total()).unwrap_or(u32::MAX), - outgoing_total: u32::try_from(page.outgoing_total()).unwrap_or(u32::MAX), - notice: page.notice().map(|notice| MobileHomeNotice { - title: notice.title().to_owned(), - detail: notice.detail().to_owned(), - system_image: notice.system_image().to_owned(), - }), - } - } -} - -fn mobile_home_commit(commit: &mobile_home::MobileHomeCommit) -> MobileHomeCommit { - MobileHomeCommit { - id: commit.id().to_owned(), - title: commit.title().to_owned(), - detail: commit.detail().to_owned(), - system_image: commit.system_image().to_owned(), - timestamp: commit.timestamp(), - changes: commit - .changes() - .iter() - .map(|change| MobileHomeChange { - id: change.id().to_owned(), - title: change.title().to_owned(), - detail: change.detail().to_owned(), - system_image: change.system_image().to_owned(), - kind: change.kind().into(), - status: change.status().into(), - }) - .collect(), - actions: commit.actions().iter().map(mobile_home_action).collect(), - } -} - -fn mobile_home_action(action: &mobile_home::MobileHomeAction) -> MobileHomeAction { - MobileHomeAction { - kind: action.kind().into(), - title: action.title().to_owned(), - system_image: action.system_image().to_owned(), - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileHomePhase { - Validating, - Authenticating, - Receiving, - Integrating, - Sending, - Finishing, -} - -impl From for MobileHomePhase { - fn from(phase: StorageHomePhase) -> Self { - match phase { - StorageHomePhase::Validating => Self::Validating, - StorageHomePhase::Authenticating => Self::Authenticating, - StorageHomePhase::Receiving => Self::Receiving, - StorageHomePhase::Integrating => Self::Integrating, - StorageHomePhase::Sending => Self::Sending, - StorageHomePhase::Finishing => Self::Finishing, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileHomeProgress { - pub action: Option, - pub phase: MobileHomePhase, - pub title: String, - pub detail: String, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileHomeErrorKind { - MissingConfiguration, - Configuration, - Authentication, - Conflict, - DirtyLocalChanges, - NoChanges, - Offline, - Interrupted, - SecureStorage, - Repository, - PartialProgress, -} - -impl From for MobileHomeErrorKind { - fn from(kind: StorageHomeErrorKind) -> Self { - match kind { - StorageHomeErrorKind::MissingConfiguration => Self::MissingConfiguration, - StorageHomeErrorKind::Configuration => Self::Configuration, - StorageHomeErrorKind::Authentication => Self::Authentication, - StorageHomeErrorKind::Conflict => Self::Conflict, - StorageHomeErrorKind::DirtyLocalChanges => Self::DirtyLocalChanges, - StorageHomeErrorKind::NoChanges => Self::NoChanges, - StorageHomeErrorKind::Offline => Self::Offline, - StorageHomeErrorKind::Interrupted => Self::Interrupted, - StorageHomeErrorKind::SecureStorage => Self::SecureStorage, - StorageHomeErrorKind::Repository => Self::Repository, - StorageHomeErrorKind::PartialProgress => Self::PartialProgress, - } - } -} - -#[derive(Debug, uniffi::Error)] -pub enum MobileHomeFfiError { - Failed { - kind: MobileHomeErrorKind, - title: String, - detail: String, - }, -} - -impl fmt::Display for MobileHomeFfiError { - fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Failed { title, detail, .. } => write!(formatter, "{title}: {detail}"), - } - } -} - -impl Error for MobileHomeFfiError {} - -impl From for MobileHomeFfiError { - fn from(error: StorageHomeError) -> Self { - Self::Failed { - kind: error.kind().into(), - title: error.title().to_owned(), - detail: error.detail().to_owned(), - } - } -} - -#[derive(uniffi::Object)] -pub struct MobileHomeOperation { - operation: mobile_home::MobileHomeOperation, -} - -#[uniffi::export] -impl MobileHomeOperation { - pub fn progress(&self) -> MobileHomeProgress { - let progress = self.operation.progress(); - MobileHomeProgress { - action: progress.action().map(Into::into), - phase: progress.phase().into(), - title: progress.title().to_owned(), - detail: progress.detail().to_owned(), - } - } - - pub fn cached(&self) -> Result { - self.operation.cached().map(Into::into).map_err(Into::into) - } - - pub fn refresh_if_stale(&self) -> Result { - self.operation - .refresh_if_stale() - .map(Into::into) - .map_err(Into::into) - } - - pub fn commit(&self, message: String) -> Result { - self.operation - .commit(&message) - .map(Into::into) - .map_err(Into::into) - } - - pub fn fetch(&self) -> Result { - self.operation.fetch().map(Into::into).map_err(Into::into) - } - - pub fn pull(&self) -> Result { - self.operation.pull().map(Into::into).map_err(Into::into) - } - - pub fn push(&self) -> Result { - self.operation.push().map(Into::into).map_err(Into::into) - } - - pub fn sync(&self) -> Result { - self.operation.sync().map(Into::into).map_err(Into::into) - } - - pub fn cancel(&self) { - self.operation.cancel(); - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobilePasswordRowKind { - Directory, - Entry, -} - -impl From for MobilePasswordRowKind { - fn from(kind: StoragePasswordRowKind) -> Self { - match kind { - StoragePasswordRowKind::Directory => Self::Directory, - StoragePasswordRowKind::Entry => Self::Entry, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobilePasswordRow { - pub id: String, - pub path: String, - pub title: String, - pub detail: String, - pub system_image: String, - pub kind: MobilePasswordRowKind, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobilePasswordPage { - pub id: String, - pub path: String, - pub title: String, - pub rows: Vec, -} - -impl From for MobilePasswordPage { - fn from(page: ironstorage::mobile_passwords::MobilePasswordPage) -> Self { - Self { - id: page.id().to_owned(), - path: page.path().to_owned(), - title: page.title().to_owned(), - rows: page - .rows() - .iter() - .map(|row| MobilePasswordRow { - id: row.id().to_owned(), - path: row.path().to_owned(), - title: row.title().to_owned(), - detail: row.detail().to_owned(), - system_image: row.system_image().to_owned(), - kind: row.kind().into(), - }) - .collect(), - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobilePasswordErrorKind { - MissingConfiguration, - Configuration, - InvalidPath, - DirectoryMissing, - Repository, -} - -impl From for MobilePasswordErrorKind { - fn from(kind: StoragePasswordErrorKind) -> Self { - match kind { - StoragePasswordErrorKind::MissingConfiguration => Self::MissingConfiguration, - StoragePasswordErrorKind::Configuration => Self::Configuration, - StoragePasswordErrorKind::InvalidPath => Self::InvalidPath, - StoragePasswordErrorKind::DirectoryMissing => Self::DirectoryMissing, - StoragePasswordErrorKind::Repository => Self::Repository, - } - } -} - -#[derive(Debug, uniffi::Error)] -pub enum MobilePasswordFfiError { - Failed { - kind: MobilePasswordErrorKind, - title: String, - detail: String, - }, -} - -impl fmt::Display for MobilePasswordFfiError { - fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Failed { title, detail, .. } => write!(formatter, "{title}: {detail}"), - } - } -} - -impl Error for MobilePasswordFfiError {} - -impl From for MobilePasswordFfiError { - fn from(error: StoragePasswordError) -> Self { - Self::Failed { - kind: error.kind().into(), - title: error.title().to_owned(), - detail: error.detail().to_owned(), - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileAuthenticationErrorKind { - PassphraseRequired, - InvalidPassphrase, - Cancelled, - BiometryUnavailable, - Configuration, - KeyMaterial, - Entry, - SecureStorage, - Expired, - Conflict, -} - -impl From for MobileAuthenticationErrorKind { - fn from(kind: StorageAuthenticationErrorKind) -> Self { - match kind { - StorageAuthenticationErrorKind::PassphraseRequired => Self::PassphraseRequired, - StorageAuthenticationErrorKind::InvalidPassphrase => Self::InvalidPassphrase, - StorageAuthenticationErrorKind::Cancelled => Self::Cancelled, - StorageAuthenticationErrorKind::BiometryUnavailable => Self::BiometryUnavailable, - StorageAuthenticationErrorKind::Configuration => Self::Configuration, - StorageAuthenticationErrorKind::KeyMaterial => Self::KeyMaterial, - StorageAuthenticationErrorKind::Entry => Self::Entry, - StorageAuthenticationErrorKind::SecureStorage => Self::SecureStorage, - StorageAuthenticationErrorKind::Expired => Self::Expired, - StorageAuthenticationErrorKind::Conflict => Self::Conflict, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileAuthenticationState { - pub unlocked: bool, - pub biometric_unlock_enabled: bool, - pub remaining_seconds: u64, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileAppearance { - System, - Light, - Dark, -} - -impl From for MobileAppearance { - fn from(appearance: StorageMobileAppearance) -> Self { - match appearance { - StorageMobileAppearance::System => Self::System, - StorageMobileAppearance::Light => Self::Light, - StorageMobileAppearance::Dark => Self::Dark, - } - } -} - -impl From for StorageMobileAppearance { - fn from(appearance: MobileAppearance) -> Self { - match appearance { - MobileAppearance::System => Self::System, - MobileAppearance::Light => Self::Light, - MobileAppearance::Dark => Self::Dark, - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileWatchPreferenceState { - Unsupported, - NotPaired, - AppNotInstalled, - Ready, - Pending, - Delivered, - Current, - Failed, -} - -impl From for MobileWatchPreferenceState { - fn from(state: StorageWatchPreferenceState) -> Self { - match state { - StorageWatchPreferenceState::Unsupported => Self::Unsupported, - StorageWatchPreferenceState::NotPaired => Self::NotPaired, - StorageWatchPreferenceState::AppNotInstalled => Self::AppNotInstalled, - StorageWatchPreferenceState::Ready => Self::Ready, - StorageWatchPreferenceState::Pending => Self::Pending, - StorageWatchPreferenceState::Delivered => Self::Delivered, - StorageWatchPreferenceState::Current => Self::Current, - StorageWatchPreferenceState::Failed => Self::Failed, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobilePreferences { - pub sync_configured: bool, - pub repository_title: String, - pub repository_url: String, - pub server_title: String, - pub server_identity: String, - pub application_account: Option, - pub default_key_title: String, - pub default_key_fingerprint: String, - pub authentication_timeout_seconds: u64, - pub biometric_unlock_enabled: bool, - pub appearance: MobileAppearance, - pub watch_state: MobileWatchPreferenceState, - pub watch_title: String, - pub watch_detail: String, -} - -impl From for MobilePreferences { - fn from(preferences: StorageMobilePreferences) -> Self { - Self { - sync_configured: preferences.sync_configured(), - repository_title: preferences.repository_title().to_owned(), - repository_url: preferences.repository_url().to_owned(), - server_title: preferences.server_title().to_owned(), - server_identity: preferences.server_identity().to_owned(), - application_account: preferences.application_account().map(str::to_owned), - default_key_title: preferences.default_key_title().to_owned(), - default_key_fingerprint: preferences.default_key_fingerprint().to_owned(), - authentication_timeout_seconds: preferences.authentication_timeout_seconds(), - biometric_unlock_enabled: preferences.biometric_unlock_enabled(), - appearance: preferences.appearance().into(), - watch_state: preferences.watch_state().into(), - watch_title: preferences.watch_title().to_owned(), - watch_detail: preferences.watch_detail().to_owned(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileGitIdentity { - pub name: String, - pub email: String, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileMutationAction { - Move, - Copy, - Delete, -} - -impl From for MobileMutationAction { - fn from(action: StorageMutationAction) -> Self { - match action { - StorageMutationAction::Move => Self::Move, - StorageMutationAction::Copy => Self::Copy, - StorageMutationAction::Delete => Self::Delete, - } - } -} - -impl From for StorageMutationAction { - fn from(action: MobileMutationAction) -> Self { - match action { - MobileMutationAction::Move => Self::Move, - MobileMutationAction::Copy => Self::Copy, - MobileMutationAction::Delete => Self::Delete, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileMutationDestination { - pub path: String, - pub title: String, - pub detail: String, - pub requires_overwrite: bool, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileMutationPlan { - pub action: MobileMutationAction, - pub source: String, - pub source_title: String, - pub revision: String, - pub destinations: Vec, - pub has_open_editor: bool, - pub has_dirty_editor: bool, -} - -impl From for MobileMutationPlan { - fn from(plan: StorageMutationPlan) -> Self { - Self { - action: plan.action().into(), - source: plan.source().to_owned(), - source_title: plan.source_title().to_owned(), - revision: plan.revision().to_owned(), - destinations: plan - .destinations() - .iter() - .map(|destination| MobileMutationDestination { - path: destination.path().to_owned(), - title: destination.title().to_owned(), - detail: destination.detail().to_owned(), - requires_overwrite: destination.requires_overwrite(), - }) - .collect(), - has_open_editor: plan.has_open_editor(), - has_dirty_editor: plan.has_dirty_editor(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileMutationRequest { - pub action: MobileMutationAction, - pub source: String, - pub revision: String, - pub destination: Option, - pub confirmed: bool, - pub overwrite: bool, - pub discard_editor: bool, -} - -impl From for StorageMutationRequest { - fn from(request: MobileMutationRequest) -> Self { - Self { - action: request.action.into(), - source: request.source, - revision: request.revision, - destination: request.destination, - confirmed: request.confirmed, - overwrite: request.overwrite, - discard_editor: request.discard_editor, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileMutationOutcome { - pub action: MobileMutationAction, - pub source: String, - pub destination: Option, - pub title: String, - pub detail: String, -} - -impl From for MobileMutationOutcome { - fn from(outcome: StorageMutationOutcome) -> Self { - Self { - action: outcome.action().into(), - source: outcome.source().to_owned(), - destination: outcome.destination().map(str::to_owned), - title: outcome.title().to_owned(), - detail: outcome.detail().to_owned(), - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileEntrySectionKind { - Password, - Details, - OneTimePassword, - Notes, -} - -impl From for MobileEntrySectionKind { - fn from(kind: StorageEntrySectionKind) -> Self { - match kind { - StorageEntrySectionKind::Password => Self::Password, - StorageEntrySectionKind::Details => Self::Details, - StorageEntrySectionKind::OneTimePassword => Self::OneTimePassword, - StorageEntrySectionKind::Notes => Self::Notes, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntryField { - pub id: u64, - pub label: String, - pub system_image: String, - pub value: Option, - pub masked_value: String, - pub detail: Option, - pub diagnostic: Option, - pub sensitive: bool, - pub multiline: bool, - pub selectable: bool, - pub editable: bool, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntrySection { - pub kind: MobileEntrySectionKind, - pub title: String, - pub fields: Vec, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntryPage { - pub id: String, - pub title: String, - pub sections: Vec, -} - -impl From for MobileEntryPage { - fn from(page: StorageEntryPage) -> Self { - Self { - id: page.id().to_owned(), - title: page.title().to_owned(), - sections: page - .sections() - .iter() - .map(|section| MobileEntrySection { - kind: section.kind().into(), - title: section.title().to_owned(), - fields: section - .fields() - .iter() - .map(|field| MobileEntryField { - id: field.id(), - label: field.label().to_owned(), - system_image: field.system_image().to_owned(), - value: field.value().map(str::to_owned), - masked_value: field.masked_value().to_owned(), - detail: field.detail().map(str::to_owned), - diagnostic: field.diagnostic().map(str::to_owned), - sensitive: field.sensitive(), - multiline: field.multiline(), - selectable: field.selectable(), - editable: field.editable(), - }) - .collect(), - }) - .collect(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntryCopy { - pub value: String, - pub timeout_seconds: u64, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileWatchSnapshotState { - Unavailable, - Unpaired, - Pending, - Delivered, - Current, - Failed, -} - -impl From for MobileWatchSnapshotState { - fn from(state: StorageWatchSnapshotState) -> Self { - match state { - StorageWatchSnapshotState::Unavailable => Self::Unavailable, - StorageWatchSnapshotState::Unpaired => Self::Unpaired, - StorageWatchSnapshotState::Pending => Self::Pending, - StorageWatchSnapshotState::Delivered => Self::Delivered, - StorageWatchSnapshotState::Current => Self::Current, - StorageWatchSnapshotState::Failed => Self::Failed, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileWatchSnapshotStatus { - pub state: MobileWatchSnapshotState, - pub revision: Option, - pub detail: String, -} - -impl From<&StorageWatchSnapshotStatus> for MobileWatchSnapshotStatus { - fn from(status: &StorageWatchSnapshotStatus) -> Self { - Self { - state: status.state().into(), - revision: status.revision(), - detail: status.detail().to_owned(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileWatchSnapshotTransfer { - pub revision: u64, - pub selected_entries: u32, - pub snapshot: Vec, - pub delivered_receipt: Vec, -} - -impl From for MobileWatchSnapshotTransfer { - fn from(transfer: StorageWatchSnapshotTransfer) -> Self { - Self { - revision: transfer.revision(), - selected_entries: transfer.selected_entries(), - snapshot: transfer.snapshot().expose().to_vec(), - delivered_receipt: transfer.delivered_receipt().to_vec(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileTotpRow { - pub path: String, - pub issuer: Option, - pub account: String, - pub title: String, - pub detail: String, - pub shared_with_watch: bool, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileTotpPage { - pub rows: Vec, - pub unavailable_entries: u32, - pub cache_notice: Option, - pub watch: MobileWatchSnapshotStatus, -} - -impl From for MobileTotpPage { - fn from(page: StorageTotpPage) -> Self { - Self { - rows: page - .rows() - .iter() - .map(|row| MobileTotpRow { - path: row.path().to_owned(), - issuer: row.issuer().map(str::to_owned), - account: row.account().to_owned(), - title: row.title().to_owned(), - detail: row.detail().to_owned(), - shared_with_watch: row.shared_with_watch(), - }) - .collect(), - unavailable_entries: page.unavailable_entries(), - cache_notice: page.cache_notice().map(str::to_owned), - watch: page.watch().into(), - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileTotpDiscoveryPhase { - Preparing, - Inspecting, - Saving, - Complete, - Cancelled, -} - -impl From for MobileTotpDiscoveryPhase { - fn from(phase: StorageTotpDiscoveryPhase) -> Self { - match phase { - StorageTotpDiscoveryPhase::Preparing => Self::Preparing, - StorageTotpDiscoveryPhase::Inspecting => Self::Inspecting, - StorageTotpDiscoveryPhase::Saving => Self::Saving, - StorageTotpDiscoveryPhase::Complete => Self::Complete, - StorageTotpDiscoveryPhase::Cancelled => Self::Cancelled, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileTotpDiscoveryProgress { - pub phase: MobileTotpDiscoveryPhase, - pub total: u32, - pub inspected: u32, - pub cache_hits: u32, - pub matches: u32, - pub unavailable: u32, -} - -#[derive(uniffi::Object)] -pub struct MobileTotpOperation { - operation: StorageTotpOperation, -} - -#[uniffi::export] -impl MobileTotpOperation { - pub fn progress(&self) -> MobileTotpDiscoveryProgress { - let progress = self.operation.progress(); - MobileTotpDiscoveryProgress { - phase: progress.phase().into(), - total: progress.total(), - inspected: progress.inspected(), - cache_hits: progress.cache_hits(), - matches: progress.matches(), - unavailable: progress.unavailable(), - } - } - - pub fn cancel(&self) { - self.operation.cancel(); - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileTotpDetail { - pub path: String, - pub issuer: Option, - pub account: String, - pub code: String, - pub valid_until: u64, - pub period: u64, - pub shared_with_watch: bool, - pub watch: MobileWatchSnapshotStatus, -} - -impl From for MobileTotpDetail { - fn from(detail: StorageTotpDetail) -> Self { - Self { - path: detail.path().to_owned(), - issuer: detail.issuer().map(str::to_owned), - account: detail.account().to_owned(), - code: String::from_utf8(detail.code().expose().to_vec()) - .expect("storage-generated TOTP codes are ASCII"), - valid_until: detail.valid_until(), - period: detail.period(), - shared_with_watch: detail.shared_with_watch(), - watch: detail.watch().into(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntryPresentation { - pub page: MobileEntryPage, - pub totp: Option, - pub cache_notice: Option, -} - -impl From for MobileEntryPresentation { - fn from(presentation: StorageEntryPresentation) -> Self { - let (page, totp, cache_notice) = presentation.into_parts(); - Self { - page: page.into(), - totp: totp.map(Into::into), - cache_notice, - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileEntryEditorFieldKind { - Password, - Field, - Note, - OtpUri, -} - -impl From for MobileEntryEditorFieldKind { - fn from(kind: StorageEntryEditorFieldKind) -> Self { - match kind { - StorageEntryEditorFieldKind::Password => Self::Password, - StorageEntryEditorFieldKind::Field => Self::Field, - StorageEntryEditorFieldKind::Note => Self::Note, - StorageEntryEditorFieldKind::OtpUri => Self::OtpUri, - } - } -} - -impl From for StorageEntryEditorFieldKind { - fn from(kind: MobileEntryEditorFieldKind) -> Self { - match kind { - MobileEntryEditorFieldKind::Password => Self::Password, - MobileEntryEditorFieldKind::Field => Self::Field, - MobileEntryEditorFieldKind::Note => Self::Note, - MobileEntryEditorFieldKind::OtpUri => Self::OtpUri, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntryEditorField { - pub id: u64, - pub kind: MobileEntryEditorFieldKind, - pub name: Option, - pub label: String, - pub system_image: String, - pub value: Option, - pub masked_value: String, - pub diagnostic: Option, - pub sensitive: bool, - pub multiline: bool, - pub name_editable: bool, - pub removable: bool, - pub reorderable: bool, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntryEditorPage { - pub path: String, - pub title: String, - pub fields: Vec, - pub dirty: bool, - pub creating: bool, - pub default_password_length: u32, - pub maximum_password_length: u32, -} - -impl From<&StorageEntryEditorPage> for MobileEntryEditorPage { - fn from(page: &StorageEntryEditorPage) -> Self { - Self { - path: page.path().to_owned(), - title: page.title().to_owned(), - fields: page - .fields() - .iter() - .map(|field| MobileEntryEditorField { - id: field.id(), - kind: field.kind().into(), - name: field.name().map(str::to_owned), - label: field.label().to_owned(), - system_image: field.system_image().to_owned(), - value: field.value().map(str::to_owned), - masked_value: field.masked_value().to_owned(), - diagnostic: field.diagnostic().map(str::to_owned), - sensitive: field.sensitive(), - multiline: field.multiline(), - name_editable: field.name_editable(), - removable: field.removable(), - reorderable: field.reorderable(), - }) - .collect(), - dirty: page.dirty(), - creating: page.creating(), - default_password_length: page.default_password_length(), - maximum_password_length: page.maximum_password_length(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntryEditorSession { - pub id: u64, - pub page: MobileEntryEditorPage, -} - -impl From for MobileEntryEditorSession { - fn from(session: StorageEntryEditorSession) -> Self { - Self { - id: session.id(), - page: session.page().into(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileEntryEditorInput { - pub id: u64, - pub name: Option, - pub value: Option, -} - -impl From for StorageEntryEditorInput { - fn from(input: MobileEntryEditorInput) -> Self { - Self::new(input.id, input.name, input.value) - } -} - -impl From for MobileEntryCopy { - fn from(copy: StorageEntryCopy) -> Self { - Self { - value: copy.value().to_owned(), - timeout_seconds: copy.timeout_seconds(), - } - } -} - -impl From for MobileAuthenticationState { - fn from(state: StorageAuthenticationState) -> Self { - Self { - unlocked: state.unlocked(), - biometric_unlock_enabled: state.biometric_unlock_enabled(), - remaining_seconds: state.remaining_seconds(), - } - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileKeyTransferKind { - Public, - Private, -} - -impl From for MobileKeyTransferKind { - fn from(kind: StorageKeyTransferKind) -> Self { - match kind { - StorageKeyTransferKind::Public => Self::Public, - StorageKeyTransferKind::Private => Self::Private, - } - } -} - -impl From for StorageKeyTransferKind { - fn from(kind: MobileKeyTransferKind) -> Self { - match kind { - MobileKeyTransferKind::Public => Self::Public, - MobileKeyTransferKind::Private => Self::Private, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileKeyTransferKey { - pub fingerprint: String, - pub title: String, - pub detail: String, - pub kind: MobileKeyTransferKind, - pub requires_passphrase: bool, -} - -impl From<&StorageKeyTransferKey> for MobileKeyTransferKey { - fn from(key: &StorageKeyTransferKey) -> Self { - Self { - fingerprint: key.fingerprint().to_owned(), - title: key.title().to_owned(), - detail: key.detail().to_owned(), - kind: key.kind().into(), - requires_passphrase: key.requires_passphrase(), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileKeyTransferFrame { - pub sequence: u32, - pub total: u32, - pub width: u32, - pub modules: Vec, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileKeyTransferExport { - pub key: MobileKeyTransferKey, - pub frames: Vec, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileKeyTransferProgress { - pub received: u32, - pub total: u32, - pub duplicate: bool, - pub key: Option, -} - -impl From for MobileKeyTransferProgress { - fn from(progress: StorageKeyTransferProgress) -> Self { - Self { - received: u32::try_from(progress.received()).unwrap_or(u32::MAX), - total: u32::try_from(progress.total()).unwrap_or(u32::MAX), - duplicate: progress.duplicate(), - key: progress.key().map(Into::into), - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileKeyTransferOutcome { - pub title: String, - pub detail: String, -} - -#[derive(Debug, uniffi::Error)] -pub enum MobileKeyTransferFfiError { - Failed { - kind: MobileKeyTransferErrorKind, - message: String, - }, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileKeyTransferErrorKind { - ExistingKey, - Failed, -} - -impl fmt::Display for MobileKeyTransferFfiError { - fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Failed { message, .. } => formatter.write_str(message), - } - } -} - -impl Error for MobileKeyTransferFfiError {} - -impl From for MobileKeyTransferFfiError { - fn from(error: StorageKeyTransferError) -> Self { - let kind = match &error { - StorageKeyTransferError::ExistingKey => MobileKeyTransferErrorKind::ExistingKey, - StorageKeyTransferError::LocalSetup(error) - if error.kind() == StorageOnboardingErrorKind::ExistingKey => - { - MobileKeyTransferErrorKind::ExistingKey - } - _ => MobileKeyTransferErrorKind::Failed, - }; - Self::Failed { - kind, - message: error.to_string(), - } - } -} - -#[derive(uniffi::Object)] -pub struct MobileKeyTransfer { - service: ironstorage::mobile_key_transfer::MobileKeyTransferService, -} - -#[uniffi::export] -impl MobileKeyTransfer { - pub fn keys(&self) -> Vec { - self.service.keys().iter().map(Into::into).collect() - } - - pub fn export( - &self, - fingerprint: String, - kind: MobileKeyTransferKind, - passphrase: Option, - ) -> Result { - let exported = self.service.export( - &fingerprint, - kind.into(), - passphrase.map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), - )?; - let frames = exported - .frames() - .iter() - .map(|frame| { - let matrix = frame.matrix(); - let mut modules = Vec::with_capacity(matrix.width() * matrix.width()); - for y in 0..matrix.width() { - for x in 0..matrix.width() { - modules.push(u8::from(matrix.is_dark(x, y).unwrap_or(false))); - } - } - MobileKeyTransferFrame { - sequence: u32::try_from(frame.sequence()).unwrap_or(u32::MAX), - total: u32::try_from(frame.total()).unwrap_or(u32::MAX), - width: u32::try_from(matrix.width()).unwrap_or(u32::MAX), - modules, - } - }) - .collect(); - Ok(MobileKeyTransferExport { - key: exported.key().into(), - frames, - }) - } - - pub fn importer(&self) -> Arc { - Arc::new(MobileKeyTransferImport { - importer: Mutex::new(self.service.importer()), - }) - } -} - -#[derive(uniffi::Object)] -pub struct MobileKeyTransferImport { - importer: Mutex, -} - -#[uniffi::export] -impl MobileKeyTransferImport { - pub fn add_frame( - &self, - payload: String, - ) -> Result { - self.importer - .lock() - .map_err(|_| MobileKeyTransferFfiError::Failed { - kind: MobileKeyTransferErrorKind::Failed, - message: "the key-transfer session is unavailable".to_owned(), - })? - .add_frame(ironstorage::repository::SecretBytes::new( - payload.into_bytes(), - )) - .map(Into::into) - .map_err(Into::into) - } - - pub fn import( - &self, - passphrase: Option, - make_default: bool, - overwrite: bool, - ) -> Result { - let outcome = self - .importer - .lock() - .map_err(|_| MobileKeyTransferFfiError::Failed { - kind: MobileKeyTransferErrorKind::Failed, - message: "the key-transfer session is unavailable".to_owned(), - })? - .import( - passphrase - .map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), - make_default, - overwrite, - )?; - Ok(MobileKeyTransferOutcome { - title: outcome.title().to_owned(), - detail: outcome.detail().to_owned(), - }) - } -} - -#[derive(Debug, uniffi::Error)] -pub enum MobileAuthenticationFfiError { - Failed { - kind: MobileAuthenticationErrorKind, - title: String, - detail: String, - }, -} - -impl fmt::Display for MobileAuthenticationFfiError { - fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Failed { title, detail, .. } => write!(formatter, "{title}: {detail}"), - } - } -} - -impl Error for MobileAuthenticationFfiError {} - -impl From for MobileAuthenticationFfiError { - fn from(error: StorageAuthenticationError) -> Self { - Self::Failed { - kind: error.kind().into(), - title: error.title().to_owned(), - detail: error.detail().to_owned(), - } - } -} - -#[derive(uniffi::Object)] -pub struct MobileAuthentication { - authentication: Arc, -} - -#[uniffi::export] -impl MobileAuthentication { - pub fn state(&self) -> Result { - self.authentication - .state() - .map(Into::into) - .map_err(Into::into) - } - - pub fn git_identity(&self) -> Result { - self.authentication - .git_identity() - .map(|identity| MobileGitIdentity { - name: identity.name().to_owned(), - email: identity.email().to_owned(), - }) - .map_err(Into::into) - } - - pub fn mobile_appearance(&self) -> Result { - self.authentication - .mobile_appearance() - .map(Into::into) - .map_err(Into::into) - } - - pub fn preferences( - &self, - watch_supported: bool, - watch_paired: bool, - watch_app_installed: bool, - ) -> Result { - self.authentication - .preferences(watch_supported, watch_paired, watch_app_installed) - .map(Into::into) - .map_err(Into::into) - } - - pub fn set_authentication_timeout( - &self, - seconds: u64, - ) -> Result<(), MobileAuthenticationFfiError> { - self.authentication - .set_authentication_timeout(seconds) - .map_err(Into::into) - } - - pub fn set_mobile_appearance( - &self, - appearance: MobileAppearance, - ) -> Result<(), MobileAuthenticationFfiError> { - self.authentication - .set_mobile_appearance(appearance.into()) - .map_err(Into::into) - } - - pub fn remove_application_token(&self) -> Result<(), MobileAuthenticationFfiError> { - self.authentication - .remove_application_token() - .map_err(Into::into) - } - - pub fn set_git_identity( - &self, - name: String, - email: String, - ) -> Result { - self.authentication - .set_git_identity(name, email) - .map(|identity| MobileGitIdentity { - name: identity.name().to_owned(), - email: identity.email().to_owned(), - }) - .map_err(Into::into) - } - - pub fn unlock_entry( - &self, - path: String, - passphrase: Option, - ) -> Result { - self.authentication - .unlock_entry( - &path, - passphrase - .map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), - ) - .map(Into::into) - .map_err(Into::into) - } - - pub fn set_biometric_unlock( - &self, - enabled: bool, - ) -> Result { - self.authentication - .set_biometric_unlock(enabled) - .map(Into::into) - .map_err(Into::into) - } - - pub fn touch_user_activity(&self) -> Result<(), MobileAuthenticationFfiError> { - self.authentication - .touch_user_activity() - .map_err(Into::into) - } - - pub fn entry_page( - &self, - path: String, - unix_seconds: u64, - ) -> Result { - self.authentication - .entry_page(&path, unix_seconds) - .map(Into::into) - .map_err(Into::into) - } - - pub fn reveal_entry_field( - &self, - path: String, - field: u64, - ) -> Result { - self.authentication - .reveal_entry_field(&path, field) - .map_err(Into::into) - } - - pub fn copy_entry_field( - &self, - path: String, - field: u64, - ) -> Result { - self.authentication - .copy_entry_field(&path, field) - .map(Into::into) - .map_err(Into::into) - } - - pub fn prepare_entry_mutation( - &self, - path: String, - action: MobileMutationAction, - ) -> Result { - self.authentication - .prepare_entry_mutation(&path, action.into()) - .map(Into::into) - .map_err(Into::into) - } - - pub fn perform_entry_mutation( - &self, - request: MobileMutationRequest, - ) -> Result { - self.authentication - .perform_entry_mutation(request.into()) - .map(Into::into) - .map_err(Into::into) - } - - pub fn replace_entry_field( - &self, - path: String, - field: u64, - value: String, - ) -> Result { - self.authentication - .replace_entry_field(&path, field, value) - .map(Into::into) - .map_err(Into::into) - } - - pub fn begin_entry_editor( - &self, - path: String, - ) -> Result { - self.authentication - .begin_entry_editor(&path) - .map(Into::into) - .map_err(Into::into) - } - - pub fn unlock_totp( - &self, - passphrase: Option, - ) -> Result { - self.authentication - .unlock_totp( - passphrase - .map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), - ) - .map(Into::into) - .map_err(Into::into) - } - - pub fn totp_page( - &self, - operation: Arc, - ) -> Result { - self.authentication - .totp_page(&operation.operation) - .map(Into::into) - .map_err(Into::into) - } - - pub fn cached_totp_page(&self) -> Result, MobileAuthenticationFfiError> { - self.authentication - .cached_totp_page() - .map(|page| page.map(Into::into)) - .map_err(Into::into) - } - - pub fn search_cached_totp_page( - &self, - query: String, - ) -> Result, MobileAuthenticationFfiError> { - self.authentication - .search_cached_totp_page(&query) - .map(|page| page.map(Into::into)) - .map_err(Into::into) - } - - pub fn totp_detail( - &self, - path: String, - unix_seconds: u64, - ) -> Result { - self.authentication - .totp_detail(&path, unix_seconds) - .map(Into::into) - .map_err(Into::into) - } - - pub fn copy_totp_code( - &self, - path: String, - unix_seconds: u64, - ) -> Result { - self.authentication - .copy_totp_code(&path, unix_seconds) - .map(Into::into) - .map_err(Into::into) - } - - pub fn set_totp_watch_shared( - &self, - path: String, - shared: bool, - unix_seconds: u64, - ) -> Result { - self.authentication - .set_totp_watch_shared(&path, shared, unix_seconds) - .map(Into::into) - .map_err(Into::into) - } - - pub fn watch_snapshot_status( - &self, - ) -> Result { - self.authentication - .watch_snapshot_status() - .map(|status| (&status).into()) - .map_err(Into::into) - } - - pub fn prepare_watch_snapshot( - &self, - platform_pairing_identity: String, - ) -> Result { - self.authentication - .prepare_watch_snapshot(&platform_pairing_identity) - .map(Into::into) - .map_err(Into::into) - } - - pub fn set_watch_snapshot_unavailable( - &self, - unpaired: bool, - detail: String, - ) -> Result { - self.authentication - .set_watch_snapshot_unavailable(unpaired, detail) - .map(|status| (&status).into()) - .map_err(Into::into) - } - - pub fn fail_watch_snapshot( - &self, - revision: u64, - detail: String, - ) -> Result { - self.authentication - .fail_watch_snapshot(revision, detail) - .map(|status| (&status).into()) - .map_err(Into::into) - } - - pub fn acknowledge_watch_snapshot( - &self, - receipt: Vec, - ) -> Result { - self.authentication - .acknowledge_watch_snapshot(&receipt) - .map(|status| (&status).into()) - .map_err(Into::into) - } - - pub fn begin_create_entry( - &self, - directory: String, - name: String, - passphrase: Option, - ) -> Result { - self.authentication - .begin_create_entry( - &directory, - &name, - passphrase - .map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), - ) - .map(Into::into) - .map_err(Into::into) - } - - pub fn create_directory( - &self, - parent: String, - name: String, - ) -> Result<(), MobileAuthenticationFfiError> { - self.authentication - .create_directory(&parent, &name) - .map_err(Into::into) - } - - pub fn entry_editor( - &self, - editor: u64, - ) -> Result { - self.authentication - .entry_editor(editor) - .map(|page| (&page).into()) - .map_err(Into::into) - } - - pub fn update_entry_editor( - &self, - editor: u64, - fields: Vec, - ) -> Result { - self.authentication - .update_entry_editor(editor, fields.into_iter().map(Into::into).collect()) - .map(|page| (&page).into()) - .map_err(Into::into) - } - - pub fn add_entry_editor_field( - &self, - editor: u64, - kind: MobileEntryEditorFieldKind, - name: Option, - value: String, - ) -> Result { - self.authentication - .add_entry_editor_field(editor, kind.into(), name, value) - .map(|page| (&page).into()) - .map_err(Into::into) - } - - pub fn add_entry_editor_otp_image( - &self, - editor: u64, - image: Vec, - ) -> Result { - self.authentication - .add_entry_editor_otp_image(editor, ironstorage::repository::SecretBytes::new(image)) - .map(|page| (&page).into()) - .map_err(Into::into) - } - - pub fn remove_entry_editor_field( - &self, - editor: u64, - field: u64, - ) -> Result { - self.authentication - .remove_entry_editor_field(editor, field) - .map(|page| (&page).into()) - .map_err(Into::into) - } - - pub fn reorder_entry_editor_field( - &self, - editor: u64, - field: u64, - index: u32, - ) -> Result { - self.authentication - .reorder_entry_editor_field(editor, field, index as usize) - .map(|page| (&page).into()) - .map_err(Into::into) - } - - pub fn generate_entry_editor_password( - &self, - editor: u64, - length: Option, - no_symbols: bool, - ) -> Result { - self.authentication - .generate_entry_editor_password(editor, length, no_symbols) - .map(|page| (&page).into()) - .map_err(Into::into) - } - - pub fn save_entry_editor( - &self, - editor: u64, - fields: Vec, - ) -> Result { - self.authentication - .save_entry_editor(editor, fields.into_iter().map(Into::into).collect()) - .map(Into::into) - .map_err(Into::into) - } - - pub fn discard_entry_editor(&self, editor: u64) -> Result<(), MobileAuthenticationFfiError> { - self.authentication - .discard_entry_editor(editor) - .map_err(Into::into) - } - - pub fn manual_lock(&self) -> Result<(), MobileAuthenticationFfiError> { - self.authentication.manual_lock().map_err(Into::into) - } - - pub fn cancel(&self) -> Result<(), MobileAuthenticationFfiError> { - self.authentication.cancel().map_err(Into::into) - } -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileOnboardingPhase { - Validating, - Authenticating, - Receiving, - Integrating, - Finishing, -} - -impl From for MobileOnboardingPhase { - fn from(phase: StorageOnboardingPhase) -> Self { - match phase { - StorageOnboardingPhase::Validating => Self::Validating, - StorageOnboardingPhase::Authenticating => Self::Authenticating, - StorageOnboardingPhase::Receiving => Self::Receiving, - StorageOnboardingPhase::Integrating => Self::Integrating, - StorageOnboardingPhase::Finishing => Self::Finishing, - } - } -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileOnboardingProgress { - pub phase: MobileOnboardingPhase, - pub title: String, - pub detail: String, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileOnboardingDiscovery { - pub branches: Vec, - pub selected_branch: u32, -} - -#[derive(Clone, uniffi::Record)] -pub struct MobileOnboardingOutcome { - pub title: String, - pub detail: String, -} - -#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] -pub enum MobileOnboardingErrorKind { - InvalidInput, - UnsupportedRemote, - Authentication, - Repository, - ExistingClone, - ExistingKey, - Interrupted, - SecureStorage, - Configuration, - AlreadyConfigured, -} - -impl From for MobileOnboardingErrorKind { - fn from(kind: StorageOnboardingErrorKind) -> Self { - match kind { - StorageOnboardingErrorKind::InvalidInput => Self::InvalidInput, - StorageOnboardingErrorKind::UnsupportedRemote => Self::UnsupportedRemote, - StorageOnboardingErrorKind::Authentication => Self::Authentication, - StorageOnboardingErrorKind::Repository => Self::Repository, - StorageOnboardingErrorKind::ExistingClone => Self::ExistingClone, - StorageOnboardingErrorKind::ExistingKey => Self::ExistingKey, - StorageOnboardingErrorKind::Interrupted => Self::Interrupted, - StorageOnboardingErrorKind::SecureStorage => Self::SecureStorage, - StorageOnboardingErrorKind::Configuration => Self::Configuration, - StorageOnboardingErrorKind::AlreadyConfigured => Self::AlreadyConfigured, - } - } -} - -#[derive(Debug, uniffi::Error)] -pub enum MobileOnboardingFfiError { - Failed { - kind: MobileOnboardingErrorKind, - title: String, - detail: String, - }, -} - -impl fmt::Display for MobileOnboardingFfiError { - fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Failed { title, detail, .. } => write!(formatter, "{title}: {detail}"), - } - } -} - -impl Error for MobileOnboardingFfiError {} - -impl From for MobileOnboardingFfiError { - fn from(error: StorageOnboardingError) -> Self { - Self::Failed { - kind: error.kind().into(), - title: error.title().to_owned(), - detail: error.detail().to_owned(), - } - } -} - -#[derive(uniffi::Object)] -pub struct MobileOnboardingOperation { - operation: mobile_onboarding::MobileOnboardingOperation, - request: mobile_onboarding::MobileOnboardingRequest, -} - -#[uniffi::export] -impl MobileOnboardingOperation { - pub fn progress(&self) -> MobileOnboardingProgress { - let progress = self.operation.progress(); - MobileOnboardingProgress { - phase: progress.phase().into(), - title: progress.title().to_owned(), - detail: progress.detail().to_owned(), - } - } - - pub fn discover(&self) -> Result { - let discovery = self.operation.discover(&self.request)?; - Ok(MobileOnboardingDiscovery { - branches: discovery.branches().to_vec(), - selected_branch: u32::try_from(discovery.selected_branch()).unwrap_or_default(), - }) - } - - pub fn setup( - &self, - branch: String, - use_existing: bool, - ) -> Result { - let outcome = self.operation.setup(&self.request, &branch, use_existing)?; - Ok(MobileOnboardingOutcome { - title: outcome.title().to_owned(), - detail: outcome.detail().to_owned(), - }) - } - - pub fn connect_local_store(&self) -> Result { - let outcome = self.operation.connect_local_store(&self.request)?; - Ok(MobileOnboardingOutcome { - title: outcome.title().to_owned(), - detail: outcome.detail().to_owned(), - }) - } - - pub fn cancel(&self) { - self.operation.cancel(); - } -} - -#[derive(uniffi::Object)] -pub struct MobileLocalOnboardingOperation { - operation: mobile_onboarding::MobileOnboardingOperation, -} - -#[uniffi::export] -impl MobileLocalOnboardingOperation { - pub fn generate( - &self, - user_id: String, - passphrase: String, - replace_existing_key: bool, - ) -> Result { - let outcome = self.operation.setup_local_generated( - &user_id, - ironstorage::repository::SecretBytes::new(passphrase.into_bytes()), - replace_existing_key, - )?; - Ok(MobileOnboardingOutcome { - title: outcome.title().to_owned(), - detail: outcome.detail().to_owned(), - }) - } - - pub fn cancel(&self) { - self.operation.cancel(); - } -} - -impl From for MobileShell { - fn from(shell: mobile::MobileShell) -> Self { - Self { - selected_tab: shell.selected_tab().into(), - pages: shell - .pages() - .iter() - .map(|page| MobilePage { - tab: page.tab().into(), - title: page.title().to_owned(), - system_image: page.system_image().to_owned(), - selected_system_image: page.selected_system_image().to_owned(), - state: page.state().into(), - state_title: page.state_title().to_owned(), - state_detail: page.state_detail().to_owned(), - }) - .collect(), - } - } -} - -#[derive(Debug, uniffi::Error)] -pub enum MobilePreferenceError { - Configuration { message: String }, -} - -impl fmt::Display for MobilePreferenceError { - fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::Configuration { message } => formatter.write_str(message), - } - } -} - -impl Error for MobilePreferenceError {} - -impl From for MobilePreferenceError { - fn from(error: ConfigError) -> Self { - Self::Configuration { - message: error.to_string(), - } - } -} - -#[uniffi::export] -pub fn product_name() -> String { - ironstorage::PRODUCT_NAME.to_owned() -} - -#[uniffi::export] -pub fn mobile_shell() -> MobileShell { - mobile::MobileShell::load().into() -} - -#[uniffi::export] -pub fn mobile_shell_fixture(state: MobileShellState) -> MobileShell { - mobile::MobileShell::fixture(state.into()).into() -} - -#[uniffi::export] -pub fn set_selected_mobile_tab(tab: MobileTab) -> Result<(), MobilePreferenceError> { - mobile::store_selected_tab(tab.into()).map_err(Into::into) -} - -#[uniffi::export] -pub fn mobile_home_operation( - authentication: Option>, -) -> Arc { - Arc::new(MobileHomeOperation { - operation: mobile_home::MobileHomeOperation::new( - authentication.map(|authentication| Arc::clone(&authentication.authentication)), - ), - }) -} - -#[uniffi::export] -pub fn mobile_totp_operation() -> Arc { - Arc::new(MobileTotpOperation { - operation: StorageTotpOperation::default(), - }) -} - -#[uniffi::export] -pub fn mobile_password_page( - path: Option, -) -> Result { - ironstorage::mobile_passwords::MobilePasswordPage::load(path.as_deref()) - .map(Into::into) - .map_err(Into::into) -} - -#[uniffi::export] -pub fn mobile_password_search(query: String) -> Result { - ironstorage::mobile_passwords::MobilePasswordPage::search(&query) - .map(Into::into) - .map_err(Into::into) -} - -#[uniffi::export] -pub fn mobile_authentication() -> Result, MobileAuthenticationFfiError> { - Ok(Arc::new(MobileAuthentication { - authentication: Arc::new(ironstorage::mobile_authentication::MobileAuthentication::load()?), - })) -} - -#[uniffi::export] -pub fn mobile_key_transfer() -> Result, MobileKeyTransferFfiError> { - Ok(Arc::new(MobileKeyTransfer { - service: ironstorage::mobile_key_transfer::MobileKeyTransferService::load()?, - })) -} - -#[uniffi::export] -pub fn mobile_local_key_transfer_importer() -> Arc { - Arc::new(MobileKeyTransferImport { - importer: Mutex::new( - ironstorage::mobile_key_transfer::MobileKeyTransferImport::local_setup(), - ), - }) -} - -#[uniffi::export] -pub fn mobile_onboarding_operation( - server_url: String, - account: String, - repository_path: String, - application_token: String, -) -> Result, MobileOnboardingFfiError> { - Ok(Arc::new(MobileOnboardingOperation { - operation: mobile_onboarding::MobileOnboardingOperation::default(), - request: mobile_onboarding::MobileOnboardingRequest::new( - server_url, - account, - repository_path, - application_token.into_bytes(), - )?, - })) -} - -#[uniffi::export] -pub fn mobile_local_onboarding_operation() -> Arc { - Arc::new(MobileLocalOnboardingOperation { - operation: mobile_onboarding::MobileOnboardingOperation::default(), - }) -} - -#[uniffi::export] -pub fn replace_configured_mobile_application_token( - account: String, - application_token: String, -) -> Result<(), MobileOnboardingFfiError> { - mobile_onboarding::replace_configured_application_token( - account, - application_token.into_bytes(), - )?; - Ok(()) -} - -#[cfg(test)] -mod tests { - use super::{ - MobileHomeActionKind, MobileHomePhase, MobileOnboardingErrorKind, MobileOnboardingFfiError, - MobileShellState, MobileTab, StorageHomeActionKind, - }; - - #[test] - fn bridge_reads_product_name_from_storage_crate() { - assert_eq!(super::product_name(), ironstorage::PRODUCT_NAME); - } - - #[test] - fn bridge_exposes_every_view_ready_shell_fixture() { - for state in [ - MobileShellState::Loading, - MobileShellState::Empty, - MobileShellState::Ready, - MobileShellState::Locked, - MobileShellState::Error, - ] { - let shell = super::mobile_shell_fixture(state); - assert_eq!(shell.selected_tab, MobileTab::Home); - assert_eq!(shell.pages.len(), 5); - assert!(shell.pages.iter().all(|page| page.state == state)); - } - } - - #[test] - fn bridge_rejects_non_https_before_creating_an_operation() { - let error = match super::mobile_onboarding_operation( - "ssh://example.test".to_owned(), - "alice".to_owned(), - "team/passwords".to_owned(), - "DO-NOT-RENDER".to_owned(), - ) { - Ok(_) => panic!("SSH must be rejected"), - Err(error) => error, - }; - match error { - MobileOnboardingFfiError::Failed { kind, detail, .. } => { - assert_eq!(kind, MobileOnboardingErrorKind::UnsupportedRemote); - assert!(!detail.contains("DO-NOT-RENDER")); - } - } - } - - #[test] - fn home_bridge_preserves_storage_action_kinds() { - assert_eq!( - MobileHomeActionKind::from(StorageHomeActionKind::Push), - MobileHomeActionKind::Push - ); - } - - #[test] - fn home_bridge_does_not_require_entry_authentication() { - let operation = super::mobile_home_operation(None); - assert_eq!(operation.progress().phase, MobileHomePhase::Validating); - operation.cancel(); - } -} +pub use ironstorage_mobile::*; +ironstorage_mobile::uniffi_reexport_scaffolding!(); diff --git a/crates/mobile-bridge/Cargo.toml b/crates/mobile-bridge/Cargo.toml new file mode 100644 index 0000000..a5f012f --- /dev/null +++ b/crates/mobile-bridge/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "ironstorage-mobile" +description = "Shared platform-neutral mobile UniFFI contract" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +publish = false + +[features] +default = [] +watch = [] + +[dependencies] +ironstorage = { path = "../storage", default-features = false, features = ["full"] } +uniffi.workspace = true diff --git a/crates/mobile-bridge/src/lib.rs b/crates/mobile-bridge/src/lib.rs new file mode 100644 index 0000000..6cfc402 --- /dev/null +++ b/crates/mobile-bridge/src/lib.rs @@ -0,0 +1,2508 @@ +#![forbid(unsafe_code)] +#![deny(clippy::disallowed_types)] + +//! Shared UniFFI contract for native phone presentation. Watch exports are opt-in. + +use std::{ + error::Error, + fmt, + sync::{Arc, Mutex}, +}; + +use ironstorage::{ + config::{ConfigError, MobileAppearance as StorageMobileAppearance}, + mobile::{ + self, MobileIcon as StorageIcon, MobileShellState as StorageShellState, + MobileTab as StorageTab, + }, + mobile_authentication::{ + MobileAuthenticationError as StorageAuthenticationError, + MobileAuthenticationErrorKind as StorageAuthenticationErrorKind, + MobileAuthenticationState as StorageAuthenticationState, + MobileEntryCopy as StorageEntryCopy, MobileEntryPresentation as StorageEntryPresentation, + MobilePreferences as StorageMobilePreferences, + }, + mobile_entry::{ + MobileEntryEditorFieldKind as StorageEntryEditorFieldKind, + MobileEntryEditorInput as StorageEntryEditorInput, + MobileEntryEditorPage as StorageEntryEditorPage, + MobileEntryEditorSession as StorageEntryEditorSession, MobileEntryPage as StorageEntryPage, + MobileEntrySectionKind as StorageEntrySectionKind, + }, + mobile_home::{ + self, MobileHomeActionKind as StorageHomeActionKind, + MobileHomeChangeKind as StorageHomeChangeKind, + MobileHomeChangeStatus as StorageHomeChangeStatus, MobileHomeError as StorageHomeError, + MobileHomeErrorKind as StorageHomeErrorKind, MobileHomeFreshness as StorageHomeFreshness, + MobileHomePhase as StorageHomePhase, + }, + mobile_key_transfer::{ + MobileKeyTransferError as StorageKeyTransferError, + MobileKeyTransferKey as StorageKeyTransferKey, + MobileKeyTransferKind as StorageKeyTransferKind, + MobileKeyTransferProgress as StorageKeyTransferProgress, + }, + mobile_mutation::{ + MobileMutationAction as StorageMutationAction, + MobileMutationOutcome as StorageMutationOutcome, MobileMutationPlan as StorageMutationPlan, + MobileMutationRequest as StorageMutationRequest, + }, + mobile_onboarding::{ + self, MobileOnboardingError as StorageOnboardingError, + MobileOnboardingErrorKind as StorageOnboardingErrorKind, + MobileOnboardingPhase as StorageOnboardingPhase, + }, + mobile_passwords::{ + MobilePasswordError as StoragePasswordError, + MobilePasswordErrorKind as StoragePasswordErrorKind, + MobilePasswordRowKind as StoragePasswordRowKind, + }, + mobile_totp::{ + MobileTotpDetail as StorageTotpDetail, + MobileTotpDiscoveryPhase as StorageTotpDiscoveryPhase, + MobileTotpOperation as StorageTotpOperation, MobileTotpPage as StorageTotpPage, + }, +}; + +#[cfg(feature = "watch")] +use ironstorage::{ + mobile_authentication::MobileWatchPreferenceState as StorageWatchPreferenceState, + mobile_watch::{ + MobileWatchSnapshotState as StorageWatchSnapshotState, + MobileWatchSnapshotStatus as StorageWatchSnapshotStatus, + WatchSnapshotTransfer as StorageWatchSnapshotTransfer, + }, +}; + +uniffi::setup_scaffolding!(); + +mod platform; +pub use platform::*; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileIcon { + Home, + Key, + Search, + Timer, + Settings, + Warning, + Branch, + Success, + Sync, + Protected, + Repository, + History, + Incoming, + Outgoing, + Recipients, + Signature, + File, + Merge, + Refresh, + Folder, + User, + Email, + Website, + Text, + Note, +} + +impl From for MobileIcon { + fn from(icon: StorageIcon) -> Self { + match icon { + StorageIcon::Home => Self::Home, + StorageIcon::Key => Self::Key, + StorageIcon::Search => Self::Search, + StorageIcon::Timer => Self::Timer, + StorageIcon::Settings => Self::Settings, + StorageIcon::Warning => Self::Warning, + StorageIcon::Branch => Self::Branch, + StorageIcon::Success => Self::Success, + StorageIcon::Sync => Self::Sync, + StorageIcon::Protected => Self::Protected, + StorageIcon::Repository => Self::Repository, + StorageIcon::History => Self::History, + StorageIcon::Incoming => Self::Incoming, + StorageIcon::Outgoing => Self::Outgoing, + StorageIcon::Recipients => Self::Recipients, + StorageIcon::Signature => Self::Signature, + StorageIcon::File => Self::File, + StorageIcon::Merge => Self::Merge, + StorageIcon::Refresh => Self::Refresh, + StorageIcon::Folder => Self::Folder, + StorageIcon::User => Self::User, + StorageIcon::Email => Self::Email, + StorageIcon::Website => Self::Website, + StorageIcon::Text => Self::Text, + StorageIcon::Note => Self::Note, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileTab { + Home, + Passwords, + Search, + Totp, + Preferences, +} + +impl From for MobileTab { + fn from(tab: StorageTab) -> Self { + match tab { + StorageTab::Home => Self::Home, + StorageTab::Passwords => Self::Passwords, + StorageTab::Search => Self::Search, + StorageTab::Totp => Self::Totp, + StorageTab::Preferences => Self::Preferences, + } + } +} + +impl From for StorageTab { + fn from(tab: MobileTab) -> Self { + match tab { + MobileTab::Home => Self::Home, + MobileTab::Passwords => Self::Passwords, + MobileTab::Search => Self::Search, + MobileTab::Totp => Self::Totp, + MobileTab::Preferences => Self::Preferences, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileShellState { + Loading, + Empty, + Ready, + Locked, + Error, +} + +impl From for MobileShellState { + fn from(state: StorageShellState) -> Self { + match state { + StorageShellState::Loading => Self::Loading, + StorageShellState::Empty => Self::Empty, + StorageShellState::Ready => Self::Ready, + StorageShellState::Locked => Self::Locked, + StorageShellState::Error => Self::Error, + } + } +} + +impl From for StorageShellState { + fn from(state: MobileShellState) -> Self { + match state { + MobileShellState::Loading => Self::Loading, + MobileShellState::Empty => Self::Empty, + MobileShellState::Ready => Self::Ready, + MobileShellState::Locked => Self::Locked, + MobileShellState::Error => Self::Error, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobilePage { + pub tab: MobileTab, + pub title: String, + pub icon: MobileIcon, + pub state: MobileShellState, + pub state_title: String, + pub state_detail: String, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileShell { + pub selected_tab: MobileTab, + pub pages: Vec, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileHomeFreshness { + NeverRefreshed, + Cached, + Current, +} + +impl From for MobileHomeFreshness { + fn from(freshness: StorageHomeFreshness) -> Self { + match freshness { + StorageHomeFreshness::NeverRefreshed => Self::NeverRefreshed, + StorageHomeFreshness::Cached => Self::Cached, + StorageHomeFreshness::Current => Self::Current, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileHomeChangeKind { + PasswordEntry, + RecipientPolicy, + RecipientSignature, + RepositoryFile, +} + +impl From for MobileHomeChangeKind { + fn from(kind: StorageHomeChangeKind) -> Self { + match kind { + StorageHomeChangeKind::PasswordEntry => Self::PasswordEntry, + StorageHomeChangeKind::RecipientPolicy => Self::RecipientPolicy, + StorageHomeChangeKind::RecipientSignature => Self::RecipientSignature, + StorageHomeChangeKind::RepositoryFile => Self::RepositoryFile, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileHomeChangeStatus { + Added, + Modified, + Deleted, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileHomeActionKind { + Commit, + Fetch, + Pull, + Push, +} + +impl From for MobileHomeActionKind { + fn from(kind: StorageHomeActionKind) -> Self { + match kind { + StorageHomeActionKind::Commit => Self::Commit, + StorageHomeActionKind::Fetch => Self::Fetch, + StorageHomeActionKind::Pull => Self::Pull, + StorageHomeActionKind::Push => Self::Push, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileHomeAction { + pub kind: MobileHomeActionKind, + pub title: String, + pub icon: MobileIcon, +} + +impl From for MobileHomeChangeStatus { + fn from(status: StorageHomeChangeStatus) -> Self { + match status { + StorageHomeChangeStatus::Added => Self::Added, + StorageHomeChangeStatus::Modified => Self::Modified, + StorageHomeChangeStatus::Deleted => Self::Deleted, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileHomeSummaryRow { + pub id: String, + pub title: String, + pub detail: String, + pub icon: MobileIcon, + pub actions: Vec, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileHomeChange { + pub id: String, + pub title: String, + pub detail: String, + pub icon: MobileIcon, + pub kind: MobileHomeChangeKind, + pub status: MobileHomeChangeStatus, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileHomeCommit { + pub id: String, + pub title: String, + pub detail: String, + pub icon: MobileIcon, + pub timestamp: i64, + pub changes: Vec, + pub actions: Vec, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileHomeNotice { + pub title: String, + pub detail: String, + pub icon: MobileIcon, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileHomePage { + pub remote_configured: bool, + pub freshness: MobileHomeFreshness, + pub refreshed_at: Option, + pub summaries: Vec, + pub incoming: Vec, + pub outgoing: Vec, + pub incoming_total: u32, + pub outgoing_total: u32, + pub notice: Option, +} + +impl From for MobileHomePage { + fn from(page: mobile_home::MobileHomePage) -> Self { + Self { + remote_configured: page.remote_configured(), + freshness: page.freshness().into(), + refreshed_at: page.refreshed_at(), + summaries: page + .summaries() + .iter() + .map(|row| MobileHomeSummaryRow { + id: row.id().to_owned(), + title: row.title().to_owned(), + detail: row.detail().to_owned(), + icon: row.icon().into(), + actions: row.actions().iter().map(mobile_home_action).collect(), + }) + .collect(), + incoming: page.incoming().iter().map(mobile_home_commit).collect(), + outgoing: page.outgoing().iter().map(mobile_home_commit).collect(), + incoming_total: u32::try_from(page.incoming_total()).unwrap_or(u32::MAX), + outgoing_total: u32::try_from(page.outgoing_total()).unwrap_or(u32::MAX), + notice: page.notice().map(|notice| MobileHomeNotice { + title: notice.title().to_owned(), + detail: notice.detail().to_owned(), + icon: notice.icon().into(), + }), + } + } +} + +fn mobile_home_commit(commit: &mobile_home::MobileHomeCommit) -> MobileHomeCommit { + MobileHomeCommit { + id: commit.id().to_owned(), + title: commit.title().to_owned(), + detail: commit.detail().to_owned(), + icon: commit.icon().into(), + timestamp: commit.timestamp(), + changes: commit + .changes() + .iter() + .map(|change| MobileHomeChange { + id: change.id().to_owned(), + title: change.title().to_owned(), + detail: change.detail().to_owned(), + icon: change.icon().into(), + kind: change.kind().into(), + status: change.status().into(), + }) + .collect(), + actions: commit.actions().iter().map(mobile_home_action).collect(), + } +} + +fn mobile_home_action(action: &mobile_home::MobileHomeAction) -> MobileHomeAction { + MobileHomeAction { + kind: action.kind().into(), + title: action.title().to_owned(), + icon: action.icon().into(), + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileHomePhase { + Validating, + Authenticating, + Receiving, + Integrating, + Sending, + Finishing, +} + +impl From for MobileHomePhase { + fn from(phase: StorageHomePhase) -> Self { + match phase { + StorageHomePhase::Validating => Self::Validating, + StorageHomePhase::Authenticating => Self::Authenticating, + StorageHomePhase::Receiving => Self::Receiving, + StorageHomePhase::Integrating => Self::Integrating, + StorageHomePhase::Sending => Self::Sending, + StorageHomePhase::Finishing => Self::Finishing, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileHomeProgress { + pub action: Option, + pub phase: MobileHomePhase, + pub title: String, + pub detail: String, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileHomeErrorKind { + MissingConfiguration, + Configuration, + Authentication, + Conflict, + DirtyLocalChanges, + NoChanges, + Offline, + Interrupted, + SecureStorage, + Repository, + PartialProgress, +} + +impl From for MobileHomeErrorKind { + fn from(kind: StorageHomeErrorKind) -> Self { + match kind { + StorageHomeErrorKind::MissingConfiguration => Self::MissingConfiguration, + StorageHomeErrorKind::Configuration => Self::Configuration, + StorageHomeErrorKind::Authentication => Self::Authentication, + StorageHomeErrorKind::Conflict => Self::Conflict, + StorageHomeErrorKind::DirtyLocalChanges => Self::DirtyLocalChanges, + StorageHomeErrorKind::NoChanges => Self::NoChanges, + StorageHomeErrorKind::Offline => Self::Offline, + StorageHomeErrorKind::Interrupted => Self::Interrupted, + StorageHomeErrorKind::SecureStorage => Self::SecureStorage, + StorageHomeErrorKind::Repository => Self::Repository, + StorageHomeErrorKind::PartialProgress => Self::PartialProgress, + } + } +} + +#[derive(uniffi::Error)] +pub enum MobileHomeFfiError { + Failed { + kind: MobileHomeErrorKind, + title: String, + detail: String, + }, +} + +impl fmt::Debug for MobileHomeFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("MobileHomeFfiError([REDACTED])") + } +} + +impl fmt::Display for MobileHomeFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(self, formatter) + } +} + +impl Error for MobileHomeFfiError {} + +impl From for MobileHomeFfiError { + fn from(error: StorageHomeError) -> Self { + Self::Failed { + kind: error.kind().into(), + title: error.title().to_owned(), + detail: error.detail().to_owned(), + } + } +} + +#[derive(uniffi::Object)] +pub struct MobileHomeOperation { + operation: mobile_home::MobileHomeOperation, +} + +#[uniffi::export] +impl MobileHomeOperation { + pub fn progress(&self) -> MobileHomeProgress { + let progress = self.operation.progress(); + MobileHomeProgress { + action: progress.action().map(Into::into), + phase: progress.phase().into(), + title: progress.title().to_owned(), + detail: progress.detail().to_owned(), + } + } + + pub fn cached(&self) -> Result { + self.operation.cached().map(Into::into).map_err(Into::into) + } + + pub fn refresh_if_stale(&self) -> Result { + self.operation + .refresh_if_stale() + .map(Into::into) + .map_err(Into::into) + } + + pub fn commit(&self, message: String) -> Result { + self.operation + .commit(&message) + .map(Into::into) + .map_err(Into::into) + } + + pub fn fetch(&self) -> Result { + self.operation.fetch().map(Into::into).map_err(Into::into) + } + + pub fn pull(&self) -> Result { + self.operation.pull().map(Into::into).map_err(Into::into) + } + + pub fn push(&self) -> Result { + self.operation.push().map(Into::into).map_err(Into::into) + } + + pub fn sync(&self) -> Result { + self.operation.sync().map(Into::into).map_err(Into::into) + } + + pub fn cancel(&self) { + self.operation.cancel(); + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobilePasswordRowKind { + Directory, + Entry, +} + +impl From for MobilePasswordRowKind { + fn from(kind: StoragePasswordRowKind) -> Self { + match kind { + StoragePasswordRowKind::Directory => Self::Directory, + StoragePasswordRowKind::Entry => Self::Entry, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobilePasswordRow { + pub id: String, + pub path: String, + pub title: String, + pub detail: String, + pub icon: MobileIcon, + pub kind: MobilePasswordRowKind, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobilePasswordPage { + pub id: String, + pub path: String, + pub title: String, + pub rows: Vec, +} + +impl From for MobilePasswordPage { + fn from(page: ironstorage::mobile_passwords::MobilePasswordPage) -> Self { + Self { + id: page.id().to_owned(), + path: page.path().to_owned(), + title: page.title().to_owned(), + rows: page + .rows() + .iter() + .map(|row| MobilePasswordRow { + id: row.id().to_owned(), + path: row.path().to_owned(), + title: row.title().to_owned(), + detail: row.detail().to_owned(), + icon: row.icon().into(), + kind: row.kind().into(), + }) + .collect(), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobilePasswordErrorKind { + MissingConfiguration, + Configuration, + InvalidPath, + DirectoryMissing, + Repository, +} + +impl From for MobilePasswordErrorKind { + fn from(kind: StoragePasswordErrorKind) -> Self { + match kind { + StoragePasswordErrorKind::MissingConfiguration => Self::MissingConfiguration, + StoragePasswordErrorKind::Configuration => Self::Configuration, + StoragePasswordErrorKind::InvalidPath => Self::InvalidPath, + StoragePasswordErrorKind::DirectoryMissing => Self::DirectoryMissing, + StoragePasswordErrorKind::Repository => Self::Repository, + } + } +} + +#[derive(uniffi::Error)] +pub enum MobilePasswordFfiError { + Failed { + kind: MobilePasswordErrorKind, + title: String, + detail: String, + }, +} + +impl fmt::Debug for MobilePasswordFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("MobilePasswordFfiError([REDACTED])") + } +} + +impl fmt::Display for MobilePasswordFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(self, formatter) + } +} + +impl Error for MobilePasswordFfiError {} + +impl From for MobilePasswordFfiError { + fn from(error: StoragePasswordError) -> Self { + Self::Failed { + kind: error.kind().into(), + title: error.title().to_owned(), + detail: error.detail().to_owned(), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileAuthenticationErrorKind { + PassphraseRequired, + InvalidPassphrase, + Cancelled, + BiometryUnavailable, + Configuration, + KeyMaterial, + Entry, + SecureStorage, + Expired, + Conflict, +} + +impl From for MobileAuthenticationErrorKind { + fn from(kind: StorageAuthenticationErrorKind) -> Self { + match kind { + StorageAuthenticationErrorKind::PassphraseRequired => Self::PassphraseRequired, + StorageAuthenticationErrorKind::InvalidPassphrase => Self::InvalidPassphrase, + StorageAuthenticationErrorKind::Cancelled => Self::Cancelled, + StorageAuthenticationErrorKind::BiometryUnavailable => Self::BiometryUnavailable, + StorageAuthenticationErrorKind::Configuration => Self::Configuration, + StorageAuthenticationErrorKind::KeyMaterial => Self::KeyMaterial, + StorageAuthenticationErrorKind::Entry => Self::Entry, + StorageAuthenticationErrorKind::SecureStorage => Self::SecureStorage, + StorageAuthenticationErrorKind::Expired => Self::Expired, + StorageAuthenticationErrorKind::Conflict => Self::Conflict, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileAuthenticationState { + pub unlocked: bool, + pub biometric_unlock_enabled: bool, + pub remaining_seconds: u64, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileAppearance { + System, + Light, + Dark, +} + +impl From for MobileAppearance { + fn from(appearance: StorageMobileAppearance) -> Self { + match appearance { + StorageMobileAppearance::System => Self::System, + StorageMobileAppearance::Light => Self::Light, + StorageMobileAppearance::Dark => Self::Dark, + } + } +} + +impl From for StorageMobileAppearance { + fn from(appearance: MobileAppearance) -> Self { + match appearance { + MobileAppearance::System => Self::System, + MobileAppearance::Light => Self::Light, + MobileAppearance::Dark => Self::Dark, + } + } +} + +#[cfg(feature = "watch")] +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileWatchPreferenceState { + Unsupported, + NotPaired, + AppNotInstalled, + Ready, + Pending, + Delivered, + Current, + Failed, +} + +#[cfg(feature = "watch")] +impl From for MobileWatchPreferenceState { + fn from(state: StorageWatchPreferenceState) -> Self { + match state { + StorageWatchPreferenceState::Unsupported => Self::Unsupported, + StorageWatchPreferenceState::NotPaired => Self::NotPaired, + StorageWatchPreferenceState::AppNotInstalled => Self::AppNotInstalled, + StorageWatchPreferenceState::Ready => Self::Ready, + StorageWatchPreferenceState::Pending => Self::Pending, + StorageWatchPreferenceState::Delivered => Self::Delivered, + StorageWatchPreferenceState::Current => Self::Current, + StorageWatchPreferenceState::Failed => Self::Failed, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobilePreferences { + pub sync_configured: bool, + pub repository_title: String, + pub repository_url: String, + pub server_title: String, + pub server_identity: String, + pub application_account: Option, + pub default_key_title: String, + pub default_key_fingerprint: String, + pub authentication_timeout_seconds: u64, + pub biometric_unlock_enabled: bool, + pub appearance: MobileAppearance, + #[cfg(feature = "watch")] + pub watch_state: MobileWatchPreferenceState, + #[cfg(feature = "watch")] + pub watch_title: String, + #[cfg(feature = "watch")] + pub watch_detail: String, +} + +impl From for MobilePreferences { + fn from(preferences: StorageMobilePreferences) -> Self { + Self { + sync_configured: preferences.sync_configured(), + repository_title: preferences.repository_title().to_owned(), + repository_url: preferences.repository_url().to_owned(), + server_title: preferences.server_title().to_owned(), + server_identity: preferences.server_identity().to_owned(), + application_account: preferences.application_account().map(str::to_owned), + default_key_title: preferences.default_key_title().to_owned(), + default_key_fingerprint: preferences.default_key_fingerprint().to_owned(), + authentication_timeout_seconds: preferences.authentication_timeout_seconds(), + biometric_unlock_enabled: preferences.biometric_unlock_enabled(), + appearance: preferences.appearance().into(), + #[cfg(feature = "watch")] + watch_state: preferences.watch_state().into(), + #[cfg(feature = "watch")] + watch_title: preferences.watch_title().to_owned(), + #[cfg(feature = "watch")] + watch_detail: preferences.watch_detail().to_owned(), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileGitIdentity { + pub name: String, + pub email: String, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileMutationAction { + Move, + Copy, + Delete, +} + +impl From for MobileMutationAction { + fn from(action: StorageMutationAction) -> Self { + match action { + StorageMutationAction::Move => Self::Move, + StorageMutationAction::Copy => Self::Copy, + StorageMutationAction::Delete => Self::Delete, + } + } +} + +impl From for StorageMutationAction { + fn from(action: MobileMutationAction) -> Self { + match action { + MobileMutationAction::Move => Self::Move, + MobileMutationAction::Copy => Self::Copy, + MobileMutationAction::Delete => Self::Delete, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileMutationDestination { + pub path: String, + pub title: String, + pub detail: String, + pub requires_overwrite: bool, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileMutationPlan { + pub action: MobileMutationAction, + pub source: String, + pub source_title: String, + pub revision: String, + pub destinations: Vec, + pub has_open_editor: bool, + pub has_dirty_editor: bool, +} + +impl From for MobileMutationPlan { + fn from(plan: StorageMutationPlan) -> Self { + Self { + action: plan.action().into(), + source: plan.source().to_owned(), + source_title: plan.source_title().to_owned(), + revision: plan.revision().to_owned(), + destinations: plan + .destinations() + .iter() + .map(|destination| MobileMutationDestination { + path: destination.path().to_owned(), + title: destination.title().to_owned(), + detail: destination.detail().to_owned(), + requires_overwrite: destination.requires_overwrite(), + }) + .collect(), + has_open_editor: plan.has_open_editor(), + has_dirty_editor: plan.has_dirty_editor(), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileMutationRequest { + pub action: MobileMutationAction, + pub source: String, + pub revision: String, + pub destination: Option, + pub confirmed: bool, + pub overwrite: bool, + pub discard_editor: bool, +} + +impl From for StorageMutationRequest { + fn from(request: MobileMutationRequest) -> Self { + Self { + action: request.action.into(), + source: request.source, + revision: request.revision, + destination: request.destination, + confirmed: request.confirmed, + overwrite: request.overwrite, + discard_editor: request.discard_editor, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileMutationOutcome { + pub action: MobileMutationAction, + pub source: String, + pub destination: Option, + pub title: String, + pub detail: String, +} + +impl From for MobileMutationOutcome { + fn from(outcome: StorageMutationOutcome) -> Self { + Self { + action: outcome.action().into(), + source: outcome.source().to_owned(), + destination: outcome.destination().map(str::to_owned), + title: outcome.title().to_owned(), + detail: outcome.detail().to_owned(), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileEntrySectionKind { + Password, + Details, + OneTimePassword, + Notes, +} + +impl From for MobileEntrySectionKind { + fn from(kind: StorageEntrySectionKind) -> Self { + match kind { + StorageEntrySectionKind::Password => Self::Password, + StorageEntrySectionKind::Details => Self::Details, + StorageEntrySectionKind::OneTimePassword => Self::OneTimePassword, + StorageEntrySectionKind::Notes => Self::Notes, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntryField { + pub id: u64, + pub label: String, + pub icon: MobileIcon, + pub value: Option, + pub masked_value: String, + pub detail: Option, + pub diagnostic: Option, + pub sensitive: bool, + pub multiline: bool, + pub selectable: bool, + pub editable: bool, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntrySection { + pub kind: MobileEntrySectionKind, + pub title: String, + pub fields: Vec, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntryPage { + pub id: String, + pub title: String, + pub sections: Vec, +} + +impl From for MobileEntryPage { + fn from(page: StorageEntryPage) -> Self { + Self { + id: page.id().to_owned(), + title: page.title().to_owned(), + sections: page + .sections() + .iter() + .map(|section| MobileEntrySection { + kind: section.kind().into(), + title: section.title().to_owned(), + fields: section + .fields() + .iter() + .map(|field| MobileEntryField { + id: field.id(), + label: field.label().to_owned(), + icon: field.icon().into(), + value: field.value().map(str::to_owned), + masked_value: field.masked_value().to_owned(), + detail: field.detail().map(str::to_owned), + diagnostic: field.diagnostic().map(str::to_owned), + sensitive: field.sensitive(), + multiline: field.multiline(), + selectable: field.selectable(), + editable: field.editable(), + }) + .collect(), + }) + .collect(), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntryCopy { + pub value: String, + pub timeout_seconds: u64, +} + +#[cfg(feature = "watch")] +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileWatchSnapshotState { + Unavailable, + Unpaired, + Pending, + Delivered, + Current, + Failed, +} + +#[cfg(feature = "watch")] +impl From for MobileWatchSnapshotState { + fn from(state: StorageWatchSnapshotState) -> Self { + match state { + StorageWatchSnapshotState::Unavailable => Self::Unavailable, + StorageWatchSnapshotState::Unpaired => Self::Unpaired, + StorageWatchSnapshotState::Pending => Self::Pending, + StorageWatchSnapshotState::Delivered => Self::Delivered, + StorageWatchSnapshotState::Current => Self::Current, + StorageWatchSnapshotState::Failed => Self::Failed, + } + } +} + +#[cfg(feature = "watch")] +#[derive(Clone, uniffi::Record)] +pub struct MobileWatchSnapshotStatus { + pub state: MobileWatchSnapshotState, + pub revision: Option, + pub detail: String, +} + +#[cfg(feature = "watch")] +impl From<&StorageWatchSnapshotStatus> for MobileWatchSnapshotStatus { + fn from(status: &StorageWatchSnapshotStatus) -> Self { + Self { + state: status.state().into(), + revision: status.revision(), + detail: status.detail().to_owned(), + } + } +} + +#[cfg(feature = "watch")] +#[derive(Clone, uniffi::Record)] +pub struct MobileWatchSnapshotTransfer { + pub revision: u64, + pub selected_entries: u32, + pub snapshot: Vec, + pub delivered_receipt: Vec, +} + +#[cfg(feature = "watch")] +impl From for MobileWatchSnapshotTransfer { + fn from(transfer: StorageWatchSnapshotTransfer) -> Self { + Self { + revision: transfer.revision(), + selected_entries: transfer.selected_entries(), + snapshot: transfer.snapshot().expose().to_vec(), + delivered_receipt: transfer.delivered_receipt().to_vec(), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileTotpRow { + pub path: String, + pub issuer: Option, + pub account: String, + pub title: String, + pub detail: String, + #[cfg(feature = "watch")] + pub shared_with_watch: bool, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileTotpPage { + pub rows: Vec, + pub unavailable_entries: u32, + pub cache_notice: Option, + #[cfg(feature = "watch")] + pub watch: MobileWatchSnapshotStatus, +} + +impl From for MobileTotpPage { + fn from(page: StorageTotpPage) -> Self { + Self { + rows: page + .rows() + .iter() + .map(|row| MobileTotpRow { + path: row.path().to_owned(), + issuer: row.issuer().map(str::to_owned), + account: row.account().to_owned(), + title: row.title().to_owned(), + detail: row.detail().to_owned(), + #[cfg(feature = "watch")] + shared_with_watch: row.shared_with_watch(), + }) + .collect(), + unavailable_entries: page.unavailable_entries(), + cache_notice: page.cache_notice().map(str::to_owned), + #[cfg(feature = "watch")] + watch: page.watch().into(), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileTotpDiscoveryPhase { + Preparing, + Inspecting, + Saving, + Complete, + Cancelled, +} + +impl From for MobileTotpDiscoveryPhase { + fn from(phase: StorageTotpDiscoveryPhase) -> Self { + match phase { + StorageTotpDiscoveryPhase::Preparing => Self::Preparing, + StorageTotpDiscoveryPhase::Inspecting => Self::Inspecting, + StorageTotpDiscoveryPhase::Saving => Self::Saving, + StorageTotpDiscoveryPhase::Complete => Self::Complete, + StorageTotpDiscoveryPhase::Cancelled => Self::Cancelled, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileTotpDiscoveryProgress { + pub phase: MobileTotpDiscoveryPhase, + pub total: u32, + pub inspected: u32, + pub cache_hits: u32, + pub matches: u32, + pub unavailable: u32, +} + +#[derive(uniffi::Object)] +pub struct MobileTotpOperation { + operation: StorageTotpOperation, +} + +#[uniffi::export] +impl MobileTotpOperation { + pub fn progress(&self) -> MobileTotpDiscoveryProgress { + let progress = self.operation.progress(); + MobileTotpDiscoveryProgress { + phase: progress.phase().into(), + total: progress.total(), + inspected: progress.inspected(), + cache_hits: progress.cache_hits(), + matches: progress.matches(), + unavailable: progress.unavailable(), + } + } + + pub fn cancel(&self) { + self.operation.cancel(); + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileTotpDetail { + pub path: String, + pub issuer: Option, + pub account: String, + pub code: String, + pub valid_until: u64, + pub period: u64, + #[cfg(feature = "watch")] + pub shared_with_watch: bool, + #[cfg(feature = "watch")] + pub watch: MobileWatchSnapshotStatus, +} + +impl From for MobileTotpDetail { + fn from(detail: StorageTotpDetail) -> Self { + Self { + path: detail.path().to_owned(), + issuer: detail.issuer().map(str::to_owned), + account: detail.account().to_owned(), + code: String::from_utf8(detail.code().expose().to_vec()) + .expect("storage-generated TOTP codes are ASCII"), + valid_until: detail.valid_until(), + period: detail.period(), + #[cfg(feature = "watch")] + shared_with_watch: detail.shared_with_watch(), + #[cfg(feature = "watch")] + watch: detail.watch().into(), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntryPresentation { + pub page: MobileEntryPage, + pub totp: Option, + pub cache_notice: Option, +} + +impl From for MobileEntryPresentation { + fn from(presentation: StorageEntryPresentation) -> Self { + let (page, totp, cache_notice) = presentation.into_parts(); + Self { + page: page.into(), + totp: totp.map(Into::into), + cache_notice, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileEntryEditorFieldKind { + Password, + Field, + Note, + OtpUri, +} + +impl From for MobileEntryEditorFieldKind { + fn from(kind: StorageEntryEditorFieldKind) -> Self { + match kind { + StorageEntryEditorFieldKind::Password => Self::Password, + StorageEntryEditorFieldKind::Field => Self::Field, + StorageEntryEditorFieldKind::Note => Self::Note, + StorageEntryEditorFieldKind::OtpUri => Self::OtpUri, + } + } +} + +impl From for StorageEntryEditorFieldKind { + fn from(kind: MobileEntryEditorFieldKind) -> Self { + match kind { + MobileEntryEditorFieldKind::Password => Self::Password, + MobileEntryEditorFieldKind::Field => Self::Field, + MobileEntryEditorFieldKind::Note => Self::Note, + MobileEntryEditorFieldKind::OtpUri => Self::OtpUri, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntryEditorField { + pub id: u64, + pub kind: MobileEntryEditorFieldKind, + pub name: Option, + pub label: String, + pub icon: MobileIcon, + pub value: Option, + pub masked_value: String, + pub diagnostic: Option, + pub sensitive: bool, + pub multiline: bool, + pub name_editable: bool, + pub removable: bool, + pub reorderable: bool, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntryEditorPage { + pub path: String, + pub title: String, + pub fields: Vec, + pub dirty: bool, + pub creating: bool, + pub default_password_length: u32, + pub maximum_password_length: u32, +} + +impl From<&StorageEntryEditorPage> for MobileEntryEditorPage { + fn from(page: &StorageEntryEditorPage) -> Self { + Self { + path: page.path().to_owned(), + title: page.title().to_owned(), + fields: page + .fields() + .iter() + .map(|field| MobileEntryEditorField { + id: field.id(), + kind: field.kind().into(), + name: field.name().map(str::to_owned), + label: field.label().to_owned(), + icon: field.icon().into(), + value: field.value().map(str::to_owned), + masked_value: field.masked_value().to_owned(), + diagnostic: field.diagnostic().map(str::to_owned), + sensitive: field.sensitive(), + multiline: field.multiline(), + name_editable: field.name_editable(), + removable: field.removable(), + reorderable: field.reorderable(), + }) + .collect(), + dirty: page.dirty(), + creating: page.creating(), + default_password_length: page.default_password_length(), + maximum_password_length: page.maximum_password_length(), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntryEditorSession { + pub id: u64, + pub page: MobileEntryEditorPage, +} + +impl From for MobileEntryEditorSession { + fn from(session: StorageEntryEditorSession) -> Self { + Self { + id: session.id(), + page: session.page().into(), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileEntryEditorInput { + pub id: u64, + pub name: Option, + pub value: Option, +} + +impl From for StorageEntryEditorInput { + fn from(input: MobileEntryEditorInput) -> Self { + Self::new(input.id, input.name, input.value) + } +} + +impl From for MobileEntryCopy { + fn from(copy: StorageEntryCopy) -> Self { + Self { + value: copy.value().to_owned(), + timeout_seconds: copy.timeout_seconds(), + } + } +} + +impl From for MobileAuthenticationState { + fn from(state: StorageAuthenticationState) -> Self { + Self { + unlocked: state.unlocked(), + biometric_unlock_enabled: state.biometric_unlock_enabled(), + remaining_seconds: state.remaining_seconds(), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileKeyTransferKind { + Public, + Private, +} + +impl From for MobileKeyTransferKind { + fn from(kind: StorageKeyTransferKind) -> Self { + match kind { + StorageKeyTransferKind::Public => Self::Public, + StorageKeyTransferKind::Private => Self::Private, + } + } +} + +impl From for StorageKeyTransferKind { + fn from(kind: MobileKeyTransferKind) -> Self { + match kind { + MobileKeyTransferKind::Public => Self::Public, + MobileKeyTransferKind::Private => Self::Private, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileKeyTransferKey { + pub fingerprint: String, + pub title: String, + pub detail: String, + pub kind: MobileKeyTransferKind, + pub requires_passphrase: bool, +} + +impl From<&StorageKeyTransferKey> for MobileKeyTransferKey { + fn from(key: &StorageKeyTransferKey) -> Self { + Self { + fingerprint: key.fingerprint().to_owned(), + title: key.title().to_owned(), + detail: key.detail().to_owned(), + kind: key.kind().into(), + requires_passphrase: key.requires_passphrase(), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileKeyTransferFrame { + pub sequence: u32, + pub total: u32, + pub width: u32, + pub modules: Vec, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileKeyTransferExport { + pub key: MobileKeyTransferKey, + pub frames: Vec, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileKeyTransferProgress { + pub received: u32, + pub total: u32, + pub duplicate: bool, + pub key: Option, +} + +impl From for MobileKeyTransferProgress { + fn from(progress: StorageKeyTransferProgress) -> Self { + Self { + received: u32::try_from(progress.received()).unwrap_or(u32::MAX), + total: u32::try_from(progress.total()).unwrap_or(u32::MAX), + duplicate: progress.duplicate(), + key: progress.key().map(Into::into), + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileKeyTransferOutcome { + pub title: String, + pub detail: String, +} + +#[derive(uniffi::Error)] +pub enum MobileKeyTransferFfiError { + Failed { + kind: MobileKeyTransferErrorKind, + message: String, + }, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileKeyTransferErrorKind { + ExistingKey, + Failed, +} + +impl fmt::Debug for MobileKeyTransferFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("MobileKeyTransferFfiError([REDACTED])") + } +} + +impl fmt::Display for MobileKeyTransferFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(self, formatter) + } +} + +impl Error for MobileKeyTransferFfiError {} + +impl From for MobileKeyTransferFfiError { + fn from(error: StorageKeyTransferError) -> Self { + let kind = match &error { + StorageKeyTransferError::ExistingKey => MobileKeyTransferErrorKind::ExistingKey, + StorageKeyTransferError::LocalSetup(error) + if error.kind() == StorageOnboardingErrorKind::ExistingKey => + { + MobileKeyTransferErrorKind::ExistingKey + } + _ => MobileKeyTransferErrorKind::Failed, + }; + Self::Failed { + kind, + message: error.to_string(), + } + } +} + +#[derive(uniffi::Object)] +pub struct MobileKeyTransfer { + service: ironstorage::mobile_key_transfer::MobileKeyTransferService, +} + +#[uniffi::export] +impl MobileKeyTransfer { + pub fn keys(&self) -> Vec { + self.service.keys().iter().map(Into::into).collect() + } + + pub fn export( + &self, + fingerprint: String, + kind: MobileKeyTransferKind, + passphrase: Option, + ) -> Result { + let exported = self.service.export( + &fingerprint, + kind.into(), + passphrase.map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), + )?; + let frames = exported + .frames() + .iter() + .map(|frame| { + let matrix = frame.matrix(); + let mut modules = Vec::with_capacity(matrix.width() * matrix.width()); + for y in 0..matrix.width() { + for x in 0..matrix.width() { + modules.push(u8::from(matrix.is_dark(x, y).unwrap_or(false))); + } + } + MobileKeyTransferFrame { + sequence: u32::try_from(frame.sequence()).unwrap_or(u32::MAX), + total: u32::try_from(frame.total()).unwrap_or(u32::MAX), + width: u32::try_from(matrix.width()).unwrap_or(u32::MAX), + modules, + } + }) + .collect(); + Ok(MobileKeyTransferExport { + key: exported.key().into(), + frames, + }) + } + + pub fn importer(&self) -> Arc { + Arc::new(MobileKeyTransferImport { + importer: Mutex::new(self.service.importer()), + }) + } +} + +#[derive(uniffi::Object)] +pub struct MobileKeyTransferImport { + importer: Mutex, +} + +#[uniffi::export] +impl MobileKeyTransferImport { + pub fn add_frame( + &self, + payload: String, + ) -> Result { + self.importer + .lock() + .map_err(|_| MobileKeyTransferFfiError::Failed { + kind: MobileKeyTransferErrorKind::Failed, + message: "the key-transfer session is unavailable".to_owned(), + })? + .add_frame(ironstorage::repository::SecretBytes::new( + payload.into_bytes(), + )) + .map(Into::into) + .map_err(Into::into) + } + + pub fn import( + &self, + passphrase: Option, + make_default: bool, + overwrite: bool, + ) -> Result { + let outcome = self + .importer + .lock() + .map_err(|_| MobileKeyTransferFfiError::Failed { + kind: MobileKeyTransferErrorKind::Failed, + message: "the key-transfer session is unavailable".to_owned(), + })? + .import( + passphrase + .map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), + make_default, + overwrite, + )?; + Ok(MobileKeyTransferOutcome { + title: outcome.title().to_owned(), + detail: outcome.detail().to_owned(), + }) + } +} + +#[derive(uniffi::Error)] +pub enum MobileAuthenticationFfiError { + Failed { + kind: MobileAuthenticationErrorKind, + title: String, + detail: String, + }, +} + +impl fmt::Debug for MobileAuthenticationFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("MobileAuthenticationFfiError([REDACTED])") + } +} + +impl fmt::Display for MobileAuthenticationFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(self, formatter) + } +} + +impl Error for MobileAuthenticationFfiError {} + +impl From for MobileAuthenticationFfiError { + fn from(error: StorageAuthenticationError) -> Self { + Self::Failed { + kind: error.kind().into(), + title: error.title().to_owned(), + detail: error.detail().to_owned(), + } + } +} + +#[derive(uniffi::Object)] +pub struct MobileAuthentication { + authentication: Arc, +} + +#[uniffi::export] +impl MobileAuthentication { + pub fn state(&self) -> Result { + self.authentication + .state() + .map(Into::into) + .map_err(Into::into) + } + + pub fn git_identity(&self) -> Result { + self.authentication + .git_identity() + .map(|identity| MobileGitIdentity { + name: identity.name().to_owned(), + email: identity.email().to_owned(), + }) + .map_err(Into::into) + } + + pub fn mobile_appearance(&self) -> Result { + self.authentication + .mobile_appearance() + .map(Into::into) + .map_err(Into::into) + } + + pub fn set_authentication_timeout( + &self, + seconds: u64, + ) -> Result<(), MobileAuthenticationFfiError> { + self.authentication + .set_authentication_timeout(seconds) + .map_err(Into::into) + } + + pub fn set_mobile_appearance( + &self, + appearance: MobileAppearance, + ) -> Result<(), MobileAuthenticationFfiError> { + self.authentication + .set_mobile_appearance(appearance.into()) + .map_err(Into::into) + } + + pub fn remove_application_token(&self) -> Result<(), MobileAuthenticationFfiError> { + self.authentication + .remove_application_token() + .map_err(Into::into) + } + + pub fn set_git_identity( + &self, + name: String, + email: String, + ) -> Result { + self.authentication + .set_git_identity(name, email) + .map(|identity| MobileGitIdentity { + name: identity.name().to_owned(), + email: identity.email().to_owned(), + }) + .map_err(Into::into) + } + + pub fn unlock_entry( + &self, + path: String, + passphrase: Option, + ) -> Result { + self.authentication + .unlock_entry( + &path, + passphrase + .map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), + ) + .map(Into::into) + .map_err(Into::into) + } + + pub fn set_biometric_unlock( + &self, + enabled: bool, + ) -> Result { + self.authentication + .set_biometric_unlock(enabled) + .map(Into::into) + .map_err(Into::into) + } + + pub fn touch_user_activity(&self) -> Result<(), MobileAuthenticationFfiError> { + self.authentication + .touch_user_activity() + .map_err(Into::into) + } + + pub fn entry_page( + &self, + path: String, + unix_seconds: u64, + ) -> Result { + self.authentication + .entry_page(&path, unix_seconds) + .map(Into::into) + .map_err(Into::into) + } + + pub fn reveal_entry_field( + &self, + path: String, + field: u64, + ) -> Result { + self.authentication + .reveal_entry_field(&path, field) + .map_err(Into::into) + } + + pub fn copy_entry_field( + &self, + path: String, + field: u64, + ) -> Result { + self.authentication + .copy_entry_field(&path, field) + .map(Into::into) + .map_err(Into::into) + } + + pub fn prepare_entry_mutation( + &self, + path: String, + action: MobileMutationAction, + ) -> Result { + self.authentication + .prepare_entry_mutation(&path, action.into()) + .map(Into::into) + .map_err(Into::into) + } + + pub fn perform_entry_mutation( + &self, + request: MobileMutationRequest, + ) -> Result { + self.authentication + .perform_entry_mutation(request.into()) + .map(Into::into) + .map_err(Into::into) + } + + pub fn replace_entry_field( + &self, + path: String, + field: u64, + value: String, + ) -> Result { + self.authentication + .replace_entry_field(&path, field, value) + .map(Into::into) + .map_err(Into::into) + } + + pub fn begin_entry_editor( + &self, + path: String, + ) -> Result { + self.authentication + .begin_entry_editor(&path) + .map(Into::into) + .map_err(Into::into) + } + + pub fn unlock_totp( + &self, + passphrase: Option, + ) -> Result { + self.authentication + .unlock_totp( + passphrase + .map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), + ) + .map(Into::into) + .map_err(Into::into) + } + + pub fn totp_page( + &self, + operation: Arc, + ) -> Result { + self.authentication + .totp_page(&operation.operation) + .map(Into::into) + .map_err(Into::into) + } + + pub fn cached_totp_page(&self) -> Result, MobileAuthenticationFfiError> { + self.authentication + .cached_totp_page() + .map(|page| page.map(Into::into)) + .map_err(Into::into) + } + + pub fn search_cached_totp_page( + &self, + query: String, + ) -> Result, MobileAuthenticationFfiError> { + self.authentication + .search_cached_totp_page(&query) + .map(|page| page.map(Into::into)) + .map_err(Into::into) + } + + pub fn totp_detail( + &self, + path: String, + unix_seconds: u64, + ) -> Result { + self.authentication + .totp_detail(&path, unix_seconds) + .map(Into::into) + .map_err(Into::into) + } + + pub fn copy_totp_code( + &self, + path: String, + unix_seconds: u64, + ) -> Result { + self.authentication + .copy_totp_code(&path, unix_seconds) + .map(Into::into) + .map_err(Into::into) + } + + pub fn begin_create_entry( + &self, + directory: String, + name: String, + passphrase: Option, + ) -> Result { + self.authentication + .begin_create_entry( + &directory, + &name, + passphrase + .map(|value| ironstorage::repository::SecretBytes::new(value.into_bytes())), + ) + .map(Into::into) + .map_err(Into::into) + } + + pub fn create_directory( + &self, + parent: String, + name: String, + ) -> Result<(), MobileAuthenticationFfiError> { + self.authentication + .create_directory(&parent, &name) + .map_err(Into::into) + } + + pub fn entry_editor( + &self, + editor: u64, + ) -> Result { + self.authentication + .entry_editor(editor) + .map(|page| (&page).into()) + .map_err(Into::into) + } + + pub fn update_entry_editor( + &self, + editor: u64, + fields: Vec, + ) -> Result { + self.authentication + .update_entry_editor(editor, fields.into_iter().map(Into::into).collect()) + .map(|page| (&page).into()) + .map_err(Into::into) + } + + pub fn add_entry_editor_field( + &self, + editor: u64, + kind: MobileEntryEditorFieldKind, + name: Option, + value: String, + ) -> Result { + self.authentication + .add_entry_editor_field(editor, kind.into(), name, value) + .map(|page| (&page).into()) + .map_err(Into::into) + } + + pub fn add_entry_editor_otp_image( + &self, + editor: u64, + image: Vec, + ) -> Result { + self.authentication + .add_entry_editor_otp_image(editor, ironstorage::repository::SecretBytes::new(image)) + .map(|page| (&page).into()) + .map_err(Into::into) + } + + pub fn remove_entry_editor_field( + &self, + editor: u64, + field: u64, + ) -> Result { + self.authentication + .remove_entry_editor_field(editor, field) + .map(|page| (&page).into()) + .map_err(Into::into) + } + + pub fn reorder_entry_editor_field( + &self, + editor: u64, + field: u64, + index: u32, + ) -> Result { + self.authentication + .reorder_entry_editor_field(editor, field, index as usize) + .map(|page| (&page).into()) + .map_err(Into::into) + } + + pub fn generate_entry_editor_password( + &self, + editor: u64, + length: Option, + no_symbols: bool, + ) -> Result { + self.authentication + .generate_entry_editor_password(editor, length, no_symbols) + .map(|page| (&page).into()) + .map_err(Into::into) + } + + pub fn save_entry_editor( + &self, + editor: u64, + fields: Vec, + ) -> Result { + self.authentication + .save_entry_editor(editor, fields.into_iter().map(Into::into).collect()) + .map(Into::into) + .map_err(Into::into) + } + + pub fn discard_entry_editor(&self, editor: u64) -> Result<(), MobileAuthenticationFfiError> { + self.authentication + .discard_entry_editor(editor) + .map_err(Into::into) + } + + pub fn manual_lock(&self) -> Result<(), MobileAuthenticationFfiError> { + self.authentication.manual_lock().map_err(Into::into) + } + + pub fn cancel(&self) -> Result<(), MobileAuthenticationFfiError> { + self.authentication.cancel().map_err(Into::into) + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileOnboardingPhase { + Validating, + Authenticating, + Receiving, + Integrating, + Finishing, +} + +impl From for MobileOnboardingPhase { + fn from(phase: StorageOnboardingPhase) -> Self { + match phase { + StorageOnboardingPhase::Validating => Self::Validating, + StorageOnboardingPhase::Authenticating => Self::Authenticating, + StorageOnboardingPhase::Receiving => Self::Receiving, + StorageOnboardingPhase::Integrating => Self::Integrating, + StorageOnboardingPhase::Finishing => Self::Finishing, + } + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileOnboardingProgress { + pub phase: MobileOnboardingPhase, + pub title: String, + pub detail: String, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileOnboardingDiscovery { + pub branches: Vec, + pub selected_branch: u32, +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileOnboardingOutcome { + pub title: String, + pub detail: String, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileOnboardingErrorKind { + InvalidInput, + UnsupportedRemote, + Authentication, + Repository, + ExistingClone, + ExistingKey, + Interrupted, + SecureStorage, + Configuration, + AlreadyConfigured, +} + +impl From for MobileOnboardingErrorKind { + fn from(kind: StorageOnboardingErrorKind) -> Self { + match kind { + StorageOnboardingErrorKind::InvalidInput => Self::InvalidInput, + StorageOnboardingErrorKind::UnsupportedRemote => Self::UnsupportedRemote, + StorageOnboardingErrorKind::Authentication => Self::Authentication, + StorageOnboardingErrorKind::Repository => Self::Repository, + StorageOnboardingErrorKind::ExistingClone => Self::ExistingClone, + StorageOnboardingErrorKind::ExistingKey => Self::ExistingKey, + StorageOnboardingErrorKind::Interrupted => Self::Interrupted, + StorageOnboardingErrorKind::SecureStorage => Self::SecureStorage, + StorageOnboardingErrorKind::Configuration => Self::Configuration, + StorageOnboardingErrorKind::AlreadyConfigured => Self::AlreadyConfigured, + } + } +} + +#[derive(uniffi::Error)] +pub enum MobileOnboardingFfiError { + Failed { + kind: MobileOnboardingErrorKind, + title: String, + detail: String, + }, +} + +impl fmt::Debug for MobileOnboardingFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("MobileOnboardingFfiError([REDACTED])") + } +} + +impl fmt::Display for MobileOnboardingFfiError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(self, formatter) + } +} + +impl Error for MobileOnboardingFfiError {} + +impl From for MobileOnboardingFfiError { + fn from(error: StorageOnboardingError) -> Self { + Self::Failed { + kind: error.kind().into(), + title: error.title().to_owned(), + detail: error.detail().to_owned(), + } + } +} + +#[derive(uniffi::Object)] +pub struct MobileOnboardingOperation { + operation: mobile_onboarding::MobileOnboardingOperation, + request: mobile_onboarding::MobileOnboardingRequest, +} + +#[uniffi::export] +impl MobileOnboardingOperation { + pub fn progress(&self) -> MobileOnboardingProgress { + let progress = self.operation.progress(); + MobileOnboardingProgress { + phase: progress.phase().into(), + title: progress.title().to_owned(), + detail: progress.detail().to_owned(), + } + } + + pub fn discover(&self) -> Result { + let discovery = self.operation.discover(&self.request)?; + Ok(MobileOnboardingDiscovery { + branches: discovery.branches().to_vec(), + selected_branch: u32::try_from(discovery.selected_branch()).unwrap_or_default(), + }) + } + + pub fn setup( + &self, + branch: String, + use_existing: bool, + ) -> Result { + let outcome = self.operation.setup(&self.request, &branch, use_existing)?; + Ok(MobileOnboardingOutcome { + title: outcome.title().to_owned(), + detail: outcome.detail().to_owned(), + }) + } + + pub fn connect_local_store(&self) -> Result { + let outcome = self.operation.connect_local_store(&self.request)?; + Ok(MobileOnboardingOutcome { + title: outcome.title().to_owned(), + detail: outcome.detail().to_owned(), + }) + } + + pub fn cancel(&self) { + self.operation.cancel(); + } +} + +#[derive(uniffi::Object)] +pub struct MobileLocalOnboardingOperation { + operation: mobile_onboarding::MobileOnboardingOperation, +} + +#[uniffi::export] +impl MobileLocalOnboardingOperation { + pub fn generate( + &self, + user_id: String, + passphrase: String, + replace_existing_key: bool, + ) -> Result { + let outcome = self.operation.setup_local_generated( + &user_id, + ironstorage::repository::SecretBytes::new(passphrase.into_bytes()), + replace_existing_key, + )?; + Ok(MobileOnboardingOutcome { + title: outcome.title().to_owned(), + detail: outcome.detail().to_owned(), + }) + } + + pub fn cancel(&self) { + self.operation.cancel(); + } +} + +impl From for MobileShell { + fn from(shell: mobile::MobileShell) -> Self { + Self { + selected_tab: shell.selected_tab().into(), + pages: shell + .pages() + .iter() + .map(|page| MobilePage { + tab: page.tab().into(), + title: page.title().to_owned(), + icon: page.icon().into(), + state: page.state().into(), + state_title: page.state_title().to_owned(), + state_detail: page.state_detail().to_owned(), + }) + .collect(), + } + } +} + +#[derive(uniffi::Error)] +pub enum MobilePreferenceError { + Configuration { message: String }, +} + +impl fmt::Debug for MobilePreferenceError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("MobilePreferenceError([REDACTED])") + } +} + +impl fmt::Display for MobilePreferenceError { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(self, formatter) + } +} + +impl Error for MobilePreferenceError {} + +impl From for MobilePreferenceError { + fn from(error: ConfigError) -> Self { + Self::Configuration { + message: error.to_string(), + } + } +} + +#[uniffi::export] +pub fn product_name() -> String { + ironstorage::PRODUCT_NAME.to_owned() +} + +#[uniffi::export] +pub fn mobile_shell() -> MobileShell { + mobile::MobileShell::load().into() +} + +#[uniffi::export] +pub fn mobile_shell_fixture(state: MobileShellState) -> MobileShell { + mobile::MobileShell::fixture(state.into()).into() +} + +#[uniffi::export] +pub fn set_selected_mobile_tab(tab: MobileTab) -> Result<(), MobilePreferenceError> { + mobile::store_selected_tab(tab.into()).map_err(Into::into) +} + +#[uniffi::export] +pub fn mobile_home_operation( + authentication: Option>, +) -> Arc { + Arc::new(MobileHomeOperation { + operation: mobile_home::MobileHomeOperation::new( + authentication.map(|authentication| Arc::clone(&authentication.authentication)), + ), + }) +} + +#[uniffi::export] +pub fn mobile_totp_operation() -> Arc { + Arc::new(MobileTotpOperation { + operation: StorageTotpOperation::default(), + }) +} + +#[uniffi::export] +pub fn mobile_password_page( + path: Option, +) -> Result { + ironstorage::mobile_passwords::MobilePasswordPage::load(path.as_deref()) + .map(Into::into) + .map_err(Into::into) +} + +#[uniffi::export] +pub fn mobile_password_search(query: String) -> Result { + ironstorage::mobile_passwords::MobilePasswordPage::search(&query) + .map(Into::into) + .map_err(Into::into) +} + +#[uniffi::export] +pub fn mobile_authentication() -> Result, MobileAuthenticationFfiError> { + Ok(Arc::new(MobileAuthentication { + authentication: Arc::new(ironstorage::mobile_authentication::MobileAuthentication::load()?), + })) +} + +#[uniffi::export] +pub fn mobile_key_transfer() -> Result, MobileKeyTransferFfiError> { + Ok(Arc::new(MobileKeyTransfer { + service: ironstorage::mobile_key_transfer::MobileKeyTransferService::load()?, + })) +} + +#[uniffi::export] +pub fn mobile_local_key_transfer_importer() -> Arc { + Arc::new(MobileKeyTransferImport { + importer: Mutex::new( + ironstorage::mobile_key_transfer::MobileKeyTransferImport::local_setup(), + ), + }) +} + +#[uniffi::export] +pub fn mobile_onboarding_operation( + server_url: String, + account: String, + repository_path: String, + application_token: String, +) -> Result, MobileOnboardingFfiError> { + Ok(Arc::new(MobileOnboardingOperation { + operation: mobile_onboarding::MobileOnboardingOperation::default(), + request: mobile_onboarding::MobileOnboardingRequest::new( + server_url, + account, + repository_path, + application_token.into_bytes(), + )?, + })) +} + +#[uniffi::export] +pub fn mobile_local_onboarding_operation() -> Arc { + Arc::new(MobileLocalOnboardingOperation { + operation: mobile_onboarding::MobileOnboardingOperation::default(), + }) +} + +#[uniffi::export] +pub fn replace_configured_mobile_application_token( + account: String, + application_token: String, +) -> Result<(), MobileOnboardingFfiError> { + mobile_onboarding::replace_configured_application_token( + account, + application_token.into_bytes(), + )?; + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::{ + MobileHomeActionKind, MobileHomePhase, MobileOnboardingErrorKind, MobileOnboardingFfiError, + MobileShellState, MobileTab, StorageHomeActionKind, + }; + + #[test] + fn bridge_reads_product_name_from_storage_crate() { + assert_eq!(super::product_name(), ironstorage::PRODUCT_NAME); + } + + #[test] + fn bridge_exposes_every_view_ready_shell_fixture() { + for state in [ + MobileShellState::Loading, + MobileShellState::Empty, + MobileShellState::Ready, + MobileShellState::Locked, + MobileShellState::Error, + ] { + let shell = super::mobile_shell_fixture(state); + assert_eq!(shell.selected_tab, MobileTab::Home); + assert_eq!(shell.pages.len(), 5); + assert!(shell.pages.iter().all(|page| page.state == state)); + } + } + + #[test] + fn bridge_rejects_non_https_before_creating_an_operation() { + let error = match super::mobile_onboarding_operation( + "ssh://example.test".to_owned(), + "alice".to_owned(), + "team/passwords".to_owned(), + "DO-NOT-RENDER".to_owned(), + ) { + Ok(_) => panic!("SSH must be rejected"), + Err(error) => error, + }; + match error { + MobileOnboardingFfiError::Failed { kind, detail, .. } => { + assert_eq!(kind, MobileOnboardingErrorKind::UnsupportedRemote); + assert!(!detail.contains("DO-NOT-RENDER")); + } + } + } + + #[test] + fn home_bridge_preserves_storage_action_kinds() { + assert_eq!( + MobileHomeActionKind::from(StorageHomeActionKind::Push), + MobileHomeActionKind::Push + ); + } + + #[test] + fn home_bridge_does_not_require_entry_authentication() { + let operation = super::mobile_home_operation(None); + assert_eq!(operation.progress().phase, MobileHomePhase::Validating); + operation.cancel(); + } +} + +#[cfg(feature = "watch")] +#[uniffi::export] +impl MobileAuthentication { + pub fn preferences( + &self, + watch_supported: bool, + watch_paired: bool, + watch_app_installed: bool, + ) -> Result { + self.authentication + .preferences(watch_supported, watch_paired, watch_app_installed) + .map(Into::into) + .map_err(Into::into) + } + + pub fn set_totp_watch_shared( + &self, + path: String, + shared: bool, + unix_seconds: u64, + ) -> Result { + self.authentication + .set_totp_watch_shared(&path, shared, unix_seconds) + .map(Into::into) + .map_err(Into::into) + } + + pub fn watch_snapshot_status( + &self, + ) -> Result { + self.authentication + .watch_snapshot_status() + .map(|status| (&status).into()) + .map_err(Into::into) + } + + pub fn prepare_watch_snapshot( + &self, + platform_pairing_identity: String, + ) -> Result { + self.authentication + .prepare_watch_snapshot(&platform_pairing_identity) + .map(Into::into) + .map_err(Into::into) + } + + pub fn set_watch_snapshot_unavailable( + &self, + unpaired: bool, + detail: String, + ) -> Result { + self.authentication + .set_watch_snapshot_unavailable(unpaired, detail) + .map(|status| (&status).into()) + .map_err(Into::into) + } + + pub fn fail_watch_snapshot( + &self, + revision: u64, + detail: String, + ) -> Result { + self.authentication + .fail_watch_snapshot(revision, detail) + .map(|status| (&status).into()) + .map_err(Into::into) + } + + pub fn acknowledge_watch_snapshot( + &self, + receipt: Vec, + ) -> Result { + self.authentication + .acknowledge_watch_snapshot(&receipt) + .map(|status| (&status).into()) + .map_err(Into::into) + } +} + +#[cfg(not(feature = "watch"))] +#[uniffi::export] +impl MobileAuthentication { + pub fn preferences(&self) -> Result { + self.authentication + .preferences(false, false, false) + .map(Into::into) + .map_err(Into::into) + } +} diff --git a/crates/mobile-bridge/src/platform.rs b/crates/mobile-bridge/src/platform.rs new file mode 100644 index 0000000..c09f3c3 --- /dev/null +++ b/crates/mobile-bridge/src/platform.rs @@ -0,0 +1,441 @@ +//! Mechanical adapters: foreign code performs OS calls, storage owns behavior. + +use std::{fmt, sync::Arc, time::Duration}; + +use ironstorage::{ + authentication::AuthenticationClock, + config::Config, + mobile_platform as storage, + presentation::{self, ClipboardBackend}, + repository::SecretBytes, + secret_store::{SecretLocator, SecretProtection, SecretStoreBackend, SecretStoreError}, +}; + +use crate::{ + MobileAuthentication, MobileAuthenticationFfiError, MobileAuthenticationState, MobileEntryCopy, +}; + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Error)] +pub enum MobilePlatformFfiError { + InvalidPaths, + InvalidCameraFrame, + QrNotFound, + InvalidQrPayload, + InvalidCredentialRequest, + ClipboardFailed, + Cancelled, +} + +impl fmt::Display for MobilePlatformFfiError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "Mobile platform operation failed: {self:?}") + } +} +impl std::error::Error for MobilePlatformFfiError {} + +#[derive(Clone, uniffi::Record)] +pub struct MobilePlatformPaths { + pub data_root: String, + pub cache_root: String, +} + +impl TryFrom for storage::MobilePlatformPaths { + type Error = MobilePlatformFfiError; + fn try_from(paths: MobilePlatformPaths) -> Result { + Self::new(paths.data_root.into(), paths.cache_root.into()) + .map_err(|_| MobilePlatformFfiError::InvalidPaths) + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobilePlatformLayout { + pub configuration: String, + pub vault: String, + pub keys: String, + pub cache: String, +} + +#[uniffi::export] +pub fn mobile_platform_layout( + paths: MobilePlatformPaths, +) -> Result { + let paths = storage::MobilePlatformPaths::try_from(paths)?; + Ok(MobilePlatformLayout { + configuration: paths.configuration().to_string_lossy().into_owned(), + vault: paths.vault().to_string_lossy().into_owned(), + keys: paths.keys().to_string_lossy().into_owned(), + cache: paths.cache().to_string_lossy().into_owned(), + }) +} + +#[derive(Clone, uniffi::Enum)] +pub enum MobileSecretLocator { + OpenPgpPassphrase { + fingerprint: String, + }, + HttpsGitCredential { + server_id: String, + application_id: String, + }, + SshKeyPassphrase { + fingerprint: String, + }, +} + +impl From<&SecretLocator> for MobileSecretLocator { + fn from(locator: &SecretLocator) -> Self { + match locator { + SecretLocator::OpenPgpPassphrase { fingerprint } => Self::OpenPgpPassphrase { + fingerprint: fingerprint.clone(), + }, + SecretLocator::HttpsGitCredential { + server_id, + application_id, + } => Self::HttpsGitCredential { + server_id: server_id.clone(), + application_id: application_id.clone(), + }, + SecretLocator::SshKeyPassphrase { fingerprint } => Self::SshKeyPassphrase { + fingerprint: fingerprint.to_string(), + }, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileSecretProtection { + DeviceUnlocked, + RequireUserPresence, + BiometryCurrentSet, +} +impl From for MobileSecretProtection { + fn from(value: SecretProtection) -> Self { + match value { + SecretProtection::DeviceUnlocked => Self::DeviceUnlocked, + SecretProtection::RequireUserPresence => Self::RequireUserPresence, + SecretProtection::BiometryCurrentSet => Self::BiometryCurrentSet, + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Error)] +pub enum MobileSecretError { + AlreadyExists, + Missing, + Locked, + Denied, + Cancelled, + Corrupted, + UnsupportedProtection, + Unavailable, +} +impl fmt::Display for MobileSecretError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "OS secret operation failed: {self:?}") + } +} +impl std::error::Error for MobileSecretError {} +impl From for SecretStoreError { + fn from(value: MobileSecretError) -> Self { + match value { + MobileSecretError::AlreadyExists => Self::AlreadyExists, + MobileSecretError::Missing => Self::Missing, + MobileSecretError::Locked => Self::Locked, + MobileSecretError::Denied => Self::Denied, + MobileSecretError::Cancelled => Self::Cancelled, + MobileSecretError::Corrupted => Self::Corrupted, + MobileSecretError::UnsupportedProtection => Self::UnsupportedProtection, + MobileSecretError::Unavailable => Self::Unavailable, + } + } +} + +/// Receives storage-encoded opaque bytes; cannot select accounts, leases or protection. +#[uniffi::export(rust, foreign)] +pub trait MobileSecretBackend: Send + Sync { + fn create( + &self, + locator: MobileSecretLocator, + protection: MobileSecretProtection, + value: Vec, + ) -> Result<(), MobileSecretError>; + fn retrieve( + &self, + locator: MobileSecretLocator, + protection: MobileSecretProtection, + ) -> Result, MobileSecretError>; + fn replace( + &self, + locator: MobileSecretLocator, + protection: MobileSecretProtection, + value: Vec, + ) -> Result<(), MobileSecretError>; + fn delete( + &self, + locator: MobileSecretLocator, + protection: MobileSecretProtection, + ) -> Result<(), MobileSecretError>; + fn lock(&self) -> Result<(), MobileSecretError>; + fn unlock(&self) -> Result<(), MobileSecretError>; +} + +pub(crate) struct SecretBackendAdapter(pub Arc); +impl SecretStoreBackend for SecretBackendAdapter { + fn create( + &self, + locator: &SecretLocator, + protection: SecretProtection, + value: &[u8], + ) -> Result<(), SecretStoreError> { + self.0 + .create(locator.into(), protection.into(), value.to_vec()) + .map_err(Into::into) + } + fn retrieve( + &self, + locator: &SecretLocator, + protection: SecretProtection, + ) -> Result { + self.0 + .retrieve(locator.into(), protection.into()) + .map(SecretBytes::new) + .map_err(Into::into) + } + fn replace( + &self, + locator: &SecretLocator, + protection: SecretProtection, + value: &[u8], + ) -> Result<(), SecretStoreError> { + self.0 + .replace(locator.into(), protection.into(), value.to_vec()) + .map_err(Into::into) + } + fn delete( + &self, + locator: &SecretLocator, + protection: SecretProtection, + ) -> Result<(), SecretStoreError> { + self.0 + .delete(locator.into(), protection.into()) + .map_err(Into::into) + } + fn lock(&self) -> Result<(), SecretStoreError> { + self.0.lock().map_err(Into::into) + } + fn unlock(&self) -> Result<(), SecretStoreError> { + self.0.unlock().map_err(Into::into) + } +} + +#[uniffi::export(rust, foreign)] +pub trait MobileClock: Send + Sync { + fn monotonic_milliseconds(&self) -> u64; +} +struct ClockAdapter(Arc); +impl AuthenticationClock for ClockAdapter { + fn now(&self) -> Duration { + Duration::from_millis(self.0.monotonic_milliseconds()) + } +} + +#[uniffi::export] +pub fn mobile_authentication_with_platform( + paths: MobilePlatformPaths, + backend: Arc, + clock: Arc, +) -> Result, MobileAuthenticationFfiError> { + let paths = storage::MobilePlatformPaths::try_from(paths).map_err(|_| { + MobileAuthenticationFfiError::Failed { + kind: crate::MobileAuthenticationErrorKind::Configuration, + title: "Invalid Private Paths".into(), + detail: "The OS private roots are invalid.".into(), + } + })?; + let config = Config::load(Some(&paths.configuration())).map_err(|error| { + MobileAuthenticationFfiError::Failed { + kind: crate::MobileAuthenticationErrorKind::Configuration, + title: "Configuration Is Unavailable".into(), + detail: error.to_string(), + } + })?; + let authentication = ironstorage::mobile_authentication::MobileAuthentication::with_platform( + config, + Arc::new(SecretBackendAdapter(backend)), + Arc::new(ClockAdapter(clock)), + )?; + Ok(Arc::new(MobileAuthentication { + authentication: Arc::new(authentication), + })) +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileLifecycleEvent { + Foreground, + Background, + DeviceLocked, + UserActivity, + Cancel, +} +impl From for storage::MobileLifecycleEvent { + fn from(event: MobileLifecycleEvent) -> Self { + match event { + MobileLifecycleEvent::Foreground => Self::Foreground, + MobileLifecycleEvent::Background => Self::Background, + MobileLifecycleEvent::DeviceLocked => Self::DeviceLocked, + MobileLifecycleEvent::UserActivity => Self::UserActivity, + MobileLifecycleEvent::Cancel => Self::Cancel, + } + } +} +#[uniffi::export] +impl MobileAuthentication { + pub fn lifecycle( + &self, + event: MobileLifecycleEvent, + ) -> Result { + self.authentication + .lifecycle(event.into()) + .map(Into::into) + .map_err(Into::into) + } +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileCameraFrame { + pub width: u32, + pub height: u32, + pub row_stride: u32, + pub pixel_stride: u32, + pub luminance: Vec, +} +#[uniffi::export] +pub fn decode_mobile_camera_frame( + frame: MobileCameraFrame, +) -> Result, MobilePlatformFfiError> { + storage::MobileCameraFrame { + width: frame.width, + height: frame.height, + row_stride: frame.row_stride, + pixel_stride: frame.pixel_stride, + luminance: SecretBytes::new(frame.luminance), + } + .decode() + .map(|payload| payload.expose().to_vec()) + .map_err(|error| match error { + presentation::QrError::NotFound => MobilePlatformFfiError::QrNotFound, + presentation::QrError::InvalidPayload => MobilePlatformFfiError::InvalidQrPayload, + _ => MobilePlatformFfiError::InvalidCameraFrame, + }) +} + +#[derive(Clone, uniffi::Enum)] +pub enum MobileClipboardContent { + Text { value: Vec }, + EmptyOrNonText, +} +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileClipboardWait { + Elapsed, + Cancelled, +} +#[derive(Clone, Copy, Debug, Eq, PartialEq, uniffi::Enum)] +pub enum MobileClipboardDisposition { + RestoredPrevious, + Cleared, + PreservedNewer, +} + +#[uniffi::export(rust, foreign)] +pub trait MobileClipboard: Send + Sync { + fn read(&self) -> Result; + fn write(&self, value: Vec) -> Result<(), MobilePlatformFfiError>; + fn clear(&self) -> Result<(), MobilePlatformFfiError>; + fn wait_for_timeout(&self, milliseconds: u64) -> MobileClipboardWait; +} +struct ClipboardAdapter(Arc); +impl ClipboardBackend for ClipboardAdapter { + fn read(&mut self) -> Result { + self.0 + .read() + .map(|value| match value { + MobileClipboardContent::Text { value } => { + presentation::ClipboardContent::text(value) + } + MobileClipboardContent::EmptyOrNonText => { + presentation::ClipboardContent::EmptyOrNonText + } + }) + .map_err(|_| presentation::ClipboardError::ReadFailed) + } + fn write(&mut self, value: &SecretBytes) -> Result<(), presentation::ClipboardError> { + self.0 + .write(value.expose().to_vec()) + .map_err(|_| presentation::ClipboardError::WriteFailed) + } + fn clear(&mut self) -> Result<(), presentation::ClipboardError> { + self.0 + .clear() + .map_err(|_| presentation::ClipboardError::CleanupFailed) + } +} +#[uniffi::export] +pub fn copy_mobile_entry( + copy: MobileEntryCopy, + clipboard: Arc, +) -> Result { + let timeout = presentation::ClipboardTimeout::new(Duration::from_secs(copy.timeout_seconds)) + .map_err(|_| MobilePlatformFfiError::ClipboardFailed)?; + let mut manager = + presentation::ClipboardManager::new(ClipboardAdapter(Arc::clone(&clipboard)), timeout); + manager + .copy_with( + &SecretBytes::new(copy.value.into_bytes()), + |duration| match clipboard.wait_for_timeout(duration.as_millis() as u64) { + MobileClipboardWait::Elapsed => presentation::ClipboardWait::Elapsed, + MobileClipboardWait::Cancelled => presentation::ClipboardWait::Cancelled, + }, + ) + .map(|result| match result { + presentation::ClipboardDisposition::RestoredPrevious => { + MobileClipboardDisposition::RestoredPrevious + } + presentation::ClipboardDisposition::Cleared => MobileClipboardDisposition::Cleared, + presentation::ClipboardDisposition::PreservedNewer => { + MobileClipboardDisposition::PreservedNewer + } + }) + .map_err(|error| { + if error == presentation::ClipboardError::Cancelled { + MobilePlatformFfiError::Cancelled + } else { + MobilePlatformFfiError::ClipboardFailed + } + }) +} + +#[derive(Clone, uniffi::Record)] +pub struct MobileCredentialRequest { + pub request_id: String, + pub package: String, + pub signing_certificate_sha256: String, + pub origins: Vec, +} +#[uniffi::export] +pub fn validate_mobile_credential_request( + request: MobileCredentialRequest, +) -> Result { + let request = storage::MobileCredentialRequest::new( + request.request_id, + request.package, + request.signing_certificate_sha256, + request.origins, + ) + .map_err(|_| MobilePlatformFfiError::InvalidCredentialRequest)?; + Ok(MobileCredentialRequest { + request_id: request.request_id().to_owned(), + package: request.package().to_owned(), + signing_certificate_sha256: request.signing_certificate_sha256().to_owned(), + origins: request.origins().to_vec(), + }) +} diff --git a/crates/storage/src/authentication.rs b/crates/storage/src/authentication.rs index 8cb9cfc..8450b77 100644 --- a/crates/storage/src/authentication.rs +++ b/crates/storage/src/authentication.rs @@ -55,6 +55,12 @@ pub trait AuthenticationClock: Send + Sync + 'static { fn now(&self) -> Duration; } +impl AuthenticationClock for Arc { + fn now(&self) -> Duration { + (**self).now() + } +} + /// Process-local monotonic clock used by production sessions. #[derive(Clone, Debug)] pub struct SystemAuthenticationClock { diff --git a/crates/storage/src/lib.rs b/crates/storage/src/lib.rs index 9dfb3b2..74c6c2d 100644 --- a/crates/storage/src/lib.rs +++ b/crates/storage/src/lib.rs @@ -40,6 +40,8 @@ pub mod mobile_onboarding; #[cfg(feature = "full")] pub mod mobile_passwords; #[cfg(feature = "full")] +pub mod mobile_platform; +#[cfg(feature = "full")] pub mod mobile_totp; pub mod mobile_watch; #[cfg(feature = "full")] diff --git a/crates/storage/src/mobile.rs b/crates/storage/src/mobile.rs index 0cc68b2..e8e4f58 100644 --- a/crates/storage/src/mobile.rs +++ b/crates/storage/src/mobile.rs @@ -5,6 +5,36 @@ use crate::{ repository::{Repository, RepositoryError}, }; +/// Presentation intent. Native UIs choose their own assets and selected variants. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum MobileIcon { + Home, + Key, + Search, + Timer, + Settings, + Warning, + Branch, + Success, + Sync, + Protected, + Repository, + History, + Incoming, + Outgoing, + Recipients, + Signature, + File, + Merge, + Refresh, + Folder, + User, + Email, + Website, + Text, + Note, +} + #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub enum MobileTab { #[default] @@ -34,23 +64,13 @@ impl MobileTab { } } - pub const fn system_image(self) -> &'static str { + pub const fn icon(self) -> MobileIcon { match self { - Self::Home => "house", - Self::Passwords => "key", - Self::Search => "magnifyingglass", - Self::Totp => "timer", - Self::Preferences => "gearshape", - } - } - - pub const fn selected_system_image(self) -> &'static str { - match self { - Self::Home => "house.fill", - Self::Passwords => "key.fill", - Self::Search => "magnifyingglass", - Self::Totp => "timer", - Self::Preferences => "gearshape.fill", + Self::Home => MobileIcon::Home, + Self::Passwords => MobileIcon::Key, + Self::Search => MobileIcon::Search, + Self::Totp => MobileIcon::Timer, + Self::Preferences => MobileIcon::Settings, } } @@ -91,8 +111,7 @@ pub enum MobileShellState { pub struct MobilePage { tab: MobileTab, title: String, - system_image: String, - selected_system_image: String, + icon: MobileIcon, state: MobileShellState, state_title: String, state_detail: String, @@ -107,12 +126,8 @@ impl MobilePage { &self.title } - pub fn system_image(&self) -> &str { - &self.system_image - } - - pub fn selected_system_image(&self) -> &str { - &self.selected_system_image + pub fn icon(&self) -> MobileIcon { + self.icon } pub fn state(&self) -> MobileShellState { @@ -180,8 +195,7 @@ impl MobileShell { MobilePage { tab, title: tab.title().to_owned(), - system_image: tab.system_image().to_owned(), - selected_system_image: tab.selected_system_image().to_owned(), + icon: tab.icon(), state, state_title, state_detail, @@ -268,8 +282,7 @@ mod tests { assert!(shell.pages().iter().all(|page| { page.state() == state && !page.title().is_empty() - && !page.system_image().is_empty() - && !page.selected_system_image().is_empty() + && page.icon() == page.tab().icon() && !page.state_title().is_empty() && !page.state_detail().is_empty() })); diff --git a/crates/storage/src/mobile_authentication.rs b/crates/storage/src/mobile_authentication.rs index ff9aa9e..67ab025 100644 --- a/crates/storage/src/mobile_authentication.rs +++ b/crates/storage/src/mobile_authentication.rs @@ -1,11 +1,17 @@ -//! Shared mobile authentication state; Swift only supplies input and presents results. +//! Shared mobile authentication state; native frontends supply input and present results. -use std::{collections::BTreeMap, error::Error, fmt, sync::Mutex, time::Duration}; +use std::{ + collections::BTreeMap, + error::Error, + fmt, + sync::{Arc, Mutex}, + time::Duration, +}; use crate::{ authentication::{ - AuthenticationError, AuthenticationTimeout, NativeAuthenticationHandle, - NativeAuthenticationSession, + AuthenticationClock, AuthenticationError, AuthenticationHandle, AuthenticationSession, + AuthenticationTimeout, SystemAuthenticationClock, }, config::{Config, ConfigError, GitRemote, MobileAppearance}, crypto::{CryptoError, KeyInfo, KeyStore, SecretProvider, SecretProviderError}, @@ -33,7 +39,8 @@ use crate::{ DirectoryPath, EncryptedEntry, EntryPath, Repository, RepositoryError, SecretBytes, }, secret_store::{ - NativeSecretStore, SecretCachePolicy, SecretProtectionPolicy, SecretStoreError, + NativeSecretBackend, SecretCachePolicy, SecretProtectionPolicy, SecretStore, + SecretStoreBackend, SecretStoreError, }, write::{VaultWriter, WriteError}, }; @@ -279,7 +286,7 @@ impl MobileAuthenticationState { } struct ActiveMobileLease { - handle: NativeAuthenticationHandle, + handle: MobileAuthenticationHandle, key: KeyInfo, } @@ -326,11 +333,17 @@ impl Drop for MobileRepositoryOperationGuard<'_> { } /// One process-wide mobile authentication lease shared by every tab and viewer. +type MobileAuthenticationSession = + AuthenticationSession, Arc>; +type MobileAuthenticationHandle = + AuthenticationHandle, Arc>; + pub struct MobileAuthentication { config: Config, repository: Repository, keys: KeyStore, - session: NativeAuthenticationSession, + session: MobileAuthenticationSession, + backend: Arc, status: Mutex, totp_discovery: Mutex<()>, } @@ -344,13 +357,28 @@ impl MobileAuthentication { error.to_string(), ) })?; + let backend = Arc::new(NativeSecretBackend::new().map_err(preference_secret_error)?); + Self::with_platform( + config, + backend, + Arc::new(SystemAuthenticationClock::default()), + ) + } + + /// OS mechanics are injected; configuration, protection, leases and storage stay here. + pub fn with_platform( + config: Config, + backend: Arc, + clock: Arc, + ) -> Result { let repository = Repository::open(config.vault()).map_err(entry_error)?; let keys = KeyStore::load(config.key_material()).map_err(key_error)?; - let session = NativeAuthenticationSession::system( + let session = MobileAuthenticationSession::with_clock( + Arc::clone(&backend), SecretProtectionPolicy::current_biometry_for_openpgp(), config.authentication_timeout(), - ) - .map_err(MobileAuthenticationError::authentication)?; + clock, + ); let watch_snapshot = WatchSnapshotSender::load(config.source().with_file_name("watch-snapshot.toml")); Ok(Self { @@ -371,6 +399,7 @@ impl MobileAuthentication { repository, keys, session, + backend, totp_discovery: Mutex::new(()), }) } @@ -599,7 +628,7 @@ impl MobileAuthentication { sync_configured: remote.is_some(), repository_title, repository_url: remote.map_or_else( - || "Stored and versioned on this iPhone".to_owned(), + || "Stored and versioned on this device".to_owned(), |remote| remote.url().to_string(), ), server_title: remote @@ -621,7 +650,10 @@ impl MobileAuthentication { ) }, ), - application_account: remote.map(application_account).transpose()?.flatten(), + application_account: remote + .map(|remote| application_account(remote, Arc::clone(&self.backend))) + .transpose()? + .flatten(), default_key_title: key .user_ids() .first() @@ -674,7 +706,7 @@ impl MobileAuthentication { .find(|remote| remote.name().as_str() == "origin") .or_else(|| self.config.git_remotes().first()) .ok_or_else(|| config_detail("No HTTPS Git remote is configured."))?; - let store = preference_secret_store()?; + let store = preference_secret_store(Arc::clone(&self.backend)); store.unlock().map_err(preference_secret_error)?; let (server_id, application_id) = remote.https_credentials().ok_or_else(|| { config_detail("The configured Git remote does not use HTTPS credentials.") @@ -1276,6 +1308,26 @@ impl MobileAuthentication { Ok(()) } + pub fn lifecycle( + &self, + event: crate::mobile_platform::MobileLifecycleEvent, + ) -> Result { + use crate::mobile_platform::MobileLifecycleEvent; + match event { + MobileLifecycleEvent::Foreground => {} + MobileLifecycleEvent::Background | MobileLifecycleEvent::DeviceLocked => { + self.manual_lock()? + } + MobileLifecycleEvent::UserActivity => { + if self.state()?.unlocked() { + self.touch_user_activity()?; + } + } + MobileLifecycleEvent::Cancel => self.cancel()?, + } + self.state() + } + pub fn cancel(&self) -> Result<(), MobileAuthenticationError> { self.session .cancel() @@ -1319,7 +1371,7 @@ impl MobileAuthentication { fn set_active( &self, - handle: NativeAuthenticationHandle, + handle: MobileAuthenticationHandle, key: KeyInfo, ) -> Result<(), MobileAuthenticationError> { self.status()?.active = Some(ActiveMobileLease { handle, key }); @@ -1529,12 +1581,12 @@ fn repository_operation_conflict( } struct KeyOnlyProvider<'a> { - handle: NativeAuthenticationHandle, + handle: MobileAuthenticationHandle, fingerprint: &'a str, } impl<'a> KeyOnlyProvider<'a> { - fn new(handle: NativeAuthenticationHandle, key: &'a KeyInfo) -> Self { + fn new(handle: MobileAuthenticationHandle, key: &'a KeyInfo) -> Self { Self { handle, fingerprint: key.fingerprint().as_str(), @@ -1567,19 +1619,24 @@ fn config_detail(detail: &str) -> MobileAuthenticationError { ) } -fn preference_secret_store() -> Result { - NativeSecretStore::system( +fn preference_secret_store( + backend: Arc, +) -> SecretStore> { + SecretStore::new( + backend, SecretCachePolicy::Disabled, SecretProtectionPolicy::device_unlocked(), ) - .map_err(preference_secret_error) } -fn application_account(remote: &GitRemote) -> Result, MobileAuthenticationError> { +fn application_account( + remote: &GitRemote, + backend: Arc, +) -> Result, MobileAuthenticationError> { let Some((server_id, application_id)) = remote.https_credentials() else { return Ok(None); }; - let store = preference_secret_store()?; + let store = preference_secret_store(backend); store.unlock().map_err(preference_secret_error)?; let result = store.https_git_credential_account(server_id, application_id); let lock_result = store.lock(); diff --git a/crates/storage/src/mobile_entry.rs b/crates/storage/src/mobile_entry.rs index 5953b12..b50640a 100644 --- a/crates/storage/src/mobile_entry.rs +++ b/crates/storage/src/mobile_entry.rs @@ -1,5 +1,7 @@ //! Storage-owned projection of lossless entry documents for native mobile viewers. +use crate::mobile::MobileIcon; + use std::{collections::BTreeSet, error::Error, fmt, num::NonZeroUsize}; use crate::document::{ @@ -22,7 +24,7 @@ pub enum MobileEntrySectionKind { pub struct MobileEntryField { id: u64, label: String, - system_image: String, + icon: MobileIcon, value: Option, masked_value: String, detail: Option, @@ -42,8 +44,8 @@ impl MobileEntryField { &self.label } - pub fn system_image(&self) -> &str { - &self.system_image + pub fn icon(&self) -> MobileIcon { + self.icon } pub fn value(&self) -> Option<&str> { @@ -121,7 +123,7 @@ pub struct MobileEntryEditorField { kind: MobileEntryEditorFieldKind, name: Option, label: String, - system_image: String, + icon: MobileIcon, value: Option, masked_value: String, diagnostic: Option, @@ -149,8 +151,8 @@ impl MobileEntryEditorField { &self.label } - pub fn system_image(&self) -> &str { - &self.system_image + pub fn icon(&self) -> MobileIcon { + self.icon } pub fn value(&self) -> Option<&str> { @@ -573,7 +575,7 @@ fn mobile_field(field: &EntryField) -> MobileEntryField { MobileEntryField { id: field.id().value(), label: label(field), - system_image: system_image(metadata.kind()).to_owned(), + icon: icon(metadata.kind()), value, masked_value: if metadata.sensitivity() == EntrySensitivity::Empty { "Empty" @@ -614,7 +616,7 @@ fn editor_field(index: usize, field: &EntryField) -> MobileEntryEditorField { kind, name: metadata.name().map(str::to_owned), label: label(field), - system_image: system_image(metadata.kind()).to_owned(), + icon: icon(metadata.kind()), value: String::from_utf8(field.value().to_vec()).ok(), masked_value: if metadata.sensitivity() == EntrySensitivity::Empty { "Empty" @@ -705,15 +707,15 @@ fn display_name(name: &str) -> String { } } -fn system_image(kind: EntryFieldKind) -> &'static str { +fn icon(kind: EntryFieldKind) -> MobileIcon { match kind { - EntryFieldKind::Password => "key.fill", - EntryFieldKind::Username => "person.fill", - EntryFieldKind::Email => "envelope.fill", - EntryFieldKind::Url => "globe", - EntryFieldKind::OtpUri => "timer", - EntryFieldKind::Field => "text.alignleft", - EntryFieldKind::Note => "note.text", + EntryFieldKind::Password => MobileIcon::Key, + EntryFieldKind::Username => MobileIcon::User, + EntryFieldKind::Email => MobileIcon::Email, + EntryFieldKind::Url => MobileIcon::Website, + EntryFieldKind::OtpUri => MobileIcon::Timer, + EntryFieldKind::Field => MobileIcon::Text, + EntryFieldKind::Note => MobileIcon::Note, } } diff --git a/crates/storage/src/mobile_home.rs b/crates/storage/src/mobile_home.rs index 252fc43..99e8e6b 100644 --- a/crates/storage/src/mobile_home.rs +++ b/crates/storage/src/mobile_home.rs @@ -1,4 +1,6 @@ -//! Storage-owned remote activity and pull-then-push refresh for iPhone Home. +//! Storage-owned remote activity and pull-then-push refresh for mobile Home. + +use crate::mobile::MobileIcon; use std::{ collections::BTreeSet, @@ -62,7 +64,7 @@ pub enum MobileHomeActionKind { pub struct MobileHomeAction { kind: MobileHomeActionKind, title: &'static str, - system_image: &'static str, + icon: MobileIcon, } impl MobileHomeAction { @@ -74,8 +76,8 @@ impl MobileHomeAction { self.title } - pub fn system_image(&self) -> &str { - self.system_image + pub fn icon(&self) -> MobileIcon { + self.icon } } @@ -94,7 +96,7 @@ pub struct MobileHomeSummaryRow { id: String, title: String, detail: String, - system_image: String, + icon: MobileIcon, actions: Vec, } @@ -111,8 +113,8 @@ impl MobileHomeSummaryRow { &self.detail } - pub fn system_image(&self) -> &str { - &self.system_image + pub fn icon(&self) -> MobileIcon { + self.icon } pub fn actions(&self) -> &[MobileHomeAction] { @@ -125,7 +127,7 @@ pub struct MobileHomeChange { id: String, title: String, detail: String, - system_image: String, + icon: MobileIcon, kind: MobileHomeChangeKind, status: MobileHomeChangeStatus, } @@ -143,8 +145,8 @@ impl MobileHomeChange { &self.detail } - pub fn system_image(&self) -> &str { - &self.system_image + pub fn icon(&self) -> MobileIcon { + self.icon } pub fn kind(&self) -> MobileHomeChangeKind { @@ -161,7 +163,7 @@ pub struct MobileHomeCommit { id: String, title: String, detail: String, - system_image: String, + icon: MobileIcon, timestamp: i64, changes: Vec, actions: Vec, @@ -180,8 +182,8 @@ impl MobileHomeCommit { &self.detail } - pub fn system_image(&self) -> &str { - &self.system_image + pub fn icon(&self) -> MobileIcon { + self.icon } pub fn timestamp(&self) -> i64 { @@ -201,7 +203,7 @@ impl MobileHomeCommit { pub struct MobileHomeNotice { title: String, detail: String, - system_image: String, + icon: MobileIcon, } impl MobileHomeNotice { @@ -213,8 +215,8 @@ impl MobileHomeNotice { &self.detail } - pub fn system_image(&self) -> &str { - &self.system_image + pub fn icon(&self) -> MobileIcon { + self.icon } } @@ -615,7 +617,7 @@ impl MobileHomeStorage { .to_owned(), detail: "The repository was updated, but the refresh time could not be cached." .to_owned(), - system_image: "exclamationmark.triangle".to_owned(), + icon: MobileIcon::Warning, }) }; self.page(MobileHomeFreshness::Current, Some(now), notice) @@ -938,7 +940,7 @@ fn page_from_divergence( id: "tracked-branch".to_owned(), title: format!("{}/{}", divergence.remote().name(), divergence.branch()), detail: "Tracked HTTPS branch".to_owned(), - system_image: "point.3.connected.trianglepath.dotted".to_owned(), + icon: MobileIcon::Branch, actions: vec![ mobile_action(MobileHomeActionKind::Fetch), mobile_action(MobileHomeActionKind::Pull), @@ -949,10 +951,10 @@ fn page_from_divergence( id: "divergence".to_owned(), title: divergence_title, detail: divergence_detail, - system_image: if ahead == 0 && behind == 0 { - "checkmark.circle".to_owned() + icon: if ahead == 0 && behind == 0 { + MobileIcon::Success } else { - "arrow.triangle.2.circlepath".to_owned() + MobileIcon::Sync }, actions: [ (behind > 0).then(|| mobile_action(MobileHomeActionKind::Pull)), @@ -974,10 +976,10 @@ fn page_from_divergence( } else { "Commit or discard these changes before pulling".to_owned() }, - system_image: if local_count == 0 { - "checkmark.shield".to_owned() + icon: if local_count == 0 { + MobileIcon::Protected } else { - "exclamationmark.triangle".to_owned() + MobileIcon::Warning }, actions: if local_count > 0 { vec![mobile_action(MobileHomeActionKind::Commit)] @@ -1040,7 +1042,7 @@ fn page_from_local_snapshot( id: "local-branch".to_owned(), title: snapshot.branch().to_owned(), detail: "Local Git branch · no sync remote configured".to_owned(), - system_image: "externaldrive.fill".to_owned(), + icon: MobileIcon::Repository, actions: Vec::new(), }, MobileHomeSummaryRow { @@ -1051,7 +1053,7 @@ fn page_from_local_snapshot( if commit_count == 1 { "" } else { "s" } ), detail: latest.unwrap_or_else(|| "No local history yet".to_owned()), - system_image: "clock.arrow.circlepath".to_owned(), + icon: MobileIcon::History, actions: Vec::new(), }, working_tree_summary(local_paths.len()), @@ -1077,10 +1079,10 @@ fn working_tree_summary(local_count: usize) -> MobileHomeSummaryRow { } else { "Commit these local password-store changes".to_owned() }, - system_image: if local_count == 0 { - "checkmark.shield".to_owned() + icon: if local_count == 0 { + MobileIcon::Protected } else { - "exclamationmark.triangle".to_owned() + MobileIcon::Warning }, actions: if local_count > 0 { vec![mobile_action(MobileHomeActionKind::Commit)] @@ -1124,10 +1126,10 @@ fn mobile_commit(activity: &GitCommitActivity, incoming: bool) -> MobileHomeComm }, change_count(changes.len()) ), - system_image: if incoming { - "arrow.down.circle".to_owned() + icon: if incoming { + MobileIcon::Incoming } else { - "arrow.up.circle".to_owned() + MobileIcon::Outgoing }, timestamp: commit.timestamp(), changes, @@ -1147,33 +1149,33 @@ fn mobile_change(id: String, path: &Path, kind: GitChangeKind) -> MobileHomeChan MobileHomeChangeStatus::Deleted => "Deleted", }; let file_name = path.file_name().and_then(|name| name.to_str()); - let (title, detail, system_image, change_kind) = + let (title, detail, icon, change_kind) = if path.extension().is_some_and(|extension| extension == "gpg") { ( display_path(&path.with_extension("")), format!("{status_name} password entry"), - "key".to_owned(), + MobileIcon::Key, MobileHomeChangeKind::PasswordEntry, ) } else if file_name == Some(".gpg-id") { ( policy_title(path, "recipients"), format!("{status_name} recipient policy"), - "person.2".to_owned(), + MobileIcon::Recipients, MobileHomeChangeKind::RecipientPolicy, ) } else if file_name == Some(".gpg-id.sig") { ( policy_title(path, "recipient signature"), format!("{status_name} recipient signature"), - "signature".to_owned(), + MobileIcon::Signature, MobileHomeChangeKind::RecipientSignature, ) } else { ( display_path(path), format!("{status_name} repository file"), - "doc".to_owned(), + MobileIcon::File, MobileHomeChangeKind::RepositoryFile, ) }; @@ -1181,7 +1183,7 @@ fn mobile_change(id: String, path: &Path, kind: GitChangeKind) -> MobileHomeChan id, title, detail, - system_image, + icon, kind: change_kind, status, } @@ -1228,27 +1230,27 @@ fn change_count(count: usize) -> String { } fn pull_notice(outcome: PullOutcome) -> MobileHomeNotice { - let (title, detail, system_image) = match outcome { + let (title, detail, icon) = match outcome { PullOutcome::UpToDate => ( "Already Up to Date", "The local password store already contains every fetched commit.", - "checkmark.circle", + MobileIcon::Success, ), PullOutcome::FastForward => ( "Password Store Updated", "Remote commits were applied without changing local history.", - "arrow.down.circle", + MobileIcon::Incoming, ), PullOutcome::Merged => ( "Remote Changes Merged", "Remote and local commits were merged by storage.", - "arrow.triangle.merge", + MobileIcon::Merge, ), }; MobileHomeNotice { title: title.to_owned(), detail: detail.to_owned(), - system_image: system_image.to_owned(), + icon, } } @@ -1256,7 +1258,7 @@ fn commit_notice(commit: &str) -> MobileHomeNotice { MobileHomeNotice { title: "Changes Committed".to_owned(), detail: format!("Created commit {}.", &commit[..commit.len().min(12)]), - system_image: "checkmark.circle".to_owned(), + icon: MobileIcon::Success, } } @@ -1276,7 +1278,7 @@ fn fetch_notice(outcome: &FetchOutcome) -> MobileHomeNotice { } else { format!("{} has no new objects for this clone.", outcome.remote()) }, - system_image: "arrow.clockwise.circle".to_owned(), + icon: MobileIcon::Refresh, } } @@ -1302,22 +1304,18 @@ fn push_notice(outcome: &PushOutcome) -> MobileHomeNotice { outcome.branch() ) }, - system_image: "arrow.up.circle".to_owned(), + icon: MobileIcon::Outgoing, } } fn mobile_action(kind: MobileHomeActionKind) -> MobileHomeAction { - let (title, system_image) = match kind { - MobileHomeActionKind::Commit => ("Commit", "checkmark.circle"), - MobileHomeActionKind::Fetch => ("Fetch", "arrow.clockwise"), - MobileHomeActionKind::Pull => ("Pull", "arrow.down.circle"), - MobileHomeActionKind::Push => ("Push", "arrow.up.circle"), + let (title, icon) = match kind { + MobileHomeActionKind::Commit => ("Commit", MobileIcon::Success), + MobileHomeActionKind::Fetch => ("Fetch", MobileIcon::Refresh), + MobileHomeActionKind::Pull => ("Pull", MobileIcon::Incoming), + MobileHomeActionKind::Push => ("Push", MobileIcon::Outgoing), }; - MobileHomeAction { - kind, - title, - system_image, - } + MobileHomeAction { kind, title, icon } } fn repository_operation(action: MobileHomeActionKind) -> MobileRepositoryOperation { @@ -1393,7 +1391,10 @@ fn is_stale(refreshed_at: Option, now: i64) -> bool { mod tests { use std::path::Path; - use crate::git::{GitChangeKind, GitError}; + use crate::{ + git::{GitChangeKind, GitError}, + mobile::MobileIcon, + }; use super::{ MobileHomeActionKind, MobileHomeChangeKind, MobileHomeChangeStatus, MobileHomeErrorKind, @@ -1446,7 +1447,7 @@ mod tests { fn actions_and_progress_are_typed_before_swift_presentation() { let push = mobile_action(MobileHomeActionKind::Push); assert_eq!(push.title(), "Push"); - assert_eq!(push.system_image(), "arrow.up.circle"); + assert_eq!(push.icon(), MobileIcon::Outgoing); let progress = progress_copy(Some(MobileHomeActionKind::Push), MobileHomePhase::Sending); assert_eq!(progress.action(), Some(MobileHomeActionKind::Push)); assert_eq!(progress.title(), "Pushing Changes"); diff --git a/crates/storage/src/mobile_onboarding.rs b/crates/storage/src/mobile_onboarding.rs index 05d782b..50e6fd6 100644 --- a/crates/storage/src/mobile_onboarding.rs +++ b/crates/storage/src/mobile_onboarding.rs @@ -1,4 +1,4 @@ -//! Storage-owned first-run setup for the native iPhone application. +//! Storage-owned first-run setup for the native mobile applications. use std::{ error::Error, @@ -363,7 +363,7 @@ impl MobileOnboardingOperation { result?; Ok(MobileOnboardingOutcome { title: "Local Password Store Ready".to_owned(), - detail: "A local Git repository and protected GPG key are ready on this iPhone." + detail: "A local Git repository and protected GPG key are ready on this device." .to_owned(), }) } diff --git a/crates/storage/src/mobile_passwords.rs b/crates/storage/src/mobile_passwords.rs index f902d58..14fee5f 100644 --- a/crates/storage/src/mobile_passwords.rs +++ b/crates/storage/src/mobile_passwords.rs @@ -1,5 +1,7 @@ //! Storage-owned, locked password navigation for native mobile frontends. +use crate::mobile::MobileIcon; + use std::{error::Error, fmt}; use crate::{ @@ -20,7 +22,7 @@ pub struct MobilePasswordRow { path: String, title: String, detail: String, - system_image: String, + icon: MobileIcon, kind: MobilePasswordRowKind, } @@ -41,8 +43,8 @@ impl MobilePasswordRow { &self.detail } - pub fn system_image(&self) -> &str { - &self.system_image + pub fn icon(&self) -> MobileIcon { + self.icon } pub fn kind(&self) -> MobilePasswordRowKind { @@ -168,25 +170,25 @@ fn search_row(path: &crate::repository::EntryPath, text: &str) -> MobilePassword path: text.to_owned(), title, detail, - system_image: "key.fill".to_owned(), + icon: MobileIcon::Key, kind: MobilePasswordRowKind::Entry, } } fn mobile_row(node: &TreeNode) -> MobilePasswordRow { let path = node.path().to_owned(); - let (kind, prefix, detail, system_image) = match node.kind() { + let (kind, prefix, detail, icon) = match node.kind() { TreeNodeKind::Directory => ( MobilePasswordRowKind::Directory, "directory", entry_count_detail(node), - "folder", + MobileIcon::Folder, ), TreeNodeKind::Entry => ( MobilePasswordRowKind::Entry, "entry", "Locked password".to_owned(), - "key.fill", + MobileIcon::Key, ), }; MobilePasswordRow { @@ -194,7 +196,7 @@ fn mobile_row(node: &TreeNode) -> MobilePasswordRow { path, title: node.name().to_owned(), detail, - system_image: system_image.to_owned(), + icon, kind, } } diff --git a/crates/storage/src/mobile_platform.rs b/crates/storage/src/mobile_platform.rs new file mode 100644 index 0000000..702fcc8 --- /dev/null +++ b/crates/storage/src/mobile_platform.rs @@ -0,0 +1,295 @@ +//! OS facts accepted by mobile frontends. Storage validates and interprets them. + +use std::{ + error::Error, + fmt, + path::{Component, Path, PathBuf}, +}; + +use crate::{ + presentation::{QrError, QrMatrix}, + repository::SecretBytes, +}; + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum MobilePlatformError { + InvalidPaths, + InvalidCredentialRequest, +} + +impl fmt::Display for MobilePlatformError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(match self { + Self::InvalidPaths => "invalid mobile platform paths", + Self::InvalidCredentialRequest => "invalid credential-provider request", + }) + } +} + +impl Error for MobilePlatformError {} + +/// The OS supplies private roots; the repository layout is selected here. +#[derive(Clone, Eq, PartialEq)] +pub struct MobilePlatformPaths { + data: PathBuf, + cache: PathBuf, +} + +impl MobilePlatformPaths { + pub fn new(data: PathBuf, cache: PathBuf) -> Result { + for path in [&data, &cache] { + if !path.is_absolute() + || path.parent().is_none() + || path.components().any(|component| { + !matches!(component, Component::RootDir | Component::Normal(_)) + }) + || path + .to_str() + .is_none_or(|value| value.len() > 4096 || value.contains('\0')) + { + return Err(MobilePlatformError::InvalidPaths); + } + } + if data.starts_with(&cache) || cache.starts_with(&data) { + return Err(MobilePlatformError::InvalidPaths); + } + Ok(Self { data, cache }) + } + + pub fn data(&self) -> &Path { + &self.data + } + pub fn cache(&self) -> &Path { + &self.cache + } + pub fn configuration(&self) -> PathBuf { + self.data.join("config.toml") + } + pub fn vault(&self) -> PathBuf { + self.data.join("vault") + } + pub fn keys(&self) -> PathBuf { + self.data.join("keys") + } +} + +impl fmt::Debug for MobilePlatformPaths { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("MobilePlatformPaths([REDACTED])") + } +} + +/// A Y plane, with OS-provided row/pixel strides. No camera or QR policy lives in the UI. +pub struct MobileCameraFrame { + pub width: u32, + pub height: u32, + pub row_stride: u32, + pub pixel_stride: u32, + pub luminance: SecretBytes, +} + +impl MobileCameraFrame { + pub fn decode(&self) -> Result { + let width = self.width as usize; + let height = self.height as usize; + let row = self.row_stride as usize; + let pixel = self.pixel_stride as usize; + let bytes = self.luminance.expose(); + if !(1..=4096).contains(&width) + || !(1..=4096).contains(&height) + || !(1..=4).contains(&pixel) + || bytes.len() > 32 * 1024 * 1024 + { + return Err(QrError::InvalidImage); + } + let last_column = (width - 1) + .checked_mul(pixel) + .ok_or(QrError::InvalidImage)?; + let last = (height - 1) + .checked_mul(row) + .and_then(|offset| offset.checked_add(last_column)) + .ok_or(QrError::InvalidImage)?; + if row <= last_column || last >= bytes.len() { + return Err(QrError::InvalidImage); + } + QrMatrix::decode_luminance(width, height, |x, y| bytes[y * row + x * pixel]) + } +} + +impl fmt::Debug for MobileCameraFrame { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("MobileCameraFrame([REDACTED])") + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum MobileLifecycleEvent { + Foreground, + Background, + DeviceLocked, + UserActivity, + Cancel, +} + +/// A caller identity is an OS assertion, never an authorization grant. +#[derive(Clone, Eq, PartialEq)] +pub struct MobileCredentialRequest { + request_id: String, + package: String, + signing_certificate_sha256: String, + origins: Vec, +} + +impl MobileCredentialRequest { + pub fn new( + request_id: String, + package: String, + certificate: String, + origins: Vec, + ) -> Result { + let invalid = MobilePlatformError::InvalidCredentialRequest; + if request_id.is_empty() + || request_id.len() > 256 + || request_id.chars().any(char::is_control) + || package.len() > 255 + || !package.contains('.') + || package.split('.').any(|part| { + part.is_empty() + || !part.bytes().enumerate().all(|(i, ch)| { + ch == b'_' || ch.is_ascii_alphabetic() || (i > 0 && ch.is_ascii_digit()) + }) + }) + || certificate.len() != 64 + || !certificate.bytes().all(|ch| ch.is_ascii_hexdigit()) + || origins.len() > 64 + { + return Err(invalid); + } + let mut validated = Vec::new(); + for origin in origins { + if origin.len() > 4096 + || origin.chars().any(char::is_whitespace) + || origin.chars().any(char::is_control) + { + return Err(invalid); + } + let url = url::Url::parse(&origin).map_err(|_| invalid)?; + if !matches!(url.scheme(), "https" | "http") + || url.host_str().is_none() + || !url.username().is_empty() + || url.password().is_some() + || url.query().is_some() + || url.fragment().is_some() + || url.path() != "/" + { + return Err(invalid); + } + let origin = url.origin().ascii_serialization(); + if !validated.contains(&origin) { + validated.push(origin); + } + } + Ok(Self { + request_id, + package, + signing_certificate_sha256: certificate.to_ascii_lowercase(), + origins: validated, + }) + } + + pub fn request_id(&self) -> &str { + &self.request_id + } + pub fn package(&self) -> &str { + &self.package + } + pub fn signing_certificate_sha256(&self) -> &str { + &self.signing_certificate_sha256 + } + pub fn origins(&self) -> &[String] { + &self.origins + } +} + +impl fmt::Debug for MobileCredentialRequest { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("MobileCredentialRequest([REDACTED])") + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn roots_and_caller_facts_are_validated_without_creating_data_or_grants() { + let paths = + MobilePlatformPaths::new("/private/app/no-backup".into(), "/private/app/cache".into()) + .unwrap(); + assert_eq!( + paths.configuration(), + Path::new("/private/app/no-backup/config.toml") + ); + for (data, cache) in [ + ("relative", "/cache"), + ("/app/../other", "/cache"), + ("/app", "/app/cache"), + ("/", "/cache"), + ] { + assert!(MobilePlatformPaths::new(data.into(), cache.into()).is_err()); + } + let request = MobileCredentialRequest::new( + "opaque-id".into(), + "de.example.app".into(), + "A".repeat(64), + vec!["https://EXAMPLE.test:443/".into()], + ) + .unwrap(); + assert_eq!(request.origins(), ["https://example.test"]); + for origin in [ + "https://user:secret@example.test", + "file:///tmp", + "https://example.test/path", + "https://example.test/?token=secret", + ] { + assert!( + MobileCredentialRequest::new( + "id".into(), + "de.example.app".into(), + "A".repeat(64), + vec![origin.into()] + ) + .is_err() + ); + } + assert!(!format!("{request:?}").contains("example")); + } + + #[test] + fn strided_camera_frame_decodes_in_rust_and_rejects_truncated_or_oversized_planes() { + let secret = SecretBytes::new(b"otpauth://totp/Test?secret=JBSWY3DPEHPK3PXP".to_vec()); + let qr = QrMatrix::encode(&secret).unwrap(); + let side = (qr.width() + 8) * 8; + let row = side * 2 + 7; + let mut plane = vec![255; side * row]; + for y in 0..side { + for x in 0..side { + if x / 8 >= 4 && y / 8 >= 4 && qr.is_dark(x / 8 - 4, y / 8 - 4) == Some(true) { + plane[y * row + x * 2] = 0; + } + } + } + let mut frame = MobileCameraFrame { + width: side as u32, + height: side as u32, + row_stride: row as u32, + pixel_stride: 2, + luminance: SecretBytes::new(plane), + }; + assert_eq!(frame.decode().unwrap().expose(), secret.expose()); + frame.row_stride = 1; + assert!(frame.decode().is_err()); + frame.width = 4097; + assert!(frame.decode().is_err()); + } +} diff --git a/crates/storage/src/presentation.rs b/crates/storage/src/presentation.rs index 7efa861..a17cc95 100644 --- a/crates/storage/src/presentation.rs +++ b/crates/storage/src/presentation.rs @@ -257,11 +257,19 @@ impl QrMatrix { .decode() .map_err(|_| QrError::InvalidImage)? .into_luma8(); - let mut prepared = rqrr::PreparedImage::prepare_from_greyscale( + Self::decode_luminance( grayscale.width() as usize, grayscale.height() as usize, |x, y| grayscale.get_pixel(x as u32, y as u32).0[0], - ); + ) + } + + pub(crate) fn decode_luminance( + width: usize, + height: usize, + pixel: impl Fn(usize, usize) -> u8, + ) -> Result { + let mut prepared = rqrr::PreparedImage::prepare_from_greyscale(width, height, pixel); let grid = prepared .detect_grids() .into_iter() diff --git a/crates/storage/src/secret_store.rs b/crates/storage/src/secret_store.rs index 9b23964..6db2b6f 100644 --- a/crates/storage/src/secret_store.rs +++ b/crates/storage/src/secret_store.rs @@ -369,6 +369,51 @@ pub trait SecretStoreBackend: Send + Sync { } } +impl SecretStoreBackend for std::sync::Arc { + fn create( + &self, + locator: &SecretLocator, + protection: SecretProtection, + value: &[u8], + ) -> Result<(), SecretStoreError> { + (**self).create(locator, protection, value) + } + fn retrieve( + &self, + locator: &SecretLocator, + protection: SecretProtection, + ) -> Result { + (**self).retrieve(locator, protection) + } + fn replace( + &self, + locator: &SecretLocator, + protection: SecretProtection, + value: &[u8], + ) -> Result<(), SecretStoreError> { + (**self).replace(locator, protection, value) + } + fn delete( + &self, + locator: &SecretLocator, + protection: SecretProtection, + ) -> Result<(), SecretStoreError> { + (**self).delete(locator, protection) + } + fn platform_https_git_credential( + &self, + endpoint: &url::Url, + ) -> Result, SecretStoreError> { + (**self).platform_https_git_credential(endpoint) + } + fn lock(&self) -> Result<(), SecretStoreError> { + (**self).lock() + } + fn unlock(&self) -> Result<(), SecretStoreError> { + (**self).unlock() + } +} + struct CachedSecret { value: SecretBytes, expires_at: Instant, diff --git a/crates/storage/tests/apple_mobile_audit.rs b/crates/storage/tests/apple_mobile_audit.rs index a8fa142..3870b99 100644 --- a/crates/storage/tests/apple_mobile_audit.rs +++ b/crates/storage/tests/apple_mobile_audit.rs @@ -17,9 +17,11 @@ fn apple_sources_preserve_the_mobile_security_boundary() { let watch = workspace_file("apple/Sources/Watch/IronStorageWatchApp.swift"); let autofill = workspace_file("apple/Sources/AutoFill/CredentialProviderViewController.swift"); let bridges = format!( - "{}\n{}", + "{}\n{}\n{}\n{}", workspace_file("crates/apple/src/lib.rs"), - workspace_file("crates/watch-apple/src/lib.rs") + workspace_file("crates/watch-apple/src/lib.rs"), + workspace_file("crates/mobile-bridge/src/lib.rs"), + workspace_file("crates/mobile-bridge/src/platform.rs") ); for (name, source) in [ diff --git a/crates/storage/tests/authentication_leases.rs b/crates/storage/tests/authentication_leases.rs index 0a6286a..5ede452 100644 --- a/crates/storage/tests/authentication_leases.rs +++ b/crates/storage/tests/authentication_leases.rs @@ -26,6 +26,74 @@ use support::compatibility::FixtureSet; type TestResult = Result>; +#[test] +fn mobile_context_uses_injected_os_backend_clock_and_lifecycle_without_global_configuration() +-> TestResult { + use ironstorage::{ + config::Config, mobile_authentication::MobileAuthentication, + mobile_platform::MobileLifecycleEvent, + }; + let fixture = FixtureSet::load()?; + let vault = fixture.materialize_store("basic")?; + let root = tempfile::tempdir()?; + let source = root.path().join("config.toml"); + std::fs::write( + &source, + format!( + "vault = {:?}\nkey_material = {:?}\ndefault_key = {:?}\n[[git.remotes]]\nname = \"origin\"\nurl = \"https://example.test/team/passwords.git\"\nserver_id = \"server-example\"\napplication_id = \"repository-example\"\n", + vault.path().to_str().expect("fixture UTF8"), + fixture.path("keys").to_str().expect("fixture UTF8"), + fixture.key("alice")?.primary_fingerprint, + ), + )?; + let backend = MemoryBackend::default(); + let clock = ManualClock::default(); + let authentication = MobileAuthentication::with_platform( + Config::load(Some(&source))?, + Arc::new(backend.clone()), + Arc::new(clock.clone()), + )?; + assert!( + !authentication + .lifecycle(MobileLifecycleEvent::Foreground)? + .unlocked() + ); + assert_eq!( + authentication + .preferences(false, false, false)? + .application_account(), + None + ); + assert_eq!( + backend.retrieves(), + 1, + "preferences must use the injected backend" + ); + authentication.set_authentication_timeout(30)?; + authentication.unlock_entry( + "email/personal", + Some(SecretBytes::new( + fixture.key("alice")?.passphrase.as_bytes().to_vec(), + )), + )?; + assert!(authentication.state()?.unlocked()); + clock.advance(Duration::from_secs(20)); + assert_eq!(authentication.state()?.remaining_seconds(), 10); + authentication.lifecycle(MobileLifecycleEvent::UserActivity)?; + assert_eq!(authentication.state()?.remaining_seconds(), 30); + let editor = authentication.begin_entry_editor("email/personal")?; + authentication.lifecycle(MobileLifecycleEvent::Background)?; + assert!(!authentication.state()?.unlocked()); + assert!(authentication.entry_editor(editor.id()).is_err()); + let baseline_locks = backend.locks(); + drop(authentication); + assert!( + backend.locks() > baseline_locks, + "final owner locks the OS backend" + ); + Ok(()) +} + #[derive(Default)] struct BackendState { values: BTreeMap, diff --git a/crates/storage/tests/entry_documents.rs b/crates/storage/tests/entry_documents.rs index dc8a3b4..1019f08 100644 --- a/crates/storage/tests/entry_documents.rs +++ b/crates/storage/tests/entry_documents.rs @@ -183,7 +183,7 @@ fn complex_documents_round_trip_with_storage_owned_metadata() -> TestResult { assert_eq!(mobile_custom[1].value(), Some("")); let mobile_otp = mobile_fields .iter() - .find(|field| field.system_image() == "timer") + .find(|field| field.icon() == ironstorage::mobile::MobileIcon::Timer) .expect("OTP field"); assert!(mobile_otp.sensitive()); assert_eq!(mobile_otp.value(), None); @@ -192,7 +192,7 @@ fn complex_documents_round_trip_with_storage_owned_metadata() -> TestResult { })); let mobile_note = mobile_fields .iter() - .find(|field| field.system_image() == "note.text") + .find(|field| field.icon() == ironstorage::mobile::MobileIcon::Note) .expect("multiline note"); assert!(!mobile_note.sensitive()); assert!(mobile_note.multiline()); diff --git a/crates/storage/tests/ssh_release_audit.rs b/crates/storage/tests/ssh_release_audit.rs index 4e13e98..5f58b84 100644 --- a/crates/storage/tests/ssh_release_audit.rs +++ b/crates/storage/tests/ssh_release_audit.rs @@ -1,6 +1,8 @@ const WORKSPACE: &str = include_str!("../../../Cargo.toml"); const STORAGE_MANIFEST: &str = include_str!("../Cargo.toml"); const APPLE_MANIFEST: &str = include_str!("../../apple/Cargo.toml"); +const ANDROID_MANIFEST: &str = include_str!("../../android/Cargo.toml"); +const MOBILE_MANIFEST: &str = include_str!("../../mobile-bridge/Cargo.toml"); const CLI_MANIFEST: &str = include_str!("../../../apps/cli/Cargo.toml"); const TUI_MANIFEST: &str = include_str!("../../../apps/tui/Cargo.toml"); const DESKTOP_MANIFEST: &str = include_str!("../../../apps/desktop/Cargo.toml"); @@ -18,8 +20,16 @@ fn release_feature_and_advisory_boundaries_stay_explicit() { for manifest in [CLI_MANIFEST, TUI_MANIFEST, DESKTOP_MANIFEST] { assert!(manifest.contains("features = [\"ssh\"]")); } - assert!(APPLE_MANIFEST.contains("default-features = false, features = [\"full\"]")); - assert!(!APPLE_MANIFEST.contains("features = [\"ssh\"]")); + assert!(MOBILE_MANIFEST.contains("default-features = false, features = [\"full\"]")); + assert!( + APPLE_MANIFEST.contains( + "ironstorage-mobile = { path = \"../mobile-bridge\", features = [\"watch\"] }" + ) + ); + assert!(ANDROID_MANIFEST.contains("ironstorage-mobile = { path = \"../mobile-bridge\" }")); + for manifest in [APPLE_MANIFEST, ANDROID_MANIFEST, MOBILE_MANIFEST] { + assert!(!manifest.contains("features = [\"ssh\"]")); + } assert!(AUDIT_WORKFLOW.contains("tool: rust@1.92.0,cargo-audit@0.22.2")); assert!(AUDIT_WORKFLOW.contains("fallback: none")); assert!(!AUDIT_WORKFLOW.contains("cargo install")); diff --git a/docs/android/architecture.md b/docs/android/architecture.md index e95dd10..2e55a0d 100644 --- a/docs/android/architecture.md +++ b/docs/android/architecture.md @@ -25,10 +25,10 @@ reads repository files, parses entries/URIs or error labels, generates passwords or codes, or independently decides credential matches or authentication policy. Use typed semantic icons/actions, stable IDs, generation/revision tokens, -view-ready records and typed errors. #91 removes SF Symbol and Watch assumptions -from shared phone contracts. Keep Swift compatibility through mechanical -adapters. #92 generates Kotlin and Swift from one shared UniFFI surface rather -than copying crates/apple conversions. A thin Android bridge may adapt platform +view-ready records and typed errors. #91's `crates/mobile-bridge` removes SF Symbol +and Watch assumptions from shared phone contracts and generates Swift and Kotlin +from one source. `crates/apple` opts into Watch; `crates/android` packages the +phone surface through #92's native build gates. A thin Android bridge may adapt platform callbacks; it must contain no password-store decisions or handwritten unsafe Rust. Generated/dependency FFI stays isolated from project-authored safe Rust. diff --git a/docs/android/mobile-contract.md b/docs/android/mobile-contract.md new file mode 100644 index 0000000..6a77080 --- /dev/null +++ b/docs/android/mobile-contract.md @@ -0,0 +1,127 @@ +# Shared mobile contract (#91) + +`crates/mobile-bridge` is the single UniFFI source for phone records, enums, +conversions, objects, operations and OS callbacks. `crates/android` packages it +without features. `crates/apple` packages it with the explicit `watch` feature. +Neither packaging crate copies converters. The component namespace is +`ironstorage_mobile`; the native library names remain `ironstorage_android` and +`ironstorage_apple`. Swift source/header names follow the shared namespace. + +## Public workflow inventory + +| Storage owner | Shared phone exports | Identity / concurrency boundary | +| --- | --- | --- | +| mobile | shell, fixtures, tab selection | typed tabs/states/semantic icons | +| mobile_home / git | Home page, commits/changes/actions, controlled operations/progress | typed actions, repository operation serialization and cancellation | +| mobile_passwords | browse, search, folder/entry rows | storage entry paths and row IDs | +| mobile_authentication / authentication | unlock, reveal/copy, preferences, identity/appearance/timeout, lifecycle | generation-scoped authentication handles, monotonic expiry | +| mobile_entry / document / generate | structured fields, editor sessions, OTP image import, generation, save/discard | session u64 and field IDs; original ciphertext/conflict checks | +| mobile_mutation / mutation | preparation, request, commit, outcome | opaque revision token validated at execution; explicit overwrite decisions | +| mobile_totp / otp | discovery/progress/cancel, cached search, detail/code/copy | storage-owned catalog, Unix-time inputs and expiry | +| mobile_onboarding / config | server discovery, clone and local setup, token replacement | typed transport/phase errors, controlled cancellation | +| mobile_key_transfer / presentation | export/import, frames, progress, key selection | storage-owned QR envelopes and bounded decoding | +| mobile_watch | **Apple opt-in only:** preferences, selection, snapshots/status/receipts | no Watch enum, field, method or control in the Android contract | + +`MobileIcon` expresses intent, never an asset name. UIKit maps it to SF Symbols +in `MobileIcons.swift`. Android's core maps it exhaustively to its presentation +enum; Compose maps navigation intents to vector drawables. Asset names and +selected variants belong to the native UI. Actions already use typed enums. + +## OS boundaries + +- `MobilePlatformPaths` accepts absolute private data and cache roots, rejects + traversal and overlapping roots, and lets storage derive config/vault/key + paths. Validation does not create or migrate files. #90 owns initialization, + permissions, relocation, backup and cache policy. +- `MobileSecretBackend` performs create/retrieve/replace/delete/lock/unlock on + a typed locator and protection supplied by storage. Values are opaque encoded + storage records. OS errors are enums. It cannot select accounts, protection, + enrollment recovery, cache lifetime or authentication policy. Its adapter is + usable by `mobileAuthenticationWithPlatform`; #93 implements Android Keystore. + Preferences use that same injected backend, never a hidden native fallback. +- `MobileClock` returns elapsed monotonic milliseconds from a stable origin. + It cannot mint or refresh leases. Rust uses the existing authentication clock + and generation checks. Unix timestamps required by TOTP/Git remain explicit + inputs, not values parsed from rendered countdowns. +- `MobileLifecycleEvent` reports foreground, background, device lock, real user + activity, or cancellation. Storage revokes leases/editors on background/lock, + checks expiry on foreground, and extends activity only for an active lease. +- `MobileClipboard` reads/writes/clears OS text and waits for a requested timeout + or cancellation. Rust's existing manager restores the prior text or clears + only if the copied value is still current; newer clipboard content survives. + Call off the UI thread; the facade serializes access to one OS clipboard. +- `MobileCameraFrame` supplies luminance bytes, dimensions and row/pixel stride. + Storage validates bounds (4096 pixels per dimension, 32 MiB plane, pixel + stride 1–4) and decodes QR payloads. Native UI never interprets envelopes. +- `MobileCredentialRequest` carries an opaque request ID, OS-asserted package, + signing-certificate SHA-256 and web origins. Rust validates/canonicalizes the + facts. A validated request is **not** an authorization grant. #109 implements + matching, selected-candidate authentication and scoped grants in storage. + +## Ownership, cancellation and diagnostics + +UniFFI objects are reference-counted Rust owners. Operation objects retain their +authentication owner while work runs. Kotlin `close()` / Swift deinitialization +release native handles; the final storage authentication owner destroys the +lease and locks its store. Frontends cancel the exact operation on navigation +or coroutine cancellation before releasing it. `MobileAuthentication.cancel` +revokes its generation and discards editor state; it is not interchangeable +with cancelling an individual discovery/Git operation. Late results are +discarded by facade revision IDs. Polling, repaint and progress never count as +user activity. Editor IDs and field IDs are stable within their owning session; +revision tokens are opaque and must be returned unchanged to storage. + +Secrets and payloads are owned values, not persisted view state. Rust secret +buffers zeroize on drop. Swift/Kotlin cannot promise complete managed-memory +erasure, so callers release revealed/copy/OTP/frame values when their operation +ends and never log or save them. Generated records, associated-value enums and +errors have redacted diagnostic rendering; typed fields remain available for +deliberate UI presentation. Unexpected native/callback errors redact their +payloads. Mechanical generator hardening is version-checked and preserves wire +layouts and every UniFFI contract/API checksum. + +## Contract gates + +Every Android binding generation generates both Swift and Kotlin from the +compiled phone component. The build tool verifies all records/fields, types, +functions and operation checksums against metadata, writes `inventory.tsv`, and +rejects any Watch item in the phone surface. The Apple opt-in build generates +both languages too. `compare-contract` compares complete shared signatures; +only Watch items and the opt-in Watch inputs to `preferences` differ. + +```sh +cargo build -p ironstorage-apple --lib +cargo run -p ironstorage-android-build -- contract-bindings \ + target/debug/libironstorage_apple.dylib android/uniffi.toml /tmp/ironstorage-watch-contract watch +cargo run -p ironstorage-android-build -- compare-contract \ + android/rust-bridge/build/generated/bindings-raw/debug/inventory.tsv \ + /tmp/ironstorage-watch-contract/inventory.tsv +``` + +On non-macOS build hosts, use the host shared-library extension. Apple generation +copies the verified/hardened Swift source and header into `apple/Generated`. +Contract tests exercise typed errors, checksum failure, callback ownership, +cancellation/concurrency, camera bounds, large foreign payloads and redaction. +All app validation uses persistent emulator devices; no physical-device gate is +part of this milestone's testing scope. + +The native Swift probe in `tools/android-build/tests/mobile_contract.swift` runs +against the generated source and the host Apple library: + +```sh +xcrun swiftc -swift-version 5 -module-cache-path /tmp/ironstorage-swift-cache \ + -I apple/Generated \ + -Xcc -fmodule-map-file=apple/Generated/ironstorage_mobileFFI.modulemap \ + -L target/debug -lironstorage_apple \ + -Xlinker -rpath -Xlinker "$PWD/target/debug" \ + apple/Generated/ironstorage_mobile.swift \ + tools/android-build/tests/mobile_contract.swift -o /tmp/ironstorage-swift-contract +/tmp/ironstorage-swift-contract +``` + +The Android native probe is `MobileContractTest`: run it with the existing +`NativeRuntimeTest` on persistent 4 KB and strict 16 KB ARM64 emulators. UI and +native instrumentation suites run sequentially to preserve input focus. The +storage integration test exercises a real encrypted fixture with the injected +secret backend/clock, activity renewal, background revocation, editor invalidation +and final-owner cleanup without global configuration. diff --git a/docs/android/parity.md b/docs/android/parity.md index 2b00f05..6555a35 100644 --- a/docs/android/parity.md +++ b/docs/android/parity.md @@ -36,7 +36,7 @@ each row. Every issue linked here belongs to milestone 23. | iPhone AutoFill credential selection (CredentialProviderViewController) and shared identity/access domain | desktop/read/document/secret_store today; storage-owned provider contract to add | AndroidX CredentialProviderService (API 34+) and framework AutofillService (API 26+) | #109; typed caller/site identity, non-secret candidates, explicit selection/auth, forged/stale requests, permissions and cross-process lifetime | | Camera permissions, private paths, secret-store mechanics, clipboard, scene/process events, screen privacy | Rust repository/config/secret_store/authentication/presentation; platform callbacks contain facts only | Android framework adapters, FLAG_SECURE, backup rules, ClipboardManager | #90/#93/#98/#100; backup inspection, sandbox paths, pressure/update, screen/clipboard/lifecycle tests | | Accessible labels/actions, large text, keyboard, responsive layout and localization | Typed Rust state/actions; UI accessibility is Kotlin | Compose semantics, TalkBack, adaptive layout, resources | #105; measured keyboard/TalkBack/large-font/multi-window/RTL/rotation coverage | -| Watch pairing/install state in Settings; TOTP Watch selection, snapshots, receipts, transfer and watchOS detail | mobile_watch; Watch fields currently in mobile_totp/mobile_authentication and Apple bridge | Excluded from Android records and UI by #91 | Deliberate Watch-only exclusion; no unsupported placeholder controls or Wear implementation | +| Watch pairing/install state in Settings; TOTP Watch selection, snapshots, receipts, transfer and watchOS detail | mobile_watch; shared bridge's explicit `watch` feature enabled only by crates/apple | Absent from Android records and UI (#91) | Deliberate Watch-only exclusion; no unsupported placeholder controls or Wear implementation | Name search matches current mobile behavior; CLI/TUI decrypted grep is not an iPhone parity claim. Android has no separate filesystem-based search. The diff --git a/tools/android-build/Cargo.toml b/tools/android-build/Cargo.toml index a14fed6..882278d 100644 --- a/tools/android-build/Cargo.toml +++ b/tools/android-build/Cargo.toml @@ -13,6 +13,8 @@ publish = false ironstorage.workspace = true regex.workspace = true uniffi = { workspace = true, features = ["cli"] } +uniffi_bindgen = "=0.32.0" +camino = "1.2" object = { version = "0.36.7", default-features = false, features = ["read", "elf"] } zip = { version = "2.4.2", default-features = false, features = ["deflate"] } diff --git a/tools/android-build/src/bindings.rs b/tools/android-build/src/bindings.rs index 71b5522..c3802c0 100644 --- a/tools/android-build/src/bindings.rs +++ b/tools/android-build/src/bindings.rs @@ -61,14 +61,14 @@ fn harden_source(source: &str) -> Result> { } let source = source.replace(internal, "class InternalException(@Suppress(\"UNUSED_PARAMETER\") message: String) : kotlin.Exception(\"Native Rust failure ([REDACTED])\")") .replace(callback, "val err = \"Native callback failed ([REDACTED])\""); - let records = Regex::new(r"(?ms)^data class (\w+) \((.*?)\n\)([^\{]*)\{\n")?; + let records = Regex::new(r"(?ms)^([ \t]*)data class (\w+)\s*\((.*?)\)[^\{]*\{\n")?; if !records.is_match(&source) { return Err("UniFFI record template changed; review diagnostic hardening".into()); } let source = records.replace_all(&source, |captures: ®ex::Captures<'_>| { format!( "{} override fun toString(): String = \"{}([REDACTED])\"\n", - &captures[0], &captures[1] + &captures[0], &captures[2] ) }); let errors = Regex::new(r#"(?m)(override val message\n\s*)get\(\) = ".*"$"#)?; diff --git a/tools/android-build/src/contract.rs b/tools/android-build/src/contract.rs new file mode 100644 index 0000000..f970bda --- /dev/null +++ b/tools/android-build/src/contract.rs @@ -0,0 +1,315 @@ +//! Generate both languages from compiled metadata and verify their whole public inventory. + +use std::{collections::BTreeSet, error::Error, fs, path::Path}; + +use camino::Utf8PathBuf; +use regex::Regex; +use uniffi_bindgen::{EmptyCrateConfigSupplier, interface::AsType}; + +fn utf8(path: &Path) -> Result> { + Ok(Utf8PathBuf::from_path_buf(path.to_owned()).map_err(|_| "non-UTF8 binding path")?) +} + +pub fn generate( + library: &Path, + config: &Path, + output: &Path, + watch: bool, +) -> Result<(), Box> { + use uniffi::{GenerateOptions, TargetLanguage}; + let library = utf8(library)?; + let config = utf8(config)?; + let out = utf8(output)?; + fs::create_dir_all(output)?; + for (language, directory) in [ + (TargetLanguage::Swift, "swift"), + (TargetLanguage::Kotlin, "kotlin"), + ] { + uniffi::generate(GenerateOptions { + languages: vec![language], + source: library.clone(), + out_dir: out.join(directory), + config_override: Some(config.clone()), + format: false, + ..Default::default() + })?; + } + let cis = uniffi_bindgen::library_mode::find_cis(&library, &EmptyCrateConfigSupplier)?; + if cis.len() != 1 || cis[0].namespace() != "ironstorage_mobile" { + return Err("expected one shared mobile UniFFI component".into()); + } + let ci = &cis[0]; + let swift = fs::read_to_string(output.join("swift/ironstorage_mobile.swift"))?; + let kotlin = read_kotlin(&output.join("kotlin"))?; + let mut inventory = BTreeSet::new(); + let mut names = BTreeSet::new(); + for record in ci.record_definitions() { + names.insert(record.name().to_owned()); + inventory.insert(format!("record\t{}", record.name())); + for field in record.fields() { + let name = camel(field.name()); + if !swift.contains(&format!("var {name}:")) || !kotlin.contains(&format!("`{name}`:")) { + return Err(format!( + "record field missing in a generated language: {}.{name}", + record.name() + ) + .into()); + } + inventory.insert(format!( + "field\t{}.{}\t{:?}", + record.name(), + field.name(), + field.as_type() + )); + } + } + for value in ci.enum_definitions() { + names.insert(value.name().to_owned()); + inventory.insert(format!("enum\t{}", value.name())); + for variant in value.variants() { + inventory.insert(format!( + "variant\t{}.{}\t{:?}", + value.name(), + variant.name(), + variant + .fields() + .iter() + .map(|field| field.as_type()) + .collect::>() + )); + } + } + for object in ci.object_definitions() { + names.insert(object.name().to_owned()); + inventory.insert(format!("object\t{}", object.name())); + for method in object.methods() { + inventory.insert(format!( + "method\t{}.{}\t{:?}\t{:?}", + object.name(), + method.name(), + method + .arguments() + .iter() + .map(|argument| argument.as_type()) + .collect::>(), + method.return_type() + )); + } + } + for function in ci.function_definitions() { + let name = camel(function.name()); + if !swift.contains(&format!("func {name}(")) + || !kotlin.contains(&format!("fun `{name}`(")) + && !kotlin.contains(&format!("fun {name}(")) + { + return Err(format!("function missing from generated language: {name}").into()); + } + inventory.insert(format!( + "function\t{}\t{:?}\t{:?}", + function.name(), + function + .arguments() + .iter() + .map(|argument| argument.as_type()) + .collect::>(), + function.return_type() + )); + } + for name in names { + let kotlin_name = if ci.is_name_used_as_error(&name) { + format!("{}Exception", name.strip_suffix("Error").unwrap_or(&name)) + } else { + name.clone() + }; + if !swift.contains(&name) || !kotlin.contains(&kotlin_name) { + return Err(format!("type missing from generated language: {name}").into()); + } + } + // Both generated languages must verify every native operation checksum, not just its name. + for checksum in ci.iter_checksum_ffi_functions() { + if !swift.contains(checksum.name()) || !kotlin.contains(checksum.name()) { + return Err(format!("missing integrity check: {}", checksum.name()).into()); + } + } + if !watch + && inventory + .iter() + .any(|line| line.to_ascii_lowercase().contains("watch")) + { + return Err("Watch data leaked into the phone contract".into()); + } + if watch + && !inventory + .iter() + .any(|line| line.contains("MobileWatchSnapshotTransfer")) + { + return Err("Apple contract lost Watch transfer".into()); + } + fs::write( + output.join("inventory.tsv"), + inventory.into_iter().collect::>().join("\n") + "\n", + )?; + prepare_swift( + &output.join("swift/ironstorage_mobile.swift"), + &output.join("swift/ironstorage_mobile.swift"), + )?; + let header = output.join("swift/ironstorage_mobileFFI.h"); + fs::write(&header, normalized_lines(&fs::read_to_string(&header)?))?; + println!("Verified Swift/Kotlin inventory and operation checksums (watch={watch})"); + Ok(()) +} + +pub fn compare(phone: &Path, watch: &Path) -> Result<(), Box> { + let phone = fs::read_to_string(phone)?; + let watch = fs::read_to_string(watch)?; + let shared = |source: &str| -> BTreeSet { + source + .lines() + .filter(|line| { + !line.to_ascii_lowercase().contains("watch") + && !line.starts_with("method\tMobileAuthentication.preferences\t") + }) + .map(str::to_owned) + .collect() + }; + let phone = shared(&phone); + let watch = shared(&watch); + if phone != watch { + return Err(format!( + "phone/Apple public API drift: phone-only={:?}, Apple-only={:?}", + phone.difference(&watch).collect::>(), + watch.difference(&phone).collect::>() + ) + .into()); + } + println!( + "Verified {} identical shared phone feature/signature entries", + phone.len() + ); + Ok(()) +} + +fn camel(name: &str) -> String { + let mut parts = name.split('_'); + let mut output = parts.next().unwrap_or_default().to_owned(); + for part in parts { + let mut chars = part.chars(); + if let Some(first) = chars.next() { + output.extend(first.to_uppercase()); + output.extend(chars); + } + } + output +} + +fn read_kotlin(path: &Path) -> Result> { + let mut source = String::new(); + for entry in fs::read_dir(path)? { + let entry = entry?; + if entry.file_type()?.is_dir() { + source.push_str(&read_kotlin(&entry.path())?); + } else if entry.path().extension().is_some_and(|ext| ext == "kt") { + source.push_str(&fs::read_to_string(entry.path())?); + } + } + Ok(source) +} + +fn normalized_lines(source: &str) -> String { + source + .lines() + .map(str::trim_end) + .collect::>() + .join("\n") + .trim_end() + .to_owned() + + "\n" +} + +pub fn prepare_swift(input: &Path, output: &Path) -> Result<(), Box> { + let source = fs::read_to_string(input)?; + if source.contains("// IronStorage diagnostic redaction") { + return Err("Swift diagnostics already prepared".into()); + } + let records = Regex::new(r"(?m)^public struct (Mobile\w+)[ :]")?; + let mut names = records + .captures_iter(&source) + .map(|capture| capture[1].to_owned()) + .collect::>(); + // Error/associated-value enums also expose payloads through Swift's default reflection. + let error_names = Regex::new(r"(?m)^enum (Mobile\w+Error):")?; + names.extend( + error_names + .captures_iter(&source) + .map(|capture| capture[1].to_owned()), + ); + for name in ["MobileSecretLocator", "MobileClipboardContent"] { + if source.contains(&format!("enum {name}")) { + names.insert(name.into()); + } + } + if names.is_empty() { + return Err("Swift record template changed".into()); + } + let panic_payload = + "throw UniffiInternalError.rustPanic(try FfiConverterString.lift(callStatus.errorBuf))"; + let callback_payload = "FfiConverterString.lower(String(describing: error))"; + if source.contains("fileprivate enum UniffiInternalError") + && (!source.contains(panic_payload) || source.matches(callback_payload).count() != 2) + { + return Err("UniFFI Swift unexpected-error template changed".into()); + } + let source = source.replace(panic_payload, "_ = try FfiConverterString.lift(callStatus.errorBuf)\n throw UniffiInternalError.rustPanic(\"Native Rust failure ([REDACTED])\")") + .replace(callback_payload, "FfiConverterString.lower(\"Native callback failed ([REDACTED])\")") + .replace("} catch let error {\n callStatus.pointee.code = CALL_UNEXPECTED_ERROR", "} catch {\n callStatus.pointee.code = CALL_UNEXPECTED_ERROR") + .replace("case let .rustPanic(message): return message", "case .rustPanic: return \"Native Rust failure ([REDACTED])\""); + let mut output_source = source; + output_source.push_str( + "\n// IronStorage diagnostic redaction; wire values and checksums remain generated.\n", + ); + for name in names { + output_source.push_str(&format!("extension {name}: CustomStringConvertible, CustomDebugStringConvertible {{\n public var description: String {{ \"{name}([REDACTED])\" }}\n public var debugDescription: String {{ description }}\n}}\n")); + } + fs::write(output, normalized_lines(&output_source))?; + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn inventory_comparison_rejects_missing_methods_and_type_changes() { + let root = + std::env::temp_dir().join(format!("ironstorage-contract-{}", std::process::id())); + fs::create_dir_all(&root).unwrap(); + let phone = root.join("phone.tsv"); + let watch = root.join("watch.tsv"); + fs::write(&phone, "method\tMobileAuthentication.state\t[]\tBool\n").unwrap(); + fs::write(&watch, "method\tMobileAuthentication.state\t[]\tString\n").unwrap(); + assert!(compare(&phone, &watch).is_err()); + fs::write( + &watch, + "method\tMobileAuthentication.state\t[]\tBool\nfield\tMobileTotpPage.watch\tWatch\n", + ) + .unwrap(); + compare(&phone, &watch).unwrap(); + fs::remove_dir_all(root).unwrap(); + } + #[test] + fn swift_record_and_error_reflection_are_redacted() { + let root = std::env::temp_dir().join(format!( + "ironstorage-swift-redaction-{}", + std::process::id() + )); + fs::create_dir_all(&root).unwrap(); + let input = root.join("raw.swift"); + let output = root.join("prepared.swift"); + fs::write(&input, "public struct MobileEntryCopy: Equatable { public var value: String }\npublic\nenum MobileAuthenticationFfiError: Swift.Error {}\n").unwrap(); + prepare_swift(&input, &output).unwrap(); + let hardened = fs::read_to_string(output).unwrap(); + assert!(hardened.contains("MobileEntryCopy([REDACTED])")); + assert!(hardened.contains("MobileAuthenticationFfiError([REDACTED])")); + assert!(hardened.contains("public var value: String")); + fs::remove_dir_all(root).unwrap(); + } +} diff --git a/tools/android-build/src/main.rs b/tools/android-build/src/main.rs index 87eb2db..8ce3436 100644 --- a/tools/android-build/src/main.rs +++ b/tools/android-build/src/main.rs @@ -4,6 +4,7 @@ use ironstorage::mobile::{MobileShell, MobileShellState}; use std::{env, error::Error, fs, path::Path}; mod bindings; +mod contract; mod native; mod toolchain; @@ -16,6 +17,20 @@ fn main() -> Result<(), Box> { fs::write(path, fixtures())?; } [_, command, path] if command == "check" => check(Path::new(path))?, + [_, command, library, config, output, mode] if command == "contract-bindings" => { + contract::generate( + Path::new(library), + Path::new(config), + Path::new(output), + mode == "watch", + )?; + } + [_, command, phone, watch] if command == "compare-contract" => { + contract::compare(Path::new(phone), Path::new(watch))?; + } + [_, command, input, output] if command == "prepare-swift" => { + contract::prepare_swift(Path::new(input), Path::new(output))?; + } [_, command, input, output] if command == "prepare-bindings" => { bindings::prepare(Path::new(input), Path::new(output))?; } @@ -68,11 +83,12 @@ fn fixtures() -> String { output.push_str(&format!(" ShellState.{state:?} to listOf(\n")); for page in MobileShell::fixture(state).pages() { output.push_str(&format!( - " ShellPage(ShellTab.{:?}, {}, {}, {}),\n", + " ShellPage(ShellTab.{:?}, {}, {}, {}, ShellIcon.{:?}),\n", page.tab(), kotlin_string(page.title()), kotlin_string(page.state_title()), kotlin_string(page.state_detail()), + page.icon(), )); } output.push_str(" ),\n"); diff --git a/tools/android-build/tests/mobile_contract.swift b/tools/android-build/tests/mobile_contract.swift new file mode 100644 index 0000000..b6abb55 --- /dev/null +++ b/tools/android-build/tests/mobile_contract.swift @@ -0,0 +1,66 @@ +import Foundation + +// Runs against the generated Swift component and host Rust library. +final class ContractClipboard: MobileClipboard, @unchecked Sendable { + var text = "previous" + var writtenBytes = 0 + var timeout: UInt64 = 0 + var newer: String? + var cancelled = false + + func read() throws -> MobileClipboardContent { .text(value: Data(text.utf8)) } + func write(value: Data) throws { + writtenBytes = max(writtenBytes, value.count) + text = String(decoding: value, as: UTF8.self) + } + func clear() throws { text = "" } + func waitForTimeout(milliseconds: UInt64) -> MobileClipboardWait { + timeout = milliseconds + if let newer { text = newer } + return cancelled ? .cancelled : .elapsed + } +} + +@main +enum MobileContractProbe { + static func main() throws { + let secret = String(repeating: "contract-payload-", count: 70_000) + let copy = MobileEntryCopy(value: secret, timeoutSeconds: 45) + for diagnostic in [String(describing: copy), String(reflecting: copy)] { + precondition(!diagnostic.contains(secret)) + } + let error = MobileAuthenticationFfiError.Failed(kind: .entry, title: secret, detail: secret) + precondition(!String(reflecting: error).contains(secret)) + precondition(!error.localizedDescription.contains(secret)) + precondition(!String(reflecting: MobileClipboardContent.text(value: Data(secret.utf8))).contains(secret)) + precondition(!String(reflecting: MobileSecretLocator.openPgpPassphrase(fingerprint: secret)).contains(secret)) + for state in [MobileShellState.loading, .empty, .ready, .locked, .error] { + let shell = mobileShellFixture(state: state) + precondition(shell.pages.count == 5) + precondition(shell.pages.allSatisfy { $0.state == state }) + precondition(shell.pages.map(\.icon) == [.home, .key, .search, .timer, .settings]) + } + let clipboard = ContractClipboard() + let restored = try copyMobileEntry(copy: copy, clipboard: clipboard) + precondition(restored == .restoredPrevious) + precondition(clipboard.text == "previous" && clipboard.writtenBytes == secret.utf8.count) + precondition(clipboard.timeout == 45_000) + clipboard.newer = "newer" + let preserved = try copyMobileEntry(copy: copy, clipboard: clipboard) + precondition(preserved == .preservedNewer) + precondition(clipboard.text == "newer") + clipboard.newer = nil + clipboard.cancelled = true + do { _ = try copyMobileEntry(copy: copy, clipboard: clipboard); preconditionFailure("cancellation must fail") } + catch MobilePlatformFfiError.Cancelled {} + precondition(clipboard.text == "newer") + DispatchQueue.concurrentPerform(iterations: 16) { _ in + let operation = mobileTotpOperation() + operation.cancel() + precondition(operation.progress().phase == .cancelled) + } + let request = try validateMobileCredentialRequest(request: MobileCredentialRequest(requestId: "opaque", package: "de.example.app", signingCertificateSha256: String(repeating: "A", count: 64), origins: ["https://EXAMPLE.test:443/"])) + precondition(request.origins == ["https://example.test"]) + print("Swift native contract: fixtures/icons, callbacks, large payload, redaction, cancellation and concurrency passed") + } +}