marinofaggiana 6 years ago
parent
commit
684d90b901

+ 0 - 216
Nextcloud.xcodeproj/project.pbxproj

@@ -113,18 +113,6 @@
 		F72D1001210B6638009C96B7 /* FirebaseCoreDiagnostics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F72D0FF8210B6638009C96B7 /* FirebaseCoreDiagnostics.framework */; };
 		F72D1003210B67CE009C96B7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = F72D1002210B67CE009C96B7 /* GoogleService-Info.plist */; };
 		F72D1007210B6882009C96B7 /* NCPushNotificationEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */; };
-		F72D100F210B6B17009C96B7 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72D100E210B6B17009C96B7 /* NotificationService.swift */; };
-		F72D1013210B6B17009C96B7 /* Notification Service Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = F72D100C210B6B16009C96B7 /* Notification Service Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
-		F72D101A210B7473009C96B7 /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; };
-		F72D103A210B769E009C96B7 /* NCDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB41ED5A87C00B7EAD4 /* NCDatabase.swift */; };
-		F72D103B210B76A1009C96B7 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; };
-		F72D103C210B777F009C96B7 /* NCBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */; };
-		F72D103D210B7796009C96B7 /* OCSharedDto.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022791EC4C9100080073F /* OCSharedDto.m */; };
-		F72D103E210B77A5009C96B7 /* OCActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022671EC4C9100080073F /* OCActivity.m */; };
-		F72D103F210B77B8009C96B7 /* NCPushNotificationEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */; };
-		F72D1040210B77EA009C96B7 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63061D5B3467004E2AA5 /* libcrypto.a */; };
-		F72D1041210B77ED009C96B7 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63071D5B3467004E2AA5 /* libssl.a */; };
-		F72D1042210B783D009C96B7 /* NCEndToEndEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F70CAE391F8CF31A008125FD /* NCEndToEndEncryption.m */; };
 		F72E0B9D21AD60BC00898D7B /* WeScan.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F72E0B9C21AD60BC00898D7B /* WeScan.framework */; };
 		F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
 		F732BA0B1D76DBA500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
@@ -547,7 +535,6 @@
 		F7DFB7E0219C312D00680748 /* NCRichDocumentTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7DF219C312D00680748 /* NCRichDocumentTemplate.m */; };
 		F7DFB7E1219C312D00680748 /* NCRichDocumentTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7DF219C312D00680748 /* NCRichDocumentTemplate.m */; };
 		F7DFB7E2219C312D00680748 /* NCRichDocumentTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7DF219C312D00680748 /* NCRichDocumentTemplate.m */; };
-		F7DFB7E3219C312D00680748 /* NCRichDocumentTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7DF219C312D00680748 /* NCRichDocumentTemplate.m */; };
 		F7DFB7EB219C5A2E00680748 /* NCCreateMenuAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7EA219C5A2E00680748 /* NCCreateMenuAdd.swift */; };
 		F7DFB7F0219C5B8000680748 /* NCCreateFormUploadAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7EF219C5B8000680748 /* NCCreateFormUploadAssets.swift */; };
 		F7DFB7F2219C5C0000680748 /* NCCreateFormUploadFileText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7F1219C5C0000680748 /* NCCreateFormUploadFileText.swift */; };
@@ -616,13 +603,6 @@
 			remoteGlobalIDString = F71459B41D12E3B700CAFEEC;
 			remoteInfo = "Share Ext Nextcloud";
 		};
-		F72D1011210B6B17009C96B7 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = F7F67BA01A24D27800EE80DA /* Project object */;
-			proxyType = 1;
-			remoteGlobalIDString = F72D100B210B6B16009C96B7;
-			remoteInfo = "Notification Service Extension";
-		};
 		F771E3E920E2392E00AFB62D /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = F7F67BA01A24D27800EE80DA /* Project object */;
@@ -651,7 +631,6 @@
 			files = (
 				F771E3EB20E2392E00AFB62D /* File Provider Extension.appex in Embed App Extensions */,
 				F749E4E91DC1FB38009BA2FD /* Share.appex in Embed App Extensions */,
-				F72D1013210B6B17009C96B7 /* Notification Service Extension.appex in Embed App Extensions */,
 			);
 			name = "Embed App Extensions";
 			runOnlyForDeploymentPostprocessing = 0;
