Reorganize project with SwiftPM

- Drop CocoaPods completely
- Make PassepartoutCore a Swift package
- Enable Bitcode to fix OpenSSL linkage (iOS)
- Update CI scripts without CocoaPods
This commit is contained in:
Davide De Rosa 2021-10-27 18:47:08 +02:00
parent 996b2fbcf7
commit ae1aa1a268
163 changed files with 757 additions and 2247 deletions

View File

@ -45,14 +45,6 @@ jobs:
uses: maxim-lobanov/setup-xcode@v1 uses: maxim-lobanov/setup-xcode@v1
with: with:
xcode-version: latest-stable xcode-version: latest-stable
- name: Cache CocoaPods
uses: actions/cache@v2
with:
path: |
Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Prepare for fastlane match - name: Prepare for fastlane match
run: | run: |
scripts/ci/recognize-match-hostname.sh scripts/ci/recognize-match-hostname.sh
@ -101,12 +93,12 @@ jobs:
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
bundler-cache: true bundler-cache: true
- name: Submit to TestFlight (macOS) - name: Publish on TestFlight (macOS)
run: | run: |
export PILOT_APP_VERSION=`ci/version-number.sh mac` export PILOT_APP_VERSION=`ci/version-number.sh mac`
export PILOT_BUILD_NUMBER=`ci/build-number.sh mac` export PILOT_BUILD_NUMBER=`ci/build-number.sh mac`
bundle exec fastlane --env mac,beta store_beta bundle exec fastlane --env mac,beta store_beta
- name: Submit to TestFlight (iOS) - name: Publish on TestFlight (iOS)
run: | run: |
export PILOT_APP_VERSION=`ci/version-number.sh ios` export PILOT_APP_VERSION=`ci/version-number.sh ios`
export PILOT_BUILD_NUMBER=`ci/build-number.sh ios` export PILOT_BUILD_NUMBER=`ci/build-number.sh ios`

2
.gitignore vendored
View File

@ -22,3 +22,5 @@ default.profraw
asc-key.json asc-key.json
.bundle .bundle
vendor/ vendor/
.build
.swiftpm

6
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "Submodules/API"]
path = Submodules/API
url = https://github.com/passepartoutvpn/api
[submodule "Submodules/fastlane-ci-templates"] [submodule "Submodules/fastlane-ci-templates"]
path = Submodules/fastlane-ci-templates path = Submodules/fastlane-ci-templates
url = https://github.com/keeshux/fastlane-ci-templates url = https://github.com/keeshux/fastlane-ci-templates
[submodule "PassepartoutCore/Sources/PassepartoutCore/API"]
path = PassepartoutCore/Sources/PassepartoutCore/API
url = https://github.com/passepartoutvpn/api

View File

@ -1,16 +0,0 @@
language: objective-c
osx_image: xcode12.2
xcode_workspace: Passepartout.xcworkspace
xcode_scheme: PassepartoutCore-iOS
xcode_destination: platform=iOS Simulator,OS=12.4,name=iPhone Xs Max
cache:
bundler: true
cocoapods: true
branches:
only:
- master
- fix-travis-ci
install:
- bundle install --jobs=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle}
- bundle exec pod repo update
- travis_wait 40 bundle exec pod install --verbose

View File

@ -17,17 +17,17 @@ GEM
artifactory (3.0.15) artifactory (3.0.15)
atomos (0.1.3) atomos (0.1.3)
aws-eventstream (1.2.0) aws-eventstream (1.2.0)
aws-partitions (1.515.0) aws-partitions (1.525.0)
aws-sdk-core (3.121.1) aws-sdk-core (3.122.0)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0) aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-kms (1.49.0) aws-sdk-kms (1.51.0)
aws-sdk-core (~> 3, >= 3.120.0) aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.103.0) aws-sdk-s3 (1.105.0)
aws-sdk-core (~> 3, >= 3.120.0) aws-sdk-core (~> 3, >= 3.122.0)
aws-sdk-kms (~> 1) aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4) aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0) aws-sigv4 (1.4.0)
@ -86,7 +86,7 @@ GEM
escape (0.0.4) escape (0.0.4)
ethon (0.15.0) ethon (0.15.0)
ffi (>= 1.15.0) ffi (>= 1.15.0)
excon (0.87.0) excon (0.88.0)
faraday (1.8.0) faraday (1.8.0)
faraday-em_http (~> 1.0) faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0) faraday-em_synchrony (~> 1.0)
@ -112,7 +112,7 @@ GEM
faraday_middleware (1.2.0) faraday_middleware (1.2.0)
faraday (~> 1.0) faraday (~> 1.0)
fastimage (2.2.5) fastimage (2.2.5)
fastlane (2.196.0) fastlane (2.197.0)
CFPropertyList (>= 2.3, < 4.0.0) CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0) addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0) artifactory (~> 3.0)
@ -156,7 +156,7 @@ GEM
fourflusher (2.3.1) fourflusher (2.3.1)
fuzzy_match (2.0.4) fuzzy_match (2.0.4)
gh_inspector (1.1.3) gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.12.0) google-apis-androidpublisher_v3 (0.13.0)
google-apis-core (>= 0.4, < 2.a) google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1) google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1) addressable (~> 2.5, >= 2.5.1)
@ -167,11 +167,11 @@ GEM
retriable (>= 2.0, < 4.a) retriable (>= 2.0, < 4.a)
rexml rexml
webrick webrick
google-apis-iamcredentials_v1 (0.7.0) google-apis-iamcredentials_v1 (0.8.0)
google-apis-core (>= 0.4, < 2.a) google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0) google-apis-playcustomapp_v1 (0.6.0)
google-apis-core (>= 0.4, < 2.a) google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.8.0) google-apis-storage_v1 (0.9.0)
google-apis-core (>= 0.4, < 2.a) google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0) google-cloud-core (1.6.0)
google-cloud-env (~> 1.0) google-cloud-env (~> 1.0)
@ -187,7 +187,7 @@ GEM
google-cloud-core (~> 1.6) google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a) googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0) mini_mime (~> 1.0)
googleauth (1.0.0) googleauth (1.1.0)
faraday (>= 0.17.3, < 2.0) faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0) jwt (>= 1.4, < 3.0)
memoist (~> 0.16) memoist (~> 0.16)
@ -198,10 +198,10 @@ GEM
http-cookie (1.0.4) http-cookie (1.0.4)
domain_name (~> 0.5) domain_name (~> 0.5)
httpclient (2.8.3) httpclient (2.8.3)
i18n (1.8.10) i18n (1.8.11)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
jmespath (1.4.0) jmespath (1.4.0)
json (2.6.0) json (2.6.1)
jwt (2.3.0) jwt (2.3.0)
memoist (0.16.2) memoist (0.16.2)
mini_magick (4.11.0) mini_magick (4.11.0)
@ -268,7 +268,7 @@ GEM
rouge (~> 2.0.7) rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1) xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7) xcpretty (~> 0.2, >= 0.0.7)
zeitwerk (2.4.2) zeitwerk (2.5.1)
PLATFORMS PLATFORMS
ruby ruby

