37 lines
1.4 KiB
Swift
37 lines
1.4 KiB
Swift
//
|
|
// Environment.swift
|
|
// Privado
|
|
//
|
|
// Created by Juraldinio on 11/14/19.
|
|
// Copyright © 2019 Omicronmedia. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
struct Environment {
|
|
|
|
static let environment = ProcessInfo.processInfo.environment
|
|
static let arguments = ProcessInfo.processInfo.arguments
|
|
static let hostName = ProcessInfo.processInfo.hostName
|
|
static let processName = ProcessInfo.processInfo.processName
|
|
static let globallyUniqueString = ProcessInfo.processInfo.globallyUniqueString
|
|
|
|
static let operationSystem = ProcessInfo.processInfo.operatingSystemVersionString
|
|
static let currentUUID = UUID().uuidString
|
|
static let bundleName = Bundle.main.infoDictionary?["CFBundleName"] as? String ?? "Privado"
|
|
|
|
static let shortVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0"
|
|
static let bundleVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "1"
|
|
|
|
static let router: NetworkRouter = {
|
|
NetworkRouter.addPlugin(ErrorNetworkPlugin())
|
|
#if PRODUCTION
|
|
let router = NetworkRouter(environment: WLVPNEnvironment.production)
|
|
#else
|
|
let router = NetworkRouter(environment: WLVPNEnvironment.development)
|
|
#endif
|
|
router.customHeaders = ["User-Agent": "App: \(Environment.shortVersion) (\(Environment.bundleVersion)), macOS: \(Environment.operationSystem)"]
|
|
return router
|
|
}()
|
|
}
|