@@ -785,9 +764,6 @@
 		F72D1004210B6835009C96B7 /* Firebase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Firebase.h; sourceTree = "<group>"; };
 		F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCPushNotificationEncryption.m; sourceTree = "<group>"; };
 		F72D1006210B6882009C96B7 /* NCPushNotificationEncryption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCPushNotificationEncryption.h; sourceTree = "<group>"; };
-		F72D100C210B6B16009C96B7 /* Notification Service Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Notification Service Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
-		F72D100E210B6B17009C96B7 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
-		F72D1019210B7394009C96B7 /* NotificationServiceExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NotificationServiceExtension-Bridging-Header.h"; sourceTree = "<group>"; };
 		F72E0B9C21AD60BC00898D7B /* WeScan.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WeScan.framework; path = Carthage/Build/iOS/WeScan.framework; sourceTree = "<group>"; };
 		F73049B81CB567F000C7C320 /* NSString+TruncateToWidth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+TruncateToWidth.h"; sourceTree = "<group>"; };
 		F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+TruncateToWidth.m"; sourceTree = "<group>"; };
@@ -1488,15 +1464,6 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
-		F72D1009210B6B16009C96B7 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				F72D1041210B77ED009C96B7 /* libssl.a in Frameworks */,
-				F72D1040210B77EA009C96B7 /* libcrypto.a in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 		F771E3CD20E2392D00AFB62D /* Frameworks */ = {
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
@@ -1832,15 +1799,6 @@
 			path = Analytics;
 			sourceTree = "<group>";
 		};
-		F72D100D210B6B17009C96B7 /* Notification Service Extension */ = {
-			isa = PBXGroup;
-			children = (
-				F72D100E210B6B17009C96B7 /* NotificationService.swift */,
-				F72D1019210B7394009C96B7 /* NotificationServiceExtension-Bridging-Header.h */,
-			);
-			path = "Notification Service Extension";
-			sourceTree = "<group>";
-		};
 		F7381ED9218218A4000B1560 /* Offline */ = {
 			isa = PBXGroup;
 			children = (
@@ -2911,12 +2869,10 @@
 				F7F67BAA1A24D27800EE80DA /* iOSClient */,
 				F7F67BAB1A24D27800EE80DA /* Supporting Files */,
 				F771E3D120E2392D00AFB62D /* File Provider Extension */,
-				F72D100D210B6B17009C96B7 /* Notification Service Extension */,
 				F7C0F46D1C8880540059EC54 /* Share */,
 				F7FC7D651DC1F98700BB2C6A /* Products */,
 				F7FC7D541DC1F93700BB2C6A /* Frameworks */,
 				F771E3D020E2392D00AFB62D /* File Provider Extension.appex */,
-				F72D100C210B6B16009C96B7 /* Notification Service Extension.appex */,
 			);
 			sourceTree = "<group>";
 		};
@@ -3084,23 +3040,6 @@
 			productReference = F7CE8AFB1DC1F8D8009CAE48 /* Share.appex */;
 			productType = "com.apple.product-type.app-extension";
 		};
-		F72D100B210B6B16009C96B7 /* Notification Service Extension */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = F72D1014210B6B17009C96B7 /* Build configuration list for PBXNativeTarget "Notification Service Extension" */;
-			buildPhases = (
-				F72D1008210B6B16009C96B7 /* Sources */,
-				F72D1009210B6B16009C96B7 /* Frameworks */,
-				F72D100A210B6B16009C96B7 /* Resources */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = "Notification Service Extension";
-			productName = "Notification Service Extension";
-			productReference = F72D100C210B6B16009C96B7 /* Notification Service Extension.appex */;
-			productType = "com.apple.product-type.app-extension";
-		};
 		F771E3CF20E2392D00AFB62D /* File Provider Extension */ = {
 			isa = PBXNativeTarget;
 			buildConfigurationList = F771E3EF20E2392E00AFB62D /* Build configuration list for PBXNativeTarget "File Provider Extension" */;
@@ -3136,7 +3075,6 @@
 			dependencies = (
 				F7145A321D12E65F00CAFEEC /* PBXTargetDependency */,
 				F771E3EA20E2392E00AFB62D /* PBXTargetDependency */,
-				F72D1012210B6B17009C96B7 /* PBXTargetDependency */,
 			);
 			name = Nextcloud;
 			productName = "Crypto Cloud";
@@ -3165,20 +3103,6 @@
 							};
 						};
 					};
