2017-06-13 11:42:49 +08:00
|
|
|
//
|
|
|
|
|
// Globals.swift
|
2021-08-28 07:32:31 +02:00
|
|
|
// passKit
|
2017-06-13 11:42:49 +08:00
|
|
|
//
|
|
|
|
|
// Created by Mingshen Sun on 21/1/2017.
|
|
|
|
|
// Copyright © 2017 Bob Sun. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
import UIKit
|
|
|
|
|
|
2020-02-09 14:06:08 +01:00
|
|
|
public final class Globals {
|
2020-09-06 14:15:30 +02:00
|
|
|
public static let bundleIdentifier: String = {
|
|
|
|
|
#if BETA
|
|
|
|
|
return "me.mssun.passforiosbeta"
|
|
|
|
|
#else
|
|
|
|
|
return "me.mssun.passforios"
|
|
|
|
|
#endif
|
|
|
|
|
}()
|
|
|
|
|
|
2017-06-13 11:42:49 +08:00
|
|
|
public static let groupIdentifier = "group." + bundleIdentifier
|
|
|
|
|
public static let passKitBundleIdentifier = bundleIdentifier + ".passKit"
|
2018-12-09 16:59:07 -08:00
|
|
|
|
2017-06-13 11:42:49 +08:00
|
|
|
public static let sharedContainerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupIdentifier)!
|
|
|
|
|
public static let documentPath = sharedContainerURL.appendingPathComponent("Documents").path
|
|
|
|
|
public static let libraryPath = sharedContainerURL.appendingPathComponent("Library").path
|
|
|
|
|
public static let pgpPublicKeyPath = documentPath + "/gpg_key.pub"
|
|
|
|
|
public static let pgpPrivateKeyPath = documentPath + "/gpg_key"
|
|
|
|
|
public static let gitSSHPrivateKeyPath = documentPath + "/ssh_key"
|
|
|
|
|
public static let gitSSHPrivateKeyURL = URL(fileURLWithPath: gitSSHPrivateKeyPath)
|
|
|
|
|
public static let repositoryPath = libraryPath + "/password-store"
|
2017-06-14 21:43:33 +08:00
|
|
|
public static let dbPath = documentPath + "/pass.sqlite"
|
2018-12-09 16:59:07 -08:00
|
|
|
|
2017-06-14 20:22:15 +08:00
|
|
|
public static let iTunesFileSharingPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
|
|
|
|
|
public static let iTunesFileSharingPGPPublic = iTunesFileSharingPath + "/gpg_key.pub"
|
|
|
|
|
public static let iTunesFileSharingPGPPrivate = iTunesFileSharingPath + "/gpg_key"
|
|
|
|
|
public static let iTunesFileSharingSSHPrivate = iTunesFileSharingPath + "/ssh_key"
|
2018-12-09 16:59:07 -08:00
|
|
|
|
2019-09-11 22:02:48 +02:00
|
|
|
public static let gitPassword = "gitPassword"
|
|
|
|
|
public static let gitSSHPrivateKeyPassphrase = "gitSSHPrivateKeyPassphrase"
|
2019-09-08 23:00:46 +02:00
|
|
|
public static let pgpKeyPassphrase = "pgpKeyPassphrase"
|
2020-06-28 21:25:40 +02:00
|
|
|
|
2017-06-13 11:42:49 +08:00
|
|
|
public static let gitSignatureDefaultName = "Pass for iOS"
|
|
|
|
|
public static let gitSignatureDefaultEmail = "user@passforios"
|
2018-12-09 16:59:07 -08:00
|
|
|
|
2017-06-13 11:42:49 +08:00
|
|
|
public static let passwordDots = "••••••••••••"
|
|
|
|
|
public static let oneTimePasswordDots = "••••••"
|
2017-10-07 23:05:26 -07:00
|
|
|
public static let passwordFont = UIFont(name: "Courier-Bold", size: UIFont.labelFontSize - 1)
|
2018-12-09 16:59:07 -08:00
|
|
|
|
2017-06-13 11:42:49 +08:00
|
|
|
// UI related
|
|
|
|
|
public static let tableCellButtonSize = CGFloat(20.0)
|
2018-12-09 16:59:07 -08:00
|
|
|
|
2020-06-28 21:25:40 +02:00
|
|
|
private init() {}
|
2017-06-13 11:42:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public extension Bundle {
|
|
|
|
|
var releaseVersionNumber: String? {
|
2020-06-28 21:25:40 +02:00
|
|
|
infoDictionary?["CFBundleShortVersionString"] as? String
|
2017-06-13 11:42:49 +08:00
|
|
|
}
|
2020-06-28 21:25:40 +02:00
|
|
|
|
2017-06-13 11:42:49 +08:00
|
|
|
var buildVersionNumber: String? {
|
2020-06-28 21:25:40 +02:00
|
|
|
infoDictionary?["CFBundleVersion"] as? String
|
2017-06-13 11:42:49 +08:00
|
|
|
}
|
|
|
|
|
}
|