Enforce Android lifecycle and presentation security (#100)
Android ARM verification / rust (push) Failing after 47m6s
Android ARM verification / android (push) Failing after 8s
Dependency security audit / rustsec (push) Successful in 23s

This commit is contained in:
hugo committed 2026-10-09 18:59:18 +02:00
1 parent c0ba6d43d8
commit a06f39af23
37 files changed
+1129 -110

No files matched your search

+19
View File
@@ -282,6 +282,8 @@ pub enum MobileLifecycleEvent {
Foreground,
Background,
DeviceLocked,
MemoryPressure,
ProcessRecreated,
UserActivity,
Cancel,
}
@@ -291,6 +293,8 @@ impl From<MobileLifecycleEvent> for storage::MobileLifecycleEvent {
MobileLifecycleEvent::Foreground => Self::Foreground,
MobileLifecycleEvent::Background => Self::Background,
MobileLifecycleEvent::DeviceLocked => Self::DeviceLocked,
MobileLifecycleEvent::MemoryPressure => Self::MemoryPressure,
MobileLifecycleEvent::ProcessRecreated => Self::ProcessRecreated,
MobileLifecycleEvent::UserActivity => Self::UserActivity,
MobileLifecycleEvent::Cancel => Self::Cancel,
}
@@ -404,6 +408,21 @@ pub fn copy_mobile_entry_clearing(
copy_entry(copy, clipboard, true)
}
/// Revoke a copy while the Android window still has foreground clipboard access.
#[uniffi::export]
pub fn clear_mobile_entry_copy(
copy: MobileEntryCopy,
clipboard: Arc<dyn MobileClipboard>,
) -> Result<(), MobilePlatformFfiError> {
presentation::ClipboardManager::new(
ClipboardAdapter(clipboard),
presentation::ClipboardTimeout::default(),
)
.clear_current_copy(&SecretBytes::new(copy.value.into_bytes()))
.map(|_| ())
.map_err(|_| MobilePlatformFfiError::ClipboardFailed)
}
fn copy_entry(
copy: MobileEntryCopy,
clipboard: Arc<dyn MobileClipboard>,