-					F72D100B210B6B16009C96B7 = {
-						CreatedOnToolsVersion = 9.4.1;
-						DevelopmentTeam = 6JLRKY9ZV7;
-						LastSwiftMigration = 1000;
-						ProvisioningStyle = Automatic;
-						SystemCapabilities = {
-							com.apple.ApplicationGroups.iOS = {
-								enabled = 1;
-							};
-							com.apple.Keychain = {
-								enabled = 1;
-							};
-						};
-					};
 					F771E3CF20E2392D00AFB62D = {
 						CreatedOnToolsVersion = 9.4.1;
 						DevelopmentTeam = 6JLRKY9ZV7;
@@ -3255,7 +3179,6 @@
 				F77B0DEB1D118A16002130FE /* Nextcloud */,
 				F71459B41D12E3B700CAFEEC /* Share */,
 				F771E3CF20E2392D00AFB62D /* File Provider Extension */,
-				F72D100B210B6B16009C96B7 /* Notification Service Extension */,
 			);
 		};
 /* End PBXProject section */
@@ -3274,13 +3197,6 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
-		F72D100A210B6B16009C96B7 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 		F771E3CE20E2392D00AFB62D /* Resources */ = {
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -3562,23 +3478,6 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
-		F72D1008210B6B16009C96B7 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				F72D103C210B777F009C96B7 /* NCBrand.swift in Sources */,
-				F7DFB7E3219C312D00680748 /* NCRichDocumentTemplate.m in Sources */,
-				F72D101A210B7473009C96B7 /* CCUtility.m in Sources */,
-				F72D100F210B6B17009C96B7 /* NotificationService.swift in Sources */,
-				F72D103A210B769E009C96B7 /* NCDatabase.swift in Sources */,
-				F72D103D210B7796009C96B7 /* OCSharedDto.m in Sources */,
-				F72D103F210B77B8009C96B7 /* NCPushNotificationEncryption.m in Sources */,
-				F72D103E210B77A5009C96B7 /* OCActivity.m in Sources */,
-				F72D1042210B783D009C96B7 /* NCEndToEndEncryption.m in Sources */,
-				F72D103B210B76A1009C96B7 /* NCManageDatabase.swift in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
 		F771E3CC20E2392D00AFB62D /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -3936,11 +3835,6 @@
 			target = F71459B41D12E3B700CAFEEC /* Share */;
 			targetProxy = F7145A311D12E65F00CAFEEC /* PBXContainerItemProxy */;
 		};
-		F72D1012210B6B17009C96B7 /* PBXTargetDependency */ = {
-			isa = PBXTargetDependency;
-			target = F72D100B210B6B16009C96B7 /* Notification Service Extension */;
-			targetProxy = F72D1011210B6B17009C96B7 /* PBXContainerItemProxy */;
-		};
 		F771E3EA20E2392E00AFB62D /* PBXTargetDependency */ = {
 			isa = PBXTargetDependency;
 			target = F771E3CF20E2392D00AFB62D /* File Provider Extension */;
@@ -4091,107 +3985,6 @@
 			};
 			name = Release;
 		};
