Hardcode the sliding sync proxy. (#502)

* Add support for migrating between versions.
* Rename InfoPlistReader property.
* Bump SDK version.
This commit is contained in:
Doug
2023-01-31 17:48:24 +00:00
committed by GitHub
parent 4f8cc08989
commit f6629e0d6e
31 changed files with 143 additions and 99 deletions
@@ -23,6 +23,6 @@ extension UIDevice {
}
var initialDisplayName: String {
ElementL10n.defaultSessionDisplayName(InfoPlistReader.target.bundleDisplayName)
ElementL10n.defaultSessionDisplayName(InfoPlistReader.main.bundleDisplayName)
}
}
+2 -2
View File
@@ -27,7 +27,7 @@ extension URL {
/// The URL of the primary app group container.
static var appGroupContainerDirectory: URL {
guard let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: InfoPlistReader.target.appGroupIdentifier) else {
guard let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: InfoPlistReader.main.appGroupIdentifier) else {
fatalError("Should always be able to retrieve the container directory")
}
return url
@@ -64,7 +64,7 @@ extension URL {
var url = appGroupContainerDirectory
.appendingPathComponent("Library", isDirectory: true)
.appendingPathComponent("Application Support", isDirectory: true)
.appendingPathComponent(InfoPlistReader.target.baseBundleIdentifier, isDirectory: true)
.appendingPathComponent(InfoPlistReader.main.baseBundleIdentifier, isDirectory: true)
try? FileManager.default.createDirectoryIfNeeded(at: url)
+2 -2
View File
@@ -25,8 +25,8 @@ struct InfoPlistReader {
static let bundleDisplayName = "CFBundleDisplayName"
}
/// Info.plist reader on the current target
static let target = InfoPlistReader(bundle: .main)
/// Info.plist reader on the bundle object that contains the current executable.
static let main = InfoPlistReader(bundle: .main)
private let bundle: Bundle
@@ -150,9 +150,9 @@ class MXLogger {
MXLogger.logCrashes(false)
// Extract running app information
let app = InfoPlistReader.target.bundleExecutable
let appId = InfoPlistReader.target.bundleIdentifier
let appVersion = "\(InfoPlistReader.target.bundleShortVersionString) (r\(InfoPlistReader.target.bundleVersion))"
let app = InfoPlistReader.main.bundleExecutable
let appId = InfoPlistReader.main.bundleIdentifier
let appVersion = "\(InfoPlistReader.main.bundleShortVersionString) (r\(InfoPlistReader.main.bundleVersion))"
// Build the crash log
let model = UIDevice.current.model
@@ -27,8 +27,8 @@ final class UserAgentBuilder {
}
private class func makeUserAgent() -> String? {
let clientName = InfoPlistReader.target.bundleDisplayName
let clientVersion = InfoPlistReader.target.bundleShortVersionString
let clientName = InfoPlistReader.main.bundleDisplayName
let clientVersion = InfoPlistReader.main.bundleShortVersionString
#if os(iOS)
return String(