file provider works

This commit is contained in:
Evgeny Poberezkin 2022-06-10 22:49:48 +01:00
parent e01be483da
commit 88c57c82d4
66 changed files with 762 additions and 546 deletions

View File

@ -8,7 +8,8 @@
import Foundation import Foundation
import UIKit import UIKit
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
class AppDelegate: NSObject, UIApplicationDelegate { class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {

View File

@ -1,77 +0,0 @@
//
// FPService.swift
// SimpleX Service
//
// Created by Evgeny on 01/06/2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
import Foundation
import FileProvider
import SimpleXChat
import SimpleXServiceProtocol
func testFPService() {
logger.debug("testFPService get services")
let manager = NSFileProviderManager.default
// TODO try access file
logger.debug("testFPService NSFileProviderManager.documentStorageURL \(manager.documentStorageURL, privacy: .public)")
// let res = machMessenger.sendMessageWithReply(FPS_MACH_PORT, msg: "machMessenger before getFileProviderServicesForItem")
// print("reply 1", res)
FileManager.default.getFileProviderServicesForItem(at: URL(string: "\(manager.documentStorageURL)123")!) { (services, error) in
// let res = machMessenger.sendMessageWithReply(FPS_MACH_PORT, msg: "machMessenger after getFileProviderServicesForItem")
// print("reply 2", res)
// Check to see if an error occurred.
guard error == nil else {
logger.debug("testFPService error getting service")
print(error!) // <-- this prints the error I posted
// Handle the error here...
return
}
if let desiredService = services?[SIMPLEX_SERVICE_NAME] {
logger.debug("testFPService has desiredService")
// The named service is available for the item at the provided URL.
// To use the service, get the connection object.
desiredService.getFileProviderConnection(completionHandler: { (connectionOrNil, connectionError) in
guard connectionError == nil else {
// Handle the error here...
return
}
guard let connection = connectionOrNil else {
// No connection object found.
return
}
// Set the remote interface.
connection.remoteObjectInterface = simpleXServiceInterface
// Start the connection.
connection.resume()
// Get the proxy object.
let rawProxy = connection.remoteObjectProxyWithErrorHandler({ (errorAccessingRemoteObject) in
// Handle the error here...
})
// Cast the proxy object to the interface's protocol.
guard let proxy = rawProxy as? SimpleXFPServiceProtocol else {
// If the interface is set up properly, this should never fail.
fatalError("*** Unable to cast \(rawProxy) to a DesiredProtocol instance ***")
}
logger.debug("testFPService calling service")
proxy.upperCaseString("hello to service", withReply: { reply in
logger.debug("testFPService reply from service \(reply)")
})
})
}
}
}

View File

@ -70,8 +70,8 @@ class BGManager {
return return
} }
self.completed = false self.completed = false
DispatchQueue.main.async { Task {
initializeChat() await initializeChat()
if ChatModel.shared.currentUser == nil { if ChatModel.shared.currentUser == nil {
completeReceiving("no current user") completeReceiving("no current user")
return return

View File

@ -10,7 +10,7 @@ import Foundation
import Combine import Combine
import SwiftUI import SwiftUI
import WebKit import WebKit
import SimpleXChat import SimpleXChatSDK
final class ChatModel: ObservableObject { final class ChatModel: ObservableObject {
@Published var onboardingStage: OnboardingStage? @Published var onboardingStage: OnboardingStage?

View File

@ -9,7 +9,8 @@
import Foundation import Foundation
import UserNotifications import UserNotifications
import UIKit import UIKit
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
let ntfActionAcceptContact = "NTF_ACT_ACCEPT_CONTACT" let ntfActionAcceptContact = "NTF_ACT_ACCEPT_CONTACT"
let ntfActionAcceptCall = "NTF_ACT_ACCEPT_CALL" let ntfActionAcceptCall = "NTF_ACT_ACCEPT_CALL"

View File

@ -11,9 +11,8 @@ import UIKit
import Dispatch import Dispatch
import BackgroundTasks import BackgroundTasks
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
private var chatController: chat_ctrl?
enum TerminalItem: Identifiable { enum TerminalItem: Identifiable {
case cmd(Date, ChatCommand) case cmd(Date, ChatCommand)
@ -47,7 +46,7 @@ enum TerminalItem: Identifiable {
} }
} }
private func beginBGTask(_ handler: (() -> Void)? = nil) -> (() -> Void) { private func beginBGTask(_ handler: (() -> Void)? = nil) -> (@Sendable () -> Void) {
var id: UIBackgroundTaskIdentifier! var id: UIBackgroundTaskIdentifier!
var running = true var running = true
let endTask = { let endTask = {
@ -72,10 +71,10 @@ private func beginBGTask(_ handler: (() -> Void)? = nil) -> (() -> Void) {
let msgDelay: Double = 7.5 let msgDelay: Double = 7.5
let maxTaskDuration: Double = 15 let maxTaskDuration: Double = 15
private func withBGTask(bgDelay: Double? = nil, f: @escaping () -> ChatResponse) -> ChatResponse { private func withBGTask(bgDelay: Double? = nil, f: @escaping () async -> ChatResponse) async -> ChatResponse {
let endTask = beginBGTask() let endTask = beginBGTask()
DispatchQueue.global().asyncAfter(deadline: .now() + maxTaskDuration, execute: endTask) DispatchQueue.global().asyncAfter(deadline: .now() + maxTaskDuration, execute: endTask)
let r = f() let r = await f()
if let d = bgDelay { if let d = bgDelay {
DispatchQueue.global().asyncAfter(deadline: .now() + d, execute: endTask) DispatchQueue.global().asyncAfter(deadline: .now() + d, execute: endTask)
} else { } else {
@ -84,10 +83,10 @@ private func withBGTask(bgDelay: Double? = nil, f: @escaping () -> ChatResponse)
return r return r
} }
func chatSendCmdSync(_ cmd: ChatCommand, bgTask: Bool = true, bgDelay: Double? = nil) -> ChatResponse { func chatSendCmd(_ cmd: ChatCommand, bgTask: Bool = true, bgDelay: Double? = nil) async -> ChatResponse {
logger.debug("chatSendCmd \(cmd.cmdType)") logger.debug("chatSendCmd \(cmd.cmdType)")
let resp = bgTask let resp = await bgTask
? withBGTask(bgDelay: bgDelay) { sendSimpleXCmd(cmd) } ? withBGTask(bgDelay: bgDelay) { await sendSimpleXCmd(cmd) }
: sendSimpleXCmd(cmd) : sendSimpleXCmd(cmd)
logger.debug("chatSendCmd \(cmd.cmdType): \(resp.responseType)") logger.debug("chatSendCmd \(cmd.cmdType): \(resp.responseType)")
if case let .response(_, json) = resp { if case let .response(_, json) = resp {
@ -102,25 +101,14 @@ func chatSendCmdSync(_ cmd: ChatCommand, bgTask: Bool = true, bgDelay: Double? =
return resp return resp
} }
func chatSendCmd(_ cmd: ChatCommand, bgTask: Bool = true, bgDelay: Double? = nil) async -> ChatResponse {
await withCheckedContinuation { cont in
cont.resume(returning: chatSendCmdSync(cmd, bgTask: bgTask, bgDelay: bgDelay))
}
}
func chatRecvMsg() async -> ChatResponse { func chatRecvMsg() async -> ChatResponse {
await withCheckedContinuation { cont in await withBGTask(bgDelay: msgDelay) {
_ = withBGTask(bgDelay: msgDelay) { await recvSimpleXMsg()
let resp = chatResponse(chat_recv_msg(getChatCtrl())!)
cont.resume(returning: resp)
return resp
}
} }
} }
func apiGetActiveUser() throws -> User? { func apiGetActiveUser() async throws -> User? {
let _ = getChatCtrl() let r = await chatSendCmd(.showActiveUser)
let r = chatSendCmdSync(.showActiveUser)
switch r { switch r {
case let .activeUser(user): return user case let .activeUser(user): return user
case .chatCmdError(.error(.noActiveUser)): return nil case .chatCmdError(.error(.noActiveUser)): return nil
@ -128,14 +116,14 @@ func apiGetActiveUser() throws -> User? {
} }
} }
func apiCreateActiveUser(_ p: Profile) throws -> User { func apiCreateActiveUser(_ p: Profile) async throws -> User {
let r = chatSendCmdSync(.createActiveUser(profile: p)) let r = await chatSendCmd(.createActiveUser(profile: p))
if case let .activeUser(user) = r { return user } if case let .activeUser(user) = r { return user }
throw r throw r
} }
func apiStartChat() throws -> Bool { func apiStartChat() async throws -> Bool {
let r = chatSendCmdSync(.startChat) let r = await chatSendCmd(.startChat)
switch r { switch r {
case .chatStarted: return true case .chatStarted: return true
case .chatRunning: return false case .chatRunning: return false
@ -143,20 +131,20 @@ func apiStartChat() throws -> Bool {
} }
} }
func apiSetFilesFolder(filesFolder: String) throws { func apiSetFilesFolder(filesFolder: String) async throws {
let r = chatSendCmdSync(.setFilesFolder(filesFolder: filesFolder)) let r = await chatSendCmd(.setFilesFolder(filesFolder: filesFolder))
if case .cmdOk = r { return } if case .cmdOk = r { return }
throw r throw r
} }
func apiGetChats() throws -> [Chat] { func apiGetChats() async throws -> [Chat] {
let r = chatSendCmdSync(.apiGetChats) let r = await chatSendCmd(.apiGetChats)
if case let .apiChats(chats) = r { return chats.map { Chat.init($0) } } if case let .apiChats(chats) = r { return chats.map { Chat.init($0) } }
throw r throw r
} }
func apiGetChat(type: ChatType, id: Int64) throws -> Chat { func apiGetChat(type: ChatType, id: Int64) async throws -> Chat {
let r = chatSendCmdSync(.apiGetChat(type: type, id: id)) let r = await chatSendCmd(.apiGetChat(type: type, id: id))
if case let .apiChat(chat) = r { return Chat.init(chat) } if case let .apiChat(chat) = r { return Chat.init(chat) }
throw r throw r
} }
@ -214,8 +202,8 @@ func apiDeleteToken(token: String) async throws {
try await sendCommandOkResp(.apiDeleteToken(token: token)) try await sendCommandOkResp(.apiDeleteToken(token: token))
} }
func getUserSMPServers() throws -> [String] { func getUserSMPServers() async throws -> [String] {
let r = chatSendCmdSync(.getUserSMPServers) let r = await chatSendCmd(.getUserSMPServers)
if case let .userSMPServers(smpServers) = r { return smpServers } if case let .userSMPServers(smpServers) = r { return smpServers }
throw r throw r
} }
@ -224,8 +212,8 @@ func setUserSMPServers(smpServers: [String]) async throws {
try await sendCommandOkResp(.setUserSMPServers(smpServers: smpServers)) try await sendCommandOkResp(.setUserSMPServers(smpServers: smpServers))
} }
func apiAddContact() throws -> String { func apiAddContact() async throws -> String {
let r = chatSendCmdSync(.addContact, bgTask: false) let r = await chatSendCmd(.addContact, bgTask: false)
if case let .invitation(connReqInvitation) = r { return connReqInvitation } if case let .invitation(connReqInvitation) = r { return connReqInvitation }
throw r throw r
} }
@ -312,8 +300,8 @@ func apiUpdateProfile(profile: Profile) async throws -> Profile? {
} }
} }
func apiParseMarkdown(text: String) throws -> [FormattedText]? { func apiParseMarkdown(text: String) async throws -> [FormattedText]? {
let r = chatSendCmdSync(.apiParseMarkdown(text: text)) let r = await sendSimpleXCmd(.apiParseMarkdown(text: text))
if case let .apiParsedMarkdown(formattedText) = r { return formattedText } if case let .apiParsedMarkdown(formattedText) = r { return formattedText }
throw r throw r
} }
@ -330,8 +318,8 @@ func apiDeleteUserAddress() async throws {
throw r throw r
} }
func apiGetUserAddress() throws -> String? { func apiGetUserAddress() async throws -> String? {
let r = chatSendCmdSync(.showMyAddress) let r = await sendSimpleXCmd(.showMyAddress)
switch r { switch r {
case let .userContactLink(connReq): case let .userContactLink(connReq):
return connReq return connReq
@ -454,36 +442,45 @@ private func sendCommandOkResp(_ cmd: ChatCommand) async throws {
throw r throw r
} }
func initializeChat() { func initializeChat() async {
logger.debug("initializeChat") logger.debug("initializeChat")
do { do {
let m = ChatModel.shared let m = ChatModel.shared
m.currentUser = try apiGetActiveUser() let user = try await apiGetActiveUser()
if m.currentUser == nil { await MainActor.run {
m.onboardingStage = .step1_SimpleXInfo m.currentUser = user
} else { if user == nil {
startChat() m.onboardingStage = .step1_SimpleXInfo
}
}
if user != nil {
await startChat()
} }
} catch { } catch {
fatalError("Failed to initialize chat controller or database: \(error)") fatalError("Failed to initialize chat controller or database: \(error)")
} }
} }
func startChat() { func startChat() async {
logger.debug("startChat") logger.debug("startChat")
do { do {
let m = ChatModel.shared
// TODO set file folder once, before chat is started // TODO set file folder once, before chat is started
let justStarted = try apiStartChat() let justStarted = try await apiStartChat()
if justStarted { if justStarted {
try apiSetFilesFolder(filesFolder: getAppFilesDirectory().path) try await apiSetFilesFolder(filesFolder: getAppFilesDirectory().path)
m.userAddress = try apiGetUserAddress() let userAddress = try await apiGetUserAddress()
m.userSMPServers = try getUserSMPServers() let userSMPServers = try await getUserSMPServers()
m.chats = try apiGetChats() let chats = try await apiGetChats()
withAnimation { DispatchQueue.main.async {
m.onboardingStage = m.chats.isEmpty let m = ChatModel.shared
? .step3_MakeConnection m.userAddress = userAddress
: .onboardingComplete m.userSMPServers = userSMPServers
m.chats = chats
withAnimation {
m.onboardingStage = m.chats.isEmpty
? .step3_MakeConnection
: .onboardingComplete
}
} }
} }
ChatReceiver.shared.start() ChatReceiver.shared.start()
@ -512,7 +509,7 @@ class ChatReceiver {
func receiveMsgLoop() async { func receiveMsgLoop() async {
let msg = await chatRecvMsg() let msg = await chatRecvMsg()
self._lastMsgTime = .now self._lastMsgTime = .now
processReceivedMsg(msg) await processReceivedMsg(msg)
if self.receiveMessages { if self.receiveMessages {
do { try await Task.sleep(nanoseconds: 7_500_000) } do { try await Task.sleep(nanoseconds: 7_500_000) }
catch { logger.error("receiveMsgLoop: Task.sleep error: \(error.localizedDescription)") } catch { logger.error("receiveMsgLoop: Task.sleep error: \(error.localizedDescription)") }
@ -528,7 +525,7 @@ class ChatReceiver {
} }
} }
func processReceivedMsg(_ res: ChatResponse) { func processReceivedMsg(_ res: ChatResponse) async {
let m = ChatModel.shared let m = ChatModel.shared
DispatchQueue.main.async { DispatchQueue.main.async {
m.terminalItems.append(.resp(.now, res)) m.terminalItems.append(.resp(.now, res))

View File

@ -7,47 +7,10 @@
import SwiftUI import SwiftUI
import OSLog import OSLog
import SimpleXChat import SimpleXAppShared
let logger = Logger() let logger = Logger()
//let machMessenger = MachMessenger(APP_MACH_PORT, callback: receivedMachMessage)
//
//func receivedMachMessage(msgId: Int32, msg: String) -> String? {
// logger.debug("MachMessenger: receivedMachMessage from FPS")
//// return "reply from App to: \(msg)"
//
// if let data = msg.data(using: .utf8) {
// logger.debug("receivedMachMessage has data")
// let endpoint = try! NSKeyedUnarchiver.unarchivedObject(ofClass: NSXPCListenerEndpoint.self, from: data)!
// logger.debug("receivedMachMessage has endpoint")
// let connection = NSXPCConnection(listenerEndpoint: endpoint)
// logger.debug("receivedMachMessage has connection")
// connection.remoteObjectInterface = NSXPCInterface(with: SimpleXFPServiceProtocol.self)
//
// // Start the connection.
// connection.resume()
//
// // Get the proxy object.
// let rawProxy = connection.remoteObjectProxyWithErrorHandler({ (errorAccessingRemoteObject) in
// // Handle the error here...
// })
//
// // Cast the proxy object to the interface's protocol.
// guard let proxy = rawProxy as? SimpleXFPServiceProtocol else {
// // If the interface is set up properly, this should never fail.
// fatalError("*** Unable to cast \(rawProxy) to a DesiredProtocol instance ***")
// }
//
// logger.debug("receivedMachMessage calling service")
// proxy.upperCaseString("hello to service", withReply: { reply in
// logger.debug("receivedMachMessage reply from service \(reply)")
// })
//
// }
// return nil
//}
@main @main
struct SimpleXApp: App { struct SimpleXApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@ -60,16 +23,10 @@ struct SimpleXApp: App {
@State private var enteredBackground: Double? = nil @State private var enteredBackground: Double? = nil
init() { init() {
hs_init(0, nil) // hs_init(0, nil)
UserDefaults.standard.register(defaults: appDefaults) UserDefaults.standard.register(defaults: appDefaults)
BGManager.shared.register() BGManager.shared.register()
NtfManager.shared.registerCategories() NtfManager.shared.registerCategories()
// machMessenger.start()
// test service comms
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
testFPService()
}
} }
var body: some Scene { var body: some Scene {
@ -80,8 +37,8 @@ struct SimpleXApp: App {
logger.debug("ContentView.onOpenURL: \(url)") logger.debug("ContentView.onOpenURL: \(url)")
chatModel.appOpenUrl = url chatModel.appOpenUrl = url
} }
.onAppear() { .onAppear {
initializeChat() Task { await initializeChat() }
} }
.onChange(of: scenePhase) { phase in .onChange(of: scenePhase) { phase in
logger.debug("scenePhase \(String(describing: scenePhase))") logger.debug("scenePhase \(String(describing: scenePhase))")

View File

@ -8,7 +8,7 @@
import SwiftUI import SwiftUI
import WebKit import WebKit
import SimpleXChat import SimpleXChatSDK
struct ActiveCallView: View { struct ActiveCallView: View {
@EnvironmentObject var m: ChatModel @EnvironmentObject var m: ChatModel

View File

@ -9,7 +9,7 @@
import Foundation import Foundation
//import CallKit //import CallKit
import AVFoundation import AVFoundation
import SimpleXChat import SimpleXChatSDK
//class CallController: NSObject, CXProviderDelegate, ObservableObject { //class CallController: NSObject, CXProviderDelegate, ObservableObject {
class CallController: NSObject, ObservableObject { class CallController: NSObject, ObservableObject {

View File

@ -7,7 +7,7 @@
// //
import Foundation import Foundation
import SimpleXChat import SimpleXChatSDK
class CallManager { class CallManager {
func newOutgoingCall(_ contact: Contact, _ media: CallMediaType) -> UUID { func newOutgoingCall(_ contact: Contact, _ media: CallMediaType) -> UUID {

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct IncomingCallView: View { struct IncomingCallView: View {
@EnvironmentObject var m: ChatModel @EnvironmentObject var m: ChatModel

View File

@ -8,7 +8,7 @@
import Foundation import Foundation
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
class Call: ObservableObject, Equatable { class Call: ObservableObject, Equatable {
static func == (lhs: Call, rhs: Call) -> Bool { static func == (lhs: Call, rhs: Call) -> Bool {

View File

@ -8,7 +8,7 @@
import SwiftUI import SwiftUI
import WebKit import WebKit
import SimpleXChat import SimpleXChatSDK
class WebRTCCoordinator: NSObject, WKNavigationDelegate, WKScriptMessageHandler, WKUIDelegate { class WebRTCCoordinator: NSObject, WKNavigationDelegate, WKScriptMessageHandler, WKUIDelegate {
var rtcWebView: Binding<WKWebView?> var rtcWebView: Binding<WKWebView?>

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
private let chatImageColorLight = Color(red: 0.9, green: 0.9, blue: 0.9) private let chatImageColorLight = Color(red: 0.9, green: 0.9, blue: 0.9)
private let chatImageColorDark = Color(red: 0.2, green: 0.2, blue: 0.2 ) private let chatImageColorDark = Color(red: 0.2, green: 0.2, blue: 0.2 )

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ChatInfoView: View { struct ChatInfoView: View {
@EnvironmentObject var chatModel: ChatModel @EnvironmentObject var chatModel: ChatModel

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct CICallItemView: View { struct CICallItemView: View {
@EnvironmentObject var m: ChatModel @EnvironmentObject var m: ChatModel

View File

@ -7,7 +7,8 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
struct CIFileView: View { struct CIFileView: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme

View File

@ -7,7 +7,8 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
struct CIImageView: View { struct CIImageView: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme

View File

@ -7,7 +7,8 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
struct CILinkView: View { struct CILinkView: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct CIMetaView: View { struct CIMetaView: View {
var chatItem: ChatItem var chatItem: ChatItem

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct DeletedItemView: View { struct DeletedItemView: View {
var chatItem: ChatItem var chatItem: ChatItem

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct EmojiItemView: View { struct EmojiItemView: View {
var chatItem: ChatItem var chatItem: ChatItem

View File

@ -7,7 +7,8 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
let sentColorLight = Color(.sRGB, red: 0.27, green: 0.72, blue: 1, opacity: 0.12) let sentColorLight = Color(.sRGB, red: 0.27, green: 0.72, blue: 1, opacity: 0.12)
let sentColorDark = Color(.sRGB, red: 0.27, green: 0.72, blue: 1, opacity: 0.17) let sentColorDark = Color(.sRGB, red: 0.27, green: 0.72, blue: 1, opacity: 0.17)

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct IntegrityErrorItemView: View { struct IntegrityErrorItemView: View {
var chatItem: ChatItem var chatItem: ChatItem

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
private let uiLinkColor = UIColor(red: 0, green: 0.533, blue: 1, alpha: 1) private let uiLinkColor = UIColor(red: 0, green: 0.533, blue: 1, alpha: 1)
private let linkColor = Color(uiColor: uiLinkColor) private let linkColor = Color(uiColor: uiLinkColor)

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ChatItemView: View { struct ChatItemView: View {
var chatInfo: ChatInfo var chatInfo: ChatInfo

View File

@ -7,7 +7,8 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
private let memberImageSize: CGFloat = 34 private let memberImageSize: CGFloat = 34

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXAppShared
struct ComposeImageView: View { struct ComposeImageView: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme

View File

@ -8,7 +8,8 @@
import SwiftUI import SwiftUI
import LinkPresentation import LinkPresentation
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
func getLinkPreview(url: URL, cb: @escaping (LinkPreview?) -> Void) { func getLinkPreview(url: URL, cb: @escaping (LinkPreview?) -> Void) {
logger.debug("getLinkMetadata: fetching URL preview") logger.debug("getLinkMetadata: fetching URL preview")

View File

@ -7,7 +7,8 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
enum ComposePreview { enum ComposePreview {
case noPreview case noPreview
@ -164,7 +165,7 @@ struct ComposeView: View {
.onChange(of: composeState.message) { _ in .onChange(of: composeState.message) { _ in
if composeState.linkPreviewAllowed() { if composeState.linkPreviewAllowed() {
if composeState.message.count > 0 { if composeState.message.count > 0 {
showLinkPreview(composeState.message) Task { await showLinkPreview(composeState.message) }
} else { } else {
resetLinkPreview() resetLinkPreview()
} }
@ -306,7 +307,7 @@ struct ComposeView: View {
case .noPreview: case .noPreview:
mc = .text(composeState.message) mc = .text(composeState.message)
case .linkPreview: case .linkPreview:
mc = checkLinkPreview() mc = await checkLinkPreview()
case let .imagePreview(imagePreview: image): case let .imagePreview(imagePreview: image):
if let uiImage = chosenImage, if let uiImage = chosenImage,
let savedFile = saveImage(uiImage) { let savedFile = saveImage(uiImage) {
@ -357,12 +358,12 @@ struct ComposeView: View {
chosenFile = nil chosenFile = nil
} }
private func updateMsgContent(_ msgContent: MsgContent) -> MsgContent { private func updateMsgContent(_ msgContent: MsgContent) async -> MsgContent {
switch msgContent { switch msgContent {
case .text: case .text:
return checkLinkPreview() return await checkLinkPreview()
case .link: case .link:
return checkLinkPreview() return await checkLinkPreview()
case .image(_, let image): case .image(_, let image):
return .image(text: composeState.message, image: image) return .image(text: composeState.message, image: image)
case .file: case .file:
@ -372,9 +373,9 @@ struct ComposeView: View {
} }
} }
private func showLinkPreview(_ s: String) { private func showLinkPreview(_ s: String) async {
prevLinkUrl = linkUrl prevLinkUrl = linkUrl
linkUrl = parseMessage(s) linkUrl = await parseMessage(s)
if let url = linkUrl { if let url = linkUrl {
if url != composeState.linkPreview()?.uri && url != pendingLinkUrl { if url != composeState.linkPreview()?.uri && url != pendingLinkUrl {
pendingLinkUrl = url pendingLinkUrl = url
@ -391,9 +392,9 @@ struct ComposeView: View {
} }
} }
private func parseMessage(_ msg: String) -> URL? { private func parseMessage(_ msg: String) async -> URL? {
do { do {
let parsedMsg = try apiParseMarkdown(text: msg) let parsedMsg = try await apiParseMarkdown(text: msg)
let uri = parsedMsg?.first(where: { ft in let uri = parsedMsg?.first(where: { ft in
ft.format == .uri && !cancelledLinks.contains(ft.text) && !isSimplexLink(ft.text) ft.format == .uri && !cancelledLinks.contains(ft.text) && !isSimplexLink(ft.text)
}) })
@ -437,10 +438,10 @@ struct ComposeView: View {
cancelledLinks = [] cancelledLinks = []
} }
private func checkLinkPreview() -> MsgContent { private func checkLinkPreview() async -> MsgContent {
switch (composeState.preview) { switch (composeState.preview) {
case let .linkPreview(linkPreview: linkPreview): case let .linkPreview(linkPreview: linkPreview):
if let url = parseMessage(composeState.message), if let url = await parseMessage(composeState.message),
let linkPreview = linkPreview, let linkPreview = linkPreview,
url == linkPreview.uri { url == linkPreview.uri {
return .link(text: composeState.message, preview: linkPreview) return .link(text: composeState.message, preview: linkPreview)

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ContextItemView: View { struct ContextItemView: View {
@Environment(\.colorScheme) var colorScheme @Environment(\.colorScheme) var colorScheme

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct SendMessageView: View { struct SendMessageView: View {
@Binding var composeState: ComposeState @Binding var composeState: ComposeState

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ChatListNavLink: View { struct ChatListNavLink: View {
@EnvironmentObject var chatModel: ChatModel @EnvironmentObject var chatModel: ChatModel
@ -31,13 +31,17 @@ struct ChatListNavLink: View {
private func chatView() -> some View { private func chatView() -> some View {
ChatView(chat: chat, showChatInfo: $showChatInfo) ChatView(chat: chat, showChatInfo: $showChatInfo)
.onAppear { .onAppear {
do { Task {
let cInfo = chat.chatInfo do {
let chat = try apiGetChat(type: cInfo.chatType, id: cInfo.apiId) let cInfo = chat.chatInfo
chatModel.updateChatInfo(chat.chatInfo) let chat = try await apiGetChat(type: cInfo.chatType, id: cInfo.apiId)
chatModel.chatItems = chat.chatItems DispatchQueue.main.async {
} catch { chatModel.updateChatInfo(chat.chatInfo)
logger.error("ChatListNavLink.chatView apiGetChatItems error: \(error.localizedDescription)") chatModel.chatItems = chat.chatItems
}
} catch {
logger.error("ChatListNavLink.chatView apiGetChatItems error: \(String(describing: error))")
}
} }
} }
} }

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ChatListView: View { struct ChatListView: View {
@EnvironmentObject var chatModel: ChatModel @EnvironmentObject var chatModel: ChatModel

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ChatPreviewView: View { struct ChatPreviewView: View {
@ObservedObject var chat: Chat @ObservedObject var chat: Chat

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ContactConnectionView: View { struct ContactConnectionView: View {
var contactConnection: PendingContactConnection var contactConnection: PendingContactConnection

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ContactRequestView: View { struct ContactRequestView: View {
var contactRequest: UserContactRequest var contactRequest: UserContactRequest

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct ChatInfoImage: View { struct ChatInfoImage: View {
@ObservedObject var chat: Chat @ObservedObject var chat: Chat

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXAppShared
struct ProfileImage: View { struct ProfileImage: View {
var imageStr: String? = nil var imageStr: String? = nil

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
enum NewChatAction: Identifiable { enum NewChatAction: Identifiable {
case createLink case createLink
@ -27,7 +27,7 @@ struct NewChatButton: View {
Image(systemName: "person.crop.circle.badge.plus") Image(systemName: "person.crop.circle.badge.plus")
} }
.confirmationDialog("Add contact to start a new chat", isPresented: $showAddChat, titleVisibility: .visible) { .confirmationDialog("Add contact to start a new chat", isPresented: $showAddChat, titleVisibility: .visible) {
Button("Create link / QR code") { addContactAction() } Button("Create link / QR code") { Task { await addContactAction() } }
Button("Paste received link") { actionSheet = .pasteLink } Button("Paste received link") { actionSheet = .pasteLink }
Button("Scan QR code") { actionSheet = .scanQRCode } Button("Scan QR code") { actionSheet = .scanQRCode }
} }
@ -40,9 +40,9 @@ struct NewChatButton: View {
} }
} }
func addContactAction() { func addContactAction() async {
do { do {
connReq = try apiAddContact() connReq = try await apiAddContact()
actionSheet = .createLink actionSheet = .createLink
} catch { } catch {
DispatchQueue.global().async { DispatchQueue.global().async {

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct CreateProfile: View { struct CreateProfile: View {
@EnvironmentObject var m: ChatModel @EnvironmentObject var m: ChatModel
@ -43,7 +43,7 @@ struct CreateProfile: View {
.focused($focusFullName) .focused($focusFullName)
.submitLabel(.go) .submitLabel(.go)
.onSubmit { .onSubmit {
if canCreateProfile() { createProfile() } if canCreateProfile() { Task { await createProfile() } }
else { focusFullName = true } else { focusFullName = true }
} }
@ -64,7 +64,7 @@ struct CreateProfile: View {
HStack { HStack {
Button { Button {
createProfile() Task { await createProfile() }
} label: { } label: {
Text("Create") Text("Create")
Image(systemName: "greaterthan") Image(systemName: "greaterthan")
@ -87,17 +87,19 @@ struct CreateProfile: View {
.padding(.bottom) .padding(.bottom)
} }
func createProfile() { func createProfile() async {
hideKeyboard() hideKeyboard()
let profile = Profile( let profile = Profile(
displayName: displayName, displayName: displayName,
fullName: fullName fullName: fullName
) )
do { do {
m.currentUser = try apiCreateActiveUser(profile) let user = try await apiCreateActiveUser(profile)
startChat() await MainActor.run { m.currentUser = user }
withAnimation { m.onboardingStage = .step3_MakeConnection } await startChat()
DispatchQueue.main.async {
withAnimation { m.onboardingStage = .step3_MakeConnection }
}
} catch { } catch {
fatalError("Failed to create user: \(error)") fatalError("Failed to create user: \(error)")
} }

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
struct MakeConnection: View { struct MakeConnection: View {
@EnvironmentObject var m: ChatModel @EnvironmentObject var m: ChatModel
@ -38,7 +38,7 @@ struct MakeConnection: View {
icon: "link.badge.plus", icon: "link.badge.plus",
title: "Create 1-time link / QR code", title: "Create 1-time link / QR code",
text: "It's secure to share - only one contact can use it." text: "It's secure to share - only one contact can use it."
) { addContactAction() } ) { Task { await addContactAction() } }
actionRow( actionRow(
icon: "doc.plaintext", icon: "doc.plaintext",
@ -102,9 +102,9 @@ struct MakeConnection: View {
} }
} }
private func addContactAction() { private func addContactAction() async {
do { do {
connReq = try apiAddContact() connReq = try await apiAddContact()
actionSheet = .createLink actionSheet = .createLink
} catch { } catch {
DispatchQueue.global().async { DispatchQueue.global().async {

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
private let terminalFont = Font.custom("Menlo", size: 16) private let terminalFont = Font.custom("Menlo", size: 16)

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
private let serversFont = Font.custom("Menlo", size: 14) private let serversFont = Font.custom("Menlo", size: 14)

View File

@ -7,7 +7,7 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
let simplexTeamURL = URL(string: "simplex:/contact#/?v=1&smp=smp%3A%2F%2FPQUV2eL0t7OStZOoAsPEV2QYWt4-xilbakvGUGOItUo%3D%40smp6.simplex.im%2FK1rslx-m5bpXVIdMZg9NLUZ_8JBm8xTt%23MCowBQYDK2VuAyEALDeVe-sG8mRY22LsXlPgiwTNs9dbiLrNuA7f3ZMAJ2w%3D")! let simplexTeamURL = URL(string: "simplex:/contact#/?v=1&smp=smp%3A%2F%2FPQUV2eL0t7OStZOoAsPEV2QYWt4-xilbakvGUGOItUo%3D%40smp6.simplex.im%2FK1rslx-m5bpXVIdMZg9NLUZ_8JBm8xTt%23MCowBQYDK2VuAyEALDeVe-sG8mRY22LsXlPgiwTNs9dbiLrNuA7f3ZMAJ2w%3D")!

View File

@ -7,7 +7,8 @@
// //
import SwiftUI import SwiftUI
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
struct UserProfile: View { struct UserProfile: View {
@EnvironmentObject var chatModel: ChatModel @EnvironmentObject var chatModel: ChatModel

View File

@ -9,7 +9,8 @@
import UserNotifications import UserNotifications
import OSLog import OSLog
import FileProvider import FileProvider
import SimpleXChat import SimpleXChatSDK
import SimpleXAppShared
import SimpleXServiceProtocol import SimpleXServiceProtocol
import Foundation import Foundation
@ -23,8 +24,6 @@ class NotificationService: UNNotificationServiceExtension {
var bestAttemptContent: UNMutableNotificationContent? var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
testFPService()
logger.debug("NotificationService.didReceive") logger.debug("NotificationService.didReceive")
machMessenger.start() machMessenger.start()
let res = machMessenger.sendMessageWithReply(APP_MACH_PORT, msg: "starting NSE didReceive") let res = machMessenger.sendMessageWithReply(APP_MACH_PORT, msg: "starting NSE didReceive")
@ -37,20 +36,22 @@ class NotificationService: UNNotificationServiceExtension {
logger.debug("NotificationService: app is in the background") logger.debug("NotificationService: app is in the background")
self.contentHandler = contentHandler self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let _ = startChat() { Task {
let content = receiveMessages() if let _ = await startChat() {
contentHandler (content) let content = await receiveMessages()
machMessenger.stop() contentHandler (content)
return machMessenger.stop()
} return
}
if let bestAttemptContent = bestAttemptContent { if let bestAttemptContent = bestAttemptContent {
// Modify the notification content here... // Modify the notification content here...
bestAttemptContent.title = "\(bestAttemptContent.title) [modified]" bestAttemptContent.title = "\(bestAttemptContent.title) [modified]"
contentHandler(bestAttemptContent) contentHandler(bestAttemptContent)
}
machMessenger.stop()
} }
machMessenger.stop()
} }
override func serviceExtensionTimeWillExpire() { override func serviceExtensionTimeWillExpire() {
@ -68,13 +69,13 @@ func receivedAppMachMessage(msgId: Int32, msg: String) -> String? {
return "reply from NSE to: \(msg)" return "reply from NSE to: \(msg)"
} }
func startChat() -> User? { func startChat() async -> User? {
hs_init(0, nil) // hs_init(0, nil)
if let user = apiGetActiveUser() { if let user = await apiGetActiveUser() {
logger.debug("active user \(String(describing: user))") logger.debug("active user \(String(describing: user))")
do { do {
try apiStartChat() try await apiStartChat()
try apiSetFilesFolder(filesFolder: getAppFilesDirectory().path) try await apiSetFilesFolder(filesFolder: getAppFilesDirectory().path)
return user return user
} catch { } catch {
logger.error("NotificationService startChat error: \(responseError(error), privacy: .public)") logger.error("NotificationService startChat error: \(responseError(error), privacy: .public)")
@ -85,10 +86,11 @@ func startChat() -> User? {
return nil return nil
} }
func receiveMessages() -> UNNotificationContent { func receiveMessages() async -> UNNotificationContent {
logger.debug("NotificationService receiveMessages started") logger.debug("NotificationService receiveMessages started")
while true { while true {
let res = chatResponse(chat_recv_msg(getChatCtrl())!) // let res = chatResponse(chat_recv_msg(getChatCtrl())!)
let res = await recvSimpleXMsg()
logger.debug("NotificationService receiveMessages: \(res.responseType)") logger.debug("NotificationService receiveMessages: \(res.responseType)")
switch res { switch res {
// case let .newContactConnection(connection): // case let .newContactConnection(connection):
@ -123,9 +125,9 @@ func receiveMessages() -> UNNotificationContent {
} }
} }
func apiGetActiveUser() -> User? { func apiGetActiveUser() async -> User? {
let _ = getChatCtrl() // let _ = getChatCtrl()
let r = sendSimpleXCmd(.showActiveUser) let r = await sendSimpleXCmd(.showActiveUser)
logger.debug("apiGetActiveUser sendSimpleXCmd responce: \(String(describing: r))") logger.debug("apiGetActiveUser sendSimpleXCmd responce: \(String(describing: r))")
switch r { switch r {
case let .activeUser(user): return user case let .activeUser(user): return user
@ -136,8 +138,8 @@ func apiGetActiveUser() -> User? {
} }
} }
func apiStartChat() throws { func apiStartChat() async throws {
let r = sendSimpleXCmd(.startChat) let r = await sendSimpleXCmd(.startChat)
switch r { switch r {
case .chatStarted: return case .chatStarted: return
case .chatRunning: return case .chatRunning: return
@ -145,76 +147,8 @@ func apiStartChat() throws {
} }
} }
func apiSetFilesFolder(filesFolder: String) throws { func apiSetFilesFolder(filesFolder: String) async throws {
let r = sendSimpleXCmd(.setFilesFolder(filesFolder: filesFolder)) let r = await sendSimpleXCmd(.setFilesFolder(filesFolder: filesFolder))
if case .cmdOk = r { return } if case .cmdOk = r { return }
throw r throw r
} }
func testFPService() {
logger.debug("testFPService get services")
let manager = NSFileProviderManager.default
// TODO try access file
logger.debug("testFPService NSFileProviderManager.documentStorageURL \(manager.documentStorageURL, privacy: .public)")
// let res = machMessenger.sendMessageWithReply(FPS_MACH_PORT, msg: "machMessenger before getFileProviderServicesForItem")
// print("reply 1", res)
FileManager.default.getFileProviderServicesForItem(at: URL(string: "\(manager.documentStorageURL)123")!) { (services, error) in
// let res = machMessenger.sendMessageWithReply(FPS_MACH_PORT, msg: "machMessenger after getFileProviderServicesForItem")
// print("reply 2", res)
// Check to see if an error occurred.
guard error == nil else {
logger.debug("testFPService error getting service")
print(error!) // <-- this prints the error I posted
// Handle the error here...
return
}
if let desiredService = services?[SIMPLEX_SERVICE_NAME] {
logger.debug("testFPService has desiredService")
// The named service is available for the item at the provided URL.
// To use the service, get the connection object.
desiredService.getFileProviderConnection(completionHandler: { (connectionOrNil, connectionError) in
guard connectionError == nil else {
// Handle the error here...
return
}
guard let connection = connectionOrNil else {
// No connection object found.
return
}
// Set the remote interface.
connection.remoteObjectInterface = simpleXServiceInterface
// Start the connection.
connection.resume()
// Get the proxy object.
let rawProxy = connection.remoteObjectProxyWithErrorHandler({ (errorAccessingRemoteObject) in
// Handle the error here...
})
// Cast the proxy object to the interface's protocol.
guard let proxy = rawProxy as? SimpleXFPServiceProtocol else {
// If the interface is set up properly, this should never fail.
fatalError("*** Unable to cast \(rawProxy) to a DesiredProtocol instance ***")
}
logger.debug("testFPService calling service")
proxy.upperCaseString("hello to service", withReply: { reply in
logger.debug("testFPService reply from service \(reply, privacy: .public)")
})
})
}
}
}

View File

@ -52,7 +52,7 @@ class FileProviderExtension: NSFileProviderExtension {
// FileManager.default.createFile(atPath: "\(manager.documentStorageURL)123", contents: "hello".data(using: .utf8)) // FileManager.default.createFile(atPath: "\(manager.documentStorageURL)123", contents: "hello".data(using: .utf8))
self.providePlaceholder(at: URL(string: "\(manager.documentStorageURL)123")!) { err in self.providePlaceholder(at: SERVICE_PROXY_ITEM_URL) { err in
if let err = err { if let err = err {
logger.debug("FileProviderExtension.providePlaceholder error \(String(describing: err), privacy: .public)") logger.debug("FileProviderExtension.providePlaceholder error \(String(describing: err), privacy: .public)")
} else { } else {

View File

@ -23,7 +23,7 @@ class FileProviderItem: NSObject, NSFileProviderItem {
[.allowsReading, .allowsWriting, .allowsRenaming, .allowsReparenting, .allowsTrashing, .allowsDeleting] [.allowsReading, .allowsWriting, .allowsRenaming, .allowsReparenting, .allowsTrashing, .allowsDeleting]
} }
var filename: String { "123" } var filename: String { SERVICE_PROXY_ITEM_NAME }
var contentType: UTType { var contentType: UTType {
itemIdentifier == NSFileProviderItemIdentifier.rootContainer ? .folder : .plainText itemIdentifier == NSFileProviderItemIdentifier.rootContainer ? .folder : .plainText

View File

@ -8,14 +8,15 @@
import Foundation import Foundation
import FileProvider import FileProvider
import SimpleXChat
import SimpleXServiceProtocol import SimpleXServiceProtocol
extension FileProviderExtension { extension FileProviderExtension {
class SimpleXFPService: NSObject, NSFileProviderServiceSource, SimpleXFPServiceProtocol, NSXPCListenerDelegate { class FileProviderService: NSObject, NSFileProviderServiceSource, SimpleXServiceProtocol, NSXPCListenerDelegate {
var serviceName: NSFileProviderServiceName { SIMPLEX_SERVICE_NAME } var serviceName: NSFileProviderServiceName { SIMPLEX_SERVICE_NAME }
func makeListenerEndpoint() throws -> NSXPCListenerEndpoint { func makeListenerEndpoint() throws -> NSXPCListenerEndpoint {
logger.debug("SimpleXFPService.makeListenerEndpoint") logger.debug("FileProviderService.makeListenerEndpoint")
let listener = NSXPCListener.anonymous() let listener = NSXPCListener.anonymous()
listener.delegate = self listener.delegate = self
synchronized(self) { synchronized(self) {
@ -26,7 +27,7 @@ extension FileProviderExtension {
} }
func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool { func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool {
logger.debug("SimpleXFPService.listener") logger.debug("FileProviderService.listener")
newConnection.exportedInterface = simpleXServiceInterface newConnection.exportedInterface = simpleXServiceInterface
newConnection.exportedObject = self newConnection.exportedObject = self
@ -43,22 +44,28 @@ extension FileProviderExtension {
init(_ ext: FileProviderExtension) { init(_ ext: FileProviderExtension) {
self.ext = ext self.ext = ext
hs_init(0, nil)
} }
func upperCaseString(_ string: String, withReply reply: @escaping (String) -> Void) { func chatSendCmd(_ cmd: String) async -> String {
logger.debug("FileProviderExtension SimpleXFPService.upperCaseString") logger.debug("chatSendCmd cmd: \(cmd, privacy: .public)")
let response = string.uppercased() let r = SimpleXChat.chatSendCmd(cmd)
reply(response) logger.debug("chatSendCmd resp: \(r, privacy: .public)")
return r
}
func chatRecvMsg() async -> String {
SimpleXChat.chatRecvMsg()
} }
} }
override func supportedServiceSources(for itemIdentifier: NSFileProviderItemIdentifier) throws -> [NSFileProviderServiceSource] { override func supportedServiceSources(for itemIdentifier: NSFileProviderItemIdentifier) throws -> [NSFileProviderServiceSource] {
logger.debug("FileProviderExtension.supportedServiceSources") logger.debug("FileProviderExtension.supportedServiceSources")
return [SimpleXFPService(self)] return [FileProviderService(self)]
} }
} }
public func synchronized<T>(_ lock: AnyObject, _ closure: () throws -> T) rethrows -> T { private func synchronized<T>(_ lock: AnyObject, _ closure: () throws -> T) rethrows -> T {
objc_sync_enter(lock) objc_sync_enter(lock)
defer { objc_sync_exit(lock) } defer { objc_sync_exit(lock) }
return try closure() return try closure()

View File

@ -23,12 +23,10 @@
5C1CAA1A2847C5C8009E5C72 /* FileProviderExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA192847C5C8009E5C72 /* FileProviderExtension.swift */; }; 5C1CAA1A2847C5C8009E5C72 /* FileProviderExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA192847C5C8009E5C72 /* FileProviderExtension.swift */; };
5C1CAA1C2847C5C8009E5C72 /* FileProviderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA1B2847C5C8009E5C72 /* FileProviderItem.swift */; }; 5C1CAA1C2847C5C8009E5C72 /* FileProviderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA1B2847C5C8009E5C72 /* FileProviderItem.swift */; };
5C1CAA1E2847C5C8009E5C72 /* FileProviderEnumerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA1D2847C5C8009E5C72 /* FileProviderEnumerator.swift */; }; 5C1CAA1E2847C5C8009E5C72 /* FileProviderEnumerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA1D2847C5C8009E5C72 /* FileProviderEnumerator.swift */; };
5C1CAA282847D7C0009E5C72 /* SimpleXFPService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA272847D7C0009E5C72 /* SimpleXFPService.swift */; }; 5C1CAA282847D7C0009E5C72 /* FileProviderService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA272847D7C0009E5C72 /* FileProviderService.swift */; };
5C1CAA322847DDA0009E5C72 /* SimpleXServiceProtocol.docc in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA312847DDA0009E5C72 /* SimpleXServiceProtocol.docc */; }; 5C1CAA322847DDA0009E5C72 /* SimpleXServiceProtocol.docc in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA312847DDA0009E5C72 /* SimpleXServiceProtocol.docc */; };
5C1CAA332847DDA0009E5C72 /* SimpleXServiceProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1CAA302847DDA0009E5C72 /* SimpleXServiceProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5C1CAA332847DDA0009E5C72 /* SimpleXServiceProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1CAA302847DDA0009E5C72 /* SimpleXServiceProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
5C1CAA662847F5BD009E5C72 /* FPService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C1CAA3B2847DE88009E5C72 /* FPService.swift */; };
5C1CAA672848168A009E5C72 /* SimpleX Service.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 5C1CAA152847C5C8009E5C72 /* SimpleX Service.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 5C1CAA672848168A009E5C72 /* SimpleX Service.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 5C1CAA152847C5C8009E5C72 /* SimpleX Service.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
5C1CAA6A2849119A009E5C72 /* SimpleXChat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CE2BA682845308900EC33A6 /* SimpleXChat.framework */; platformFilter = ios; };
5C2E260727A2941F00F70299 /* SimpleXAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C2E260627A2941F00F70299 /* SimpleXAPI.swift */; }; 5C2E260727A2941F00F70299 /* SimpleXAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C2E260627A2941F00F70299 /* SimpleXAPI.swift */; };
5C2E260B27A30CFA00F70299 /* ChatListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C2E260A27A30CFA00F70299 /* ChatListView.swift */; }; 5C2E260B27A30CFA00F70299 /* ChatListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C2E260A27A30CFA00F70299 /* ChatListView.swift */; };
5C2E260F27A30FDC00F70299 /* ChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C2E260E27A30FDC00F70299 /* ChatView.swift */; }; 5C2E260F27A30FDC00F70299 /* ChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C2E260E27A30FDC00F70299 /* ChatView.swift */; };
@ -55,14 +53,18 @@
5C69D5B42852379F009B27A4 /* libHSsimplex-chat-2.2.0-3TOca6xkke4IR3YLgDepFy-ghc8.10.7.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C6F2A3A28522C9A00103588 /* libHSsimplex-chat-2.2.0-3TOca6xkke4IR3YLgDepFy-ghc8.10.7.a */; }; 5C69D5B42852379F009B27A4 /* libHSsimplex-chat-2.2.0-3TOca6xkke4IR3YLgDepFy-ghc8.10.7.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C6F2A3A28522C9A00103588 /* libHSsimplex-chat-2.2.0-3TOca6xkke4IR3YLgDepFy-ghc8.10.7.a */; };
5C69D5B52852379F009B27A4 /* libffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C6F2A3828522C9A00103588 /* libffi.a */; }; 5C69D5B52852379F009B27A4 /* libffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C6F2A3828522C9A00103588 /* libffi.a */; };
5C69D5B62852379F009B27A4 /* libgmpxx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C6F2A3928522C9A00103588 /* libgmpxx.a */; }; 5C69D5B62852379F009B27A4 /* libgmpxx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C6F2A3928522C9A00103588 /* libgmpxx.a */; };
5C69D5C028524D67009B27A4 /* SimpleXChatAPI.docc in Sources */ = {isa = PBXBuildFile; fileRef = 5C69D5BF28524D67009B27A4 /* SimpleXChatAPI.docc */; };
5C69D5C128524D67009B27A4 /* SimpleXChatAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C69D5BE28524D67009B27A4 /* SimpleXChatAPI.h */; settings = {ATTRIBUTES = (Public, ); }; };
5C69D5C428524D67009B27A4 /* SimpleXChatAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5BC28524D67009B27A4 /* SimpleXChatAPI.framework */; };
5C69D5C528524D67009B27A4 /* SimpleXChatAPI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5BC28524D67009B27A4 /* SimpleXChatAPI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5C69D5CA28525085009B27A4 /* ServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C69D5C928525085009B27A4 /* ServiceProtocol.swift */; }; 5C69D5CA28525085009B27A4 /* ServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C69D5C928525085009B27A4 /* ServiceProtocol.swift */; };
5C69D5CB285250FB009B27A4 /* SimpleXServiceProtocol.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; platformFilter = ios; }; 5C69D5CB285250FB009B27A4 /* SimpleXServiceProtocol.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; platformFilter = ios; };
5C69D5CC285250FB009B27A4 /* SimpleXServiceProtocol.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 5C69D5CC285250FB009B27A4 /* SimpleXServiceProtocol.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5C69D5CF28525108009B27A4 /* SimpleXServiceProtocol.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; platformFilter = ios; }; 5C69D5CF28525108009B27A4 /* SimpleXServiceProtocol.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; platformFilter = ios; };
5C69D5FB2852A01F009B27A4 /* SimpleXAppShared.docc in Sources */ = {isa = PBXBuildFile; fileRef = 5C69D5FA2852A01F009B27A4 /* SimpleXAppShared.docc */; };
5C69D5FC2852A01F009B27A4 /* SimpleXAppShared.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C69D5F92852A01F009B27A4 /* SimpleXAppShared.h */; settings = {ATTRIBUTES = (Public, ); }; };
5C69D5FF2852A01F009B27A4 /* SimpleXAppShared.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5F72852A01F009B27A4 /* SimpleXAppShared.framework */; };
5C69D6002852A01F009B27A4 /* SimpleXAppShared.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5F72852A01F009B27A4 /* SimpleXAppShared.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5C69D6042852A03F009B27A4 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD80281A7E2700503DA2 /* Notifications.swift */; };
5C69D6052852A058009B27A4 /* FileUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64DAE1502809D9F5000DA960 /* FileUtils.swift */; };
5C69D6062852A14A009B27A4 /* AppGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD5228186F9500503DA2 /* AppGroup.swift */; };
5C69D6082852A1C7009B27A4 /* ServiceAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C69D6072852A1C7009B27A4 /* ServiceAPI.swift */; };
5C6AD81327A834E300348BD7 /* NewChatButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6AD81227A834E300348BD7 /* NewChatButton.swift */; }; 5C6AD81327A834E300348BD7 /* NewChatButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6AD81227A834E300348BD7 /* NewChatButton.swift */; };
5C7505A227B65FDB00BE3227 /* CIMetaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C7505A127B65FDB00BE3227 /* CIMetaView.swift */; }; 5C7505A227B65FDB00BE3227 /* CIMetaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C7505A127B65FDB00BE3227 /* CIMetaView.swift */; };
5C7505A527B679EE00BE3227 /* NavLinkPlain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C7505A427B679EE00BE3227 /* NavLinkPlain.swift */; }; 5C7505A527B679EE00BE3227 /* NavLinkPlain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C7505A427B679EE00BE3227 /* NavLinkPlain.swift */; };
@ -97,25 +99,29 @@
5CCD403427A5F6DF00368C90 /* AddContactView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCD403327A5F6DF00368C90 /* AddContactView.swift */; }; 5CCD403427A5F6DF00368C90 /* AddContactView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCD403327A5F6DF00368C90 /* AddContactView.swift */; };
5CCD403727A5F9A200368C90 /* ScanToConnectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCD403627A5F9A200368C90 /* ScanToConnectView.swift */; }; 5CCD403727A5F9A200368C90 /* ScanToConnectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCD403627A5F9A200368C90 /* ScanToConnectView.swift */; };
5CCD403A27A5F9BE00368C90 /* CreateGroupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCD403927A5F9BE00368C90 /* CreateGroupView.swift */; }; 5CCD403A27A5F9BE00368C90 /* CreateGroupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CCD403927A5F9BE00368C90 /* CreateGroupView.swift */; };
5CCE914528532015005E7E0B /* SimpleXChatSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5E228529F66009B27A4 /* SimpleXChatSDK.framework */; platformFilter = ios; };
5CCE914A28532029005E7E0B /* CallTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5E5D3C282447AB00B0488A /* CallTypes.swift */; };
5CCE914B28532029005E7E0B /* ChatTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD7228188CFF00503DA2 /* ChatTypes.swift */; };
5CCE914C28532029005E7E0B /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9FD96A27A56D4D0075386C /* JSON.swift */; };
5CCE914D28532029005E7E0B /* APITypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD7428188D2900503DA2 /* APITypes.swift */; };
5CCE91522853202E005E7E0B /* SimpleXChatSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C69D5F128529FAD009B27A4 /* SimpleXChatSDK.h */; };
5CCE9153285320ED005E7E0B /* SimpleXChat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CE2BA682845308900EC33A6 /* SimpleXChat.framework */; platformFilter = ios; };
5CCE9154285320ED005E7E0B /* SimpleXChat.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5CE2BA682845308900EC33A6 /* SimpleXChat.framework */; platformFilter = ios; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5CCE915628532107005E7E0B /* SimpleXServiceProtocol.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; platformFilter = ios; };
5CCE915A28532144005E7E0B /* SimpleXChatSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5E228529F66009B27A4 /* SimpleXChatSDK.framework */; platformFilter = ios; };
5CCE915B28532144005E7E0B /* SimpleXChatSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5E228529F66009B27A4 /* SimpleXChatSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5CCE915E28532150005E7E0B /* SimpleXAppShared.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5F72852A01F009B27A4 /* SimpleXAppShared.framework */; platformFilter = ios; };
5CCE916328532155005E7E0B /* SimpleXChatSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C69D5E228529F66009B27A4 /* SimpleXChatSDK.framework */; platformFilter = ios; };
5CCE91672853215A005E7E0B /* SimpleXServiceProtocol.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; platformFilter = ios; };
5CDCAD482818589900503DA2 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD472818589900503DA2 /* NotificationService.swift */; }; 5CDCAD482818589900503DA2 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD472818589900503DA2 /* NotificationService.swift */; };
5CE2BA702845308900EC33A6 /* SimpleXChat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CE2BA682845308900EC33A6 /* SimpleXChat.framework */; };
5CE2BA712845308900EC33A6 /* SimpleXChat.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5CE2BA682845308900EC33A6 /* SimpleXChat.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5CE2BA77284530BF00EC33A6 /* SimpleXChat.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE2BA76284530BF00EC33A6 /* SimpleXChat.h */; }; 5CE2BA77284530BF00EC33A6 /* SimpleXChat.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE2BA76284530BF00EC33A6 /* SimpleXChat.h */; };
5CE2BA79284530CC00EC33A6 /* SimpleXChat.docc in Sources */ = {isa = PBXBuildFile; fileRef = 5CE2BA78284530CC00EC33A6 /* SimpleXChat.docc */; }; 5CE2BA79284530CC00EC33A6 /* SimpleXChat.docc in Sources */ = {isa = PBXBuildFile; fileRef = 5CE2BA78284530CC00EC33A6 /* SimpleXChat.docc */; };
5CE2BA8B284533A300EC33A6 /* ChatTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD7228188CFF00503DA2 /* ChatTypes.swift */; };
5CE2BA8C284533A300EC33A6 /* AppGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD5228186F9500503DA2 /* AppGroup.swift */; };
5CE2BA8D284533A300EC33A6 /* CallTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C5E5D3C282447AB00B0488A /* CallTypes.swift */; };
5CE2BA8E284533A300EC33A6 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD7D2818941F00503DA2 /* API.swift */; }; 5CE2BA8E284533A300EC33A6 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD7D2818941F00503DA2 /* API.swift */; };
5CE2BA8F284533A300EC33A6 /* APITypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD7428188D2900503DA2 /* APITypes.swift */; };
5CE2BA90284533A300EC33A6 /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9FD96A27A56D4D0075386C /* JSON.swift */; };
5CE2BA91284533A300EC33A6 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDCAD80281A7E2700503DA2 /* Notifications.swift */; };
5CE2BA922845340900EC33A6 /* FileUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64DAE1502809D9F5000DA960 /* FileUtils.swift */; };
5CE2BA93284534B000EC33A6 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CDCAD5E28187D4A00503DA2 /* libiconv.tbd */; }; 5CE2BA93284534B000EC33A6 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CDCAD5E28187D4A00503DA2 /* libiconv.tbd */; };
5CE2BA94284534BB00EC33A6 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CDCAD6028187D7900503DA2 /* libz.tbd */; }; 5CE2BA94284534BB00EC33A6 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CDCAD6028187D7900503DA2 /* libz.tbd */; };
5CE2BA952845354B00EC33A6 /* SimpleX.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE2BA8A2845332200EC33A6 /* SimpleX.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5CE2BA952845354B00EC33A6 /* SimpleX.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE2BA8A2845332200EC33A6 /* SimpleX.h */; settings = {ATTRIBUTES = (Public, ); }; };
5CE2BA97284537A800EC33A6 /* dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CE2BA96284537A800EC33A6 /* dummy.m */; }; 5CE2BA97284537A800EC33A6 /* dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5CE2BA96284537A800EC33A6 /* dummy.m */; };
5CE2BA9D284555F500EC33A6 /* SimpleX NSE.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 5CDCAD452818589900503DA2 /* SimpleX NSE.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 5CE2BA9D284555F500EC33A6 /* SimpleX NSE.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 5CDCAD452818589900503DA2 /* SimpleX NSE.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
5CE2BAA62845617C00EC33A6 /* SimpleXChat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CE2BA682845308900EC33A6 /* SimpleXChat.framework */; platformFilter = ios; };
5CE4407227ADB1D0007B033A /* Emoji.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE4407127ADB1D0007B033A /* Emoji.swift */; }; 5CE4407227ADB1D0007B033A /* Emoji.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE4407127ADB1D0007B033A /* Emoji.swift */; };
5CE4407927ADB701007B033A /* EmojiItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE4407827ADB701007B033A /* EmojiItemView.swift */; }; 5CE4407927ADB701007B033A /* EmojiItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE4407827ADB701007B033A /* EmojiItemView.swift */; };
5CEACCE327DE9246000BD591 /* ComposeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CEACCE227DE9246000BD591 /* ComposeView.swift */; }; 5CEACCE327DE9246000BD591 /* ComposeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CEACCE227DE9246000BD591 /* ComposeView.swift */; };
@ -148,13 +154,6 @@
remoteGlobalIDString = 5CE2BA672845308900EC33A6; remoteGlobalIDString = 5CE2BA672845308900EC33A6;
remoteInfo = SimpleXChat; remoteInfo = SimpleXChat;
}; };
5C69D5C228524D67009B27A4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5C69D5BB28524D67009B27A4;
remoteInfo = SimpleXChatAPI;
};
5C69D5CD285250FB009B27A4 /* PBXContainerItemProxy */ = { 5C69D5CD285250FB009B27A4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */; containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
@ -169,6 +168,13 @@
remoteGlobalIDString = 5C1CAA2D2847DDA0009E5C72; remoteGlobalIDString = 5C1CAA2D2847DDA0009E5C72;
remoteInfo = SimpleXServiceProtocol; remoteInfo = SimpleXServiceProtocol;
}; };
5C69D5FD2852A01F009B27A4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5C69D5F62852A01F009B27A4;
remoteInfo = SimpleXAppShared;
};
5CA059D8279559F40002BEB4 /* PBXContainerItemProxy */ = { 5CA059D8279559F40002BEB4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */; containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
@ -176,12 +182,47 @@
remoteGlobalIDString = 5CA059C9279559F40002BEB4; remoteGlobalIDString = 5CA059C9279559F40002BEB4;
remoteInfo = "SimpleX (iOS)"; remoteInfo = "SimpleX (iOS)";
}; };
5CE2BA6E2845308900EC33A6 /* PBXContainerItemProxy */ = { 5CCE914728532015005E7E0B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */; containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1; proxyType = 1;
remoteGlobalIDString = 5CE2BA672845308900EC33A6; remoteGlobalIDString = 5C69D5E128529F66009B27A4;
remoteInfo = SimpleXChat; remoteInfo = SimpleXChatSDK;
};
5CCE915828532107005E7E0B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5C1CAA2D2847DDA0009E5C72;
remoteInfo = SimpleXServiceProtocol;
};
5CCE915C28532144005E7E0B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5C69D5E128529F66009B27A4;
remoteInfo = SimpleXChatSDK;
};
5CCE916028532150005E7E0B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5C69D5F62852A01F009B27A4;
remoteInfo = SimpleXAppShared;
};
5CCE916528532155005E7E0B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5C69D5E128529F66009B27A4;
remoteInfo = SimpleXChatSDK;
};
5CCE91692853215A005E7E0B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5C1CAA2D2847DDA0009E5C72;
remoteInfo = SimpleXServiceProtocol;
}; };
5CE2BA9E284555F500EC33A6 /* PBXContainerItemProxy */ = { 5CE2BA9E284555F500EC33A6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
@ -190,24 +231,28 @@
remoteGlobalIDString = 5CDCAD442818589900503DA2; remoteGlobalIDString = 5CDCAD442818589900503DA2;
remoteInfo = "SimpleX NSE"; remoteInfo = "SimpleX NSE";
}; };
5CE2BAA82845617C00EC33A6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5CA059BE279559F40002BEB4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5CE2BA672845308900EC33A6;
remoteInfo = SimpleXChat;
};
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
5CCE9155285320ED005E7E0B /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
5CCE9154285320ED005E7E0B /* SimpleXChat.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
5CE2BA722845308900EC33A6 /* Embed Frameworks */ = { 5CE2BA722845308900EC33A6 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase; isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
5C69D5C528524D67009B27A4 /* SimpleXChatAPI.framework in Embed Frameworks */, 5CCE915B28532144005E7E0B /* SimpleXChatSDK.framework in Embed Frameworks */,
5CE2BA712845308900EC33A6 /* SimpleXChat.framework in Embed Frameworks */, 5C69D6002852A01F009B27A4 /* SimpleXAppShared.framework in Embed Frameworks */,
5C69D5CC285250FB009B27A4 /* SimpleXServiceProtocol.framework in Embed Frameworks */, 5C69D5CC285250FB009B27A4 /* SimpleXServiceProtocol.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
@ -248,11 +293,10 @@
5C1CAA1D2847C5C8009E5C72 /* FileProviderEnumerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderEnumerator.swift; sourceTree = "<group>"; }; 5C1CAA1D2847C5C8009E5C72 /* FileProviderEnumerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderEnumerator.swift; sourceTree = "<group>"; };
5C1CAA1F2847C5C8009E5C72 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 5C1CAA1F2847C5C8009E5C72 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5C1CAA202847C5C8009E5C72 /* SimpleX_Service.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SimpleX_Service.entitlements; sourceTree = "<group>"; }; 5C1CAA202847C5C8009E5C72 /* SimpleX_Service.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SimpleX_Service.entitlements; sourceTree = "<group>"; };
5C1CAA272847D7C0009E5C72 /* SimpleXFPService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleXFPService.swift; sourceTree = "<group>"; }; 5C1CAA272847D7C0009E5C72 /* FileProviderService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderService.swift; sourceTree = "<group>"; };
5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SimpleXServiceProtocol.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SimpleXServiceProtocol.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5C1CAA302847DDA0009E5C72 /* SimpleXServiceProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleXServiceProtocol.h; sourceTree = "<group>"; }; 5C1CAA302847DDA0009E5C72 /* SimpleXServiceProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleXServiceProtocol.h; sourceTree = "<group>"; };
5C1CAA312847DDA0009E5C72 /* SimpleXServiceProtocol.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = SimpleXServiceProtocol.docc; sourceTree = "<group>"; }; 5C1CAA312847DDA0009E5C72 /* SimpleXServiceProtocol.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = SimpleXServiceProtocol.docc; sourceTree = "<group>"; };
5C1CAA3B2847DE88009E5C72 /* FPService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FPService.swift; sourceTree = "<group>"; };
5C2E260627A2941F00F70299 /* SimpleXAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleXAPI.swift; sourceTree = "<group>"; }; 5C2E260627A2941F00F70299 /* SimpleXAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleXAPI.swift; sourceTree = "<group>"; };
5C2E260A27A30CFA00F70299 /* ChatListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatListView.swift; sourceTree = "<group>"; }; 5C2E260A27A30CFA00F70299 /* ChatListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatListView.swift; sourceTree = "<group>"; };
5C2E260E27A30FDC00F70299 /* ChatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatView.swift; sourceTree = "<group>"; }; 5C2E260E27A30FDC00F70299 /* ChatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatView.swift; sourceTree = "<group>"; };
@ -276,10 +320,14 @@
5C5E5D3C282447AB00B0488A /* CallTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallTypes.swift; sourceTree = "<group>"; }; 5C5E5D3C282447AB00B0488A /* CallTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallTypes.swift; sourceTree = "<group>"; };
5C5F2B6C27EBC3FE006A9D5F /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = "<group>"; }; 5C5F2B6C27EBC3FE006A9D5F /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = "<group>"; };
5C5F2B6F27EBC704006A9D5F /* ProfileImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileImage.swift; sourceTree = "<group>"; }; 5C5F2B6F27EBC704006A9D5F /* ProfileImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileImage.swift; sourceTree = "<group>"; };
5C69D5BC28524D67009B27A4 /* SimpleXChatAPI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SimpleXChatAPI.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5C69D5BE28524D67009B27A4 /* SimpleXChatAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleXChatAPI.h; sourceTree = "<group>"; };
5C69D5BF28524D67009B27A4 /* SimpleXChatAPI.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = SimpleXChatAPI.docc; sourceTree = "<group>"; };
5C69D5C928525085009B27A4 /* ServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceProtocol.swift; sourceTree = "<group>"; }; 5C69D5C928525085009B27A4 /* ServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceProtocol.swift; sourceTree = "<group>"; };
5C69D5E228529F66009B27A4 /* SimpleXChatSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SimpleXChatSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5C69D5F028529FAD009B27A4 /* SimpleXChatSDK.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = SimpleXChatSDK.docc; sourceTree = "<group>"; };
5C69D5F128529FAD009B27A4 /* SimpleXChatSDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleXChatSDK.h; sourceTree = "<group>"; };
5C69D5F72852A01F009B27A4 /* SimpleXAppShared.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SimpleXAppShared.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5C69D5F92852A01F009B27A4 /* SimpleXAppShared.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleXAppShared.h; sourceTree = "<group>"; };
5C69D5FA2852A01F009B27A4 /* SimpleXAppShared.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = SimpleXAppShared.docc; sourceTree = "<group>"; };
5C69D6072852A1C7009B27A4 /* ServiceAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceAPI.swift; sourceTree = "<group>"; };
5C6AD81227A834E300348BD7 /* NewChatButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewChatButton.swift; sourceTree = "<group>"; }; 5C6AD81227A834E300348BD7 /* NewChatButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewChatButton.swift; sourceTree = "<group>"; };
5C6F2A3728522C9A00103588 /* libgmp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgmp.a; sourceTree = "<group>"; }; 5C6F2A3728522C9A00103588 /* libgmp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgmp.a; sourceTree = "<group>"; };
5C6F2A3828522C9A00103588 /* libffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libffi.a; sourceTree = "<group>"; }; 5C6F2A3828522C9A00103588 /* libffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libffi.a; sourceTree = "<group>"; };
@ -361,7 +409,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5C1CAA172847C5C8009E5C72 /* UniformTypeIdentifiers.framework in Frameworks */, 5C1CAA172847C5C8009E5C72 /* UniformTypeIdentifiers.framework in Frameworks */,
5C1CAA6A2849119A009E5C72 /* SimpleXChat.framework in Frameworks */, 5CCE9153285320ED005E7E0B /* SimpleXChat.framework in Frameworks */,
5C69D5CF28525108009B27A4 /* SimpleXServiceProtocol.framework in Frameworks */, 5C69D5CF28525108009B27A4 /* SimpleXServiceProtocol.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -373,22 +421,31 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
5C69D5B928524D67009B27A4 /* Frameworks */ = { 5C69D5DF28529F66009B27A4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
5C69D5F42852A01F009B27A4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5CCE915628532107005E7E0B /* SimpleXServiceProtocol.framework in Frameworks */,
5CCE914528532015005E7E0B /* SimpleXChatSDK.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
5CA059C7279559F40002BEB4 /* Frameworks */ = { 5CA059C7279559F40002BEB4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5C69D5C428524D67009B27A4 /* SimpleXChatAPI.framework in Frameworks */,
5C69D5CB285250FB009B27A4 /* SimpleXServiceProtocol.framework in Frameworks */, 5C69D5CB285250FB009B27A4 /* SimpleXServiceProtocol.framework in Frameworks */,
5CE2BA702845308900EC33A6 /* SimpleXChat.framework in Frameworks */,
646BB38C283BEEB9001CE359 /* LocalAuthentication.framework in Frameworks */, 646BB38C283BEEB9001CE359 /* LocalAuthentication.framework in Frameworks */,
5CCE915A28532144005E7E0B /* SimpleXChatSDK.framework in Frameworks */,
5C8F01CD27A6F0D8007D2C8D /* CodeScanner in Frameworks */, 5C8F01CD27A6F0D8007D2C8D /* CodeScanner in Frameworks */,
5C69D5FF2852A01F009B27A4 /* SimpleXAppShared.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -403,7 +460,9 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5CE2BAA62845617C00EC33A6 /* SimpleXChat.framework in Frameworks */, 5CCE916328532155005E7E0B /* SimpleXChatSDK.framework in Frameworks */,
5CCE915E28532150005E7E0B /* SimpleXAppShared.framework in Frameworks */,
5CCE91672853215A005E7E0B /* SimpleXServiceProtocol.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -444,7 +503,7 @@
5C1CAA192847C5C8009E5C72 /* FileProviderExtension.swift */, 5C1CAA192847C5C8009E5C72 /* FileProviderExtension.swift */,
5C1CAA1B2847C5C8009E5C72 /* FileProviderItem.swift */, 5C1CAA1B2847C5C8009E5C72 /* FileProviderItem.swift */,
5C1CAA1D2847C5C8009E5C72 /* FileProviderEnumerator.swift */, 5C1CAA1D2847C5C8009E5C72 /* FileProviderEnumerator.swift */,
5C1CAA272847D7C0009E5C72 /* SimpleXFPService.swift */, 5C1CAA272847D7C0009E5C72 /* FileProviderService.swift */,
5C1CAA1F2847C5C8009E5C72 /* Info.plist */, 5C1CAA1F2847C5C8009E5C72 /* Info.plist */,
5C1CAA202847C5C8009E5C72 /* SimpleX_Service.entitlements */, 5C1CAA202847C5C8009E5C72 /* SimpleX_Service.entitlements */,
); );
@ -490,13 +549,30 @@
path = Chat; path = Chat;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
5C69D5BD28524D67009B27A4 /* SimpleXChatAPI */ = { 5C69D5EF28529FAD009B27A4 /* SimpleXChatSDK */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5C69D5BE28524D67009B27A4 /* SimpleXChatAPI.h */, 5CDCAD7228188CFF00503DA2 /* ChatTypes.swift */,
5C69D5BF28524D67009B27A4 /* SimpleXChatAPI.docc */, 5CDCAD7428188D2900503DA2 /* APITypes.swift */,
5C5E5D3C282447AB00B0488A /* CallTypes.swift */,
5C9FD96A27A56D4D0075386C /* JSON.swift */,
5C69D5F128529FAD009B27A4 /* SimpleXChatSDK.h */,
5C69D5F028529FAD009B27A4 /* SimpleXChatSDK.docc */,
); );
path = SimpleXChatAPI; path = SimpleXChatSDK;
sourceTree = "<group>";
};
5C69D5F82852A01F009B27A4 /* SimpleXAppShared */ = {
isa = PBXGroup;
children = (
5CDCAD5228186F9500503DA2 /* AppGroup.swift */,
64DAE1502809D9F5000DA960 /* FileUtils.swift */,
5CDCAD80281A7E2700503DA2 /* Notifications.swift */,
5C69D6072852A1C7009B27A4 /* ServiceAPI.swift */,
5C69D5F92852A01F009B27A4 /* SimpleXAppShared.h */,
5C69D5FA2852A01F009B27A4 /* SimpleXAppShared.docc */,
);
path = SimpleXAppShared;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
5C764E5C279C70B7000C6508 /* Libraries */ = { 5C764E5C279C70B7000C6508 /* Libraries */ = {
@ -561,7 +637,8 @@
5CDCAD462818589900503DA2 /* SimpleX NSE */, 5CDCAD462818589900503DA2 /* SimpleX NSE */,
5C1CAA182847C5C8009E5C72 /* SimpleX Service */, 5C1CAA182847C5C8009E5C72 /* SimpleX Service */,
5C1CAA2F2847DDA0009E5C72 /* SimpleXServiceProtocol */, 5C1CAA2F2847DDA0009E5C72 /* SimpleXServiceProtocol */,
5C69D5BD28524D67009B27A4 /* SimpleXChatAPI */, 5C69D5F82852A01F009B27A4 /* SimpleXAppShared */,
5C69D5EF28529FAD009B27A4 /* SimpleXChatSDK */,
5CE2BA692845308900EC33A6 /* SimpleXChat */, 5CE2BA692845308900EC33A6 /* SimpleXChat */,
5CA059DA279559F40002BEB4 /* Tests iOS */, 5CA059DA279559F40002BEB4 /* Tests iOS */,
5CA059CB279559F40002BEB4 /* Products */, 5CA059CB279559F40002BEB4 /* Products */,
@ -575,7 +652,6 @@
5CA059C3279559F40002BEB4 /* SimpleXApp.swift */, 5CA059C3279559F40002BEB4 /* SimpleXApp.swift */,
5C36027227F47AD5009F19D9 /* AppDelegate.swift */, 5C36027227F47AD5009F19D9 /* AppDelegate.swift */,
5CA059C4279559F40002BEB4 /* ContentView.swift */, 5CA059C4279559F40002BEB4 /* ContentView.swift */,
5C1CAA3B2847DE88009E5C72 /* FPService.swift */,
5C764E87279CBC8E000C6508 /* Model */, 5C764E87279CBC8E000C6508 /* Model */,
5C2E260D27A30E2400F70299 /* Views */, 5C2E260D27A30E2400F70299 /* Views */,
5CA059C5279559F40002BEB4 /* Assets.xcassets */, 5CA059C5279559F40002BEB4 /* Assets.xcassets */,
@ -593,7 +669,8 @@
5CE2BA682845308900EC33A6 /* SimpleXChat.framework */, 5CE2BA682845308900EC33A6 /* SimpleXChat.framework */,
5C1CAA152847C5C8009E5C72 /* SimpleX Service.appex */, 5C1CAA152847C5C8009E5C72 /* SimpleX Service.appex */,
5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */, 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */,
5C69D5BC28524D67009B27A4 /* SimpleXChatAPI.framework */, 5C69D5E228529F66009B27A4 /* SimpleXChatSDK.framework */,
5C69D5F72852A01F009B27A4 /* SimpleXAppShared.framework */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
@ -676,14 +753,7 @@
5CE2BA692845308900EC33A6 /* SimpleXChat */ = { 5CE2BA692845308900EC33A6 /* SimpleXChat */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5CDCAD5228186F9500503DA2 /* AppGroup.swift */,
5CDCAD7228188CFF00503DA2 /* ChatTypes.swift */,
5CDCAD7428188D2900503DA2 /* APITypes.swift */,
5C5E5D3C282447AB00B0488A /* CallTypes.swift */,
5C9FD96A27A56D4D0075386C /* JSON.swift */,
5CDCAD7D2818941F00503DA2 /* API.swift */, 5CDCAD7D2818941F00503DA2 /* API.swift */,
5CDCAD80281A7E2700503DA2 /* Notifications.swift */,
64DAE1502809D9F5000DA960 /* FileUtils.swift */,
5CE2BA76284530BF00EC33A6 /* SimpleXChat.h */, 5CE2BA76284530BF00EC33A6 /* SimpleXChat.h */,
5CE2BA8A2845332200EC33A6 /* SimpleX.h */, 5CE2BA8A2845332200EC33A6 /* SimpleX.h */,
5CE2BA78284530CC00EC33A6 /* SimpleXChat.docc */, 5CE2BA78284530CC00EC33A6 /* SimpleXChat.docc */,
@ -733,11 +803,19 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
5C69D5B728524D67009B27A4 /* Headers */ = { 5C69D5DD28529F66009B27A4 /* Headers */ = {
isa = PBXHeadersBuildPhase; isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5C69D5C128524D67009B27A4 /* SimpleXChatAPI.h in Headers */, 5CCE91522853202E005E7E0B /* SimpleXChatSDK.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
5C69D5F22852A01F009B27A4 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
5C69D5FC2852A01F009B27A4 /* SimpleXAppShared.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -760,6 +838,7 @@
5C1CAA112847C5C8009E5C72 /* Sources */, 5C1CAA112847C5C8009E5C72 /* Sources */,
5C1CAA122847C5C8009E5C72 /* Frameworks */, 5C1CAA122847C5C8009E5C72 /* Frameworks */,
5C1CAA132847C5C8009E5C72 /* Resources */, 5C1CAA132847C5C8009E5C72 /* Resources */,
5CCE9155285320ED005E7E0B /* Embed Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -790,22 +869,42 @@
productReference = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */; productReference = 5C1CAA2E2847DDA0009E5C72 /* SimpleXServiceProtocol.framework */;
productType = "com.apple.product-type.framework"; productType = "com.apple.product-type.framework";
}; };
5C69D5BB28524D67009B27A4 /* SimpleXChatAPI */ = { 5C69D5E128529F66009B27A4 /* SimpleXChatSDK */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 5C69D5C628524D67009B27A4 /* Build configuration list for PBXNativeTarget "SimpleXChatAPI" */; buildConfigurationList = 5C69D5EC28529F66009B27A4 /* Build configuration list for PBXNativeTarget "SimpleXChatSDK" */;
buildPhases = ( buildPhases = (
5C69D5B728524D67009B27A4 /* Headers */, 5C69D5DD28529F66009B27A4 /* Headers */,
5C69D5B828524D67009B27A4 /* Sources */, 5C69D5DE28529F66009B27A4 /* Sources */,
5C69D5B928524D67009B27A4 /* Frameworks */, 5C69D5DF28529F66009B27A4 /* Frameworks */,
5C69D5BA28524D67009B27A4 /* Resources */, 5C69D5E028529F66009B27A4 /* Resources */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
); );
name = SimpleXChatAPI; name = SimpleXChatSDK;
productName = SimpleXChatAPI; productName = SimpleXChatSDK;
productReference = 5C69D5BC28524D67009B27A4 /* SimpleXChatAPI.framework */; productReference = 5C69D5E228529F66009B27A4 /* SimpleXChatSDK.framework */;
productType = "com.apple.product-type.framework";
};
5C69D5F62852A01F009B27A4 /* SimpleXAppShared */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5C69D6012852A01F009B27A4 /* Build configuration list for PBXNativeTarget "SimpleXAppShared" */;
buildPhases = (
5C69D5F22852A01F009B27A4 /* Headers */,
5C69D5F32852A01F009B27A4 /* Sources */,
5C69D5F42852A01F009B27A4 /* Frameworks */,
5C69D5F52852A01F009B27A4 /* Resources */,
);
buildRules = (
);
dependencies = (
5CCE914828532015005E7E0B /* PBXTargetDependency */,
5CCE915928532107005E7E0B /* PBXTargetDependency */,
);
name = SimpleXAppShared;
productName = SimpleXAppShared;
productReference = 5C69D5F72852A01F009B27A4 /* SimpleXAppShared.framework */;
productType = "com.apple.product-type.framework"; productType = "com.apple.product-type.framework";
}; };
5CA059C9279559F40002BEB4 /* SimpleX (iOS) */ = { 5CA059C9279559F40002BEB4 /* SimpleX (iOS) */ = {
@ -821,11 +920,11 @@
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
5CE2BA6F2845308900EC33A6 /* PBXTargetDependency */,
5CE2BA9F284555F500EC33A6 /* PBXTargetDependency */, 5CE2BA9F284555F500EC33A6 /* PBXTargetDependency */,
5C1CAA692848168A009E5C72 /* PBXTargetDependency */, 5C1CAA692848168A009E5C72 /* PBXTargetDependency */,
5C69D5C328524D67009B27A4 /* PBXTargetDependency */,
5C69D5CE285250FB009B27A4 /* PBXTargetDependency */, 5C69D5CE285250FB009B27A4 /* PBXTargetDependency */,
5C69D5FE2852A01F009B27A4 /* PBXTargetDependency */,
5CCE915D28532144005E7E0B /* PBXTargetDependency */,
); );
name = "SimpleX (iOS)"; name = "SimpleX (iOS)";
packageProductDependencies = ( packageProductDependencies = (
@ -864,7 +963,9 @@
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
5CE2BAA92845617C00EC33A6 /* PBXTargetDependency */, 5CCE916128532150005E7E0B /* PBXTargetDependency */,
5CCE916628532155005E7E0B /* PBXTargetDependency */,
5CCE916A2853215A005E7E0B /* PBXTargetDependency */,
); );
name = "SimpleX NSE"; name = "SimpleX NSE";
productName = "SimpleX NSE"; productName = "SimpleX NSE";
@ -906,7 +1007,10 @@
5C1CAA2D2847DDA0009E5C72 = { 5C1CAA2D2847DDA0009E5C72 = {
CreatedOnToolsVersion = 13.3; CreatedOnToolsVersion = 13.3;
}; };
5C69D5BB28524D67009B27A4 = { 5C69D5E128529F66009B27A4 = {
CreatedOnToolsVersion = 13.3;
};
5C69D5F62852A01F009B27A4 = {
CreatedOnToolsVersion = 13.3; CreatedOnToolsVersion = 13.3;
}; };
5CA059C9279559F40002BEB4 = { 5CA059C9279559F40002BEB4 = {
@ -948,7 +1052,8 @@
5CDCAD442818589900503DA2 /* SimpleX NSE */, 5CDCAD442818589900503DA2 /* SimpleX NSE */,
5C1CAA142847C5C8009E5C72 /* SimpleX Service */, 5C1CAA142847C5C8009E5C72 /* SimpleX Service */,
5C1CAA2D2847DDA0009E5C72 /* SimpleXServiceProtocol */, 5C1CAA2D2847DDA0009E5C72 /* SimpleXServiceProtocol */,
5C69D5BB28524D67009B27A4 /* SimpleXChatAPI */, 5C69D5F62852A01F009B27A4 /* SimpleXAppShared */,
5C69D5E128529F66009B27A4 /* SimpleXChatSDK */,
5CE2BA672845308900EC33A6 /* SimpleXChat */, 5CE2BA672845308900EC33A6 /* SimpleXChat */,
); );
}; };
@ -969,7 +1074,14 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
5C69D5BA28524D67009B27A4 /* Resources */ = { 5C69D5E028529F66009B27A4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
5C69D5F52852A01F009B27A4 /* Resources */ = {
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
@ -1018,7 +1130,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5C1CAA282847D7C0009E5C72 /* SimpleXFPService.swift in Sources */, 5C1CAA282847D7C0009E5C72 /* FileProviderService.swift in Sources */,
5C1CAA1A2847C5C8009E5C72 /* FileProviderExtension.swift in Sources */, 5C1CAA1A2847C5C8009E5C72 /* FileProviderExtension.swift in Sources */,
5C1CAA1C2847C5C8009E5C72 /* FileProviderItem.swift in Sources */, 5C1CAA1C2847C5C8009E5C72 /* FileProviderItem.swift in Sources */,
5C1CAA1E2847C5C8009E5C72 /* FileProviderEnumerator.swift in Sources */, 5C1CAA1E2847C5C8009E5C72 /* FileProviderEnumerator.swift in Sources */,
@ -1034,11 +1146,26 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
5C69D5B828524D67009B27A4 /* Sources */ = { 5C69D5DE28529F66009B27A4 /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5C69D5C028524D67009B27A4 /* SimpleXChatAPI.docc in Sources */, 5CCE914D28532029005E7E0B /* APITypes.swift in Sources */,
5CCE914C28532029005E7E0B /* JSON.swift in Sources */,
5CCE914A28532029005E7E0B /* CallTypes.swift in Sources */,
5CCE914B28532029005E7E0B /* ChatTypes.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
5C69D5F32852A01F009B27A4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5C69D6082852A1C7009B27A4 /* ServiceAPI.swift in Sources */,
5C69D6052852A058009B27A4 /* FileUtils.swift in Sources */,
5C69D6042852A03F009B27A4 /* Notifications.swift in Sources */,
5C69D5FB2852A01F009B27A4 /* SimpleXAppShared.docc in Sources */,
5C69D6062852A14A009B27A4 /* AppGroup.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -1103,7 +1230,6 @@
5CEACCED27DEA495000BD591 /* MsgContentView.swift in Sources */, 5CEACCED27DEA495000BD591 /* MsgContentView.swift in Sources */,
5C764E89279CBCB3000C6508 /* ChatModel.swift in Sources */, 5C764E89279CBCB3000C6508 /* ChatModel.swift in Sources */,
5C971E1D27AEBEF600C8A3CE /* ChatInfoView.swift in Sources */, 5C971E1D27AEBEF600C8A3CE /* ChatInfoView.swift in Sources */,
5C1CAA662847F5BD009E5C72 /* FPService.swift in Sources */,
5CC1C99527A6CF7F000D9FF6 /* ShareSheet.swift in Sources */, 5CC1C99527A6CF7F000D9FF6 /* ShareSheet.swift in Sources */,
5C5E5D3B2824468B00B0488A /* ActiveCallView.swift in Sources */, 5C5E5D3B2824468B00B0488A /* ActiveCallView.swift in Sources */,
5C2E260727A2941F00F70299 /* SimpleXAPI.swift in Sources */, 5C2E260727A2941F00F70299 /* SimpleXAPI.swift in Sources */,
@ -1143,14 +1269,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5CE2BA97284537A800EC33A6 /* dummy.m in Sources */, 5CE2BA97284537A800EC33A6 /* dummy.m in Sources */,
5CE2BA922845340900EC33A6 /* FileUtils.swift in Sources */,
5CE2BA91284533A300EC33A6 /* Notifications.swift in Sources */,
5CE2BA79284530CC00EC33A6 /* SimpleXChat.docc in Sources */, 5CE2BA79284530CC00EC33A6 /* SimpleXChat.docc in Sources */,
5CE2BA90284533A300EC33A6 /* JSON.swift in Sources */,
5CE2BA8B284533A300EC33A6 /* ChatTypes.swift in Sources */,
5CE2BA8F284533A300EC33A6 /* APITypes.swift in Sources */,
5CE2BA8C284533A300EC33A6 /* AppGroup.swift in Sources */,
5CE2BA8D284533A300EC33A6 /* CallTypes.swift in Sources */,
5CE2BA8E284533A300EC33A6 /* API.swift in Sources */, 5CE2BA8E284533A300EC33A6 /* API.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -1169,11 +1288,6 @@
target = 5CE2BA672845308900EC33A6 /* SimpleXChat */; target = 5CE2BA672845308900EC33A6 /* SimpleXChat */;
targetProxy = 5C1CAA6C2849119A009E5C72 /* PBXContainerItemProxy */; targetProxy = 5C1CAA6C2849119A009E5C72 /* PBXContainerItemProxy */;
}; };
5C69D5C328524D67009B27A4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 5C69D5BB28524D67009B27A4 /* SimpleXChatAPI */;
targetProxy = 5C69D5C228524D67009B27A4 /* PBXContainerItemProxy */;
};
5C69D5CE285250FB009B27A4 /* PBXTargetDependency */ = { 5C69D5CE285250FB009B27A4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
platformFilter = ios; platformFilter = ios;
@ -1186,27 +1300,57 @@
target = 5C1CAA2D2847DDA0009E5C72 /* SimpleXServiceProtocol */; target = 5C1CAA2D2847DDA0009E5C72 /* SimpleXServiceProtocol */;
targetProxy = 5C69D5D128525108009B27A4 /* PBXContainerItemProxy */; targetProxy = 5C69D5D128525108009B27A4 /* PBXContainerItemProxy */;
}; };
5C69D5FE2852A01F009B27A4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 5C69D5F62852A01F009B27A4 /* SimpleXAppShared */;
targetProxy = 5C69D5FD2852A01F009B27A4 /* PBXContainerItemProxy */;
};
5CA059D9279559F40002BEB4 /* PBXTargetDependency */ = { 5CA059D9279559F40002BEB4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = 5CA059C9279559F40002BEB4 /* SimpleX (iOS) */; target = 5CA059C9279559F40002BEB4 /* SimpleX (iOS) */;
targetProxy = 5CA059D8279559F40002BEB4 /* PBXContainerItemProxy */; targetProxy = 5CA059D8279559F40002BEB4 /* PBXContainerItemProxy */;
}; };
5CE2BA6F2845308900EC33A6 /* PBXTargetDependency */ = { 5CCE914828532015005E7E0B /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = 5CE2BA672845308900EC33A6 /* SimpleXChat */; platformFilter = ios;
targetProxy = 5CE2BA6E2845308900EC33A6 /* PBXContainerItemProxy */; target = 5C69D5E128529F66009B27A4 /* SimpleXChatSDK */;
targetProxy = 5CCE914728532015005E7E0B /* PBXContainerItemProxy */;
};
5CCE915928532107005E7E0B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
target = 5C1CAA2D2847DDA0009E5C72 /* SimpleXServiceProtocol */;
targetProxy = 5CCE915828532107005E7E0B /* PBXContainerItemProxy */;
};
5CCE915D28532144005E7E0B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
target = 5C69D5E128529F66009B27A4 /* SimpleXChatSDK */;
targetProxy = 5CCE915C28532144005E7E0B /* PBXContainerItemProxy */;
};
5CCE916128532150005E7E0B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
target = 5C69D5F62852A01F009B27A4 /* SimpleXAppShared */;
targetProxy = 5CCE916028532150005E7E0B /* PBXContainerItemProxy */;
};
5CCE916628532155005E7E0B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
target = 5C69D5E128529F66009B27A4 /* SimpleXChatSDK */;
targetProxy = 5CCE916528532155005E7E0B /* PBXContainerItemProxy */;
};
5CCE916A2853215A005E7E0B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
target = 5C1CAA2D2847DDA0009E5C72 /* SimpleXServiceProtocol */;
targetProxy = 5CCE91692853215A005E7E0B /* PBXContainerItemProxy */;
}; };
5CE2BA9F284555F500EC33A6 /* PBXTargetDependency */ = { 5CE2BA9F284555F500EC33A6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = 5CDCAD442818589900503DA2 /* SimpleX NSE */; target = 5CDCAD442818589900503DA2 /* SimpleX NSE */;
targetProxy = 5CE2BA9E284555F500EC33A6 /* PBXContainerItemProxy */; targetProxy = 5CE2BA9E284555F500EC33A6 /* PBXContainerItemProxy */;
}; };
5CE2BAA92845617C00EC33A6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
target = 5CE2BA672845308900EC33A6 /* SimpleXChat */;
targetProxy = 5CE2BAA82845617C00EC33A6 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */ /* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
@ -1374,7 +1518,7 @@
}; };
name = Release; name = Release;
}; };
5C69D5C728524D67009B27A4 /* Debug */ = { 5C69D5ED28529F66009B27A4 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES; APPLICATION_EXTENSION_API_ONLY = YES;
@ -1395,7 +1539,7 @@
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleXChatAPI; PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleXChatSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos; SDKROOT = iphoneos;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -1408,7 +1552,7 @@
}; };
name = Debug; name = Debug;
}; };
5C69D5C828524D67009B27A4 /* Release */ = { 5C69D5EE28529F66009B27A4 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES; APPLICATION_EXTENSION_API_ONLY = YES;
@ -1429,7 +1573,76 @@
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleXChatAPI; PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleXChatSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
5C69D6022852A01F009B27A4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5NN7GUYB6T;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 SimpleX Chat. All rights reserved.";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleXAppShared;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
5C69D6032852A01F009B27A4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5NN7GUYB6T;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 SimpleX Chat. All rights reserved.";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleXAppShared;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos; SDKROOT = iphoneos;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -1884,11 +2097,20 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
5C69D5C628524D67009B27A4 /* Build configuration list for PBXNativeTarget "SimpleXChatAPI" */ = { 5C69D5EC28529F66009B27A4 /* Build configuration list for PBXNativeTarget "SimpleXChatSDK" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
5C69D5C728524D67009B27A4 /* Debug */, 5C69D5ED28529F66009B27A4 /* Debug */,
5C69D5C828524D67009B27A4 /* Release */, 5C69D5EE28529F66009B27A4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
5C69D6012852A01F009B27A4 /* Build configuration list for PBXNativeTarget "SimpleXAppShared" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5C69D6022852A01F009B27A4 /* Debug */,
5C69D6032852A01F009B27A4 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;

View File

@ -9,6 +9,7 @@
import Foundation import Foundation
import SwiftUI import SwiftUI
import OSLog import OSLog
import SimpleXChatSDK
let logger = Logger() let logger = Logger()
@ -17,7 +18,7 @@ public let maxImageSize: Int64 = 236700
public let maxFileSize: Int64 = 8000000 public let maxFileSize: Int64 = 8000000
func getDocumentsDirectory() -> URL { public func getDocumentsDirectory() -> URL {
// FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! // FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: APP_GROUP_NAME)! FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: APP_GROUP_NAME)!
} }

View File

@ -9,6 +9,7 @@
import Foundation import Foundation
import UserNotifications import UserNotifications
import SwiftUI import SwiftUI
import SimpleXChatSDK
public let ntfCategoryContactRequest = "NTF_CAT_CONTACT_REQUEST" public let ntfCategoryContactRequest = "NTF_CAT_CONTACT_REQUEST"
public let ntfCategoryContactConnected = "NTF_CAT_CONTACT_CONNECTED" public let ntfCategoryContactConnected = "NTF_CAT_CONTACT_CONNECTED"

View File

@ -0,0 +1,62 @@
//
// ServiceAPI.swift
// SimpleXAppShared
//
// Created by Evgeny on 09/06/2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
import Foundation
import SimpleXServiceProtocol
import SimpleXChatSDK
private var serviceProxy: SimpleXServiceProtocol?
public func sendSimpleXCmd(_ cmd: ChatCommand) async -> ChatResponse {
let proxy = await getServiceProxy()
let resp = await proxy.chatSendCmd(cmd.cmdString)
return chatResponse(resp)
}
public func recvSimpleXMsg() async -> ChatResponse {
let proxy = await getServiceProxy()
let msg = await proxy.chatRecvMsg()
return chatResponse(msg)
}
public func getServiceProxy() async -> SimpleXServiceProtocol {
if let proxy = serviceProxy { return proxy }
var err: Error?
for i in 1...20 {
do {
let proxy = try await _getServiceProxy()
serviceProxy = proxy
logger.debug("getServiceProxy \(i): success")
return proxy
} catch let error {
err = error
logger.debug("getServiceProxy \(i): \(String(describing: error), privacy: .public)")
try! await Task.sleep(nanoseconds: 250_000)
}
}
fatalError("getServiceProxy: error \(String(describing: err))")
}
private func _getServiceProxy() async throws -> SimpleXServiceProtocol {
let services = try await FileManager.default.fileProviderServicesForItem(at: SERVICE_PROXY_ITEM_URL)
guard let service = services[SIMPLEX_SERVICE_NAME] else { throw ServiceError.noService }
let connection = try await service.fileProviderConnection()
connection.remoteObjectInterface = simpleXServiceInterface
connection.resume()
var err: ServiceError?
let rawProxy = connection.remoteObjectProxyWithErrorHandler { error in err = .noProxy(error) }
if let err = err { throw ServiceError.noProxy(err) }
guard let proxy = rawProxy as? SimpleXServiceProtocol else { throw ServiceError.badProxy }
return proxy
}
enum ServiceError: Error {
case noService
case noProxy(Error)
case badProxy
}

View File

@ -0,0 +1,13 @@
# ``SimpleXAppShared``
<!--@START_MENU_TOKEN@-->Summary<!--@END_MENU_TOKEN@-->
## Overview
<!--@START_MENU_TOKEN@-->Text<!--@END_MENU_TOKEN@-->
## Topics
### <!--@START_MENU_TOKEN@-->Group<!--@END_MENU_TOKEN@-->
- <!--@START_MENU_TOKEN@-->``Symbol``<!--@END_MENU_TOKEN@-->

View File

@ -0,0 +1,19 @@
//
// SimpleXAppShared.h
// SimpleXAppShared
//
// Created by Evgeny on 09/06/2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for SimpleXAppShared.
FOUNDATION_EXPORT double SimpleXAppSharedVersionNumber;
//! Project version string for SimpleXAppShared.
FOUNDATION_EXPORT const unsigned char SimpleXAppSharedVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SimpleXAppShared/PublicHeader.h>

View File

@ -7,60 +7,76 @@
// //
import Foundation import Foundation
import OSLog
let logger = Logger()
private var chatController: chat_ctrl? private var chatController: chat_ctrl?
public func getChatCtrl() -> chat_ctrl { private func getChatCtrl() -> chat_ctrl {
if let controller = chatController { return controller } if let controller = chatController { return controller }
let dataDir = getDocumentsDirectory().path + "/mobile_v1" let dbFilePrefix = getDocumentsDirectory().path + "/mobile_v1"
logger.debug("documents directory \(dataDir)") logger.debug("getChatCtrl: dbFilePrefix \(dbFilePrefix)")
var cstr = dataDir.cString(using: .utf8)! var cstr = dbFilePrefix.cString(using: .utf8)!
chatController = chat_init(&cstr) chatController = chat_init(&cstr)
logger.debug("getChatCtrl: chat_init") logger.debug("getChatCtrl: chat_init")
return chatController! return chatController!
} }
public func sendSimpleXCmd(_ cmd: ChatCommand) -> ChatResponse { func getDocumentsDirectory() -> URL {
var c = cmd.cmdString.cString(using: .utf8)! FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
return chatResponse(chat_send_cmd(getChatCtrl(), &c)) // FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: APP_GROUP_NAME)!
} }
public func chatResponse(_ cjson: UnsafeMutablePointer<CChar>) -> ChatResponse { //public func sendSimpleXCmd(_ cmd: ChatCommand) -> ChatResponse {
// var c = cmd.cmdString.cString(using: .utf8)!
// return chatResponse(chat_send_cmd(getChatCtrl(), &c))
//}
public func chatSendCmd(_ cmd: String) -> String {
var c = cmd.cString(using: .utf8)!
return rawChatResponse(chat_send_cmd(getChatCtrl(), &c))
}
public func chatRecvMsg() -> String {
rawChatResponse(chat_recv_msg(getChatCtrl()))
}
public func rawChatResponse(_ cjson: UnsafeMutablePointer<CChar>) -> String {
let s = String.init(cString: cjson) let s = String.init(cString: cjson)
let d = s.data(using: .utf8)!
// TODO is there a way to do it without copying the data? e.g:
// let p = UnsafeMutableRawPointer.init(mutating: UnsafeRawPointer(cjson))
// let d = Data.init(bytesNoCopy: p, count: strlen(cjson), deallocator: .free)
do {
let r = try jsonDecoder.decode(APIResponse.self, from: d)
return r.resp
} catch {
logger.error("chatResponse jsonDecoder.decode error: \(error.localizedDescription)")
}
var type: String?
var json: String?
if let j = try? JSONSerialization.jsonObject(with: d) as? NSDictionary {
if let j1 = j["resp"] as? NSDictionary, j1.count == 1 {
type = j1.allKeys[0] as? String
}
json = prettyJSON(j)
}
free(cjson) free(cjson)
return ChatResponse.response(type: type ?? "invalid", json: json ?? s) return s
} }
func prettyJSON(_ obj: NSDictionary) -> String? { //public func chatResponse(_ cjson: UnsafeMutablePointer<CChar>) -> ChatResponse {
if let d = try? JSONSerialization.data(withJSONObject: obj, options: .prettyPrinted) { // let s = String.init(cString: cjson)
return String(decoding: d, as: UTF8.self) // let d = s.data(using: .utf8)!
} //// TODO is there a way to do it without copying the data? e.g:
return nil //// let p = UnsafeMutableRawPointer.init(mutating: UnsafeRawPointer(cjson))
} //// let d = Data.init(bytesNoCopy: p, count: strlen(cjson), deallocator: .free)
// do {
public func responseError(_ err: Error) -> String { // let r = try jsonDecoder.decode(APIResponse.self, from: d)
if let r = err as? ChatResponse { // return r.resp
return String(describing: r) // } catch {
} else { // logger.error("chatResponse jsonDecoder.decode error: \(error.localizedDescription)")
return err.localizedDescription // }
} //
} // var type: String?
// var json: String?
// if let j = try? JSONSerialization.jsonObject(with: d) as? NSDictionary {
// if let j1 = j["resp"] as? NSDictionary, j1.count == 1 {
// type = j1.allKeys[0] as? String
// }
// json = prettyJSON(j)
// }
// free(cjson)
// return ChatResponse.response(type: type ?? "invalid", json: json ?? s)
//}
//
//public func responseError(_ err: Error) -> String {
// if let r = err as? ChatResponse {
// return String(describing: r)
// } else {
// return err.localizedDescription
// }
//}

View File

@ -1,19 +0,0 @@
//
// SimpleXChatAPI.h
// SimpleXChatAPI
//
// Created by Evgeny on 09/06/2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for SimpleXChatAPI.
FOUNDATION_EXPORT double SimpleXChatAPIVersionNumber;
//! Project version string for SimpleXChatAPI.
FOUNDATION_EXPORT const unsigned char SimpleXChatAPIVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SimpleXChatAPI/PublicHeader.h>

View File

@ -7,6 +7,9 @@
// //
import Foundation import Foundation
import OSLog
let logger = Logger()
let jsonDecoder = getJSONDecoder() let jsonDecoder = getJSONDecoder()
let jsonEncoder = getJSONEncoder() let jsonEncoder = getJSONEncoder()
@ -520,3 +523,34 @@ public enum SMPAgentError: Decodable {
case A_VERSION case A_VERSION
case A_ENCRYPTION case A_ENCRYPTION
} }
public func chatResponse(_ s: String) -> ChatResponse {
let d = s.data(using: .utf8)!
// TODO is there a way to do it without copying the data? e.g:
// let p = UnsafeMutableRawPointer.init(mutating: UnsafeRawPointer(cjson))
// let d = Data.init(bytesNoCopy: p, count: strlen(cjson), deallocator: .free)
do {
let r = try jsonDecoder.decode(APIResponse.self, from: d)
return r.resp
} catch {
logger.error("chatResponse jsonDecoder.decode error: \(error.localizedDescription)")
}
var type: String?
var json: String?
if let j = try? JSONSerialization.jsonObject(with: d) as? NSDictionary {
if let j1 = j["resp"] as? NSDictionary, j1.count == 1 {
type = j1.allKeys[0] as? String
}
json = prettyJSON(j)
}
return ChatResponse.response(type: type ?? "invalid", json: json ?? s)
}
public func responseError(_ err: Error) -> String {
if let r = err as? ChatResponse {
return String(describing: r)
} else {
return err.localizedDescription
}
}

View File

@ -700,7 +700,7 @@ public struct CIFile: Decodable {
CIFile(fileId: fileId, fileName: fileName, fileSize: fileSize, filePath: filePath, fileStatus: fileStatus) CIFile(fileId: fileId, fileName: fileName, fileSize: fileSize, filePath: filePath, fileStatus: fileStatus)
} }
var loaded: Bool { public var loaded: Bool {
get { get {
switch self.fileStatus { switch self.fileStatus {
case .sndStored: return true case .sndStored: return true

View File

@ -36,3 +36,10 @@ private func getDateFormatter(_ format: String) -> DateFormatter {
df.timeZone = TimeZone(secondsFromGMT: 0) df.timeZone = TimeZone(secondsFromGMT: 0)
return df return df
} }
func prettyJSON(_ obj: NSDictionary) -> String? {
if let d = try? JSONSerialization.data(withJSONObject: obj, options: .prettyPrinted) {
return String(decoding: d, as: UTF8.self)
}
return nil
}

View File

@ -1,4 +1,4 @@
# ``SimpleXChatAPI`` # ``SimpleXChatSDK``
<!--@START_MENU_TOKEN@-->Summary<!--@END_MENU_TOKEN@--> <!--@START_MENU_TOKEN@-->Summary<!--@END_MENU_TOKEN@-->

View File

@ -0,0 +1,19 @@
//
// SimpleXChatSDK.h
// SimpleXChatSDK
//
// Created by Evgeny on 09/06/2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for SimpleXChatSDK.
FOUNDATION_EXPORT double SimpleXChatSDKVersionNumber;
//! Project version string for SimpleXChatSDK.
FOUNDATION_EXPORT const unsigned char SimpleXChatSDKVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SimpleXChatSDK/PublicHeader.h>

View File

@ -8,13 +8,20 @@
import Foundation import Foundation
import FileProvider import FileProvider
import OSLog
let logger = Logger()
public let SIMPLEX_SERVICE_NAME = NSFileProviderServiceName("group.chat.simplex.app.service") public let SIMPLEX_SERVICE_NAME = NSFileProviderServiceName("group.chat.simplex.app.service")
public let SERVICE_PROXY_ITEM_ID = NSFileProviderItemIdentifier("123") public let SERVICE_PROXY_ITEM_NAME = "123"
public let SERVICE_PROXY_ITEM_ID = NSFileProviderItemIdentifier(SERVICE_PROXY_ITEM_NAME)
public let SERVICE_PROXY_ITEM_URL = URL(string: "\(NSFileProviderManager.default.documentStorageURL)\(SERVICE_PROXY_ITEM_NAME)")!
public let simpleXServiceInterface: NSXPCInterface = { public let simpleXServiceInterface: NSXPCInterface = {
NSXPCInterface(with: SimpleXFPServiceProtocol.self) NSXPCInterface(with: SimpleXServiceProtocol.self)
}() }()
@objc public protocol SimpleXFPServiceProtocol { @objc public protocol SimpleXServiceProtocol {
func upperCaseString(_ string: String, withReply reply: @escaping (String) -> Void) func chatSendCmd(_ cmd: String) async -> String
func chatRecvMsg() async -> String
} }