-		F72D1015210B6B17009C96B7 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
-				APPLICATION_EXTENSION_API_ONLY = NO;
-				CLANG_ANALYZER_NONNULL = YES;
-				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
-				CLANG_ENABLE_OBJC_WEAK = YES;
-				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
-				CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
-				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
-				CLANG_WARN_STRICT_PROTOTYPES = NO;
-				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
-				CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/iOSClient/Brand/Notification_Service_Extension.entitlements";
-				CODE_SIGN_IDENTITY = "iPhone Developer";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CODE_SIGN_STYLE = Automatic;
-				DEBUG_INFORMATION_FORMAT = dwarf;
-				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"$(PROJECT_DIR)/Carthage/Build/iOS",
-				);
-				GCC_C_LANGUAGE_STANDARD = gnu11;
-				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"$(inherited)",
-					EXTENSION,
-					EXTENSION_NOTIFICATION_SERVICE,
-					NC,
-				);
-				HEADER_SEARCH_PATHS = "\"Libraries external\"/**";
-				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/Notification_Service_Extension.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"Libraries external\"/**",
-				);
-				OTHER_LDFLAGS = "-ObjC";
-				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.Nextcloud.Notification-Service-Extension";
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SKIP_INSTALL = YES;
-				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
-				SWIFT_OBJC_BRIDGING_HEADER = "Notification Service Extension/NotificationServiceExtension-Bridging-Header.h";
-				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-				SWIFT_VERSION = 4.2;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Debug;
-		};
-		F72D1016210B6B17009C96B7 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
-				APPLICATION_EXTENSION_API_ONLY = NO;
-				CLANG_ANALYZER_NONNULL = YES;
-				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
-				CLANG_ENABLE_OBJC_WEAK = YES;
-				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
-				CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
-				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
-				CLANG_WARN_STRICT_PROTOTYPES = NO;
-				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
-				CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/iOSClient/Brand/Notification_Service_Extension.entitlements";
-				CODE_SIGN_IDENTITY = "iPhone Developer";
-				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CODE_SIGN_STYLE = Automatic;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"$(PROJECT_DIR)/Carthage/Build/iOS",
-				);
-				GCC_C_LANGUAGE_STANDARD = gnu11;
-				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					EXTENSION,
-					EXTENSION_NOTIFICATION_SERVICE,
-					NC,
-				);
-				HEADER_SEARCH_PATHS = "\"Libraries external\"/**";
-				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/Notification_Service_Extension.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"Libraries external\"/**",
-				);
-				OTHER_LDFLAGS = "-ObjC";
-				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.Nextcloud.Notification-Service-Extension";
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				SKIP_INSTALL = YES;
-				SWIFT_OBJC_BRIDGING_HEADER = "Notification Service Extension/NotificationServiceExtension-Bridging-Header.h";
-				SWIFT_VERSION = 4.2;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Release;
-		};
 		F771E3F020E2392E00AFB62D /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
