diff --git a/Podfile b/Podfile index 3651be0cf..832910280 100644 --- a/Podfile +++ b/Podfile @@ -105,6 +105,10 @@ target 'SignalMessaging' do shared_pods end +target 'SessionMessagingKit' do + pod 'PromiseKit', :inhibit_warnings => true +end + target 'SessionSnodeKit' do pod 'CryptoSwift', :inhibit_warnings => true pod 'Curve25519Kit', :inhibit_warnings => true @@ -138,7 +142,7 @@ def enable_extension_support_for_purelayout(installer) if target.name.end_with? "PureLayout" target.build_configurations.each do |build_configuration| if build_configuration.build_settings['APPLICATION_EXTENSION_API_ONLY'] == 'YES' - build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)', 'PURELAYOUT_APP_EXTENSIONS=1'] + build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = [ '$(inherited)', 'PURELAYOUT_APP_EXTENSIONS=1' ] end end end diff --git a/Podfile.lock b/Podfile.lock index d9228c849..bbf6ea8b9 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -339,6 +339,6 @@ SPEC CHECKSUMS: YYImage: 6db68da66f20d9f169ceb94dfb9947c3867b9665 ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: e8671ed81c428a09caab11eefca532686e4a01b3 +PODFILE CHECKSUM: 4a5edd85603c82fca8290ab8a0db1231bbe418b2 COCOAPODS: 1.10.0.rc.1 diff --git a/Pods b/Pods index 3d20a90a1..7d18aa682 160000 --- a/Pods +++ b/Pods @@ -1 +1 @@ -Subproject commit 3d20a90a166ee56a06ce02e6f1fbffb2f4965406 +Subproject commit 7d18aa682b4d5d16403b2cbcd500d6bf055573db diff --git a/SessionMessagingKit/ControlMessage.swift b/SessionMessagingKit/ControlMessage.swift new file mode 100644 index 000000000..8f41ac52a --- /dev/null +++ b/SessionMessagingKit/ControlMessage.swift @@ -0,0 +1,8 @@ + +@objc(SNControlMessage) +public class ControlMessage : Message { + + public enum Kind { + case sessionRequest + } +} diff --git a/SessionMessagingKit/Message.swift b/SessionMessagingKit/Message.swift new file mode 100644 index 000000000..d9e89eaf1 --- /dev/null +++ b/SessionMessagingKit/Message.swift @@ -0,0 +1,17 @@ + +/// Abstract base class for `VisibleMessage` and `ControlMessage`. +@objc(SNMessage) +public class Message : NSObject, NSCoding { // Not a protocol for YapDatabase compatibility + public var id: String? + public var threadID: String? + public var sentTimestamp: UInt64? + public var receivedTimestamp: UInt64? + + public required init?(coder: NSCoder) { + preconditionFailure("init?(coder:) is abstract and must be overridden.") + } + + public func encode(with coder: NSCoder) { + preconditionFailure("encode(with:) is abstract and must be overridden.") + } +} diff --git a/SessionMessagingKit/Meta/Info.plist b/SessionMessagingKit/Meta/Info.plist new file mode 100644 index 000000000..9bcb24442 --- /dev/null +++ b/SessionMessagingKit/Meta/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + diff --git a/SessionMessagingKit/Meta/SessionMessagingKit.h b/SessionMessagingKit/Meta/SessionMessagingKit.h new file mode 100644 index 000000000..6a1fd0adf --- /dev/null +++ b/SessionMessagingKit/Meta/SessionMessagingKit.h @@ -0,0 +1,4 @@ +#import + +FOUNDATION_EXPORT double SessionMessagingKitVersionNumber; +FOUNDATION_EXPORT const unsigned char SessionMessagingKitVersionString[]; diff --git a/SessionMessagingKit/VisibleMessage+Contact.swift b/SessionMessagingKit/VisibleMessage+Contact.swift new file mode 100644 index 000000000..f0f6ef6f6 --- /dev/null +++ b/SessionMessagingKit/VisibleMessage+Contact.swift @@ -0,0 +1,15 @@ + +public extension VisibleMessage { + + @objc(SNContact) + public class Contact : NSObject, NSCoding { + + public required init?(coder: NSCoder) { + fatalError("Not implemented.") + } + + public func encode(with coder: NSCoder) { + fatalError("Not implemented.") + } + } +} diff --git a/SessionMessagingKit/VisibleMessage+LinkPreview.swift b/SessionMessagingKit/VisibleMessage+LinkPreview.swift new file mode 100644 index 000000000..34f843ae2 --- /dev/null +++ b/SessionMessagingKit/VisibleMessage+LinkPreview.swift @@ -0,0 +1,15 @@ + +public extension VisibleMessage { + + @objc(SNLinkPreview) + public class LinkPreview : NSObject, NSCoding { + + public required init?(coder: NSCoder) { + fatalError("Not implemented.") + } + + public func encode(with coder: NSCoder) { + fatalError("Not implemented.") + } + } +} diff --git a/SessionMessagingKit/VisibleMessage+Quote.swift b/SessionMessagingKit/VisibleMessage+Quote.swift new file mode 100644 index 000000000..ca467773b --- /dev/null +++ b/SessionMessagingKit/VisibleMessage+Quote.swift @@ -0,0 +1,15 @@ + +public extension VisibleMessage { + + @objc(SNQuote) + public class Quote : NSObject, NSCoding { + + public required init?(coder: NSCoder) { + fatalError("Not implemented.") + } + + public func encode(with coder: NSCoder) { + fatalError("Not implemented.") + } + } +} diff --git a/SessionMessagingKit/VisibleMessage.swift b/SessionMessagingKit/VisibleMessage.swift new file mode 100644 index 000000000..3bf3754cd --- /dev/null +++ b/SessionMessagingKit/VisibleMessage.swift @@ -0,0 +1,10 @@ + +@objc(SNVisibleMessage) +public final class VisibleMessage : Message { + public var text: String? + public var attachmentIDs: [String] = [] + public var quote: Quote? + public var linkPreview: LinkPreview? + public var contact: Contact? + +} diff --git a/SessionSnodeKit/Snode.swift b/SessionSnodeKit/Snode.swift index 878bd6392..08aa61c28 100644 --- a/SessionSnodeKit/Snode.swift +++ b/SessionSnodeKit/Snode.swift @@ -1,55 +1,61 @@ import Foundation -public struct Snode : Hashable, CustomStringConvertible { +public final class Snode : NSObject, NSCoding { // Not a struct for YapDatabase compatibility public let address: String public let port: UInt16 - public let publicKeySet: KeySet + internal let publicKeySet: KeySet public var ip: String { address.removingPrefix("https://") } - // MARK: Method - public enum Method : String { + // MARK: Nested Types + internal enum Method : String { case getSwarm = "get_snodes_for_pubkey" case getMessages = "retrieve" case sendMessage = "store" } - // MARK: Key Set - public struct KeySet : Hashable { - public let ed25519Key: String - public let x25519Key: String - - public static func == (lhs: KeySet, rhs: KeySet) -> Bool { - return lhs.ed25519Key == rhs.ed25519Key && lhs.x25519Key == rhs.x25519Key - } - - public func hash(into hasher: inout Hasher) { - hasher.combine(ed25519Key) - hasher.combine(x25519Key) - } + internal struct KeySet { + let ed25519Key: String + let x25519Key: String } - + // MARK: Initialization internal init(address: String, port: UInt16, publicKeySet: KeySet) { self.address = address self.port = port self.publicKeySet = publicKeySet } - + + // MARK: Coding + public init?(coder: NSCoder) { + address = coder.decodeObject(forKey: "address") as! String + port = coder.decodeObject(forKey: "port") as! UInt16 + guard let idKey = coder.decodeObject(forKey: "idKey") as? String, + let encryptionKey = coder.decodeObject(forKey: "encryptionKey") as? String else { return nil } + publicKeySet = KeySet(ed25519Key: idKey, x25519Key: encryptionKey) + super.init() + } + + public func encode(with coder: NSCoder) { + coder.encode(address, forKey: "address") + coder.encode(port, forKey: "port") + coder.encode(publicKeySet.ed25519Key, forKey: "idKey") + coder.encode(publicKeySet.x25519Key, forKey: "encryptionKey") + } + // MARK: Equality - public static func == (lhs: Snode, rhs: Snode) -> Bool { - return lhs.address == rhs.address && lhs.port == rhs.port && lhs.publicKeySet == rhs.publicKeySet + override public func isEqual(_ other: Any?) -> Bool { + guard let other = other as? Snode else { return false } + return address == other.address && port == other.port } // MARK: Hashing - public func hash(into hasher: inout Hasher) { - hasher.combine(address) - hasher.combine(port) - publicKeySet.hash(into: &hasher) + override public var hash: Int { // Override NSObject.hash and not Hashable.hashValue or Hashable.hash(into:) + return address.hashValue ^ port.hashValue } // MARK: Description - public var description: String { "\(address):\(port)" } + override public var description: String { return "\(address):\(port)" } } diff --git a/SessionSnodeKit/SnodeAPI.swift b/SessionSnodeKit/SnodeAPI.swift index d8a94df3c..917b7b3bb 100644 --- a/SessionSnodeKit/SnodeAPI.swift +++ b/SessionSnodeKit/SnodeAPI.swift @@ -71,7 +71,7 @@ public enum SnodeAPI { SNLog("Populating snode pool using: \(target).") let (promise, seal) = Promise.pending() attempt(maxRetryCount: 4, recoveringOn: Threading.workQueue) { - HTTP.execute(.post, url, parameters: parameters, useSeedNodeURLSession: true).map2 { json -> Snode in + HTTP.execute(.post, url, parameters: parameters, useSSLURLSession: true).map2 { json -> Snode in guard let intermediate = json["result"] as? JSON, let rawSnodes = intermediate["service_node_states"] as? [JSON] else { throw Error.randomSnodePoolUpdatingFailed } snodePool = Set(rawSnodes.compactMap { rawSnode in guard let address = rawSnode["public_ip"] as? String, let port = rawSnode["storage_port"] as? Int, diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 9814c8438..e2980dc0e 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -459,6 +459,7 @@ 4CEB78C92178EBAB00F315D2 /* OWSSessionResetJobRecord.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB78C82178EBAB00F315D2 /* OWSSessionResetJobRecord.m */; }; 4CFD151D22415AA400F2450F /* CallVideoHintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFD151C22415AA400F2450F /* CallVideoHintView.swift */; }; 4CFE6B6C21F92BA700006701 /* LegacyNotificationsAdaptee.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFE6B6B21F92BA700006701 /* LegacyNotificationsAdaptee.swift */; }; + 5DF9AB212C6DB1E8BE70EFF6 /* Pods_SessionMessagingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB523C549815DE935E98151E /* Pods_SessionMessagingKit.framework */; }; 70377AAB1918450100CAF501 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70377AAA1918450100CAF501 /* MobileCoreServices.framework */; }; 768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 768A1A2A17FC9CD300E00ED8 /* libz.dylib */; }; 76C87F19181EFCE600C4ACAB /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */; }; @@ -626,6 +627,16 @@ C3C2A680255388CC00C340D1 /* SessionUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3C2A679255388CC00C340D1 /* SessionUtilities.framework */; }; C3C2A681255388CC00C340D1 /* SessionUtilities.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C3C2A679255388CC00C340D1 /* SessionUtilities.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; C3C2A6C62553896A00C340D1 /* SessionUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3C2A679255388CC00C340D1 /* SessionUtilities.framework */; }; + C3C2A6F425539DE700C340D1 /* SessionMessagingKit.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C2A6F225539DE700C340D1 /* SessionMessagingKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C3C2A6F725539DE700C340D1 /* SessionMessagingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3C2A6F025539DE700C340D1 /* SessionMessagingKit.framework */; }; + C3C2A6F825539DE700C340D1 /* SessionMessagingKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C3C2A6F025539DE700C340D1 /* SessionMessagingKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C3C2A70B25539E1E00C340D1 /* SessionSnodeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3C2A59F255385C100C340D1 /* SessionSnodeKit.framework */; }; + C3C2A74425539EB700C340D1 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A74325539EB700C340D1 /* Message.swift */; }; + C3C2A74D2553A39700C340D1 /* VisibleMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A74C2553A39700C340D1 /* VisibleMessage.swift */; }; + C3C2A7562553A3AB00C340D1 /* VisibleMessage+Quote.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A7552553A3AB00C340D1 /* VisibleMessage+Quote.swift */; }; + C3C2A75F2553A3C500C340D1 /* VisibleMessage+LinkPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A75E2553A3C500C340D1 /* VisibleMessage+LinkPreview.swift */; }; + C3C2A7682553A3D900C340D1 /* VisibleMessage+Contact.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A7672553A3D900C340D1 /* VisibleMessage+Contact.swift */; }; + C3C2A7712553A41E00C340D1 /* ControlMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2A7702553A41E00C340D1 /* ControlMessage.swift */; }; C3C3CF8924D8EED300E1CCE7 /* TextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C3CF8824D8EED300E1CCE7 /* TextView.swift */; }; C3D0972B2510499C00F6E3E4 /* BackgroundPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3D0972A2510499C00F6E3E4 /* BackgroundPoller.swift */; }; C3DAB3242480CB2B00725F25 /* SRCopyableLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DAB3232480CB2A00725F25 /* SRCopyableLabel.swift */; }; @@ -721,6 +732,13 @@ remoteGlobalIDString = C3C2A678255388CC00C340D1; remoteInfo = SessionUtilities; }; + C3C2A6F525539DE700C340D1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D221A080169C9E5E00537ABF /* Project object */; + proxyType = 1; + remoteGlobalIDString = C3C2A6EF25539DE700C340D1; + remoteInfo = SessionMessagingKit; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -745,6 +763,7 @@ C3C2A681255388CC00C340D1 /* SessionUtilities.framework in Embed Frameworks */, C3C2A5A7255385C100C340D1 /* SessionSnodeKit.framework in Embed Frameworks */, 4535189A1FC63DBF00210559 /* SignalMessaging.framework in Embed Frameworks */, + C3C2A6F825539DE700C340D1 /* SessionMessagingKit.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -1291,6 +1310,7 @@ 4CFF4C0920F55BBA005DA313 /* MenuActionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuActionsViewController.swift; sourceTree = ""; }; 686875887229AB29C07145BA /* Pods_SessionUtilities.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SessionUtilities.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 69349DE607F5BA6036C9AC60 /* Pods-SignalShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalShareExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SignalShareExtension/Pods-SignalShareExtension.debug.xcconfig"; sourceTree = ""; }; + 6A26D6558DE69AF455E571C1 /* Pods-SessionMessagingKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SessionMessagingKit.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SessionMessagingKit/Pods-SessionMessagingKit.debug.xcconfig"; sourceTree = ""; }; 70377AAA1918450100CAF501 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; 748A5CAEDD7C919FC64C6807 /* Pods_SignalTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 768A1A2A17FC9CD300E00ED8 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; @@ -1478,6 +1498,15 @@ C3C2A679255388CC00C340D1 /* SessionUtilities.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SessionUtilities.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C3C2A67B255388CC00C340D1 /* SessionUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionUtilities.h; sourceTree = ""; }; C3C2A67C255388CC00C340D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C3C2A6F025539DE700C340D1 /* SessionMessagingKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SessionMessagingKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C3C2A6F225539DE700C340D1 /* SessionMessagingKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionMessagingKit.h; sourceTree = ""; }; + C3C2A6F325539DE700C340D1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C3C2A74325539EB700C340D1 /* Message.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = ""; }; + C3C2A74C2553A39700C340D1 /* VisibleMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisibleMessage.swift; sourceTree = ""; }; + C3C2A7552553A3AB00C340D1 /* VisibleMessage+Quote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VisibleMessage+Quote.swift"; sourceTree = ""; }; + C3C2A75E2553A3C500C340D1 /* VisibleMessage+LinkPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VisibleMessage+LinkPreview.swift"; sourceTree = ""; }; + C3C2A7672553A3D900C340D1 /* VisibleMessage+Contact.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VisibleMessage+Contact.swift"; sourceTree = ""; }; + C3C2A7702553A41E00C340D1 /* ControlMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlMessage.swift; sourceTree = ""; }; C3C3CF8824D8EED300E1CCE7 /* TextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextView.swift; sourceTree = ""; }; C3D0972A2510499C00F6E3E4 /* BackgroundPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundPoller.swift; sourceTree = ""; }; C3DAB3232480CB2A00725F25 /* SRCopyableLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRCopyableLabel.swift; sourceTree = ""; }; @@ -1507,11 +1536,13 @@ EF764C331DB67CC5000D9A87 /* UIViewController+Permissions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+Permissions.h"; path = "util/UIViewController+Permissions.h"; sourceTree = ""; }; EF764C341DB67CC5000D9A87 /* UIViewController+Permissions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+Permissions.m"; path = "util/UIViewController+Permissions.m"; sourceTree = ""; }; F62ECF7B8AF4F8089AA705B3 /* Pods-LokiPushNotificationService.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LokiPushNotificationService.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LokiPushNotificationService/Pods-LokiPushNotificationService.debug.xcconfig"; sourceTree = ""; }; + FB523C549815DE935E98151E /* Pods_SessionMessagingKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SessionMessagingKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FC3BD9871A30A790005B96BB /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; FC5CDF371A3393DD00B47253 /* error_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "error_white@2x.png"; sourceTree = ""; }; FC5CDF381A3393DD00B47253 /* warning_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "warning_white@2x.png"; sourceTree = ""; }; FC91203F1A39EFB70074545C /* qr@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "qr@2x.png"; sourceTree = ""; }; FCB11D8B1A129A76002F93FB /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; + FF9BA33D021B115B1F5B4E46 /* Pods-SessionMessagingKit.app store release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SessionMessagingKit.app store release.xcconfig"; path = "Pods/Target Support Files/Pods-SessionMessagingKit/Pods-SessionMessagingKit.app store release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1558,6 +1589,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C3C2A6ED25539DE700C340D1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C3C2A70B25539E1E00C340D1 /* SessionSnodeKit.framework in Frameworks */, + 5DF9AB212C6DB1E8BE70EFF6 /* Pods_SessionMessagingKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D221A086169C9E5E00537ABF /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1588,6 +1628,7 @@ A1C32D5017A06538000A904E /* AddressBookUI.framework in Frameworks */, D2AEACDC16C426DA00C364C0 /* CFNetwork.framework in Frameworks */, D2179CFE16BB0B480006F3AB /* SystemConfiguration.framework in Frameworks */, + C3C2A6F725539DE700C340D1 /* SessionMessagingKit.framework in Frameworks */, D2179CFC16BB0B3A0006F3AB /* CoreTelephony.framework in Frameworks */, D221A08E169C9E5E00537ABF /* UIKit.framework in Frameworks */, D221A090169C9E5E00537ABF /* Foundation.framework in Frameworks */, @@ -2599,6 +2640,8 @@ C022DD8E076866C6241610BF /* Pods-SessionSnodeKit.app store release.xcconfig */, E7E2FBF1546840C91B7E4879 /* Pods-SessionUtilities.debug.xcconfig */, 3303495F6651CE2F3CC9693B /* Pods-SessionUtilities.app store release.xcconfig */, + 6A26D6558DE69AF455E571C1 /* Pods-SessionMessagingKit.debug.xcconfig */, + FF9BA33D021B115B1F5B4E46 /* Pods-SessionMessagingKit.app store release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -2968,6 +3011,29 @@ path = Meta; sourceTree = ""; }; + C3C2A6F125539DE700C340D1 /* SessionMessagingKit */ = { + isa = PBXGroup; + children = ( + C3C2A70A25539DF900C340D1 /* Meta */, + C3C2A74325539EB700C340D1 /* Message.swift */, + C3C2A74C2553A39700C340D1 /* VisibleMessage.swift */, + C3C2A7552553A3AB00C340D1 /* VisibleMessage+Quote.swift */, + C3C2A75E2553A3C500C340D1 /* VisibleMessage+LinkPreview.swift */, + C3C2A7672553A3D900C340D1 /* VisibleMessage+Contact.swift */, + C3C2A7702553A41E00C340D1 /* ControlMessage.swift */, + ); + path = SessionMessagingKit; + sourceTree = ""; + }; + C3C2A70A25539DF900C340D1 /* Meta */ = { + isa = PBXGroup; + children = ( + C3C2A6F225539DE700C340D1 /* SessionMessagingKit.h */, + C3C2A6F325539DE700C340D1 /* Info.plist */, + ); + path = Meta; + sourceTree = ""; + }; D221A07E169C9E5E00537ABF = { isa = PBXGroup; children = ( @@ -2975,6 +3041,7 @@ 453518691FC635DD00210559 /* SignalShareExtension */, 453518931FC63DBF00210559 /* SignalMessaging */, 7BC01A3C241F40AB00BC7C55 /* LokiPushNotificationService */, + C3C2A6F125539DE700C340D1 /* SessionMessagingKit */, C3C2A5A0255385C100C340D1 /* SessionSnodeKit */, C3C2A67A255388CC00C340D1 /* SessionUtilities */, D221A08C169C9E5E00537ABF /* Frameworks */, @@ -2993,6 +3060,7 @@ 7BC01A3B241F40AB00BC7C55 /* LokiPushNotificationService.appex */, C3C2A59F255385C100C340D1 /* SessionSnodeKit.framework */, C3C2A679255388CC00C340D1 /* SessionUtilities.framework */, + C3C2A6F025539DE700C340D1 /* SessionMessagingKit.framework */, ); name = Products; sourceTree = ""; @@ -3042,6 +3110,7 @@ 04912E453971FB16E5E78EC6 /* Pods_LokiPushNotificationService.framework */, 9559C3068280BA2383F547F7 /* Pods_SessionSnodeKit.framework */, 686875887229AB29C07145BA /* Pods_SessionUtilities.framework */, + FB523C549815DE935E98151E /* Pods_SessionMessagingKit.framework */, ); name = Frameworks; sourceTree = ""; @@ -3175,6 +3244,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C3C2A6EB25539DE700C340D1 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C3C2A6F425539DE700C340D1 /* SessionMessagingKit.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -3273,6 +3350,25 @@ productReference = C3C2A679255388CC00C340D1 /* SessionUtilities.framework */; productType = "com.apple.product-type.framework"; }; + C3C2A6EF25539DE700C340D1 /* SessionMessagingKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = C3C2A6F925539DE700C340D1 /* Build configuration list for PBXNativeTarget "SessionMessagingKit" */; + buildPhases = ( + 5BEA71AEF5E31390FEFA2E99 /* [CP] Check Pods Manifest.lock */, + C3C2A6EB25539DE700C340D1 /* Headers */, + C3C2A6EC25539DE700C340D1 /* Sources */, + C3C2A6ED25539DE700C340D1 /* Frameworks */, + C3C2A6EE25539DE700C340D1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SessionMessagingKit; + productName = SessionMessagingKit; + productReference = C3C2A6F025539DE700C340D1 /* SessionMessagingKit.framework */; + productType = "com.apple.product-type.framework"; + }; D221A088169C9E5E00537ABF /* Signal */ = { isa = PBXNativeTarget; buildConfigurationList = D221A0BC169C9E5F00537ABF /* Build configuration list for PBXNativeTarget "Signal" */; @@ -3295,6 +3391,7 @@ 7BC01A41241F40AB00BC7C55 /* PBXTargetDependency */, C3C2A5A5255385C100C340D1 /* PBXTargetDependency */, C3C2A67F255388CC00C340D1 /* PBXTargetDependency */, + C3C2A6F625539DE700C340D1 /* PBXTargetDependency */, ); name = Signal; productName = RedPhone; @@ -3377,6 +3474,12 @@ DevelopmentTeam = SUQ8J2PCT7; ProvisioningStyle = Automatic; }; + C3C2A6EF25539DE700C340D1 = { + CreatedOnToolsVersion = 12.1; + DevelopmentTeam = SUQ8J2PCT7; + LastSwiftMigration = 1210; + ProvisioningStyle = Automatic; + }; D221A088169C9E5E00537ABF = { DevelopmentTeam = SUQ8J2PCT7; LastSwiftMigration = 1020; @@ -3446,6 +3549,7 @@ 453518671FC635DD00210559 /* SignalShareExtension */, 453518911FC63DBF00210559 /* SignalMessaging */, 7BC01A3A241F40AB00BC7C55 /* LokiPushNotificationService */, + C3C2A6EF25539DE700C340D1 /* SessionMessagingKit */, C3C2A59E255385C100C340D1 /* SessionSnodeKit */, C3C2A678255388CC00C340D1 /* SessionUtilities */, ); @@ -3497,6 +3601,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C3C2A6EE25539DE700C340D1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; D221A087169C9E5E00537ABF /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -3763,6 +3874,28 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Signal/Pods-Signal-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 5BEA71AEF5E31390FEFA2E99 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SessionMessagingKit-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 6565655F4068F9E5CDC5687F /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -4111,6 +4244,19 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C3C2A6EC25539DE700C340D1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C3C2A74D2553A39700C340D1 /* VisibleMessage.swift in Sources */, + C3C2A7562553A3AB00C340D1 /* VisibleMessage+Quote.swift in Sources */, + C3C2A7682553A3D900C340D1 /* VisibleMessage+Contact.swift in Sources */, + C3C2A7712553A41E00C340D1 /* ControlMessage.swift in Sources */, + C3C2A75F2553A3C500C340D1 /* VisibleMessage+LinkPreview.swift in Sources */, + C3C2A74425539EB700C340D1 /* Message.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D221A085169C9E5E00537ABF /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -4447,6 +4593,11 @@ target = C3C2A678255388CC00C340D1 /* SessionUtilities */; targetProxy = C3C2A67E255388CC00C340D1 /* PBXContainerItemProxy */; }; + C3C2A6F625539DE700C340D1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C3C2A6EF25539DE700C340D1 /* SessionMessagingKit */; + targetProxy = C3C2A6F525539DE700C340D1 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -5095,6 +5246,132 @@ }; name = "App Store Release"; }; + C3C2A6FA25539DE700C340D1 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6A26D6558DE69AF455E571C1 /* Pods-SessionMessagingKit.debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = SUQ8J2PCT7; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = SessionMessagingKit/Meta/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.SessionMessagingKit"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + C3C2A6FB25539DE700C340D1 /* App Store Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF9BA33D021B115B1F5B4E46 /* Pods-SessionMessagingKit.app store release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = SUQ8J2PCT7; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = SessionMessagingKit/Meta/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 14.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.SessionMessagingKit"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "App Store Release"; + }; D221A0BA169C9E5F00537ABF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -5547,6 +5824,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = "App Store Release"; }; + C3C2A6F925539DE700C340D1 /* Build configuration list for PBXNativeTarget "SessionMessagingKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C3C2A6FA25539DE700C340D1 /* Debug */, + C3C2A6FB25539DE700C340D1 /* App Store Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = "App Store Release"; + }; D221A083169C9E5E00537ABF /* Build configuration list for PBXProject "Signal" */ = { isa = XCConfigurationList; buildConfigurations = (