Do some code clean up
- Use guard in validators - Rename URL.openURL() to URL.open() - Sort imports (SwiftLint) - Drop unused VPNProtocolType.allTypes - Drop unused imports
This commit is contained in:
parent
1051a8dc52
commit
b4ad8dea0d
|
@ -5,6 +5,8 @@ included:
|
|||
analyzer_rules:
|
||||
- unused_declaration
|
||||
- unused_import
|
||||
opt_in_rules:
|
||||
- sorted_imports
|
||||
disabled_rules:
|
||||
- cyclomatic_complexity
|
||||
- file_length
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import PassepartoutLibrary
|
||||
import UIKit
|
||||
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate, ObservableObject {
|
||||
private let mac = MacBundle.shared
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import UniformTypeIdentifiers
|
||||
import SwiftyBeaver
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
extension Constants {
|
||||
enum App {
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import LocalAuthentication
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension View {
|
||||
var themeIdiom: UIUserInterfaceIdiom {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
import PassepartoutLibrary
|
||||
|
||||
@MainActor
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import StoreKit
|
||||
import PassepartoutLibrary
|
||||
import StoreKit
|
||||
|
||||
struct LocalProduct: RawRepresentable, Equatable, Hashable {
|
||||
private static let bundleSubdomain = "ios"
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
import Kvitto
|
||||
import PassepartoutLibrary
|
||||
import StoreKit
|
||||
import Kvitto
|
||||
import Combine
|
||||
|
||||
enum ProductError: Error {
|
||||
case uneligible
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
import Intents
|
||||
import IntentsUI
|
||||
import Combine
|
||||
import PassepartoutLibrary
|
||||
|
||||
@MainActor
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
import PassepartoutLibrary
|
||||
import Combine
|
||||
|
||||
class DefaultLightProfile: LightProfile {
|
||||
let id: UUID
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
import PassepartoutLibrary
|
||||
|
||||
class DefaultLightProviderCategory: LightProviderCategory {
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
import PassepartoutLibrary
|
||||
import Combine
|
||||
|
||||
class DefaultLightVPNManager: LightVPNManager {
|
||||
private let vpnManager = VPNManager.shared
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct PassepartoutApp: App {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
struct ActivityView: UIViewControllerRepresentable {
|
||||
let activityItems: [Any]
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Intents
|
||||
import IntentsUI
|
||||
import SwiftUI
|
||||
|
||||
struct IntentAddView: UIViewControllerRepresentable {
|
||||
let shortcut: INShortcut
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Intents
|
||||
import IntentsUI
|
||||
import SwiftUI
|
||||
|
||||
struct IntentEditView: UIViewControllerRepresentable {
|
||||
let shortcut: Shortcut
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import MessageUI
|
||||
import SwiftUI
|
||||
|
||||
struct MailComposerView: UIViewControllerRepresentable {
|
||||
class Coordinator: NSObject, MFMailComposeViewControllerDelegate {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import StoreKit
|
||||
import UIKit
|
||||
|
||||
public class Reviewer: ObservableObject {
|
||||
private struct Keys {
|
||||
|
|
|
@ -61,13 +61,12 @@ struct Validators {
|
|||
var sin = sockaddr_in()
|
||||
var sin6 = sockaddr_in6()
|
||||
|
||||
if string.withCString({ cstring in inet_pton(AF_INET6, cstring, &sin6.sin6_addr) }) == 1 {
|
||||
return
|
||||
guard string.withCString({ cstring in inet_pton(AF_INET6, cstring, &sin6.sin6_addr) }) == 1 else {
|
||||
throw ValidationError.ipAddress
|
||||
}
|
||||
if string.withCString({ cstring in inet_pton(AF_INET, cstring, &sin.sin_addr) }) == 1 {
|
||||
return
|
||||
throw ValidationError.ipAddress
|
||||
}
|
||||
throw ValidationError.ipAddress
|
||||
}
|
||||
|
||||
static func domainName(_ string: String) throws {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
enum ShortcutType: String {
|
||||
case enableVPN
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
func sceneDidEnterBackground(_ scene: UIScene) {
|
||||
|
|
|
@ -73,7 +73,7 @@ struct AboutView: View {
|
|||
private var supportSection: some View {
|
||||
Section {
|
||||
Button(L10n.About.Items.JoinCommunity.caption) {
|
||||
URL.openURL(redditURL)
|
||||
URL.open(redditURL)
|
||||
}
|
||||
Button(L10n.About.Items.ShareTwitter.caption, action: shareOnTwitter)
|
||||
Button(L10n.About.Items.WriteReview.caption, action: submitReview)
|
||||
|
@ -85,16 +85,16 @@ struct AboutView: View {
|
|||
private var webSection: some View {
|
||||
Section {
|
||||
Button(L10n.About.Items.Website.caption) {
|
||||
URL.openURL(homeURL)
|
||||
URL.open(homeURL)
|
||||
}
|
||||
Button(Unlocalized.About.faq) {
|
||||
URL.openURL(faqURL)
|
||||
URL.open(faqURL)
|
||||
}
|
||||
Button(L10n.About.Items.Disclaimer.caption) {
|
||||
URL.openURL(disclaimerURL)
|
||||
URL.open(disclaimerURL)
|
||||
}
|
||||
Button(L10n.About.Items.PrivacyPolicy.caption) {
|
||||
URL.openURL(privacyURL)
|
||||
URL.open(privacyURL)
|
||||
}
|
||||
} header: {
|
||||
Text(L10n.About.Sections.Web.header)
|
||||
|
@ -104,10 +104,10 @@ struct AboutView: View {
|
|||
private var githubSection: some View {
|
||||
Section {
|
||||
Button(Unlocalized.About.readme) {
|
||||
URL.openURL(readmeURL)
|
||||
URL.open(readmeURL)
|
||||
}
|
||||
Button(Unlocalized.About.changelog) {
|
||||
URL.openURL(changelogURL)
|
||||
URL.open(changelogURL)
|
||||
}
|
||||
} header: {
|
||||
Text(Unlocalized.About.github)
|
||||
|
@ -118,11 +118,11 @@ struct AboutView: View {
|
|||
extension AboutView {
|
||||
private func shareOnTwitter() {
|
||||
let url = Unlocalized.Social.twitterIntent(withMessage: shareMessage)
|
||||
URL.openURL(url)
|
||||
URL.open(url)
|
||||
}
|
||||
|
||||
private func submitReview() {
|
||||
let reviewURL = Reviewer.urlForReview(withAppId: Constants.App.appStoreId)
|
||||
URL.openURL(reviewURL)
|
||||
URL.open(reviewURL)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct AccountView: View {
|
||||
@ObservedObject private var providerManager: ProviderManager
|
||||
|
@ -116,7 +116,7 @@ struct AccountView: View {
|
|||
}
|
||||
|
||||
private func openGuidanceURL(_ url: URL) {
|
||||
URL.openURL(url)
|
||||
URL.open(url)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
import TunnelKitOpenVPN
|
||||
import TunnelKitWireGuard
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct AddProfileMenu: View {
|
||||
enum ModalType: Identifiable {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
enum AddProfileView {
|
||||
struct Bindings {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension AddProviderView {
|
||||
struct NameView: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct AddProviderView: View {
|
||||
@ObservedObject private var providerManager: ProviderManager
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Combine
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct DebugLogView: View {
|
||||
private let title: String
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
import TunnelKitOpenVPN
|
||||
|
||||
extension DiagnosticsView {
|
||||
|
@ -178,7 +178,7 @@ extension DiagnosticsView.OpenVPNView {
|
|||
guard let url = URL.mailto(to: V.recipient, subject: V.subject, body: body) else {
|
||||
return
|
||||
}
|
||||
guard URL.openURL(url) else {
|
||||
guard URL.open(url) else {
|
||||
alertType = .emailNotConfigured
|
||||
return
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
import TunnelKitWireGuard
|
||||
|
||||
extension DiagnosticsView {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct DiagnosticsView: View {
|
||||
let vpnProtocol: VPNProtocolType
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import StoreKit
|
||||
import PassepartoutLibrary
|
||||
import StoreKit
|
||||
import SwiftUI
|
||||
|
||||
struct DonateView: View {
|
||||
enum AlertType: Identifiable {
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
import TunnelKitOpenVPN
|
||||
import PassepartoutLibrary
|
||||
|
||||
extension EndpointAdvancedView {
|
||||
struct OpenVPNView: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
import TunnelKitOpenVPN
|
||||
|
||||
extension EndpointView {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
import TunnelKitWireGuard
|
||||
|
||||
extension EndpointView {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct EndpointView: View {
|
||||
@ObservedObject private var currentProfile: ObservableProfile
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct InteractiveConnectionView: View {
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct NetworkSettingsView: View {
|
||||
@ObservedObject private var currentProfile: ObservableProfile
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension OnDemandView {
|
||||
struct SSIDList: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct OnDemandView: View {
|
||||
@ObservedObject private var productManager: ProductManager
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension OrganizerView {
|
||||
struct ProfileRow: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension OrganizerView {
|
||||
struct ProfilesList: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension OrganizerView {
|
||||
struct SceneView: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct OrganizerView: View {
|
||||
enum ModalType: Identifiable {
|
||||
|
@ -151,7 +151,7 @@ extension OrganizerView {
|
|||
message: Text(L10n.Organizer.Alerts.Reddit.message),
|
||||
primaryButton: .default(Text(L10n.Organizer.Alerts.Reddit.Buttons.subscribe)) {
|
||||
didHandleSubreddit = true
|
||||
URL.openURL(redditURL)
|
||||
URL.open(redditURL)
|
||||
},
|
||||
secondaryButton: .cancel(Text(L10n.Global.Alerts.Buttons.never)) {
|
||||
didHandleSubreddit = true
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import StoreKit
|
||||
import PassepartoutLibrary
|
||||
import StoreKit
|
||||
import SwiftUI
|
||||
|
||||
extension PaywallView {
|
||||
struct PurchaseView: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension ProfileView {
|
||||
struct ConfigurationSection: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension ProfileView {
|
||||
struct DiagnosticsSection: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension ProfileView {
|
||||
struct ExtraSection: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension ProfileView {
|
||||
struct MainMenu: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension ProfileView {
|
||||
struct ProviderSection: View, ProviderProfileAvailability {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension ProfileView {
|
||||
struct RenameView: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension ProfileView {
|
||||
struct VPNSection: View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct ProfileView: View {
|
||||
enum ModalType: Int, Identifiable {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct ProviderLocationView: View, ProviderProfileAvailability {
|
||||
@ObservedObject var providerManager: ProviderManager
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct ProviderPresetView: View {
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import MessageUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct ReportIssueView: View {
|
||||
@Binding private var isPresented: Bool
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct SettingsButton: View {
|
||||
@State private var isPresented = false
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct SettingsView: View {
|
||||
@ObservedObject private var profileManager: ProfileManager
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Intents
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
extension ShortcutsView {
|
||||
struct AddView: View {
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Intents
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct ShortcutsView: View {
|
||||
enum ModalType: Identifiable {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct VPNStatusText: View {
|
||||
@ObservedObject private var currentVPNState: ObservableVPNState
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
|
||||
struct VPNToggle: View {
|
||||
@ObservedObject private var profileManager: ProfileManager
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import PassepartoutLibrary
|
||||
import SwiftUI
|
||||
import SwiftyBeaver
|
||||
|
||||
extension View {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
import PassepartoutLibrary
|
||||
|
||||
@MainActor
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import NetworkExtension
|
||||
import PassepartoutLibrary
|
||||
import TunnelKitManager
|
||||
import TunnelKitOpenVPN
|
||||
import TunnelKitWireGuard
|
||||
import NetworkExtension
|
||||
import PassepartoutLibrary
|
||||
|
||||
extension VPNStatus {
|
||||
var localizedDescription: String {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
|
||||
private let appURL = Constants.Launcher.appURL
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
private let bundle = Constants.Mac.bundle
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
class DefaultMacUtils: MacUtils {
|
||||
private(set) lazy var isStartedByLauncher = NSApp.isHidden
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct HostProfileItem: Item {
|
||||
private let viewModel: ViewModel
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
import ServiceManagement
|
||||
|
||||
extension LaunchOnLoginItem {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct LaunchOnLoginItem: Item {
|
||||
private let viewModel: ViewModel
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
extension PassepartoutMenu {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
class PassepartoutMenu {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct ProfileItemGroup: ItemGroup {
|
||||
private let profileManager: LightProfileManager
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct ProviderLocationItem: Item {
|
||||
private let profile: LightProfile
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct ProviderProfileItem: Item {
|
||||
private let viewModel: ViewModel
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct ProviderServerItem: Item {
|
||||
private let profile: LightProfile
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
extension VPNItemGroup {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct VPNItemGroup: ItemGroup {
|
||||
private let viewModel: ViewModel
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
extension VisibilityItem {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct VisibilityItem: Item {
|
||||
private let title: String
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
protocol Item: ItemGroup {
|
||||
func asMenuItem(withParent parent: NSMenu) -> NSMenuItem
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
protocol ItemGroup {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
class ObservableProcessTransformer: ObservableObject {
|
||||
static let shared = ObservableProcessTransformer()
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct SeparatorItem: Item {
|
||||
func asMenuItem(withParent parent: NSMenu) -> NSMenuItem {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct StaticSystemMenu: SystemMenu {
|
||||
let children: [ItemGroup]
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
protocol SystemMenu {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
extension TextItem {
|
||||
class ViewModel {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppKit
|
||||
import Foundation
|
||||
|
||||
struct TextItem: Item {
|
||||
enum State {
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import TunnelKit
|
||||
|
||||
extension Profile {
|
||||
public struct NetworkSettings: Codable, Equatable {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
public enum VPNProtocolType: String, Codable {
|
||||
public enum VPNProtocolType: String, CaseIterable, Codable {
|
||||
case openVPN = "ovpn"
|
||||
|
||||
case wireGuard = "wg"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
@_exported import PassepartoutVPN
|
||||
@_exported import PassepartoutCore
|
||||
@_exported import PassepartoutProfiles
|
||||
@_exported import PassepartoutProviders
|
||||
@_exported import PassepartoutServices
|
||||
@_exported import PassepartoutUtils
|
||||
@_exported import PassepartoutCore
|
||||
@_exported import PassepartoutVPN
|
||||
@_exported import TunnelKit
|
||||
@_exported import TunnelKitCore
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
|
||||
import Foundation
|
||||
import GenericJSON
|
||||
import TunnelKitCore
|
||||
import TunnelKitOpenVPNCore
|
||||
import TunnelKitManager
|
||||
import PassepartoutCore
|
||||
import PassepartoutUtils
|
||||
import TunnelKitCore
|
||||
import TunnelKitManager
|
||||
import TunnelKitOpenVPNCore
|
||||
|
||||
private typealias Map = [String: Any]
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
import SwiftyBeaver
|
||||
import Foundation
|
||||
import PassepartoutCore
|
||||
import PassepartoutUtils
|
||||
import SwiftyBeaver
|
||||
|
||||
@MainActor
|
||||
public final class UpgradeManager: ObservableObject {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
// This file was automatically generated and should not be edited.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
import Foundation
|
||||
|
||||
@objc(CDProfile)
|
||||
public class CDProfile: NSManagedObject {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
// This file was automatically generated and should not be edited.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
import Foundation
|
||||
|
||||
extension CDProfile {
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import PassepartoutCore
|
||||
import TunnelKitCore
|
||||
import TunnelKitOpenVPN
|
||||
import PassepartoutCore
|
||||
|
||||
extension Profile.OpenVPNSettings: GatewaySettingsProviding {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
import Foundation
|
||||
import PassepartoutCore
|
||||
|
||||
extension PassepartoutDataModels {
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import TunnelKitOpenVPN
|
||||
import TunnelKitWireGuard
|
||||
import Foundation
|
||||
import PassepartoutCore
|
||||
import PassepartoutUtils
|
||||
import TunnelKitOpenVPN
|
||||
import TunnelKitWireGuard
|
||||
|
||||
extension ProviderServer.Preset {
|
||||
public var openVPNConfiguration: OpenVPN.Configuration? {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
import PassepartoutCore
|
||||
import PassepartoutProviders
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue