From ca20f3f979919e7d16f5f3f4f1b4008f5890f2a8 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Tue, 24 Mar 2020 11:28:53 +1100 Subject: [PATCH] add a Notification Service Extension for PN with preview --- LokiPushNotificationService/Info.plist | 31 +++ .../LokiPushNotificationService.entitlements | 14 + .../NotificationService.swift | 211 +++++++++++++++ .../NotificationServiceExtensionContext.swift | 94 +++++++ Podfile | 6 + Podfile.lock | 6 +- Signal.xcodeproj/project.pbxproj | 241 +++++++++++++++++- .../xcshareddata/xcschemes/Signal.xcscheme | 14 +- Signal/Signal-Info.plist | 6 +- .../src/Messages/OWSMessageManager.m | 17 +- .../src/Messages/TypingIndicatorMessage.swift | 5 + SignalServiceKit/src/Util/FeatureFlags.swift | 5 + 12 files changed, 626 insertions(+), 24 deletions(-) create mode 100644 LokiPushNotificationService/Info.plist create mode 100644 LokiPushNotificationService/LokiPushNotificationService.entitlements create mode 100644 LokiPushNotificationService/NotificationService.swift create mode 100644 LokiPushNotificationService/NotificationServiceExtensionContext.swift diff --git a/LokiPushNotificationService/Info.plist b/LokiPushNotificationService/Info.plist new file mode 100644 index 000000000..fa9b846f2 --- /dev/null +++ b/LokiPushNotificationService/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + LokiPushNotificationService + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionPointIdentifier + com.apple.usernotifications.service + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).NotificationService + + + diff --git a/LokiPushNotificationService/LokiPushNotificationService.entitlements b/LokiPushNotificationService/LokiPushNotificationService.entitlements new file mode 100644 index 000000000..f10895535 --- /dev/null +++ b/LokiPushNotificationService/LokiPushNotificationService.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.security.application-groups + + group.com.loki-project.loki-messenger + + keychain-access-groups + + $(AppIdentifierPrefix)com.loki-project.loki-messenger + + + diff --git a/LokiPushNotificationService/NotificationService.swift b/LokiPushNotificationService/NotificationService.swift new file mode 100644 index 000000000..706c2edd3 --- /dev/null +++ b/LokiPushNotificationService/NotificationService.swift @@ -0,0 +1,211 @@ +import UserNotifications +import SignalServiceKit +import SignalMessaging + +class NotificationService: UNNotificationServiceExtension { + + static let threadIdKey = "Signal.AppNotificationsUserInfoKey.threadId" + var areVersionMigrationsComplete = false + var contentHandler: ((UNNotificationContent) -> Void)? + var notificationContent: UNMutableNotificationContent? + + override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { + self.contentHandler = contentHandler + notificationContent = (request.content.mutableCopy() as? UNMutableNotificationContent) + + DispatchQueue.main.sync { self.setupIfNecessary() } + + if let notificationContent = notificationContent { + // Modify the notification content here... + let base64EncodedData = notificationContent.userInfo["ENCRYPTED_DATA"] as! String + let data = Data(base64Encoded: base64EncodedData)! + let envelope = try? LokiMessageWrapper.unwrap(data: data) + let envelopeData = try? envelope?.serializedData() + let decrypter = SSKEnvironment.shared.messageDecrypter + if (envelope != nil && envelopeData != nil) { + decrypter.decryptEnvelope(envelope!, envelopeData: envelopeData!, + successBlock: { result,transaction in + if let envelope = try? SSKProtoEnvelope.parseData(result.envelopeData) { + self.removeDecryptionChain(envelope: envelope, transaction: transaction) + self.handelDecryptionResult(result: result, notificationContent: notificationContent, transaction: transaction) + } else { + self.completeWithFailure(content: notificationContent) + } + }, + failureBlock: { + self.completeWithFailure(content: notificationContent) + }) + } else { + self.completeWithFailure(content: notificationContent) + } + } + } + + func removeDecryptionChain(envelope: SSKProtoEnvelope, transaction: YapDatabaseReadWriteTransaction) { + let sessionRecord = SSKEnvironment.shared.primaryStorage.loadSession(envelope.source!, deviceId: Int32(envelope.sourceDevice), protocolContext: transaction) + let sessionState = sessionRecord.sessionState() + } + + func handelDecryptionResult(result: OWSMessageDecryptResult, notificationContent: UNMutableNotificationContent, transaction: YapDatabaseReadWriteTransaction) { + let contentProto = try? SSKProtoContent.parseData(result.plaintextData!) + var thread: TSThread + var newNotificationBody = "" + let masterHexEncodedPublicKey: String = LokiDatabaseUtilities.objc_getMasterHexEncodedPublicKey(for: result.source, in: transaction) ?? result.source + var displayName = masterHexEncodedPublicKey + if let groupId = contentProto?.dataMessage?.group?.id { + thread = TSGroupThread.getOrCreateThread(withGroupId: groupId, groupType: .closedGroup, transaction: transaction) + displayName = thread.name() + if displayName.count < 1 { + displayName = MessageStrings.newGroupDefaultTitle + } + let group: SSKProtoGroupContext = (contentProto?.dataMessage?.group!)! + let oldGroupModel = (thread as! TSGroupThread).groupModel + var removeMembers = Set(arrayLiteral: oldGroupModel.groupMemberIds) + let newGroupModel = TSGroupModel.init(title: group.name, + memberIds:group.members, + image: oldGroupModel.groupImage, + groupId: group.id, + groupType: oldGroupModel.groupType, + adminIds: group.admins) + removeMembers.subtract(Set(arrayLiteral: newGroupModel.groupMemberIds)) + newGroupModel.removedMembers = removeMembers as! NSMutableSet + switch contentProto?.dataMessage?.group?.type { + case .update: + newNotificationBody = oldGroupModel.getInfoStringAboutUpdate(to: newGroupModel, contactsManager: SSKEnvironment.shared.contactsManager) + break + case .quit: + let nameString = SSKEnvironment.shared.contactsManager.displayName(forPhoneIdentifier: masterHexEncodedPublicKey, transaction: transaction) + newNotificationBody = NSLocalizedString("GROUP_MEMBER_LEFT", comment: nameString) + break + default: + break + } + } else { + thread = TSContactThread.getOrCreateThread(withContactId: result.source, transaction: transaction) + displayName = contentProto?.dataMessage?.profile?.displayName ?? displayName + } + let userInfo: [String: Any] = [NotificationService.threadIdKey: thread.uniqueId!] + notificationContent.title = displayName + notificationContent.userInfo = userInfo + if newNotificationBody.count < 1 { + newNotificationBody = contentProto?.dataMessage?.body ?? "" + } + notificationContent.body = newNotificationBody + if notificationContent.body.count < 1 { + self.completeWithFailure(content: notificationContent) + } else { + self.contentHandler!(notificationContent) + } + } + + private var hasSetup = false + func setupIfNecessary() { + AssertIsOnMainThread() + + // The NSE will often re-use the same process, so if we're + // already setup we want to do nothing. We're already ready + // to process new messages. + guard !hasSetup else { return } + + hasSetup = true + + // This should be the first thing we do. + SetCurrentAppContext(NotificationServiceExtensionContext()) + + DebugLogger.shared().enableTTYLogging() + if _isDebugAssertConfiguration() { + DebugLogger.shared().enableFileLogging() + } + + Logger.info("") + + _ = AppVersion.sharedInstance() + + Cryptography.seedRandom() + + // We should never receive a non-voip notification on an app that doesn't support + // app extensions since we have to inform the service we wanted these, so in theory + // this path should never occur. However, the service does have our push token + // so it is possible that could change in the future. If it does, do nothing + // and don't disturb the user. Messages will be processed when they open the app. + guard OWSPreferences.isReadyForAppExtensions() else { return completeSilenty() } + + AppSetup.setupEnvironment( + appSpecificSingletonBlock: { + // TODO: calls.. + SSKEnvironment.shared.callMessageHandler = NoopCallMessageHandler() + SSKEnvironment.shared.notificationsManager = NoopNotificationsManager() + }, + migrationCompletion: { [weak self] in + self?.versionMigrationsDidComplete() + } + ) + + NotificationCenter.default.addObserver(self, + selector: #selector(storageIsReady), + name: .StorageIsReady, + object: nil) + + Logger.info("completed.") + + } + + override func serviceExtensionTimeWillExpire() { + // Called just before the extension will be terminated by the system. + // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. + if let contentHandler = contentHandler, let notificationContent = notificationContent { + contentHandler(notificationContent) + } + } + + func wasReceivedByUD(envelope: SSKProtoEnvelope) -> Bool { + return (envelope.type == .unidentifiedSender && (!envelope.hasSource || envelope.source!.count < 1)) + } + + @objc + func versionMigrationsDidComplete() { + AssertIsOnMainThread() + + Logger.debug("") + + areVersionMigrationsComplete = true + + checkIsAppReady() + } + + @objc + func storageIsReady() { + AssertIsOnMainThread() + + Logger.debug("") + + checkIsAppReady() + } + + @objc + func checkIsAppReady() { + AssertIsOnMainThread() + + // Only mark the app as ready once. + guard !AppReadiness.isAppReady() else { return } + + // App isn't ready until storage is ready AND all version migrations are complete. + guard OWSStorage.isStorageReady() && areVersionMigrationsComplete else { return } + + // Note that this does much more than set a flag; it will also run all deferred blocks. + AppReadiness.setAppIsReady() + +// AppVersion.sharedInstance().nseLaunchDidComplete() + } + + func completeSilenty() { + contentHandler?(.init()) + } + + func completeWithFailure(content: UNMutableNotificationContent) { + content.body = "You've got a new message." + content.title = "Session" + contentHandler?(content) + } + +} diff --git a/LokiPushNotificationService/NotificationServiceExtensionContext.swift b/LokiPushNotificationService/NotificationServiceExtensionContext.swift new file mode 100644 index 000000000..fbcce8ff4 --- /dev/null +++ b/LokiPushNotificationService/NotificationServiceExtensionContext.swift @@ -0,0 +1,94 @@ +// +// Copyright (c) 2020 Open Whisper Systems. All rights reserved. +// + +import Foundation +import SignalServiceKit +import SignalMessaging + +class NotificationServiceExtensionContext: NSObject, AppContext { + var wasWokenUpBySilentPushNotification: Bool = true + + var openSystemSettingsAction: UIAlertAction? + + let isMainApp = false + let isMainAppAndActive = false + + func isInBackground() -> Bool { true } + func isAppForegroundAndActive() -> Bool { false } + func mainApplicationStateOnLaunch() -> UIApplication.State { .inactive } + + var shouldProcessIncomingMessages: Bool { true } + func canPresentNotifications() -> Bool { true } + + let appLaunchTime = Date() + lazy var buildTime: Date = { + guard let buildTimestamp = Bundle.main.object(forInfoDictionaryKey: "BuildTimestamp") as? TimeInterval, buildTimestamp > 0 else { + Logger.debug("No build timestamp, assuming app never expires.") + return .distantFuture + } + + return .init(timeIntervalSince1970: buildTimestamp) + }() + + func keychainStorage() -> SSKKeychainStorage { + return SSKDefaultKeychainStorage.shared + } + + func appDocumentDirectoryPath() -> String { + guard let documentDirectoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last else { + owsFail("failed to query document directory") + } + return documentDirectoryURL.path + } + + func appSharedDataDirectoryPath() -> String { + guard let groupContainerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: SignalApplicationGroup) else { + owsFail("failed to query group container") + } + return groupContainerURL.path + } + + func appDatabaseBaseDirectoryPath() -> String { + return appSharedDataDirectoryPath() + } + + func appUserDefaults() -> UserDefaults { + guard let userDefaults = UserDefaults(suiteName: SignalApplicationGroup) else { + owsFail("failed to initialize user defaults") + } + return userDefaults + } + + override init() { super.init() } + + // MARK: - Unused in this extension + + let isRTL = false + let isRunningTests = false + + var mainWindow: UIWindow? + let frame: CGRect = .zero + let interfaceOrientation: UIInterfaceOrientation = .unknown + let reportedApplicationState: UIApplication.State = .background + let statusBarHeight: CGFloat = .zero + + func beginBackgroundTask(expirationHandler: @escaping BackgroundTaskExpirationHandler) -> UInt { 0 } + func endBackgroundTask(_ backgroundTaskIdentifier: UInt) {} + + func beginBackgroundTask(expirationHandler: @escaping BackgroundTaskExpirationHandler) -> UIBackgroundTaskIdentifier { .invalid } + func endBackgroundTask(_ backgroundTaskIdentifier: UIBackgroundTaskIdentifier) {} + + func ensureSleepBlocking(_ shouldBeBlocking: Bool, blockingObjectsDescription: String) {} + + func setMainAppBadgeNumber(_ value: Int) {} + func setStatusBarHidden(_ isHidden: Bool, animated isAnimated: Bool) {} + + func frontmostViewController() -> UIViewController? { nil } + + func setNetworkActivityIndicatorVisible(_ value: Bool) {} + + func runNowOr(whenMainAppIsActive block: @escaping AppActiveBlock) {} + + func ensureSleepBlocking(_ shouldBeBlocking: Bool, blockingObjects: [Any]) {} +} diff --git a/Podfile b/Podfile index 5343918db..20a697599 100644 --- a/Podfile +++ b/Podfile @@ -88,6 +88,12 @@ target 'SignalShareExtension' do shared_pods end +target 'LokiPushNotificationService' do + project 'Signal' + pod 'CryptoSwift', '~> 1.0', :inhibit_warnings => true + shared_pods +end + target 'SignalMessaging' do project 'Signal' shared_pods diff --git a/Podfile.lock b/Podfile.lock index 8074df569..f2d174e62 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -60,7 +60,6 @@ PODS: - Mantle (2.1.0): - Mantle/extobjc (= 2.1.0) - Mantle/extobjc (2.1.0) - - Mixpanel (3.4.7) - NVActivityIndicatorView (4.7.0): - NVActivityIndicatorView/Presenter (= 4.7.0) - NVActivityIndicatorView/Presenter (4.7.0) @@ -220,7 +219,6 @@ DEPENDENCIES: - HKDFKit (from `https://github.com/signalapp/HKDFKit.git`) - HKDFKit/Tests (from `https://github.com/signalapp/HKDFKit.git`) - Mantle (from `https://github.com/signalapp/Mantle`, branch `signal-master`) - - Mixpanel (~> 3.4) - NVActivityIndicatorView (~> 4.7) - PromiseKit (= 6.5.3) - PureLayout @@ -249,7 +247,6 @@ SPEC REPOS: - GCDWebServer - GoogleUtilities - libPhoneNumber-iOS - - Mixpanel - NVActivityIndicatorView - PromiseKit - PureLayout @@ -331,7 +328,6 @@ SPEC CHECKSUMS: HKDFKit: 3b6dbbb9d59c221cc6c52c3aa915700cbf24e376 libPhoneNumber-iOS: e444379ac18bbfbdefad571da735b2cd7e096caa Mantle: 2fa750afa478cd625a94230fbf1c13462f29395b - Mixpanel: 696e0a1c7f2685aa06bb23829b7a58ab7203d6c7 NVActivityIndicatorView: b19ddab2576f805cbe0fb2306cba3476e09a1dea PromiseKit: c609029bdd801f792551a504c695c7d3098b42cd PureLayout: f08c01b8dec00bb14a1fefa3de4c7d9c265df85e @@ -347,6 +343,6 @@ SPEC CHECKSUMS: YapDatabase: b418a4baa6906e8028748938f9159807fd039af4 YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 -PODFILE CHECKSUM: 156b349e2791f53224143291e318592b9c1f7ade +PODFILE CHECKSUM: 472252f3a4801d0d14d9553ff33cf52ef0846dc3 COCOAPODS: 1.5.3 diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 3d5da66da..17a32d5bb 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -331,6 +331,7 @@ 34EA69422194DE8000702471 /* MediaUploadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34EA69412194DE7F00702471 /* MediaUploadView.swift */; }; 34F308A21ECB469700BB7697 /* OWSBezierPathView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34F308A11ECB469700BB7697 /* OWSBezierPathView.m */; }; 34FDB29221FF986600A01202 /* UIView+OWS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34FDB29121FF986600A01202 /* UIView+OWS.swift */; }; + 390650A6D345BFE01E006DB0 /* Pods_LokiPushNotificationService.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04912E453971FB16E5E78EC6 /* Pods_LokiPushNotificationService.framework */; }; 4503F1BE20470A5B00CEE724 /* classic-quiet.aifc in Resources */ = {isa = PBXBuildFile; fileRef = 4503F1BB20470A5B00CEE724 /* classic-quiet.aifc */; }; 4503F1BF20470A5B00CEE724 /* classic.aifc in Resources */ = {isa = PBXBuildFile; fileRef = 4503F1BC20470A5B00CEE724 /* classic.aifc */; }; 4503F1C3204711D300CEE724 /* OWS107LegacySounds.m in Sources */ = {isa = PBXBuildFile; fileRef = 4503F1C1204711D200CEE724 /* OWS107LegacySounds.m */; }; @@ -519,6 +520,11 @@ 768A1A2B17FC9CD300E00ED8 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 768A1A2A17FC9CD300E00ED8 /* libz.dylib */; }; 76C87F19181EFCE600C4ACAB /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */; }; 76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; }; + 7BC01A3E241F40AB00BC7C55 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BC01A3D241F40AB00BC7C55 /* NotificationService.swift */; }; + 7BC01A42241F40AB00BC7C55 /* LokiPushNotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 7BC01A3B241F40AB00BC7C55 /* LokiPushNotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 7BDCFC08242186E700641C39 /* NotificationServiceExtensionContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */; }; + 7BDCFC092421894900641C39 /* MessageFetcherJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452ECA4C1E087E7200E2F016 /* MessageFetcherJob.swift */; }; + 7BDCFC0B2421EB7600641C39 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6F509951AA53F760068F56A /* Localizable.strings */; }; 954AEE6A1DF33E01002E5410 /* ContactsPickerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954AEE681DF33D32002E5410 /* ContactsPickerTest.swift */; }; A10FDF79184FB4BB007FF963 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */; }; A11CD70D17FA230600A2D1B1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */; }; @@ -676,6 +682,13 @@ remoteGlobalIDString = 453518911FC63DBF00210559; remoteInfo = SignalMessaging; }; + 7BC01A40241F40AB00BC7C55 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D221A080169C9E5E00537ABF /* Project object */; + proxyType = 1; + remoteGlobalIDString = 7BC01A3A241F40AB00BC7C55; + remoteInfo = LokiPushNotificationService; + }; B6AFCEBA19A93DA60098CFCB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D221A080169C9E5E00537ABF /* Project object */; @@ -692,6 +705,7 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( + 7BC01A42241F40AB00BC7C55 /* LokiPushNotificationService.appex in Embed App Extensions */, 453518721FC635DD00210559 /* SignalShareExtension.appex in Embed App Extensions */, ); name = "Embed App Extensions"; @@ -711,7 +725,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 04912E453971FB16E5E78EC6 /* Pods_LokiPushNotificationService.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LokiPushNotificationService.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0F94C85CB0B235DA37F68ED0 /* Pods_SignalShareExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SignalShareExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 18D19142FD6E60FD0A5D89F7 /* Pods-LokiPushNotificationService.app store release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LokiPushNotificationService.app store release.xcconfig"; path = "Pods/Target Support Files/Pods-LokiPushNotificationService/Pods-LokiPushNotificationService.app store release.xcconfig"; sourceTree = ""; }; 1C93CF3971B64E8B6C1F9AC1 /* Pods-SignalShareExtension.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalShareExtension.test.xcconfig"; path = "Pods/Target Support Files/Pods-SignalShareExtension/Pods-SignalShareExtension.test.xcconfig"; sourceTree = ""; }; 1CE3CD5C23334683BDD3D78C /* Pods-Signal.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Signal.test.xcconfig"; path = "Pods/Target Support Files/Pods-Signal/Pods-Signal.test.xcconfig"; sourceTree = ""; }; 2400888D239F30A600305217 /* SessionRestorationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionRestorationView.swift; sourceTree = ""; }; @@ -1342,6 +1358,11 @@ 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; 76EB03C218170B33006006FC /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 76EB03C318170B33006006FC /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 7BC01A3B241F40AB00BC7C55 /* LokiPushNotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = LokiPushNotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 7BC01A3D241F40AB00BC7C55 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = ""; }; + 7BC01A3F241F40AB00BC7C55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7BDCFC0424206E7300641C39 /* LokiPushNotificationService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LokiPushNotificationService.entitlements; sourceTree = ""; }; + 7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationServiceExtensionContext.swift; sourceTree = ""; }; 8981C8F64D94D3C52EB67A2C /* Pods-SignalTests.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalTests.test.xcconfig"; path = "Pods/Target Support Files/Pods-SignalTests/Pods-SignalTests.test.xcconfig"; sourceTree = ""; }; 8EEE74B0753448C085B48721 /* Pods-SignalMessaging.app store release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalMessaging.app store release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalMessaging/Pods-SignalMessaging.app store release.xcconfig"; sourceTree = ""; }; 948239851C08032C842937CC /* Pods-SignalMessaging.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalMessaging.test.xcconfig"; path = "Pods/Target Support Files/Pods-SignalMessaging/Pods-SignalMessaging.test.xcconfig"; sourceTree = ""; }; @@ -1492,6 +1513,7 @@ E85DB184824BA9DC302EC8B3 /* Pods-SignalTests.app store release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalTests.app store release.xcconfig"; path = "Pods/Target Support Files/Pods-SignalTests/Pods-SignalTests.app store release.xcconfig"; sourceTree = ""; }; 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 = ""; }; 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 = ""; }; @@ -1517,6 +1539,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 7BC01A38241F40AB00BC7C55 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 390650A6D345BFE01E006DB0 /* Pods_LokiPushNotificationService.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D221A086169C9E5E00537ABF /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2596,6 +2626,17 @@ path = views; sourceTree = ""; }; + 7BC01A3C241F40AB00BC7C55 /* LokiPushNotificationService */ = { + isa = PBXGroup; + children = ( + 7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */, + 7BDCFC0424206E7300641C39 /* LokiPushNotificationService.entitlements */, + 7BC01A3D241F40AB00BC7C55 /* NotificationService.swift */, + 7BC01A3F241F40AB00BC7C55 /* Info.plist */, + ); + path = LokiPushNotificationService; + sourceTree = ""; + }; 9404664EC513585B05DF1350 /* Pods */ = { isa = PBXGroup; children = ( @@ -2611,6 +2652,8 @@ 9B533A9FA46206D3D99C9ADA /* Pods-SignalMessaging.debug.xcconfig */, 948239851C08032C842937CC /* Pods-SignalMessaging.test.xcconfig */, 8EEE74B0753448C085B48721 /* Pods-SignalMessaging.app store release.xcconfig */, + F62ECF7B8AF4F8089AA705B3 /* Pods-LokiPushNotificationService.debug.xcconfig */, + 18D19142FD6E60FD0A5D89F7 /* Pods-LokiPushNotificationService.app store release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -2856,6 +2899,7 @@ D221A093169C9E5E00537ABF /* Signal */, 453518691FC635DD00210559 /* SignalShareExtension */, 453518931FC63DBF00210559 /* SignalMessaging */, + 7BC01A3C241F40AB00BC7C55 /* LokiPushNotificationService */, D221A08C169C9E5E00537ABF /* Frameworks */, D221A08A169C9E5E00537ABF /* Products */, 9404664EC513585B05DF1350 /* Pods */, @@ -2869,6 +2913,7 @@ D221A0AA169C9E5F00537ABF /* SignalTests.xctest */, 453518681FC635DD00210559 /* SignalShareExtension.appex */, 453518921FC63DBF00210559 /* SignalMessaging.framework */, + 7BC01A3B241F40AB00BC7C55 /* LokiPushNotificationService.appex */, ); name = Products; sourceTree = ""; @@ -2914,6 +2959,7 @@ 0F94C85CB0B235DA37F68ED0 /* Pods_SignalShareExtension.framework */, 748A5CAEDD7C919FC64C6807 /* Pods_SignalTests.framework */, 264242150E87D10A357DB07B /* Pods_SignalMessaging.framework */, + 04912E453971FB16E5E78EC6 /* Pods_LokiPushNotificationService.framework */, ); name = Frameworks; sourceTree = ""; @@ -3082,6 +3128,24 @@ productReference = 453518921FC63DBF00210559 /* SignalMessaging.framework */; productType = "com.apple.product-type.framework"; }; + 7BC01A3A241F40AB00BC7C55 /* LokiPushNotificationService */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7BC01A45241F40AB00BC7C55 /* Build configuration list for PBXNativeTarget "LokiPushNotificationService" */; + buildPhases = ( + 4B4609DACEC6E462A2394D2F /* [CP] Check Pods Manifest.lock */, + 7BC01A37241F40AB00BC7C55 /* Sources */, + 7BC01A38241F40AB00BC7C55 /* Frameworks */, + 7BC01A39241F40AB00BC7C55 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = LokiPushNotificationService; + productName = LokiPushNotificationService; + productReference = 7BC01A3B241F40AB00BC7C55 /* LokiPushNotificationService.appex */; + productType = "com.apple.product-type.app-extension"; + }; D221A088169C9E5E00537ABF /* Signal */ = { isa = PBXNativeTarget; buildConfigurationList = D221A0BC169C9E5F00537ABF /* Build configuration list for PBXNativeTarget "Signal" */; @@ -3103,6 +3167,7 @@ dependencies = ( 453518711FC635DD00210559 /* PBXTargetDependency */, 453518981FC63DBF00210559 /* PBXTargetDependency */, + 7BC01A41241F40AB00BC7C55 /* PBXTargetDependency */, ); name = Signal; productName = RedPhone; @@ -3137,7 +3202,8 @@ D221A080169C9E5E00537ABF /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0920; + DefaultBuildSystemTypeForWorkspace = Original; + LastSwiftUpdateCheck = 1130; LastTestingUpgradeCheck = 0600; LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Open Whisper Systems"; @@ -3168,6 +3234,11 @@ LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; + 7BC01A3A241F40AB00BC7C55 = { + CreatedOnToolsVersion = 11.3.1; + DevelopmentTeam = SUQ8J2PCT7; + ProvisioningStyle = Automatic; + }; D221A088169C9E5E00537ABF = { DevelopmentTeam = SUQ8J2PCT7; LastSwiftMigration = 1020; @@ -3280,6 +3351,7 @@ D221A0A9169C9E5F00537ABF /* SignalTests */, 453518671FC635DD00210559 /* SignalShareExtension */, 453518911FC63DBF00210559 /* SignalMessaging */, + 7BC01A3A241F40AB00BC7C55 /* LokiPushNotificationService */, ); }; /* End PBXProject section */ @@ -3307,6 +3379,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 7BC01A39241F40AB00BC7C55 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7BDCFC0B2421EB7600641C39 /* Localizable.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D221A087169C9E5E00537ABF /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -3495,6 +3575,28 @@ shellPath = /bin/sh; shellScript = "if which swiftlint >/dev/null; then\n# disabled for now. too many lint errors outside of the scope of this branch\n#(cd Signal && swiftlint)\n# never fail.\nexit 0\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; + 4B4609DACEC6E462A2394D2F /* [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-LokiPushNotificationService-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; + }; 59C9DBA462715B5C999FFB02 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -3513,7 +3615,6 @@ "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", "${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework", "${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework", - "${BUILT_PRODUCTS_DIR}/Mixpanel/Mixpanel.framework", "${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework", "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", "${BUILT_PRODUCTS_DIR}/PureLayout/PureLayout.framework", @@ -3543,7 +3644,6 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HKDFKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mantle.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mixpanel.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NVActivityIndicatorView.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PureLayout.framework", @@ -3850,6 +3950,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 7BC01A37241F40AB00BC7C55 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7BDCFC08242186E700641C39 /* NotificationServiceExtensionContext.swift in Sources */, + 7BC01A3E241F40AB00BC7C55 /* NotificationService.swift in Sources */, + 7BDCFC092421894900641C39 /* MessageFetcherJob.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D221A085169C9E5E00537ABF /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -4171,6 +4281,11 @@ target = 453518911FC63DBF00210559 /* SignalMessaging */; targetProxy = 453518971FC63DBF00210559 /* PBXContainerItemProxy */; }; + 7BC01A41241F40AB00BC7C55 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 7BC01A3A241F40AB00BC7C55 /* LokiPushNotificationService */; + targetProxy = 7BC01A40241F40AB00BC7C55 /* PBXContainerItemProxy */; + }; B6AFCEBB19A93DA60098CFCB /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D221A088169C9E5E00537ABF /* Signal */; @@ -4487,6 +4602,117 @@ }; name = "App Store Release"; }; + 7BC01A43241F40AB00BC7C55 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F62ECF7B8AF4F8089AA705B3 /* Pods-LokiPushNotificationService.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_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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = LokiPushNotificationService/LokiPushNotificationService.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = SUQ8J2PCT7; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + 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 = LokiPushNotificationService/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.LokiPushNotificationService"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 7BC01A44241F40AB00BC7C55 /* App Store Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 18D19142FD6E60FD0A5D89F7 /* Pods-LokiPushNotificationService.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_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_ENTITLEMENTS = LokiPushNotificationService/LokiPushNotificationService.entitlements; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = SUQ8J2PCT7; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + 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 = LokiPushNotificationService/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.LokiPushNotificationService"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "App Store Release"; + }; D221A0BA169C9E5F00537ABF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4912,6 +5138,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = "App Store Release"; }; + 7BC01A45241F40AB00BC7C55 /* Build configuration list for PBXNativeTarget "LokiPushNotificationService" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7BC01A43241F40AB00BC7C55 /* Debug */, + 7BC01A44241F40AB00BC7C55 /* App Store Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = "App Store Release"; + }; D221A083169C9E5E00537ABF /* Build configuration list for PBXProject "Signal" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme b/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme index f98b3992f..ef124ff98 100644 --- a/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme +++ b/Signal.xcodeproj/xcshareddata/xcschemes/Signal.xcscheme @@ -28,7 +28,7 @@ buildForAnalyzing = "YES"> @@ -72,7 +72,7 @@ skipped = "NO"> @@ -82,7 +82,7 @@ skipped = "NO"> @@ -92,7 +92,7 @@ skipped = "NO"> @@ -102,7 +102,7 @@ skipped = "NO"> @@ -112,7 +112,7 @@ skipped = "NO"> @@ -122,7 +122,7 @@ skipped = "NO"> diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index a7a084e27..342d37adb 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -5,15 +5,11 @@ BuildDetails CarthageVersion - 0.33.0 - DateTime - Fri Mar 6 00:51:56 UTC 2020 + 0.34.0 OSXVersion 10.15.3 WebRTCCommit 1445d719bf05280270e9f77576f80f973fd847f8 M73 - XCodeVersion - 1100.1130 CFBundleDevelopmentRegion en diff --git a/SignalServiceKit/src/Messages/OWSMessageManager.m b/SignalServiceKit/src/Messages/OWSMessageManager.m index 16ea7fd0b..136ee58ad 100644 --- a/SignalServiceKit/src/Messages/OWSMessageManager.m +++ b/SignalServiceKit/src/Messages/OWSMessageManager.m @@ -255,10 +255,10 @@ NS_ASSUME_NONNULL_BEGIN OWSFailDebug(@"Not registered."); return; } - if (!CurrentAppContext().isMainApp) { - OWSFail(@"Not the main app."); - return; - } +// if (!CurrentAppContext().isMainApp) { +// OWSFail(@"Not the main app."); +// return; +// } OWSLogInfo(@"Handling decrypted envelope: %@.", [self descriptionForEnvelope:envelope]); @@ -1881,6 +1881,15 @@ NS_ASSUME_NONNULL_BEGIN if (incomingMessage.isFriendRequest) { [thread removeOldIncomingFriendRequestMessagesIfNeededWithTransaction:transaction]; } +// +// if (!CurrentAppContext().isMainApp) { +// dispatch_async(dispatch_get_main_queue(), ^{ +// [self.typingIndicators didReceiveIncomingMessageInThread:masterThread +// recipientId:(masterThread.contactIdentifier ?: envelope.source) +// deviceId:envelope.sourceDevice]; +// }); +// return; +// } // Any messages sent from the current user - from this device or another - should be automatically marked as read. if ([(masterThread.contactIdentifier ?: envelope.source) isEqualToString:self.tsAccountManager.localNumber]) { diff --git a/SignalServiceKit/src/Messages/TypingIndicatorMessage.swift b/SignalServiceKit/src/Messages/TypingIndicatorMessage.swift index c1306908c..88ff54151 100644 --- a/SignalServiceKit/src/Messages/TypingIndicatorMessage.swift +++ b/SignalServiceKit/src/Messages/TypingIndicatorMessage.swift @@ -60,6 +60,11 @@ public class TypingIndicatorMessage: TSOutgoingMessage { public override var isOnline: Bool { return true } + + @objc + public override var ttl: UInt32 { + return UInt32(10 * kMinuteInMs) + } private func protoAction(forAction action: TypingIndicatorAction) -> SSKProtoTypingMessage.SSKProtoTypingMessageAction { switch action { diff --git a/SignalServiceKit/src/Util/FeatureFlags.swift b/SignalServiceKit/src/Util/FeatureFlags.swift index 0d78affd1..e8595dd26 100644 --- a/SignalServiceKit/src/Util/FeatureFlags.swift +++ b/SignalServiceKit/src/Util/FeatureFlags.swift @@ -29,4 +29,9 @@ public class FeatureFlags: NSObject { public static var useCustomPhotoCapture: Bool { return true } + + @objc + public static var notificationServiceExtension: Bool { + return true + } }