diff --git a/BtchapNSE/Btchap-NSE-Release.xcconfig b/Btchap/Config/AppIdentifiers.xcconfig
similarity index 52%
rename from BtchapNSE/Btchap-NSE-Release.xcconfig
rename to Btchap/Config/AppIdentifiers.xcconfig
index aac958af0d..97248a9765 100644
--- a/BtchapNSE/Btchap-NSE-Release.xcconfig
+++ b/Btchap/Config/AppIdentifiers.xcconfig
@@ -1,5 +1,5 @@
//
-// Copyright 2020 Vector Creations Ltd
+// Copyright 2021 Vector Creations Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,8 +14,15 @@
// limitations under the License.
//
-// Configuration settings file format documentation can be found at:
-// https://help.apple.com/xcode/#/dev745c5c974
+// Team
+DEVELOPMENT_TEAM = NVMQD635C6
-#include "Btchap-NSE-Common.xcconfig"
-#include "Pods/Target Support Files/Pods-TchapPods-BtchapNSE/Pods-TchapPods-BtchapNSE.release.xcconfig"
+// Provisioning profiles
+TCHAP_PROVISIONING_PROFILE_SPECIFIER = Btchap App Store
+TCHAP_PROVISIONING_PROFILE = b5b01403-90ca-407a-9762-9832eb6e5f79
+
+NSE_PROVISIONING_PROFILE_SPECIFIER = Btchap NSE App Store
+NSE_PROVISIONING_PROFILE = 690bd5d6-de7f-4d8a-90c8-45257dd23fe0
+
+SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER = Btchap Share Extension App Store
+SHARE_EXTENSION_PROVISIONING_PROFILE = 9f253758-da9e-401d-ac42-7b0310dc58c3
diff --git a/Btchap/SupportingFiles/Btchap-App-Common.xcconfig b/Btchap/SupportingFiles/Btchap-App-Common.xcconfig
index 5f57364ea6..36a5963707 100644
--- a/Btchap/SupportingFiles/Btchap-App-Common.xcconfig
+++ b/Btchap/SupportingFiles/Btchap-App-Common.xcconfig
@@ -32,6 +32,3 @@ CODE_SIGN_ENTITLEMENTS = Btchap/SupportingFiles/Btchap.entitlements
SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/Tchap/SupportingFiles/Tchap-Bridging-Header.h
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
-
-CODE_SIGN_STYLE = Automatic
-DEVELOPMENT_TEAM = NVMQD635C6
diff --git a/Btchap/SupportingFiles/Btchap-App-Release.xcconfig b/Btchap/SupportingFiles/Btchap-App-Release.xcconfig
index 728028d4b2..f021e207cf 100644
--- a/Btchap/SupportingFiles/Btchap-App-Release.xcconfig
+++ b/Btchap/SupportingFiles/Btchap-App-Release.xcconfig
@@ -19,3 +19,6 @@
#include "Btchap-App-Common.xcconfig"
#include "Pods/Target Support Files/Pods-TchapPods-Btchap/Pods-TchapPods-Btchap.release.xcconfig"
+
+PROVISIONING_PROFILE = $(TCHAP_PROVISIONING_PROFILE)
+PROVISIONING_PROFILE_SPECIFIER = $(TCHAP_PROVISIONING_PROFILE_SPECIFIER)
diff --git a/Btchap/target.yml b/Btchap/target.yml
index d8c3b91830..2bbcbfbeb3 100644
--- a/Btchap/target.yml
+++ b/Btchap/target.yml
@@ -32,7 +32,7 @@ targets:
dependencies:
- target: BtchapShareExtension
- - target: BtchapNSE
+ - target: RiotNSE
- target: DesignKit
configFiles:
@@ -40,6 +40,10 @@ targets:
Release: SupportingFiles/Btchap-App-Release.xcconfig
preBuildScripts:
+ - name: 🛠 Environment
+ runOnlyWhenInstalling: false
+ shell: /bin/sh
+ script: "\"Tools/installfiles.sh\"\n"
- name: ⚠️ SwiftLint
runOnlyWhenInstalling: false
shell: /bin/sh
@@ -58,6 +62,7 @@ targets:
- path: ../Btchap/Config
- path: ../Config/Project.xcconfig
- path: ../Config/Project-Warnings.xcconfig
+ - path: ../Config/AppIdentifiers.xcconfig
- path: .
excludes:
- "**/*.strings" # Exclude all strings files
diff --git a/BtchapNSE/Btchap-NSE-Debug.xcconfig b/BtchapNSE/Btchap-NSE-Debug.xcconfig
deleted file mode 100644
index 97cd4ec508..0000000000
--- a/BtchapNSE/Btchap-NSE-Debug.xcconfig
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Copyright 2020 Vector Creations Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// Configuration settings file format documentation can be found at:
-// https://help.apple.com/xcode/#/dev745c5c974
-
-#include "Btchap-NSE-Common.xcconfig"
-#include "Pods/Target Support Files/Pods-TchapPods-BtchapNSE/Pods-TchapPods-BtchapNSE.debug.xcconfig"
diff --git a/BtchapNSE/BtchapNSE.entitlements b/BtchapNSE/BtchapNSE.entitlements
deleted file mode 100644
index ced577af8e..0000000000
--- a/BtchapNSE/BtchapNSE.entitlements
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- com.apple.security.application-groups
-
- $(APPLICATION_GROUP_IDENTIFIER)
-
- keychain-access-groups
-
- $(KEYCHAIN_ACCESS_GROUP)
-
-
-
diff --git a/BtchapNSE/Btchap-NSE-Common.xcconfig b/BtchapNSE/Common.xcconfig
similarity index 78%
rename from BtchapNSE/Btchap-NSE-Common.xcconfig
rename to BtchapNSE/Common.xcconfig
index 38d0e2fb64..70fa0a407a 100644
--- a/BtchapNSE/Btchap-NSE-Common.xcconfig
+++ b/BtchapNSE/Common.xcconfig
@@ -19,4 +19,13 @@
#include "Btchap/SupportingFiles/Btchap-App-Common.xcconfig"
+PRODUCT_NAME = RiotNSE
PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER).nse
+
+INFOPLIST_FILE = RiotNSE/Info.plist
+
+CODE_SIGN_ENTITLEMENTS = RiotNSE/RiotNSE.entitlements
+
+SKIP_INSTALL = YES
+SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/$(PRODUCT_NAME)/SupportingFiles/RiotNSE-Bridging-Header.h
+
diff --git a/BtchapNSE/Info.plist b/BtchapNSE/Info.plist
deleted file mode 100644
index 1584ec5f8d..0000000000
--- a/BtchapNSE/Info.plist
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- $(DEVELOPMENT_LANGUAGE)
- CFBundleDisplayName
- BtchapNSE
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- $(PRODUCT_NAME)
- CFBundlePackageType
- $(PRODUCT_BUNDLE_PACKAGE_TYPE)
- CFBundleShortVersionString
- $(MARKETING_VERSION)
- CFBundleVersion
- $(CURRENT_PROJECT_VERSION)
- NSExtension
-
- NSExtensionPointIdentifier
- com.apple.usernotifications.service
- NSExtensionPrincipalClass
- $(PRODUCT_MODULE_NAME).NotificationService
-
-
-
diff --git a/BtchapNSE/target.yml b/BtchapNSE/target.yml
deleted file mode 100644
index 1d80d6d013..0000000000
--- a/BtchapNSE/target.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-name: BtchapNSE
-
-schemes:
- BtchapNSE:
- analyze:
- config: Debug
- archive:
- config: Release
- build:
- targets:
- BtchapNSE:
- - running
- - testing
- - profiling
- - analyzing
- - archiving
- profile:
- config: Release
- run:
- askForAppToLaunch: true
- config: Debug
- debugEnabled: false
- disableMainThreadChecker: true
- launchAutomaticallySubstyle: 2
- test:
- config: Debug
- disableMainThreadChecker: true
-
-targets:
- BtchapNSE:
- platform: iOS
- type: app-extension
-
- configFiles:
- Debug: Btchap-NSE-Debug.xcconfig
- Release: Btchap-NSE-Release.xcconfig
-
- sources:
- - path: .
- # Riot
- - path: ../Riot/Categories/Bundle.swift
- - path: ../Riot/Categories/Character.swift
- - path: ../Riot/Categories/String.swift
- - path: ../Riot/Categories/UNUserNotificationCenter.swift
- - path: ../Riot/Generated/InfoPlist.swift
- - path: ../Riot/Generated/Vector_Strings.swift
- - path: ../Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift
- - path: ../Riot/Managers/KeyValueStorage/Extensions/Keychain.swift
- - path: ../Riot/Managers/KeyValueStorage/KeychainStore.swift
- - path: ../Riot/Managers/KeyValueStorage/KeyValueStore.swift
- - path: ../Riot/Managers/PushNotification/PushNotificationStore.swift
- - path: ../Riot/Managers/Settings/RiotSettings.swift
- - path: ../Riot/Managers/Widgets/WidgetConstants.h
- - path: ../Riot/Managers/Widgets/WidgetConstants.m
- - path: ../Riot/PropertyWrappers
- - path: ../Riot/Utils/Constants.swift
- - path: ../Riot/Utils/DataProtectionHelper.swift
-
- # Tchap
- - path: ../Btchap/Config/BuildSettings.swift
- - path: ../Tchap/Config/CommonConfiguration.swift
- - path: ../Tchap/Config/Configurable.swift
- - path: ../Tchap/Generated/Strings.swift
- - path: ../Tchap/Generated/Images.swift
diff --git a/BtchapShareExtension/SupportingFiles/Btchap-ShareExtension-Common.xcconfig b/BtchapShareExtension/SupportingFiles/Btchap-ShareExtension-Common.xcconfig
index 39f1d80dac..00f74c5570 100644
--- a/BtchapShareExtension/SupportingFiles/Btchap-ShareExtension-Common.xcconfig
+++ b/BtchapShareExtension/SupportingFiles/Btchap-ShareExtension-Common.xcconfig
@@ -19,4 +19,16 @@
#include "Btchap/SupportingFiles/Btchap-App-Common.xcconfig"
+PRODUCT_NAME = BtchapShareExtension
PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER).shareExtension
+
+INFOPLIST_FILE = BtchapShareExtension/SupportingFiles/Info.plist
+ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
+
+CODE_SIGN_ENTITLEMENTS = BtchapShareExtension/SupportingFiles/BtchapShareExtension.entitlements
+
+APPLICATION_EXTENSION_API_ONLY = YES
+SKIP_INSTALL = YES
+SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/$(PRODUCT_NAME)/SupportingFiles/BtchapShareExtension-Bridging-Header.h
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) IS_SHARE_EXTENSION=1
+LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @executable_path/../../Frameworks
diff --git a/BtchapShareExtension/SupportingFiles/Btchap-ShareExtension-Release.xcconfig b/BtchapShareExtension/SupportingFiles/Btchap-ShareExtension-Release.xcconfig
index e742672d3b..2fa92588f2 100644
--- a/BtchapShareExtension/SupportingFiles/Btchap-ShareExtension-Release.xcconfig
+++ b/BtchapShareExtension/SupportingFiles/Btchap-ShareExtension-Release.xcconfig
@@ -19,3 +19,6 @@
#include "Btchap-ShareExtension-Common.xcconfig"
#include "Pods/Target Support Files/Pods-TchapPods-BtchapShareExtension/Pods-TchapPods-BtchapShareExtension.release.xcconfig"
+
+PROVISIONING_PROFILE = $(SHARE_EXTENSION_PROVISIONING_PROFILE)
+PROVISIONING_PROFILE_SPECIFIER = $(SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER)
diff --git a/BtchapShareExtension/SupportingFiles/BtchapShareExtension-Bridging-Header.h b/BtchapShareExtension/SupportingFiles/BtchapShareExtension-Bridging-Header.h
new file mode 100644
index 0000000000..160bdd9d9c
--- /dev/null
+++ b/BtchapShareExtension/SupportingFiles/BtchapShareExtension-Bridging-Header.h
@@ -0,0 +1,7 @@
+//
+// Use this file to import your target's public headers that you would like to expose to Swift.
+//
+
+#import "DesignValues.h"
+#import "MXRoomSummary+Riot.h"
+#import "Tools.h"
diff --git a/Config/AppIdentifiers.xcconfig b/Config/AppIdentifiers.xcconfig
index 602e72af63..48a2573c93 100644
--- a/Config/AppIdentifiers.xcconfig
+++ b/Config/AppIdentifiers.xcconfig
@@ -19,10 +19,10 @@ DEVELOPMENT_TEAM = NVMQD635C6
// Provisioning profiles
TCHAP_PROVISIONING_PROFILE_SPECIFIER = Tchap App Store
-TCHAP_PROVISIONING_PROFILE = 3e2623b9-0c4b-4fde-aef8-6a67063ceb7e // to verify
+TCHAP_PROVISIONING_PROFILE = a582ec5f-a978-4fa9-934d-ee86c9033810
-NSE_PROVISIONING_PROFILE_SPECIFIER = "Tchap NSE: App Store"
-NSE_PROVISIONING_PROFILE = 3419a4a5-6104-45c8-a5a5-275647c1fdf6 // to verify
+NSE_PROVISIONING_PROFILE_SPECIFIER = Tchap NSE App Store
+NSE_PROVISIONING_PROFILE = 1470f574-9873-42cf-9e7e-864907334457
-SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER = "Tchap Share Extension: App Store"
-SHARE_EXTENSION_PROVISIONING_PROFILE = 6b7e6b2b-5634-440e-8582-4dcce5867dd1 // to verify
+SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER = Tchap Share Extension App Store
+SHARE_EXTENSION_PROVISIONING_PROFILE = b455f0f8-cf06-4b54-a0e7-8cd651840d40
diff --git a/Podfile b/Podfile
index 19dd5944e8..384223b736 100644
--- a/Podfile
+++ b/Podfile
@@ -108,15 +108,7 @@ abstract_target 'TchapPods' do
import_MatrixKit
end
- target "TchapNSE" do
- import_MatrixKit
- end
-
- target "BtchapNSE" do
- import_MatrixKit
- end
-
- target "SiriIntents" do
+ target "RiotNSE" do
import_MatrixKit
end
end
diff --git a/Podfile.lock b/Podfile.lock
index 509c1bfff2..f7f2a72947 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -16,7 +16,7 @@ PODS:
- AFNetworking/NSURLSession
- BlueCryptor (1.0.32)
- BlueECC (1.2.5)
- - BlueRSA (1.0.34)
+ - BlueRSA (1.0.200)
- DGCollectionViewLeftAlignFlowLayout (1.0.4)
- Down (0.11.0)
- DSWaveformImage (6.1.1)
@@ -39,7 +39,7 @@ PODS:
- DTFoundation/Core
- ffmpeg-kit-ios-audio (4.5)
- FLEX (4.5.0)
- - FlowCommoniOS (1.12.0)
+ - FlowCommoniOS (1.12.2)
- GBDeviceInfo (6.6.0):
- GBDeviceInfo/Core (= 6.6.0)
- GBDeviceInfo/Core (6.6.0)
@@ -200,7 +200,7 @@ SPEC CHECKSUMS:
AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
BlueCryptor: b0aee3d9b8f367b49b30de11cda90e1735571c24
BlueECC: 0d18e93347d3ec6d41416de21c1ffa4d4cd3c2cc
- BlueRSA: 6f9776d62d9773502415a7db3bcbb2bbb3f71fc3
+ BlueRSA: dfeef51db96bcc4edec654956c1581adbda4e6a3
DGCollectionViewLeftAlignFlowLayout: a0fa58797373ded039cafba8133e79373d048399
Down: b6ba1bc985c9d2f4e15e3b293d2207766fa12612
DSWaveformImage: 3c718a0cf99291887ee70d1d0c18d80101d3d9ce
@@ -208,7 +208,7 @@ SPEC CHECKSUMS:
DTFoundation: a53f8cda2489208cbc71c648be177f902ee17536
ffmpeg-kit-ios-audio: 8c44d93054e1a9743a7014ec3dd26cd1ad8f2a59
FLEX: e51461dd6f0bfb00643c262acdfea5d5d12c596b
- FlowCommoniOS: e9ecbc97fb9ce5c593fb3da0e1073b65a3902026
+ FlowCommoniOS: ca92071ab526dc89905495a37844fd7e78d1a7f2
GBDeviceInfo: ed0db16230d2fa280e1cbb39a5a7f60f6946aaec
GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3
HPGrowingTextView: 88a716d97fb853bcb08a4a08e4727da17efc9b19
@@ -237,6 +237,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
-PODFILE CHECKSUM: 15c26df2fc46fbdbdcba1e600ee8f47405224142
+PODFILE CHECKSUM: a7f41d7347ac156393b9c8654108ce1be8b2e62f
COCOAPODS: 1.11.2
diff --git a/RiotNSE/BuildSettings.swift b/RiotNSE/BuildSettings.swift
new file mode 100644
index 0000000000..d17a4c643a
--- /dev/null
+++ b/RiotNSE/BuildSettings.swift
@@ -0,0 +1,355 @@
+//
+// Copyright 2020 Vector Creations Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+import Foundation
+
+import MatrixKit
+
+/// BuildSettings provides settings computed at build time.
+/// In future, it may be automatically generated from xcconfig files
+@objcMembers
+final class BuildSettings: NSObject {
+
+ // MARK: - Bundle Settings
+ static var bundleDisplayName: String {
+ guard let bundleDisplayName = Bundle.app.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String else {
+ fatalError("CFBundleDisplayName should be defined")
+ }
+ return bundleDisplayName
+ }
+
+ static var applicationGroupIdentifier: String {
+ guard let applicationGroupIdentifier = Bundle.app.object(forInfoDictionaryKey: "applicationGroupIdentifier") as? String else {
+ fatalError("applicationGroupIdentifier should be defined")
+ }
+ return applicationGroupIdentifier
+ }
+
+ static var baseBundleIdentifier: String {
+ guard let baseBundleIdentifier = Bundle.app.object(forInfoDictionaryKey: "baseBundleIdentifier") as? String else {
+ fatalError("baseBundleIdentifier should be defined")
+ }
+ return baseBundleIdentifier
+ }
+
+ static var keychainAccessGroup: String {
+ guard let keychainAccessGroup = Bundle.app.object(forInfoDictionaryKey: "keychainAccessGroup") as? String else {
+ fatalError("keychainAccessGroup should be defined")
+ }
+ return keychainAccessGroup
+ }
+
+ static var applicationURLScheme: String? {
+ guard let urlTypes = Bundle.app.object(forInfoDictionaryKey: "CFBundleURLTypes") as? [AnyObject],
+ let urlTypeDictionary = urlTypes.first as? [String: AnyObject],
+ let urlSchemes = urlTypeDictionary["CFBundleURLSchemes"] as? [AnyObject],
+ let externalURLScheme = urlSchemes.first as? String else {
+ return nil
+ }
+
+ return externalURLScheme
+ }
+
+ static var pushKitAppIdProd: String {
+ return baseBundleIdentifier + ".ios.voip.prod"
+ }
+
+ static var pushKitAppIdDev: String {
+ return baseBundleIdentifier + ".ios.voip.dev"
+ }
+
+ static var pusherAppIdProd: String {
+ return baseBundleIdentifier + ".ios.prod"
+ }
+
+ static var pusherAppIdDev: String {
+ return baseBundleIdentifier + ".ios.dev"
+ }
+
+ static var pushKitAppId: String {
+ #if DEBUG
+ return pushKitAppIdDev
+ #else
+ return pushKitAppIdProd
+ #endif
+ }
+
+ static var pusherAppId: String {
+ #if DEBUG
+ return pusherAppIdDev
+ #else
+ return pusherAppIdProd
+ #endif
+ }
+
+ // Tchap servers
+ static let serverUrlPrefix = "https://matrix."
+ static let preferredIdentityServerNames = [
+ "agent.externe.tchap.gouv.fr",
+ "agent.collectivites.tchap.gouv.fr",
+ "agent.tchap.gouv.fr",
+ "agent.elysee.tchap.gouv.fr",
+ "agent.pm.tchap.gouv.fr",
+ "agent.ssi.tchap.gouv.fr",
+ "agent.finances.tchap.gouv.fr",
+ "agent.social.tchap.gouv.fr",
+ "agent.interieur.tchap.gouv.fr",
+ "agent.agriculture.tchap.gouv.fr",
+ "agent.justice.tchap.gouv.fr",
+ "agent.diplomatie.tchap.gouv.fr",
+ "agent.intradef.tchap.gouv.fr",
+ "agent.dinum.tchap.gouv.fr",
+ "agent.culture.tchap.gouv.fr",
+ "agent.dev-durable.tchap.gouv.fr",
+ "agent.education.tchap.gouv.fr"
+ ]
+ static let otherIdentityServerNames: [String] = []
+
+ // Tchap-Web instance for the app
+ static let applicationWebAppUrlString = "https://www.tchap.gouv.fr"
+
+
+ // MARK: - Server configuration
+
+ // TODO: replace m.org with https://sygnal.tchap.gouv.fr
+ static let serverConfigSygnalAPIUrlString = "https://matrix.org/_matrix/push/v1/notify"
+
+
+ // MARK: - Legal URLs
+ static let applicationTermsConditionsUrlString = "https://www.tchap.gouv.fr/tac.html"
+ static let clientConfigURL = "https://www.tchap.gouv.fr/client/config/agent/ios"
+
+
+ // MARk: - Matrix permalinks
+ static let permalinkSupportedHosts: [String] = [
+ "tchap.gouv.fr",
+ "www.tchap.gouv.fr"
+ ]
+ static let permalinkPrefix = "https://tchap.gouv.fr"
+
+
+ // MARK: - VoIP
+ static var allowVoIPUsage: Bool {
+ #if canImport(JitsiMeet)
+ return true
+ #else
+ return false
+ #endif
+ }
+ static let stunServerFallbackUrlString: String? = nil
+
+
+ // MARK: - Public rooms Directory
+ // List of homeservers for the public rooms directory
+ static let publicRoomsDirectoryServers = [
+ "agent.collectivites.tchap.gouv.fr",
+ "agent.tchap.gouv.fr",
+ "agent.elysee.tchap.gouv.fr",
+ "agent.pm.tchap.gouv.fr",
+ "agent.ssi.tchap.gouv.fr",
+ "agent.finances.tchap.gouv.fr",
+ "agent.social.tchap.gouv.fr",
+ "agent.interieur.tchap.gouv.fr",
+ "agent.agriculture.tchap.gouv.fr",
+ "agent.justice.tchap.gouv.fr",
+ "agent.diplomatie.tchap.gouv.fr",
+ "agent.intradef.tchap.gouv.fr",
+ "agent.dinum.tchap.gouv.fr",
+ "agent.culture.tchap.gouv.fr",
+ "agent.dev-durable.tchap.gouv.fr",
+ "agent.education.tchap.gouv.fr"
+ ]
+
+ // MARK: - Rooms Screen
+ static let roomsAllowToJoinPublicRooms: Bool = true
+
+ // MARK: - Analytics
+ static let analyticsServerUrl: URL? = URL(string: "")
+ static let analyticsAppId: String? = nil
+
+
+ // MARK: - Bug report
+ static let bugReportDefaultHost = "agent.tchap.gouv.fr"
+ static let bugReportEndpointUrlSuffix = "/bugreports"
+ // Use the name allocated by the bug report server
+ static let bugReportApplicationId = "tchap-ios"
+
+
+ // MARK: - Integrations
+ static let integrationsUiUrlString = "https://scalar.vector.im/"
+ static let integrationsRestApiUrlString = "https://scalar.vector.im/api"
+ // Widgets in those paths require a scalar token
+ static let integrationsScalarWidgetsPaths = [
+ "https://scalar.vector.im/_matrix/integrations/v1",
+ "https://scalar.vector.im/api",
+ "https://scalar-staging.vector.im/_matrix/integrations/v1",
+ "https://scalar-staging.vector.im/api",
+ "https://scalar-staging.riot.im/scalar/api"
+ ]
+ // Jitsi server used outside integrations to create conference calls from the call button in the timeline
+ static let jitsiServerUrl: URL = URL(string: "https://jitsi.riot.im")!
+
+
+ // MARK: - Features
+
+ /// Setting to force protection by pin code
+ static let forcePinProtection: Bool = false
+
+ /// Max allowed time to continue using the app without prompting PIN
+ static let pinCodeGraceTimeInSeconds: TimeInterval = 0
+
+ /// Force non-jailbroken app usage
+ static let forceNonJailbrokenUsage: Bool = true
+
+ static let allowSendingStickers: Bool = false
+
+ static let allowLocalContactsAccess: Bool = true
+
+ static let allowInviteExernalUsers: Bool = true
+
+ static let enableSideMenu: Bool = true
+
+ /// Whether to read the `io.element.functional_members` state event and exclude any service members when computing a room's name and avatar.
+ static let supportFunctionalMembers: Bool = true
+
+ // MARK: - Feature Specifics
+
+ /// Not allowed pin codes. User won't be able to select one of the pin in the list.
+ static let notAllowedPINs: [String] = []
+
+ /// Maximum number of allowed pin failures when unlocking, before force logging out the user. Defaults to `3`
+ static let maxAllowedNumberOfPinFailures: Int = 3
+
+ /// Maximum number of allowed biometrics failures when unlocking, before fallbacking the user to the pin if set or logging out the user. Defaults to `5`
+ static let maxAllowedNumberOfBiometricsFailures: Int = 5
+
+ /// Indicates should the app log out the user when number of PIN failures reaches `maxAllowedNumberOfPinFailures`. Defaults to `false`
+ static let logOutUserWhenPINFailuresExceeded: Bool = false
+
+ /// Indicates should the app log out the user when number of biometrics failures reaches `maxAllowedNumberOfBiometricsFailures`. Defaults to `false`
+ static let logOutUserWhenBiometricsFailuresExceeded: Bool = false
+
+ static let showNotificationsV2: Bool = false
+
+ // MARK: - Main Tabs
+
+ static let homeScreenShowFavouritesTab: Bool = true
+ static let homeScreenShowPeopleTab: Bool = true
+ static let homeScreenShowRoomsTab: Bool = true
+ static let homeScreenShowCommunitiesTab: Bool = true
+
+ // MARK: - General Settings Screen
+
+ static let settingsScreenShowUserFirstName: Bool = false
+ static let settingsScreenShowUserSurname: Bool = false
+ static let settingsScreenAllowAddingEmailThreepids: Bool = true
+ static let settingsScreenAllowAddingPhoneThreepids: Bool = true
+ static let settingsScreenShowThreepidExplanatory: Bool = true
+ static let settingsScreenShowDiscoverySettings: Bool = true
+ static let settingsScreenAllowIdentityServerConfig: Bool = true
+ static let settingsScreenShowAdvancedSettings: Bool = true
+ static let settingsScreenShowLabSettings: Bool = true
+ static let settingsScreenAllowChangingRageshakeSettings: Bool = true
+ static let settingsScreenAllowChangingCrashUsageDataSettings: Bool = true
+ static let settingsScreenAllowBugReportingManually: Bool = true
+ static let settingsScreenAllowDeactivatingAccount: Bool = true
+ static let settingsScreenShowChangePassword: Bool = true
+ static let settingsScreenShowInviteFriends: Bool = true
+ static let settingsScreenShowEnableStunServerFallback: Bool = true
+ static let settingsScreenShowNotificationDecodedContentOption: Bool = true
+ static let settingsScreenShowNsfwRoomsOption: Bool = true
+ static let settingsSecurityScreenShowSessions: Bool = true
+ static let settingsSecurityScreenShowSetupBackup: Bool = true
+ static let settingsSecurityScreenShowRestoreBackup: Bool = true
+ static let settingsSecurityScreenShowDeleteBackup: Bool = true
+ static let settingsSecurityScreenShowCryptographyInfo: Bool = true
+ static let settingsSecurityScreenShowCryptographyExport: Bool = true
+ static let settingsSecurityScreenShowAdvancedUnverifiedDevices: Bool = true
+
+ // MARK: - Timeline settings
+ static let roomInputToolbarCompressionMode = MXKRoomInputToolbarCompressionModePrompt
+
+ // MARK: - Room Creation Screen
+
+ static let roomCreationScreenAllowEncryptionConfiguration: Bool = true
+ static let roomCreationScreenRoomIsEncrypted: Bool = true
+ static let roomCreationScreenAllowRoomTypeConfiguration: Bool = true
+ static let roomCreationScreenRoomIsPublic: Bool = false
+
+ // MARK: - Room Screen
+
+ static let roomScreenAllowVoIPForDirectRoom: Bool = true
+ static let roomScreenAllowVoIPForNonDirectRoom: Bool = true
+ static let roomScreenAllowCameraAction: Bool = true
+ static let roomScreenAllowMediaLibraryAction: Bool = true
+ static let roomScreenAllowStickerAction: Bool = true
+ static let roomScreenAllowFilesAction: Bool = true
+
+ // MARK: - Room Contextual Menu
+
+ static let roomContextualMenuShowMoreOptionForMessages: Bool = true
+ static let roomContextualMenuShowMoreOptionForStates: Bool = true
+ static let roomContextualMenuShowReportContentOption: Bool = true
+
+ // MARK: - Room Info Screen
+
+ static let roomInfoScreenShowIntegrations: Bool = true
+
+ // MARK: - Room Settings Screen
+
+ static let roomSettingsScreenShowLowPriorityOption: Bool = true
+ static let roomSettingsScreenShowDirectChatOption: Bool = true
+ static let roomSettingsScreenAllowChangingAccessSettings: Bool = true
+ static let roomSettingsScreenAllowChangingHistorySettings: Bool = true
+ static let roomSettingsScreenShowAddressSettings: Bool = true
+ static let roomSettingsScreenShowFlairSettings: Bool = true
+ static let roomSettingsScreenShowAdvancedSettings: Bool = true
+ static let roomSettingsScreenAdvancedShowEncryptToVerifiedOption: Bool = true
+ static let roomSettingsScreenShowNotificationsV2: Bool = false
+
+ // MARK: - Room Member Screen
+
+ static let roomMemberScreenShowIgnore: Bool = true
+
+ // MARK: - Message
+ static let messageDetailsAllowShare: Bool = true
+ static let messageDetailsAllowPermalink: Bool = true
+ static let messageDetailsAllowViewSource: Bool = false
+ static let messageDetailsAllowSave: Bool = true
+ static let messageDetailsAllowCopyMedia: Bool = true
+ static let messageDetailsAllowPasteMedia: Bool = true
+
+ // MARK: - Notifications
+ static let decryptNotificationsByDefault: Bool = true
+
+ // MARK: - HTTP
+ /// Additional HTTP headers will be sent by all requests. Not recommended to use request-specific headers, like `Authorization`.
+ /// Empty dictionary by default.
+ static let httpAdditionalHeaders: [String: String] = [:]
+
+
+ // MARK: - Authentication Screen
+ static let authScreenShowRegister = true
+ static let authScreenShowPhoneNumber = true
+ static let authScreenShowForgotPassword = true
+ static let authScreenShowCustomServerOptions = true
+
+ // MARK: - Unified Search
+ static let unifiedSearchScreenShowPublicDirectory = true
+
+ // MARK: - Secrets Recovery
+ static let secretsRecoveryAllowReset = true
+}
diff --git a/RiotNSE/Common.xcconfig b/RiotNSE/Common.xcconfig
index 336f44d1ab..5fb618d128 100644
--- a/RiotNSE/Common.xcconfig
+++ b/RiotNSE/Common.xcconfig
@@ -17,7 +17,7 @@
// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974
-#include "Config/AppIdentifiers.xcconfig"
+#include "Tchap/SupportingFiles/App-Common.xcconfig"
PRODUCT_NAME = RiotNSE
PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER).nse
@@ -28,4 +28,4 @@ CODE_SIGN_ENTITLEMENTS = RiotNSE/RiotNSE.entitlements
SKIP_INSTALL = YES
SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/$(PRODUCT_NAME)/SupportingFiles/RiotNSE-Bridging-Header.h
-SWIFT_OBJC_INTERFACE_HEADER_NAME = GeneratedInterface-Swift.h
+
diff --git a/RiotNSE/Debug.xcconfig b/RiotNSE/Debug.xcconfig
index 14c7cfc668..a968c45de1 100644
--- a/RiotNSE/Debug.xcconfig
+++ b/RiotNSE/Debug.xcconfig
@@ -18,4 +18,4 @@
// https://help.apple.com/xcode/#/dev745c5c974
#include "Common.xcconfig"
-#include "Pods/Target Support Files/Pods-RiotPods-RiotNSE/Pods-RiotPods-RiotNSE.debug.xcconfig"
+#include "Pods/Target Support Files/Pods-TchapPods-RiotNSE/Pods-TchapPods-RiotNSE.debug.xcconfig"
diff --git a/TchapNSE/NotificationService.swift b/RiotNSE/NotificationService.swift
similarity index 100%
rename from TchapNSE/NotificationService.swift
rename to RiotNSE/NotificationService.swift
diff --git a/RiotNSE/Release.xcconfig b/RiotNSE/Release.xcconfig
index c91ad51e1c..36b8402025 100644
--- a/RiotNSE/Release.xcconfig
+++ b/RiotNSE/Release.xcconfig
@@ -18,7 +18,7 @@
// https://help.apple.com/xcode/#/dev745c5c974
#include "Common.xcconfig"
-#include "Pods/Target Support Files/Pods-RiotPods-RiotNSE/Pods-RiotPods-RiotNSE.release.xcconfig"
+#include "Pods/Target Support Files/Pods-TchapPods-RiotNSE/Pods-TchapPods-RiotNSE.release.xcconfig"
PROVISIONING_PROFILE = $(NSE_PROVISIONING_PROFILE)
PROVISIONING_PROFILE_SPECIFIER = $(NSE_PROVISIONING_PROFILE_SPECIFIER)
diff --git a/RiotNSE/target.yml b/RiotNSE/target.yml
index 516f050f25..5bbaf43091 100644
--- a/RiotNSE/target.yml
+++ b/RiotNSE/target.yml
@@ -37,27 +37,29 @@ targets:
sources:
- path: .
- - path: ../Config/BuildSettings.swift
- - path: ../Config/CommonConfiguration.swift
- - path: ../Config/Configurable.swift
- path: ../Riot/Categories/Bundle.swift
- path: ../Riot/Categories/Character.swift
- path: ../Riot/Categories/String.swift
- path: ../Riot/Categories/UNUserNotificationCenter.swift
- - path: ../Riot/Generated/Images.swift
- path: ../Riot/Generated/InfoPlist.swift
+ - path: ../Riot/Generated/Vector_Strings.swift
- path: ../Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift
- path: ../Riot/Managers/KeyValueStorage/Extensions/Keychain.swift
- path: ../Riot/Managers/KeyValueStorage/KeychainStore.swift
- path: ../Riot/Managers/KeyValueStorage/KeyValueStore.swift
- - path: ../Riot/Managers/LocalAuthentication/LocalAuthenticationService.swift
- path: ../Riot/Managers/Locale/LocaleProvider.swift
- path: ../Riot/Managers/Locale/LocaleProviderType.swift
- path: ../Riot/Managers/PushNotification/PushNotificationStore.swift
- - path: ../Riot/Modules/SetPinCode/PinCodePreferences.swift
- path: ../Riot/Modules/SetPinCode/SetupBiometrics/BiometricsAuthenticationPresenter.swift
- path: ../Riot/Managers/Settings/RiotSettings.swift
- path: ../Riot/Managers/Widgets/WidgetConstants.m
- path: ../Riot/PropertyWrappers/UserDefaultsBackedPropertyWrapper.swift
- path: ../Riot/Utils/Constants.swift
- path: ../Riot/Utils/DataProtectionHelper.swift
+
+ # Tchap
+ - path: ../RiotNSE/BuildSettings.swift
+ - path: ../Tchap/Config/CommonConfiguration.swift
+ - path: ../Tchap/Config/Configurable.swift
+ - path: ../Tchap/Generated/Strings.swift
+ - path: ../Tchap/Generated/Images.swift
diff --git a/TchapNSE/SupportingFiles/TchapNSE-Bridging-Header.h b/Tchap/Config/AppIdentifiers.xcconfig
similarity index 52%
rename from TchapNSE/SupportingFiles/TchapNSE-Bridging-Header.h
rename to Tchap/Config/AppIdentifiers.xcconfig
index 698e40c1c9..48a2573c93 100644
--- a/TchapNSE/SupportingFiles/TchapNSE-Bridging-Header.h
+++ b/Tchap/Config/AppIdentifiers.xcconfig
@@ -1,5 +1,5 @@
//
-// Copyright 2021 New Vector Ltd
+// Copyright 2021 Vector Creations Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,9 +14,15 @@
// limitations under the License.
//
-#ifndef TchapNSE_Bridging_Header_h
-#define TchapNSE_Bridging_Header_h
+// Team
+DEVELOPMENT_TEAM = NVMQD635C6
-#import "WidgetConstants.h"
+// Provisioning profiles
+TCHAP_PROVISIONING_PROFILE_SPECIFIER = Tchap App Store
+TCHAP_PROVISIONING_PROFILE = a582ec5f-a978-4fa9-934d-ee86c9033810
-#endif /* TchapNSE_Bridging_Header_h */
+NSE_PROVISIONING_PROFILE_SPECIFIER = Tchap NSE App Store
+NSE_PROVISIONING_PROFILE = 1470f574-9873-42cf-9e7e-864907334457
+
+SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER = Tchap Share Extension App Store
+SHARE_EXTENSION_PROVISIONING_PROFILE = b455f0f8-cf06-4b54-a0e7-8cd651840d40
diff --git a/Tchap/SupportingFiles/App-Common.xcconfig b/Tchap/SupportingFiles/App-Common.xcconfig
index d86553b608..61a5d51db5 100644
--- a/Tchap/SupportingFiles/App-Common.xcconfig
+++ b/Tchap/SupportingFiles/App-Common.xcconfig
@@ -32,6 +32,3 @@ CODE_SIGN_ENTITLEMENTS = Tchap/SupportingFiles/Tchap.entitlements
SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/$(PRODUCT_NAME)/SupportingFiles/Tchap-Bridging-Header.h
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
-
-CODE_SIGN_STYLE = Automatic
-DEVELOPMENT_TEAM = NVMQD635C6
diff --git a/Tchap/SupportingFiles/App-Release.xcconfig b/Tchap/SupportingFiles/App-Release.xcconfig
index 186e0b4721..4933fb4a0f 100644
--- a/Tchap/SupportingFiles/App-Release.xcconfig
+++ b/Tchap/SupportingFiles/App-Release.xcconfig
@@ -19,3 +19,7 @@
#include "App-Common.xcconfig"
#include "Pods/Target Support Files/Pods-TchapPods-Tchap/Pods-TchapPods-Tchap.release.xcconfig"
+
+PROVISIONING_PROFILE = $(TCHAP_PROVISIONING_PROFILE)
+PROVISIONING_PROFILE_SPECIFIER = $(TCHAP_PROVISIONING_PROFILE_SPECIFIER)
+
diff --git a/Tchap/target.yml b/Tchap/target.yml
index a7ce0d1acd..a04cc3f612 100644
--- a/Tchap/target.yml
+++ b/Tchap/target.yml
@@ -32,8 +32,7 @@ targets:
dependencies:
- target: TchapShareExtension
- - target: SiriIntents
- - target: TchapNSE
+ - target: RiotNSE
- target: DesignKit
configFiles:
@@ -41,6 +40,10 @@ targets:
Release: SupportingFiles/App-Release.xcconfig
preBuildScripts:
+ - name: 🛠 Environment
+ runOnlyWhenInstalling: false
+ shell: /bin/sh
+ script: "\"Tools/installfiles.sh\"\n"
- name: ⚠️ SwiftLint
runOnlyWhenInstalling: false
shell: /bin/sh
@@ -59,6 +62,7 @@ targets:
- path: ../Tchap/Config
- path: ../Config/Project.xcconfig
- path: ../Config/Project-Warnings.xcconfig
+ - path: ../Config/AppIdentifiers.xcconfig
- path: .
excludes:
- "Tools"
diff --git a/TchapNSE/NSE-Common.xcconfig b/TchapNSE/Common.xcconfig
similarity index 85%
rename from TchapNSE/NSE-Common.xcconfig
rename to TchapNSE/Common.xcconfig
index e36192250e..5fb618d128 100644
--- a/TchapNSE/NSE-Common.xcconfig
+++ b/TchapNSE/Common.xcconfig
@@ -19,12 +19,13 @@
#include "Tchap/SupportingFiles/App-Common.xcconfig"
-PRODUCT_NAME = TchapNSE
+PRODUCT_NAME = RiotNSE
PRODUCT_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER).nse
-INFOPLIST_FILE = TchapNSE/Info.plist
+INFOPLIST_FILE = RiotNSE/Info.plist
-CODE_SIGN_ENTITLEMENTS = TchapNSE/TchapNSE.entitlements
+CODE_SIGN_ENTITLEMENTS = RiotNSE/RiotNSE.entitlements
SKIP_INSTALL = YES
-SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/$(PRODUCT_NAME)/SupportingFiles/TchapNSE-Bridging-Header.h
+SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/$(PRODUCT_NAME)/SupportingFiles/RiotNSE-Bridging-Header.h
+
diff --git a/TchapNSE/Info.plist b/TchapNSE/Info.plist
deleted file mode 100644
index 8001ee86cf..0000000000
--- a/TchapNSE/Info.plist
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- fr
- CFBundleDisplayName
- TchapNSE
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- $(PRODUCT_NAME)
- CFBundlePackageType
- $(PRODUCT_BUNDLE_PACKAGE_TYPE)
- CFBundleShortVersionString
- $(MARKETING_VERSION)
- CFBundleVersion
- $(CURRENT_PROJECT_VERSION)
- NSExtension
-
- NSExtensionPointIdentifier
- com.apple.usernotifications.service
- NSExtensionPrincipalClass
- $(PRODUCT_MODULE_NAME).NotificationService
-
-
-
diff --git a/TchapNSE/NSE-Debug.xcconfig b/TchapNSE/NSE-Debug.xcconfig
deleted file mode 100644
index 9085cd1917..0000000000
--- a/TchapNSE/NSE-Debug.xcconfig
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Copyright 2020 Vector Creations Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// Configuration settings file format documentation can be found at:
-// https://help.apple.com/xcode/#/dev745c5c974
-
-#include "NSE-Common.xcconfig"
-#include "Pods/Target Support Files/Pods-TchapPods-TchapNSE/Pods-TchapPods-TchapNSE.debug.xcconfig"
diff --git a/TchapNSE/NSE-Release.xcconfig b/TchapNSE/NSE-Release.xcconfig
deleted file mode 100644
index 4d57766a20..0000000000
--- a/TchapNSE/NSE-Release.xcconfig
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Copyright 2020 Vector Creations Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// Configuration settings file format documentation can be found at:
-// https://help.apple.com/xcode/#/dev745c5c974
-
-#include "NSE-Common.xcconfig"
-#include "Pods/Target Support Files/Pods-TchapPods-TchapNSE/Pods-TchapPods-TchapNSE.release.xcconfig"
diff --git a/TchapNSE/NSEMemoryStore.swift b/TchapNSE/NSEMemoryStore.swift
deleted file mode 100644
index a45864db29..0000000000
--- a/TchapNSE/NSEMemoryStore.swift
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- Copyright 2020 New Vector Ltd
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-import Foundation
-import MatrixSDK
-
-// error domain
-let NSEMemoryStoreErrorDomain: String = "NSEMemoryStoreErrorDomain"
-
-// error codes
-enum NSEMemoryStoreErrorCode: Int {
- case userIDMissing = 1001 // User ID is missing in credentials
-}
-
-/// Fake memory store implementation. Uses some real values from an MXFileStore instance.
-class NSEMemoryStore: MXMemoryStore {
-
- // In-memory value for eventStreamToken. Will be used as eventStreamToken if provided.
- private var lastStoredEventStreamToken: String?
- private var credentials: MXCredentials
- // real store
- private var fileStore: MXFileStore!
- private var myUser: MXUser?
-
- init(withCredentials credentials: MXCredentials) {
- self.credentials = credentials
- if fileStore == nil {
- fileStore = MXFileStore(credentials: credentials)
- // load real eventStreamToken
- fileStore.loadMetaData()
- }
- }
-
- override func open(with credentials: MXCredentials, onComplete: (() -> Void)?, failure: ((Error?) -> Void)? = nil) {
- super.open(with: credentials, onComplete: {
- guard let userId = credentials.userId else {
- failure?(NSError(domain: NSEMemoryStoreErrorDomain,
- code: NSEMemoryStoreErrorCode.userIDMissing.rawValue,
- userInfo: nil))
- return
- }
- // load session user before calling onComplete
- self.fileStore.asyncUsers(withUserIds: [userId], success: { (users) in
- if let user = users.first {
- self.myUser = user
- }
- onComplete?()
- }, failure: failure)
- }, failure: failure)
- }
-
- // Return real eventStreamToken, to be able to launch a meaningful background sync
- override var eventStreamToken: String? {
- get {
- // if more up-to-date token exists, use it
- if let token = lastStoredEventStreamToken {
- return token
- }
- return fileStore.eventStreamToken
- } set {
- // store new token values in memory, and return these values in future reads
- lastStoredEventStreamToken = newValue
- }
- }
-
- // Return real userAccountData, to be able to use push rules
- override var userAccountData: [AnyHashable : Any]? {
- get {
- return fileStore.userAccountData
- } set {
- // no-op
- }
- }
-
- // This store should act like as a permanent one
- override var isPermanent: Bool {
- return true
- }
-
- // Some mandatory methods to implement to be permanent
- override func storeState(forRoom roomId: String, stateEvents: [MXEvent]) {
- // no-op
- }
-
- // Fetch real room state
- override func state(ofRoom roomId: String, success: @escaping ([MXEvent]) -> Void, failure: ((Error) -> Void)? = nil) {
- fileStore.state(ofRoom: roomId, success: success, failure: failure)
- }
-
- // Fetch real soom summary
- override func summary(ofRoom roomId: String) -> MXRoomSummary? {
- return fileStore.summary(ofRoom: roomId)
- }
-
- // Fetch real room account data
- override func accountData(ofRoom roomId: String) -> MXRoomAccountData? {
- return fileStore.accountData(ofRoom: roomId)
- }
-
- // Override and return a user to be stored on session.myUser
- override func user(withUserId userId: String) -> MXUser? {
- if userId == credentials.userId, let myUser = myUser {
- // if asking for session user and myUser is set, return that
- return myUser
- }
- return MXUser(userId: userId)
- }
-
- override var syncFilterId: String? {
- get {
- let filter = MXFilterJSONModel()
- filter.room = MXRoomFilter()
- filter.room.rooms = []
- return filter.jsonString()
- } set {
- // no-op
- }
- }
-
-}
diff --git a/TchapNSE/TchapNSE.entitlements b/TchapNSE/TchapNSE.entitlements
deleted file mode 100644
index ced577af8e..0000000000
--- a/TchapNSE/TchapNSE.entitlements
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- com.apple.security.application-groups
-
- $(APPLICATION_GROUP_IDENTIFIER)
-
- keychain-access-groups
-
- $(KEYCHAIN_ACCESS_GROUP)
-
-
-
diff --git a/TchapNSE/target.yml b/TchapNSE/target.yml
deleted file mode 100644
index 7c760d93a8..0000000000
--- a/TchapNSE/target.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-name: TchapNSE
-
-schemes:
- TchapNSE:
- analyze:
- config: Debug
- archive:
- config: Release
- build:
- targets:
- TchapNSE:
- - running
- - testing
- - profiling
- - analyzing
- - archiving
- profile:
- config: Release
- run:
- askForAppToLaunch: true
- config: Debug
- debugEnabled: false
- disableMainThreadChecker: true
- launchAutomaticallySubstyle: 2
- test:
- config: Debug
- disableMainThreadChecker: true
-
-targets:
- TchapNSE:
- platform: iOS
- type: app-extension
-
- configFiles:
- Debug: NSE-Debug.xcconfig
- Release: NSE-Release.xcconfig
-
- sources:
- - path: .
-
- # Riot
- - path: ../Riot/Categories/Bundle.swift
- - path: ../Riot/Categories/Character.swift
- - path: ../Riot/Categories/String.swift
- - path: ../Riot/Categories/UNUserNotificationCenter.swift
- - path: ../Riot/Generated/InfoPlist.swift
- - path: ../Riot/Generated/Vector_Strings.swift
- - path: ../Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift
- - path: ../Riot/Managers/KeyValueStorage/Extensions/Keychain.swift
- - path: ../Riot/Managers/KeyValueStorage/KeychainStore.swift
- - path: ../Riot/Managers/KeyValueStorage/KeyValueStore.swift
- - path: ../Riot/Managers/PushNotification/PushNotificationStore.swift
- - path: ../Riot/Managers/Settings/RiotSettings.swift
- - path: ../Riot/Managers/Widgets/WidgetConstants.h
- - path: ../Riot/Managers/Widgets/WidgetConstants.m
- - path: ../Riot/PropertyWrappers
- - path: ../Riot/Utils/Constants.swift
- - path: ../Riot/Utils/DataProtectionHelper.swift
-
- # Tchap
- - path: ../Tchap/Config/BuildSettings.swift
- - path: ../Tchap/Config/CommonConfiguration.swift
- - path: ../Tchap/Config/Configurable.swift
- - path: ../Tchap/Generated/Strings.swift
- - path: ../Tchap/Generated/Images.swift
diff --git a/TchapShareExtension/SupportingFiles/ShareExtension-Release.xcconfig b/TchapShareExtension/SupportingFiles/ShareExtension-Release.xcconfig
index a51800ca84..d590b16a15 100644
--- a/TchapShareExtension/SupportingFiles/ShareExtension-Release.xcconfig
+++ b/TchapShareExtension/SupportingFiles/ShareExtension-Release.xcconfig
@@ -19,3 +19,6 @@
#include "ShareExtension-Common.xcconfig"
#include "Pods/Target Support Files/Pods-TchapPods-TchapShareExtension/Pods-TchapPods-TchapShareExtension.release.xcconfig"
+
+PROVISIONING_PROFILE = $(SHARE_EXTENSION_PROVISIONING_PROFILE)
+PROVISIONING_PROFILE_SPECIFIER = $(SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER)
diff --git a/Tools/XcodeGen/postGenCommand.sh b/Tools/XcodeGen/postGenCommand.sh
index 5204ee09ed..0130e63948 100644
--- a/Tools/XcodeGen/postGenCommand.sh
+++ b/Tools/XcodeGen/postGenCommand.sh
@@ -4,3 +4,5 @@
# Move file header template in project shared data folder
cp IDETemplateMacros.plist Tchap.xcodeproj/xcshareddata/
+
+arch -x86_64 pod install
diff --git a/Tools/installfiles.sh b/Tools/installfiles.sh
new file mode 100755
index 0000000000..926c46b171
--- /dev/null
+++ b/Tools/installfiles.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+installFile() {
+ echo "installfiles - Copying $2/$1 to $3/$1"
+ cp ../$2/$1 "../$3/$1"
+}
+
+cd $(dirname $0)
+echo "installfiles for : $PRODUCT_MODULE_NAME"
+
+echo "install NSE target files"
+installFile "Common.xcconfig" $PRODUCT_MODULE_NAME"NSE" "RiotNSE"
+installFile "BuildSettings.swift" $PRODUCT_MODULE_NAME"/Config" "RiotNSE"
+installFile "AppIdentifiers.xcconfig" $PRODUCT_MODULE_NAME"/Config" "/Config"
+
+cd -
diff --git a/project.yml b/project.yml
index 60cde14caa..b7481401fe 100644
--- a/project.yml
+++ b/project.yml
@@ -34,10 +34,8 @@ options:
include:
- path: Tchap/target.yml
- path: TchapShareExtension/target.yml
- - path: TchapNSE/target.yml
+ - path: RiotNSE/target.yml
- path: TchapTests/target.yml
- - path: SiriIntents/target.yml
- path: Btchap/target.yml
- path: BtchapShareExtension/target.yml
- - path: BtchapNSE/target.yml
- path: DesignKit/target.yml