File diff suppressed because it is too large Load Diff

View File

@ -51,16 +51,6 @@
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<Testables> <Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E9AA98C259F779F003FAFF1"
BuildableName = "PassepartoutCoreTests-iOS.xctest"
BlueprintName = "PassepartoutCoreTests-iOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction

View File

@ -20,6 +20,20 @@
ReferencedContainer = "container:Passepartout.xcodeproj"> ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E5203B4259F5F3F00CBAB56"
BuildableName = "PassepartoutTunnel.appex"
BlueprintName = "PassepartoutTunnel-macOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries> </BuildActionEntries>
</BuildAction> </BuildAction>
<TestAction <TestAction
@ -28,16 +42,6 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables> <Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E9AA9B9259F7821003FAFF1"
BuildableName = "PassepartoutCoreTests-macOS.xctest"
BlueprintName = "PassepartoutCoreTests-macOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction

View File

@ -1,95 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E31529A223F9EF400F61841"
BuildableName = "PassepartoutCore.framework"
BlueprintName = "PassepartoutCore-iOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E31529A223F9EF400F61841"
BuildableName = "PassepartoutCore.framework"
BlueprintName = "PassepartoutCore-iOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E9AA98C259F779F003FAFF1"
BuildableName = "PassepartoutCoreTests-iOS.xctest"
BlueprintName = "PassepartoutCoreTests-iOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E31529A223F9EF400F61841"
BuildableName = "PassepartoutCore.framework"
BlueprintName = "PassepartoutCore-iOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E31529A223F9EF400F61841"
BuildableName = "PassepartoutCore.framework"
BlueprintName = "PassepartoutCore-iOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E5203E9259F60D600CBAB56"
BuildableName = "PassepartoutCore.framework"
BlueprintName = "PassepartoutCore-macOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E9AA9B9259F7821003FAFF1"
BuildableName = "PassepartoutCoreTests-macOS.xctest"
BlueprintName = "PassepartoutCoreTests-macOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E9AA9B9259F7821003FAFF1"
BuildableName = "PassepartoutCoreTests-macOS.xctest"
BlueprintName = "PassepartoutCoreTests-macOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E5203E9259F60D600CBAB56"
BuildableName = "PassepartoutCore.framework"
BlueprintName = "PassepartoutCore-macOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E9AA98C259F779F003FAFF1"
BuildableName = "PassepartoutCoreTests-iOS.xctest"
BlueprintName = "PassepartoutCoreTests-iOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E9AA9B9259F7821003FAFF1"
BuildableName = "PassepartoutCoreTests-macOS.xctest"
BlueprintName = "PassepartoutCoreTests-macOS"
ReferencedContainer = "container:Passepartout.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Passepartout.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -24,8 +24,11 @@
// //
import Foundation import Foundation
import TunnelKit import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKitCore
import TunnelKitManager
import TunnelKitOpenVPN
public protocol UIDescriptible { public protocol UIDescriptible {
var uiDescription: String { get } var uiDescription: String { get }

View File

@ -24,10 +24,11 @@
// //
import UIKit import UIKit
import TunnelKit
import PassepartoutCore
import Convenience
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore
import TunnelKitOpenVPN
import Convenience
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Allow Oeck provider without any purchase. - Allow Oeck provider without any purchase.
- Migrate to SwiftPM.
### Fixed ### Fixed

View File

@ -23,10 +23,12 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>. // along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
// //
import Foundation import UIKit
import PassepartoutCore
import TunnelKit
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore
import TunnelKitCore
import TunnelKitOpenVPN
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -24,9 +24,11 @@
// //
import Foundation import Foundation
import TunnelKit
import MessageUI import MessageUI
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKitManager
import TunnelKitOpenVPN
class IssueReporter: NSObject { class IssueReporter: NSObject {
static let shared = IssueReporter() static let shared = IssueReporter()
@ -57,7 +59,7 @@ class IssueReporter: NSObject {
if issue.debugLog { if issue.debugLog {
let alert = UIAlertController.asAlert(L10n.IssueReporter.title, L10n.IssueReporter.message) let alert = UIAlertController.asAlert(L10n.IssueReporter.title, L10n.IssueReporter.message)
alert.addPreferredAction(L10n.IssueReporter.Buttons.accept) { alert.addPreferredAction(L10n.IssueReporter.Buttons.accept) {
VPN.shared.requestDebugLog(fallback: AppConstants.Log.debugSnapshot) { VPN.shared.requestDebugLog(fallback: TransientStore.shared.debugSnapshot) {
self.composeEmail(withDebugLog: $0, issue: issue) self.composeEmail(withDebugLog: $0, issue: issue)
} }
} }

View File

@ -24,6 +24,7 @@
// //
import UIKit import UIKit
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
extension UIView { extension UIView {

View File

@ -24,9 +24,11 @@
// //
import UIKit import UIKit
import TunnelKit import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import TunnelKitManager
import TunnelKitOpenVPN
import ConvenienceUI
extension UITableViewCell { extension UITableViewCell {
func applyChecked(_ checked: Bool, _ theme: Theme) { func applyChecked(_ checked: Bool, _ theme: Theme) {

View File

@ -24,7 +24,7 @@
// //
import UIKit import UIKit
import Convenience import ConvenienceUI
extension StrongTableModel { extension StrongTableModel {
func headerHeight(for section: Int) -> CGFloat { func headerHeight(for section: Int) -> CGFloat {

View File

@ -26,6 +26,7 @@
import UIKit import UIKit
import MessageUI import MessageUI
import StoreKit import StoreKit
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
struct Theme { struct Theme {

View File

@ -26,7 +26,8 @@
import Foundation import Foundation
import Intents import Intents
import SwiftyBeaver import SwiftyBeaver
import TunnelKit import TunnelKitManager
import PassepartoutCore
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -24,8 +24,10 @@
// //
import UIKit import UIKit
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import Convenience
import ConvenienceUI
class AboutViewController: UITableViewController, StrongTableHost { class AboutViewController: UITableViewController, StrongTableHost {

View File

@ -24,8 +24,9 @@
// //
import UIKit import UIKit
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import ConvenienceUI
protocol AccountViewControllerDelegate: AnyObject { protocol AccountViewControllerDelegate: AnyObject {
func accountController(_: AccountViewController, didEnterCredentials credentials: Credentials) func accountController(_: AccountViewController, didEnterCredentials credentials: Credentials)
@ -44,7 +45,7 @@ class AccountViewController: UIViewController, StrongTableHost {
var usernamePlaceholder: String? var usernamePlaceholder: String?
var infrastructureName: Infrastructure.Name? { var infrastructureName: InfrastructureName? {
didSet { didSet {
reloadModel() reloadModel()
tableView?.reloadData() tableView?.reloadData()

View File

@ -24,7 +24,7 @@
// //
import Foundation import Foundation
import TunnelKit import TunnelKitOpenVPN
protocol ConfigurationModificationDelegate: AnyObject { protocol ConfigurationModificationDelegate: AnyObject {
func configuration(didUpdate newConfiguration: OpenVPN.Configuration) func configuration(didUpdate newConfiguration: OpenVPN.Configuration)

View File

@ -24,10 +24,12 @@
// //
import UIKit import UIKit
import TunnelKit
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import TunnelKitCore
import TunnelKitOpenVPN
import ConvenienceUI
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -25,8 +25,9 @@
import UIKit import UIKit
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitManager
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self
@ -111,7 +112,7 @@ class DebugLogViewController: UIViewController {
} }
private func startRefreshingLog() { private func startRefreshingLog() {
vpn.requestDebugLog(fallback: AppConstants.Log.debugSnapshot) { vpn.requestDebugLog(fallback: TransientStore.shared.debugSnapshot) {
self.textLog?.text = $0 self.textLog?.text = $0
DispatchQueue.main.async { DispatchQueue.main.async {
@ -134,7 +135,7 @@ class DebugLogViewController: UIViewController {
return return
} }
vpn.requestDebugLog(fallback: AppConstants.Log.debugSnapshot) { vpn.requestDebugLog(fallback: TransientStore.shared.debugSnapshot) {
self.textLog?.text = $0 self.textLog?.text = $0
updateBlock() updateBlock()
} }

View File

@ -24,9 +24,10 @@
// //
import UIKit import UIKit
import TunnelKit import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import TunnelKitCore
import ConvenienceUI
protocol EndpointViewControllerDelegate: AnyObject { protocol EndpointViewControllerDelegate: AnyObject {
func endpointController(_: EndpointViewController, didUpdateWithNewAddress newAddress: String?, newProtocol: EndpointProtocol?) func endpointController(_: EndpointViewController, didUpdateWithNewAddress newAddress: String?, newProtocol: EndpointProtocol?)

View File

@ -24,10 +24,11 @@
// //
import UIKit import UIKit
import PassepartoutCore
import TunnelKit
import SwiftyBeaver import SwiftyBeaver
import Convenience import PassepartoutConstants
import PassepartoutCore
import TunnelKitCore
import ConvenienceUI
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -25,9 +25,11 @@
import UIKit import UIKit
import StoreKit import StoreKit
import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import Convenience
import SwiftyBeaver import ConvenienceUI
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -24,8 +24,9 @@
// //
import UIKit import UIKit
import TunnelKit import TunnelKitCore
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -26,10 +26,14 @@
import UIKit import UIKit
import StoreKit import StoreKit
import MessageUI import MessageUI
import PassepartoutCore
import TunnelKit
import Convenience
import SystemConfiguration.CaptiveNetwork import SystemConfiguration.CaptiveNetwork
import PassepartoutConstants
import PassepartoutCore
import TunnelKitCore
import TunnelKitManager
import TunnelKitOpenVPN
import Convenience
import ConvenienceUI
// XXX: convoluted due to the separation of provider/host profiles // XXX: convoluted due to the separation of provider/host profiles

View File

@ -24,10 +24,11 @@
// //
import UIKit import UIKit
import TunnelKit
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import TunnelKitOpenVPN
import ConvenienceUI
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -24,9 +24,10 @@
// //
import UIKit import UIKit
import PassepartoutCore
import Convenience
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore
import ConvenienceUI
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -24,8 +24,9 @@
// //
import UIKit import UIKit
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import ConvenienceUI
protocol ProviderPoolViewControllerDelegate: AnyObject { protocol ProviderPoolViewControllerDelegate: AnyObject {
func providerPoolController(_: ProviderPoolViewController, didSelectPool pool: Pool) func providerPoolController(_: ProviderPoolViewController, didSelectPool pool: Pool)

View File

@ -24,6 +24,7 @@
// //
import UIKit import UIKit
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
protocol ProviderPresetViewControllerDelegate: AnyObject { protocol ProviderPresetViewControllerDelegate: AnyObject {

View File

@ -25,9 +25,10 @@
import UIKit import UIKit
import StoreKit import StoreKit
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import SwiftyBeaver import SwiftyBeaver
import Convenience import ConvenienceUI
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -24,10 +24,12 @@
// //
import UIKit import UIKit
import TunnelKit
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import TunnelKitCore
import TunnelKitOpenVPN
import ConvenienceUI
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -25,13 +25,15 @@
import UIKit import UIKit
import NetworkExtension import NetworkExtension
import MBProgressHUD
import CoreLocation import CoreLocation
import TunnelKit
import PassepartoutCore
import Convenience
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore
import TunnelKitCore
import TunnelKitManager
import TunnelKitOpenVPN
import Convenience
import ConvenienceUI
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -25,8 +25,9 @@
import UIKit import UIKit
import Intents import Intents
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import ConvenienceUI
@available(iOS 12, *) @available(iOS 12, *)
class ShortcutsAddViewController: UITableViewController, StrongTableHost { class ShortcutsAddViewController: UITableViewController, StrongTableHost {

View File

@ -26,14 +26,15 @@
import UIKit import UIKit
import Intents import Intents
import IntentsUI import IntentsUI
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import ConvenienceUI
@available(iOS 12, *) @available(iOS 12, *)
class ShortcutsConnectToViewController: UITableViewController, ProviderPoolViewControllerDelegate, StrongTableHost { class ShortcutsConnectToViewController: UITableViewController, ProviderPoolViewControllerDelegate, StrongTableHost {
private let service = TransientStore.shared.service private let service = TransientStore.shared.service
private var providers: [Infrastructure.Name] = [] private var providers: [InfrastructureName] = []
private var hosts: [String] = [] private var hosts: [String] = []

View File

@ -26,8 +26,9 @@
import UIKit import UIKit
import Intents import Intents
import IntentsUI import IntentsUI
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import ConvenienceUI
@available(iOS 12, *) @available(iOS 12, *)
protocol ShortcutsIntentDelegate: AnyObject { protocol ShortcutsIntentDelegate: AnyObject {

View File

@ -24,9 +24,10 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import Convenience import Convenience
import TunnelKit import TunnelKitCore
import ServiceManagement import ServiceManagement
// comment on release // comment on release

View File

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Allow Oeck provider without any purchase. - Allow Oeck provider without any purchase.
- Status bar icon color had to be dropped in order to automatically adjust to desktop background color. - Status bar icon color had to be dropped in order to automatically adjust to desktop background color.
- Migrate to SwiftPM.
### Fixed ### Fixed

View File

@ -23,10 +23,12 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>. // along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
// //
import Foundation import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit
import SwiftyBeaver import SwiftyBeaver
import TunnelKitCore
import TunnelKitOpenVPN
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self

View File

@ -24,8 +24,12 @@
// //
import Foundation import Foundation
import TunnelKit import AppKit
import PassepartoutConstants
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKitManager
import TunnelKitOpenVPN
class IssueReporter: NSObject { class IssueReporter: NSObject {
static let shared = IssueReporter() static let shared = IssueReporter()
@ -38,7 +42,7 @@ class IssueReporter: NSObject {
if issue.debugLog { if issue.debugLog {
let alert = Macros.warning(L10n.IssueReporter.title, L10n.IssueReporter.message) let alert = Macros.warning(L10n.IssueReporter.title, L10n.IssueReporter.message)
alert.present(in: nil, withOK: L10n.IssueReporter.Buttons.accept, cancel: L10n.Global.cancel, handler: { alert.present(in: nil, withOK: L10n.IssueReporter.Buttons.accept, cancel: L10n.Global.cancel, handler: {
VPN.shared.requestDebugLog(fallback: AppConstants.Log.debugSnapshot) { VPN.shared.requestDebugLog(fallback: TransientStore.shared.debugSnapshot) {
self.composeEmail(withDebugLog: $0, issue: issue) self.composeEmail(withDebugLog: $0, issue: issue)
} }
}, cancelHandler: nil) }, cancelHandler: nil)

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
class Macros { class Macros {

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
protocol TextInputViewControllerDelegate: AnyObject { protocol TextInputViewControllerDelegate: AnyObject {

View File

@ -24,8 +24,10 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitManager
import TunnelKitOpenVPN
extension NSTextField { extension NSTextField {
func applyVPN(_ theme: Theme, isActive: Bool, with vpnStatus: VPNStatus?, error: OpenVPNTunnelProvider.ProviderError?) { func applyVPN(_ theme: Theme, isActive: Bool, with vpnStatus: VPNStatus?, error: OpenVPNTunnelProvider.ProviderError?) {

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
struct Theme { struct Theme {

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
class WindowManager: NSObject { class WindowManager: NSObject {

View File

@ -25,8 +25,11 @@
import Cocoa import Cocoa
import StoreKit import StoreKit
import PassepartoutConstants
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitCore
import TunnelKitManager
import Convenience import Convenience
class StatusMenu: NSObject { class StatusMenu: NSObject {

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
protocol OrganizerProfileTableViewDelegate: AnyObject { protocol OrganizerProfileTableViewDelegate: AnyObject {

View File

@ -24,9 +24,10 @@
// //
import Cocoa import Cocoa
import PassepartoutCore
import TunnelKit
import SwiftyBeaver import SwiftyBeaver
import PassepartoutConstants
import PassepartoutCore
import TunnelKitManager
private let log = SwiftyBeaver.self private let log = SwiftyBeaver.self
@ -205,7 +206,7 @@ class OrganizerViewController: NSViewController {
} else if let vc = segue.destinationController as? AccountViewController { } else if let vc = segue.destinationController as? AccountViewController {
// add provider -> account // add provider -> account
if let name = sender as? Infrastructure.Name { if let name = sender as? InfrastructureName {
vc.profile = ProviderConnectionProfile(name: name) vc.profile = ProviderConnectionProfile(name: name)
} }
// add host -> rename -> account // add host -> rename -> account

View File

@ -24,8 +24,9 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitManager
class DebugLogViewController: NSViewController { class DebugLogViewController: NSViewController {
@IBOutlet private weak var labelExchangedCaption: NSTextField! @IBOutlet private weak var labelExchangedCaption: NSTextField!

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import ServiceManagement import ServiceManagement

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
class PreferencesViewController: NSViewController { class PreferencesViewController: NSViewController {

View File

@ -25,6 +25,7 @@
import Cocoa import Cocoa
import StoreKit import StoreKit
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import SwiftyBeaver import SwiftyBeaver
import Convenience import Convenience

View File

@ -24,7 +24,8 @@
// //
import Cocoa import Cocoa
import TunnelKit import TunnelKitCore
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
protocol AccountViewControllerDelegate: AnyObject { protocol AccountViewControllerDelegate: AnyObject {

View File

@ -24,8 +24,9 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitOpenVPN
class ConfigurationViewController: NSViewController, ProfileCustomization { class ConfigurationViewController: NSViewController, ProfileCustomization {
private struct Columns { private struct Columns {

View File

@ -24,8 +24,9 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitCore
class DNSViewController: NSViewController, ProfileCustomization { class DNSViewController: NSViewController, ProfileCustomization {
@IBOutlet private weak var popupChoice: NSPopUpButton! @IBOutlet private weak var popupChoice: NSPopUpButton!

View File

@ -24,8 +24,9 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitOpenVPN
class DefaultGatewayViewController: NSViewController, ProfileCustomization { class DefaultGatewayViewController: NSViewController, ProfileCustomization {
@IBOutlet private weak var popupChoice: NSPopUpButton! @IBOutlet private weak var popupChoice: NSPopUpButton!

View File

@ -24,8 +24,9 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitCore
class EndpointViewController: NSViewController, ProfileCustomization { class EndpointViewController: NSViewController, ProfileCustomization {
@IBOutlet private weak var labelAddressCaption: NSTextField! @IBOutlet private weak var labelAddressCaption: NSTextField!

View File

@ -24,8 +24,9 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitCore
class MTUViewController: NSViewController, ProfileCustomization { class MTUViewController: NSViewController, ProfileCustomization {
@IBOutlet private weak var popupChoice: NSPopUpButton! @IBOutlet private weak var popupChoice: NSPopUpButton!

View File

@ -24,8 +24,10 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitCore
import TunnelKitOpenVPN
protocol ProfileCustomization: AnyObject { protocol ProfileCustomization: AnyObject {
var profile: ConnectionProfile? { get set } var profile: ConnectionProfile? { get set }

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
class ProxyViewController: NSViewController, ProfileCustomization { class ProxyViewController: NSViewController, ProfileCustomization {

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
protocol TrustedNetworksAddViewControllerDelegate: AnyObject { protocol TrustedNetworksAddViewControllerDelegate: AnyObject {

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
class TrustedNetworksViewController: NSViewController, ProfileCustomization { class TrustedNetworksViewController: NSViewController, ProfileCustomization {

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
protocol HostServiceViewDelegate: AnyObject { protocol HostServiceViewDelegate: AnyObject {

View File

@ -24,6 +24,7 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
protocol ProviderServiceViewDelegate: AnyObject { protocol ProviderServiceViewDelegate: AnyObject {

View File

@ -24,8 +24,10 @@
// //
import Cocoa import Cocoa
import PassepartoutConstants
import PassepartoutCore import PassepartoutCore
import TunnelKit import TunnelKitCore
import TunnelKitManager
import SwiftyBeaver import SwiftyBeaver
import Convenience import Convenience

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.17.0</string>
<key>CFBundleVersion</key>
<string>1025</string>
<key>NSHumanReadableCopyright</key>
<string>$(CFG_COPYRIGHT)</string>
</dict>
</plist>

View File

@ -1,36 +0,0 @@
//
// PassepartoutCore.h
// Passepartout
//
// Created by Davide De Rosa on 3/18/19.
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
// https://github.com/passepartoutvpn
//
// This file is part of Passepartout.
//
// Passepartout 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.
//
// Passepartout 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 Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
#import <Foundation/Foundation.h>
//! Project version number for PassepartoutCore.
FOUNDATION_EXPORT double PassepartoutCoreVersionNumber;
//! Project version string for PassepartoutCore.
FOUNDATION_EXPORT const unsigned char PassepartoutCoreVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <PassepartoutCore/PublicHeader.h>

View File

@ -1,8 +0,0 @@
strings:
inputs:
- Resources/en.lproj/Core.strings
outputs:
- templateName: structured-swift4
output: Sources/SwiftGen+Strings.swift
params:
publicAccess: true

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.17.0</string>
<key>CFBundleVersion</key>
<string>1025</string>
</dict>
</plist>

View File

@ -23,7 +23,9 @@
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>. // along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
// //
import TunnelKit import Foundation
import TunnelKitOpenVPN
import PassepartoutConstants
class PacketTunnelProvider: OpenVPNTunnelProvider { class PacketTunnelProvider: OpenVPNTunnelProvider {
override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) { override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) {

View File

@ -8,7 +8,7 @@
</array> </array>
<key>com.apple.security.application-groups</key> <key>com.apple.security.application-groups</key>
<array> <array>
<string>group.$(CFG_GROUP_ID)</string> <string>group.com.algoritmico.Passepartout</string>
</array> </array>
<key>keychain-access-groups</key> <key>keychain-access-groups</key>
<array> <array>

View File

@ -0,0 +1,79 @@
{
"object": {
"pins": [
{
"package": "Convenience",
"repositoryURL": "https://github.com/keeshux/convenience",
"state": {
"branch": null,
"revision": "c7399a59539308db5a05b6b83fb10e23fcc81426",
"version": null
}
},
{
"package": "DTFoundation",
"repositoryURL": "https://github.com/Cocoanetics/DTFoundation.git",
"state": {
"branch": null,
"revision": "76062513434421cb6c8a1ae1d4f8368a7ebc2da3",
"version": "1.7.18"
}
},
{
"package": "FontAwesome",
"repositoryURL": "https://github.com/thii/FontAwesome.swift",
"state": {
"branch": null,
"revision": "07883a32d49dfc7bdedbeea115067b53dfbeeb43",
"version": "1.9.1"
}
},
{
"package": "Kvitto",
"repositoryURL": "https://github.com/Cocoanetics/Kvitto",
"state": {
"branch": null,
"revision": "88888674d772ddcf19671159ed0022cb0bc37be2",
"version": "1.0.6"
}
},
{
"package": "MBProgressHUD",
"repositoryURL": "https://github.com/jdg/MBProgressHUD",
"state": {
"branch": null,
"revision": "bca42b801100b2b3a4eda0ba8dd33d858c780b0d",
"version": "1.2.0"
}
},
{
"package": "openssl-apple",
"repositoryURL": "https://github.com/keeshux/openssl-apple",
"state": {
"branch": null,
"revision": "1889136399ba40e4fc358cfe7fafef7170aac3f7",
"version": "1.1.112"
}
},
{
"package": "SwiftyBeaver",
"repositoryURL": "https://github.com/SwiftyBeaver/SwiftyBeaver",
"state": {
"branch": null,
"revision": "2c039501d6eeb4d4cd4aec4a8d884ad28862e044",
"version": "1.9.5"
}
},
{
"package": "TunnelKit",
"repositoryURL": "https://github.com/passepartoutvpn/tunnelkit",
"state": {
"branch": null,
"revision": "3a546ebfbb4cde41496cc719781dbf11477ae161",
"version": null
}
}
]
},
"version": 1
}

View File

@ -0,0 +1,61 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "PassepartoutCore",
defaultLocalization: "en",
platforms: [
.iOS(.v12), .macOS(.v10_15)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "PassepartoutCore",
targets: ["PassepartoutCore"]),
.library(
name: "PassepartoutOpenVPNTunnel",
targets: ["PassepartoutOpenVPNTunnel"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name: "TunnelKit", url: "https://github.com/passepartoutvpn/tunnelkit", revision: "3a546ebfbb4cde41496cc719781dbf11477ae161"),
.package(name: "Convenience", url: "https://github.com/keeshux/convenience", revision: "c7399a59539308db5a05b6b83fb10e23fcc81426"),
.package(url: "https://github.com/Cocoanetics/Kvitto", from: "1.0.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "PassepartoutConstants",
dependencies: []),
.target(
name: "PassepartoutCore",
dependencies: [
"PassepartoutConstants",
.product(name: "TunnelKitOpenVPN", package: "TunnelKit"),
.product(name: "TunnelKitLZO", package: "TunnelKit"),
"Convenience",
.product(name: "ConvenienceUI", package: "Convenience", condition: .when(platforms: [.iOS])),
"Kvitto"
],
resources: [
.copy("API")
]),
.target(
name: "PassepartoutOpenVPNTunnel",
dependencies: [
"PassepartoutConstants",
.product(name: "TunnelKitOpenVPN", package: "TunnelKit"),
.product(name: "TunnelKitLZO", package: "TunnelKit")
]),
.testTarget(
name: "PassepartoutCoreTests",
dependencies: ["PassepartoutCore"],
resources: [
.process("Resources")
])
]
)

View File

@ -24,9 +24,6 @@
// //
import Foundation import Foundation
import TunnelKit
import Convenience
import SwiftyBeaver
public class AppConstants { public class AppConstants {
public class App { public class App {
@ -49,7 +46,7 @@ public class AppConstants {
public class Store { public class Store {
public static let serviceFilename = "ConnectionService.json" public static let serviceFilename = "ConnectionService.json"
public static let apiDirectory = "API/\(WebServices.version)" public static let apiDirectory = "API/\(Services.version)"
public static let providersDirectory = "Providers" public static let providersDirectory = "Providers"
@ -57,6 +54,8 @@ public class AppConstants {
} }
public class Services { public class Services {
public static let version = "v4"
public static func apiURL(version: String, path: String) -> URL { public static func apiURL(version: String, path: String) -> URL {
return Repos.api.appendingPathComponent(version).appendingPathComponent(path) return Repos.api.appendingPathComponent(version).appendingPathComponent(path)
} }
@ -79,12 +78,8 @@ public class AppConstants {
} }
public class Log { public class Log {
public static let level: SwiftyBeaver.Level = .debug
public static let debugFormat = "$DHH:mm:ss$d - $M" public static let debugFormat = "$DHH:mm:ss$d - $M"
public static var debugSnapshot: () -> String = { TransientStore.shared.service.vpnLog }
public static let viewerRefreshInterval: TimeInterval = 3.0 public static let viewerRefreshInterval: TimeInterval = 3.0
private static let fileName = "Debug.log" private static let fileName = "Debug.log"
@ -92,26 +87,6 @@ public class AppConstants {
public static var fileURL: URL { public static var fileURL: URL {
return GroupConstants.App.cachesURL.appendingPathComponent(fileName) return GroupConstants.App.cachesURL.appendingPathComponent(fileName)
} }
private static let console: ConsoleDestination = {
let dest = ConsoleDestination()
dest.minLevel = level
dest.useNSLog = true
return dest
}()
private static let file: FileDestination = {
let dest = FileDestination()
dest.minLevel = level
dest.logFileURL = fileURL
_ = dest.deleteLogFile()
return dest
}()
public static func configure() {
SwiftyBeaver.addDestination(console)
SwiftyBeaver.addDestination(file)
}
} }
public class IssueReporter { public class IssueReporter {
@ -225,14 +200,14 @@ public class AppConstants {
return comps.url! return comps.url!
} }
public static let guidances: [Infrastructure.Name: String] = [ public static let guidances: [InfrastructureName: String] = [
.protonvpn: "https://account.protonvpn.com/settings", .protonvpn: "https://account.protonvpn.com/settings",
.surfshark: "https://my.surfshark.com/vpn/manual-setup/main", .surfshark: "https://my.surfshark.com/vpn/manual-setup/main",
.torguard: "https://torguard.net/clientarea.php?action=changepw", .torguard: "https://torguard.net/clientarea.php?action=changepw",
.windscribe: "https://windscribe.com/getconfig/openvpn" .windscribe: "https://windscribe.com/getconfig/openvpn"
] ]
public static let referrals: [Infrastructure.Name: String] = [ public static let referrals: [InfrastructureName: String] = [
.hideme: "https://member.hide.me/en/checkout?plan=new_default_prices&coupon=6CB-BDB-802&duration=24", .hideme: "https://member.hide.me/en/checkout?plan=new_default_prices&coupon=6CB-BDB-802&duration=24",
.mullvad: "https://mullvad.net/en/account/create/", .mullvad: "https://mullvad.net/en/account/create/",
.nordvpn: "https://go.nordvpn.net/SH21Z", .nordvpn: "https://go.nordvpn.net/SH21Z",
@ -244,7 +219,7 @@ public class AppConstants {
.windscribe: "https://secure.link/kCsD0prd" .windscribe: "https://secure.link/kCsD0prd"
] ]
public static let externalResources: [Infrastructure.Name: String] = [ public static let externalResources: [InfrastructureName: String] = [
.nordvpn: "https://downloads.nordcdn.com/configs/archives/certificates/servers.zip" // 9MB .nordvpn: "https://downloads.nordcdn.com/configs/archives/certificates/servers.zip" // 9MB
] ]
} }
@ -286,60 +261,48 @@ public class AppConstants {
public struct Credits { public struct Credits {
public static let author = "Davide De Rosa" public static let author = "Davide De Rosa"
public static let software: [Software] = [ public static let softwareArrays: [[String]] = [[
Software(
"Kvitto", "Kvitto",
license: "BSD", "BSD",
url: "https://raw.githubusercontent.com/Cocoanetics/Kvitto/develop/LICENSE" "https://raw.githubusercontent.com/Cocoanetics/Kvitto/develop/LICENSE"
), ], [
Software(
"lzo", "lzo",
license: "GPLv2", "GPLv2",
url: "https://www.gnu.org/licenses/gpl-2.0.txt" "https://www.gnu.org/licenses/gpl-2.0.txt"
), ], [
Software(
"MBProgressHUD", "MBProgressHUD",
license: "MIT", "MIT",
url: "https://raw.githubusercontent.com/jdg/MBProgressHUD/master/LICENSE" "https://raw.githubusercontent.com/jdg/MBProgressHUD/master/LICENSE"
), ], [
Software(
"OpenSSL", "OpenSSL",
license: "OpenSSL", "OpenSSL",
url: "https://www.openssl.org/source/license.txt" "https://www.openssl.org/source/license.txt"
), ], [
Software(
"PIATunnel", "PIATunnel",
license: "MIT", "MIT",
url: "https://raw.githubusercontent.com/pia-foss/tunnel-apple/master/LICENSE" "https://raw.githubusercontent.com/pia-foss/tunnel-apple/master/LICENSE"
), ], [
Software(
"SSZipArchive", "SSZipArchive",
license: "MIT", "MIT",
url: "https://raw.githubusercontent.com/samsoffes/ssziparchive/master/LICENSE" "https://raw.githubusercontent.com/samsoffes/ssziparchive/master/LICENSE"
), ], [
Software(
"SwiftGen", "SwiftGen",
license: "MIT", "MIT",
url: "https://raw.githubusercontent.com/SwiftGen/SwiftGen/master/LICENCE" "https://raw.githubusercontent.com/SwiftGen/SwiftGen/master/LICENCE"
), ], [
Software(
"SwiftyBeaver", "SwiftyBeaver",
license: "MIT", "MIT",
url: "https://raw.githubusercontent.com/SwiftyBeaver/SwiftyBeaver/master/LICENSE" "https://raw.githubusercontent.com/SwiftyBeaver/SwiftyBeaver/master/LICENSE"
), ], [
Software(
"Circle Icons", "Circle Icons",
notice: "The logo is taken from the awesome Circle Icons set by Nick Roach." "The logo is taken from the awesome Circle Icons set by Nick Roach."
), ], [
Software(
"Country flags", "Country flags",
notice: "The country flags are taken from: https://github.com/lipis/flag-icon-css/" "The country flags are taken from: https://github.com/lipis/flag-icon-css/"
), ], [
Software(
"OpenVPN", "OpenVPN",
notice: "© 2002-2018 OpenVPN Inc. - OpenVPN is a registered trademark of OpenVPN Inc." "© 2002-2018 OpenVPN Inc. - OpenVPN is a registered trademark of OpenVPN Inc."
) ]]
]
} }
public struct Rating { public struct Rating {
@ -350,19 +313,19 @@ public class AppConstants {
#endif #endif
} }
struct InApp { public struct InApp {
static let locksBetaFeatures = true public static let locksBetaFeatures = true
#if os(iOS) #if os(iOS)
static var isBetaFullVersion: Bool { public static var isBetaFullVersion: Bool {
return ProcessInfo.processInfo.environment["FULL_VERSION"] != nil return ProcessInfo.processInfo.environment["FULL_VERSION"] != nil
} }
static let lastFullVersionBuild: (Int, LocalProduct) = (2016, .fullVersion_iOS) public static let lastFullVersionBuild: (Int, LocalProduct) = (2016, .fullVersion_iOS)
#else #else
static let isBetaFullVersion = false public static let isBetaFullVersion = false
static let lastFullVersionBuild: (Int, LocalProduct) = (0, .fullVersion_macOS) public static let lastFullVersionBuild: (Int, LocalProduct) = (0, .fullVersion_macOS)
#endif #endif
} }
} }

View File

@ -24,7 +24,6 @@
// //
import Foundation import Foundation
import Convenience
public class GroupConstants { public class GroupConstants {
public class App { public class App {
@ -48,7 +47,7 @@ public class GroupConstants {
private static var containerURL: URL { private static var containerURL: URL {
guard let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupId) else { guard let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupId) else {
print("Unable to access App Group container") print("Unable to access App Group container")
return FileManager.default.userURL(for: .documentDirectory, appending: nil) return FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
} }
return url return url
} }

View File

@ -1,5 +1,5 @@
// //
// Infrastructure+Name.swift // InfrastructureName.swift
// Passepartout // Passepartout
// //
// Created by Davide De Rosa on 11/24/19. // Created by Davide De Rosa on 11/24/19.
@ -24,15 +24,10 @@
// //
import Foundation import Foundation
import SwiftyBeaver
private let log = SwiftyBeaver.self public typealias InfrastructureName = String
extension Infrastructure { extension InfrastructureName {
public typealias Name = String
}
extension Infrastructure.Name {
public static let hideme = "hideme" public static let hideme = "hideme"
public static let mullvad = "mullvad" public static let mullvad = "mullvad"

View File

@ -35,7 +35,7 @@ public struct LocalProduct: RawRepresentable, Equatable, Hashable {
private static let featuresBundle = "\(bundle).features" private static let featuresBundle = "\(bundle).features"
private static let providersBundle = "\(bundle).providers" public static let providersBundle = "\(bundle).providers"
// MARK: Donations // MARK: Donations
@ -91,18 +91,6 @@ public struct LocalProduct: RawRepresentable, Equatable, Hashable {
self.init(rawValue: "\(LocalProduct.featuresBundle).\(featureId)")! self.init(rawValue: "\(LocalProduct.featuresBundle).\(featureId)")!
} }
// MARK: Providers
// public static var allProviders: [LocalProduct] {
// return InfrastructureFactory.shared.allMetadata.map {
// return LocalProduct(providerMetadata: $0)
// }
// }
fileprivate init(providerMetadata: Infrastructure.Metadata) {
self.init(rawValue: "\(LocalProduct.providersBundle).\(providerMetadata.inApp ?? providerMetadata.name)")!
}
// MARK: All // MARK: All
public static var all: [LocalProduct] { public static var all: [LocalProduct] {
@ -142,12 +130,6 @@ public struct LocalProduct: RawRepresentable, Equatable, Hashable {
} }
} }
public extension Infrastructure.Metadata {
var product: LocalProduct {
return LocalProduct(providerMetadata: self)
}
}
public extension LocalProduct { public extension LocalProduct {
func matchesStoreKitProduct(_ skProduct: SKProduct) -> Bool { func matchesStoreKitProduct(_ skProduct: SKProduct) -> Bool {
return skProduct.productIdentifier == rawValue return skProduct.productIdentifier == rawValue

@ -0,0 +1 @@
Subproject commit 02768b6c06fd37a8c9b15a9e72bbecdd62cc440f

View File

@ -0,0 +1,70 @@
//
// AppConstants+Core.swift
// Passepartout
//
// Created by Davide De Rosa on 11/5/21.
// Copyright (c) 2021 Davide De Rosa. All rights reserved.
//
// https://github.com/passepartoutvpn
//
// This file is part of Passepartout.
//
// Passepartout 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.
//
// Passepartout 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 Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import PassepartoutConstants
import Convenience
import SwiftyBeaver
extension AppConstants.Log {
public static let level: SwiftyBeaver.Level = .debug
private static let console: ConsoleDestination = {
let dest = ConsoleDestination()
dest.minLevel = level
dest.useNSLog = true
return dest
}()
private static let file: FileDestination = {
let dest = FileDestination()
dest.minLevel = level
dest.logFileURL = fileURL
_ = dest.deleteLogFile()
return dest
}()
public static func configure() {
SwiftyBeaver.addDestination(console)
SwiftyBeaver.addDestination(file)
}
}
extension AppConstants.Credits {
public static var software: [Software] {
return softwareArrays.map {
switch $0.count {
case 2:
return Software($0[0], notice: $0[1])
case 3:
return Software($0[0], license: $0[1], url: $0[2])
default:
fatalError("Not enough Software arguments")
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More