PasteFerry (隔空贴): clipboard and file sync across macOS, Windows and Linux. Direct-first, end-to-end encrypted. Optional official access: no server to host. Independent self-hosting remains available.
Dart airdrop-alternativeclipboardclipboard-sharingclipboard-synccopy-pastecross-platformend-to-end-encryptionfile-syncfile-transferfluttergolanglinuxmacosnat-traversalp2pself-hostedtailscaleuniversal-clipboardwebrtcwindows
import Cocoa
import FlutterMacOS
@main
class AppDelegate: FlutterAppDelegate {
var lifecycleChannel: FlutterMethodChannel?
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return false
}
override func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
guard let channel = lifecycleChannel else { return .terminateNow }
channel.invokeMethod("quitRequested", arguments: nil) { _ in
// A cancelled transfer prompt or a shutdown error keeps the app running.
// Successful shutdown exits the process after both helpers have stopped.
NSApp.reply(toApplicationShouldTerminate: false)
}
return .terminateLater
}
override func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
mainFlutterWindow?.makeKeyAndOrderFront(nil)
return true
}
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
}