@@ -4502,15 +4295,6 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
-		F72D1014210B6B17009C96B7 /* Build configuration list for PBXNativeTarget "Notification Service Extension" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				F72D1015210B6B17009C96B7 /* Debug */,
-				F72D1016210B6B17009C96B7 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
 		F771E3EF20E2392E00AFB62D /* Build configuration list for PBXNativeTarget "File Provider Extension" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (

+ 0 - 90
Notification Service Extension/NotificationService.swift

@@ -1,90 +0,0 @@
-//
-//  NotificationService.swift
-//  Notification Service Extension
-//
-//  Created by Marino Faggiana on 27/07/18.
-//  Copyright © 2018 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-import UserNotifications
-
-class NotificationService: UNNotificationServiceExtension {
-
-    let privateKey = CCUtility.getPushNotificationPrivateKey()
-    var contentHandler: ((UNNotificationContent) -> Void)?
-    var bestAttemptContent: UNMutableNotificationContent?
-
-    override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
-        
-        self.contentHandler = contentHandler
-        bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
-        
-        if let bestAttemptContent = bestAttemptContent {
-
-            bestAttemptContent.title = ""
-            bestAttemptContent.body = "Nextcloud notification"
-            
-            let message = bestAttemptContent.userInfo["subject"] as! String
-            
-            guard let privateKey = CCUtility.getPushNotificationPrivateKey() else {
-                contentHandler(bestAttemptContent)
-                return
-            }
-            
-            guard let decryptedMessage = NCPushNotificationEncryption.sharedInstance().decryptPushNotification(message, withDevicePrivateKey: privateKey) else {
-                contentHandler(bestAttemptContent)
-                return
-            }
-            
-            guard let data = decryptedMessage.data(using: .utf8) else {
-                contentHandler(bestAttemptContent)
-                return
-            }
-            
-            do {
-                let json = try JSONSerialization.jsonObject(with: data) as! [String:AnyObject]
-                if let app = json["app"] as? String {
-                    if app == "spreed" {
-                        bestAttemptContent.title = "Nextcloud Talk"
-                    } else {
-                        bestAttemptContent.title = app.capitalized
-                    }
-                }
-                if let subject = json["subject"] as? String {
-                    bestAttemptContent.body = subject
-                }
-            } catch let error as NSError {
-                print("Failed : \(error.localizedDescription)")
-            }
-          
-            contentHandler(bestAttemptContent)
-        }
-    }
-    
-    override func serviceExtensionTimeWillExpire() {
-
-        if let contentHandler = contentHandler, let bestAttemptContent =  bestAttemptContent {
-            
-            bestAttemptContent.title = ""
-            bestAttemptContent.body = "Nextcloud notification"
-            
-            contentHandler(bestAttemptContent)
-        }
-    }
-
-}

+ 0 - 31
Notification Service Extension/NotificationServiceExtension-Bridging-Header.h

@@ -1,31 +0,0 @@
-//
-//  NotificationServiceExtension-Bridging-Header.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 27/07/18.
-//  Copyright © 2018 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCUtility.h"
-#import "NCPushNotificationEncryption.h"
-
-#import "OCActivity.h"
-#import "OCUserProfile.h"
-#import "OCCapabilities.h"
-#import "OCExternalSites.h"
-#import "OCSharedDto.h"

+ 22 - 2
iOSClient/AppDelegate.m

@@ -402,11 +402,12 @@
     if (self.activeAccount.length == 0 || self.maintenanceMode)
         return;
     
-    [[NCPushNotificationEncryption sharedInstance] generatePushNotificationsKeyPair];
+    [[NCPushNotificationEncryption sharedInstance] generatePushNotificationsKeyPair:self.activeAccount];
 
     NSString *pushToken = [CCUtility getPushNotificationToken];
     NSString *pushTokenHash = [[NCEndToEndEncryption sharedManager] createSHA512:pushToken];
-    NSString *devicePublicKey = [[NSString alloc] initWithData:[NCPushNotificationEncryption sharedInstance].ncPNPublicKey encoding:NSUTF8StringEncoding];
+    NSData *ncPNPublicKey = [CCUtility getPushNotificationPublicKey:self.activeAccount];
+    NSString *devicePublicKey = [[NSString alloc] initWithData:ncPNPublicKey encoding:NSUTF8StringEncoding];
     
     self.pnDeviceIdentifier = nil;
     self.pnDeviceIdentifierSignature = nil;
@@ -503,6 +504,25 @@
     completionHandler();
 }
 
+- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
+{
+    NSLog(@"Push notification: %@", userInfo);
+    
+    NSString *message = [userInfo objectForKey:@"subject"];
+    if (message && [CCUtility getPushNotificationPrivateKey:self.activeAccount]) {
+        NSString *decryptedMessage = [[NCPushNotificationEncryption sharedInstance] decryptPushNotification:message withDevicePrivateKey: [CCUtility getPushNotificationPrivateKey:self.activeAccount]];
+        if (decryptedMessage) {
+            UNMutableNotificationContent *content = [UNMutableNotificationContent new];
+            content.body = decryptedMessage;
+            content.sound = [UNNotificationSound defaultSound];
+            NSString *identifier = [NSString stringWithFormat:@"Notification-%@", [NSDate new]];
+            UNTimeIntervalNotificationTrigger *trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:0.1 repeats:NO];
+            UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:identifier content:content trigger:trigger];
+            [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil];
+        }
+    }
+}
+
 #pragma FIREBASE
 
 - (void)messaging:(FIRMessaging *)messaging didReceiveRegistrationToken:(NSString *)fcmToken

+ 0 - 7
iOSClient/Brand/NCBridgeSwift.h

@@ -47,10 +47,3 @@
     #import "File_Provider_Extension-Swift.h"
 
 #endif
-
-// Nextcloud Notification Service Extension
-#if defined(EXTENSION_NOTIFICATION_SERVICE)
-
-    #import "Notification_Service_Extension-Swift.h"
-
-#endif

+ 11 - 4
iOSClient/Networking/OCNetworking.m

@@ -1585,18 +1585,22 @@
     }
     
     devicePublicKey = [CCUtility URLEncodeStringFromString:devicePublicKey];
-
+    NSString *proxyServerPath = [NCBrandOptions sharedInstance].pushNotificationServerProxy;
+    //proxyServerPath = @"http://127.0.0.1:8088";
+    NSString *proxyServer = [NCBrandOptions sharedInstance].pushNotificationServerProxy;
+    //proxyServer = @"https://10.132.0.37:8443/pushnotifications";
+    
     OCCommunication *communication = [OCNetworking sharedManager].sharedOCCommunication;
     
     [communication setCredentialsWithUser:tableAccount.user andUserID:tableAccount.userID andPassword:tableAccount.password];
     [communication setUserAgent:[CCUtility getUserAgent]];
-    [communication subscribingNextcloudServerPush:url pushTokenHash:pushTokenHash devicePublicKey:devicePublicKey proxyServerPath: [NCBrandOptions sharedInstance].pushNotificationServerProxy onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
+    [communication subscribingNextcloudServerPush:url pushTokenHash:pushTokenHash devicePublicKey:devicePublicKey proxyServerPath: proxyServerPath onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
         
         deviceIdentifier = [CCUtility URLEncodeStringFromString:deviceIdentifier];
         signature = [CCUtility URLEncodeStringFromString:signature];
         publicKey = [CCUtility URLEncodeStringFromString:publicKey];
         
-        [communication subscribingPushProxy:[NCBrandOptions sharedInstance].pushNotificationServerProxy pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature publicKey:publicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
+        [communication subscribingPushProxy:proxyServer pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature publicKey:publicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
             
             completion(account, deviceIdentifier, signature, publicKey, nil, 0);
             
@@ -1640,13 +1644,16 @@
         completion(account, NSLocalizedString(@"_error_user_not_available_", nil), k_CCErrorUserNotAvailble);
     }
     
+    NSString *proxyServer = [NCBrandOptions sharedInstance].pushNotificationServerProxy;
+    //proxyServer = @"https://10.132.0.37:8443/pushnotifications";
+    
     OCCommunication *communication = [OCNetworking sharedManager].sharedOCCommunication;
 
     [communication setCredentialsWithUser:tableAccount.user andUserID:tableAccount.userID andPassword:tableAccount.password];
     [communication setUserAgent:[CCUtility getUserAgent]];
     [communication unsubscribingNextcloudServerPush:url onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
 
-        [communication unsubscribingPushProxy:[NCBrandOptions sharedInstance].pushNotificationServerProxy deviceIdentifier:deviceIdentifier deviceIdentifierSignature:deviceIdentifierSignature publicKey:publicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
+        [communication unsubscribingPushProxy:proxyServer deviceIdentifier:deviceIdentifier deviceIdentifierSignature:deviceIdentifierSignature publicKey:publicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
             
             completion(account, nil, 0);
             

+ 1 - 4
iOSClient/Security/NCPushNotificationEncryption.h

@@ -27,11 +27,8 @@
 
 @interface NCPushNotificationEncryption : NSObject
 
-@property (nonatomic, copy) NSData *ncPNPublicKey;
-@property (nonatomic, copy) NSData *ncPNPrivateKey;
-
 + (NCPushNotificationEncryption *)sharedInstance;
-- (BOOL)generatePushNotificationsKeyPair;
+- (BOOL)generatePushNotificationsKeyPair:(NSString *)account;
 - (NSString *)decryptPushNotification:(NSString *)message withDevicePrivateKey:(NSData *)privateKey;
 
 @end

+ 8 - 8
iOSClient/Security/NCPushNotificationEncryption.m

@@ -54,13 +54,11 @@
     self = [super init];
     if (self) {
        
-        self.ncPNPublicKey = [CCUtility getPushNotificationPublicKey];
-        self.ncPNPrivateKey = [CCUtility getPushNotificationPrivateKey];
     }
     return self;
 }
 
-- (BOOL)generatePushNotificationsKeyPair
+- (BOOL)generatePushNotificationsKeyPair:(NSString *)account
 {
     EVP_PKEY *pkey;
     NSError *keyError;
@@ -69,6 +67,8 @@
         return NO;
     }
     
+    
+    
     // Extract publicKey, privateKey
     int len;
     char *keyBytes;
@@ -81,9 +81,9 @@
     keyBytes  = malloc(len);
     
     BIO_read(publicKeyBIO, keyBytes, len);
-    _ncPNPublicKey = [NSData dataWithBytes:keyBytes length:len];
-    [CCUtility setPushNotificationPublicKey:_ncPNPublicKey];
-    NSLog(@"Push Notifications Key Pair generated: \n%@", [[NSString alloc] initWithData:_ncPNPublicKey encoding:NSUTF8StringEncoding]);
+    NSData *ncPNPublicKey = [NSData dataWithBytes:keyBytes length:len];
+    [CCUtility setPushNotificationPublicKey:account data:ncPNPublicKey];
+    NSLog(@"Push Notifications Key Pair generated: \n%@", [[NSString alloc] initWithData:ncPNPublicKey encoding:NSUTF8StringEncoding]);
     
     // PrivateKey
     BIO *privateKeyBIO = BIO_new(BIO_s_mem());
@@ -93,8 +93,8 @@
     keyBytes = malloc(len);
     
     BIO_read(privateKeyBIO, keyBytes, len);
-    _ncPNPrivateKey = [NSData dataWithBytes:keyBytes length:len];
-    [CCUtility setPushNotificationPrivateKey:_ncPNPrivateKey];
+    NSData *ncPNPrivateKey = [NSData dataWithBytes:keyBytes length:len];
+    [CCUtility setPushNotificationPrivateKey:account data:ncPNPrivateKey];
     
     EVP_PKEY_free(pkey);
     

+ 4 - 4
iOSClient/Utility/CCUtility.h

@@ -134,10 +134,10 @@
 + (BOOL)getDisableFilesApp;
 + (void)setDisableFilesApp:(BOOL)disable;
 
-+ (void)setPushNotificationPublicKey:(NSData *)data;
-+ (NSData *)getPushNotificationPublicKey;
-+ (void)setPushNotificationPrivateKey:(NSData *)data;
-+ (NSData *)getPushNotificationPrivateKey;
++ (void)setPushNotificationPublicKey:(NSString *)account data:(NSData *)data;
++ (NSData *)getPushNotificationPublicKey:(NSString *)account;
++ (void)setPushNotificationPrivateKey:(NSString *)account data:(NSData *)data;
++ (NSData *)getPushNotificationPrivateKey:(NSString *)account;
 + (void)setPushNotificationToken:(NSString *)token;
 + (NSString *)getPushNotificationToken;
 

+ 12 - 8
iOSClient/Utility/CCUtility.m

@@ -479,24 +479,28 @@
     [UICKeyChainStore setString:sDisable forKey:@"disablefilesapp" service:k_serviceShareKeyChain];
 }
 
-+ (void)setPushNotificationPublicKey:(NSData *)data
++ (void)setPushNotificationPublicKey:(NSString *)account data:(NSData *)data
 {
-    [UICKeyChainStore setData:data forKey:@"ncPNPublicKey" service:k_serviceShareKeyChain];
+    NSString *key = [@"ncPNPublicKey" stringByAppendingString:account];
+    [UICKeyChainStore setData:data forKey:key service:k_serviceShareKeyChain];
 }
 
-+ (NSData *)getPushNotificationPublicKey
++ (NSData *)getPushNotificationPublicKey:(NSString *)account
 {
-    return [UICKeyChainStore dataForKey:@"ncPNPublicKey" service:k_serviceShareKeyChain];
+    NSString *key = [@"ncPNPublicKey" stringByAppendingString:account];
+    return [UICKeyChainStore dataForKey:key service:k_serviceShareKeyChain];
 }
 
-+ (void)setPushNotificationPrivateKey:(NSData *)data
++ (void)setPushNotificationPrivateKey:(NSString *)account data:(NSData *)data
 {
-    [UICKeyChainStore setData:data forKey:@"ncPNPrivateKey" service:k_serviceShareKeyChain];
+    NSString *key = [@"ncPNPrivateKey" stringByAppendingString:account];
+    [UICKeyChainStore setData:data forKey:key service:k_serviceShareKeyChain];
 }
 
-+ (NSData *)getPushNotificationPrivateKey
++ (NSData *)getPushNotificationPrivateKey:(NSString *)account
 {
-    return [UICKeyChainStore dataForKey:@"ncPNPrivateKey" service:k_serviceShareKeyChain];
+    NSString *key = [@"ncPNPrivateKey" stringByAppendingString:account];
+    return [UICKeyChainStore dataForKey:key service:k_serviceShareKeyChain];
 }
 
 + (void)setPushNotificationToken:(NSString *)token