Find out version/build statically
Assume bundle and info dictionary are never nil.
This commit is contained in:
parent
fdb8762814
commit
567ddd9b12
|
@ -27,9 +27,7 @@ import TunnelKit
|
|||
|
||||
class PacketTunnelProvider: TunnelKitProvider {
|
||||
override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) {
|
||||
if let version = GroupConstants.App.version {
|
||||
appVersion = "\(GroupConstants.App.name) \(version)"
|
||||
}
|
||||
appVersion = "\(GroupConstants.App.name) \(GroupConstants.App.versionString)"
|
||||
dnsTimeout = GroupConstants.VPN.dnsTimeout
|
||||
logSeparator = GroupConstants.VPN.sessionMarker
|
||||
super.startTunnel(options: options, completionHandler: completionHandler)
|
||||
|
|
|
@ -34,14 +34,11 @@ class GroupConstants {
|
|||
static let title = name
|
||||
// static let title = "\u{1F511}"
|
||||
|
||||
static var version: String? {
|
||||
guard let info = Bundle.main.infoDictionary else {
|
||||
return nil
|
||||
}
|
||||
let versionNumber = info["CFBundleShortVersionString"] as! String
|
||||
let buildNumber = info[kCFBundleVersionKey as String] as! String
|
||||
return "\(versionNumber) (\(buildNumber))"
|
||||
}
|
||||
static let versionNumber = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
|
||||
|
||||
static let buildNumber = Int(Bundle.main.infoDictionary![kCFBundleVersionKey as String] as! String)!
|
||||
|
||||
static let versionString = "\(versionNumber) (\(buildNumber))"
|
||||
|
||||
static let teamId = "5357M5NW9W"
|
||||
|
||||
|
|
|
@ -46,10 +46,8 @@ struct DebugLog {
|
|||
}
|
||||
|
||||
func decoratedString() -> String {
|
||||
guard let appVersion = GroupConstants.App.version else {
|
||||
fatalError("Could not find bundle app version?")
|
||||
}
|
||||
let appName = GroupConstants.App.name
|
||||
let appVersion = GroupConstants.App.versionString
|
||||
|
||||
var metadata: [String] = []
|
||||
let osVersion: String
|
||||
|
|
Loading…
Reference in New Issue