Update DeviceKit and tweak user agent string on mac. (#2496)

This commit is contained in:
Doug
2024-02-23 11:26:01 +00:00
committed by GitHub
parent a3b3aa8517
commit c573b7caa1
5 changed files with 21 additions and 11 deletions
+1 -1
View File
@@ -6971,7 +6971,7 @@
repositoryURL = "https://github.com/devicekit/DeviceKit"; repositoryURL = "https://github.com/devicekit/DeviceKit";
requirement = { requirement = {
kind = upToNextMinorVersion; kind = upToNextMinorVersion;
minimumVersion = 5.0.0; minimumVersion = 5.2.2;
}; };
}; };
E025F19D013D9BA6C58B37F4 /* XCRemoteSwiftPackageReference "swift-algorithms" */ = { E025F19D013D9BA6C58B37F4 /* XCRemoteSwiftPackageReference "swift-algorithms" */ = {
@@ -22,8 +22,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/devicekit/DeviceKit", "location" : "https://github.com/devicekit/DeviceKit",
"state" : { "state" : {
"revision" : "691fe8112cca20ebf0020a1709d4e0205400311c", "revision" : "fe41d18eccd92a115cffaa35dfff03018c67e635",
"version" : "5.0.0" "version" : "5.2.2"
} }
}, },
{ {
+16 -7
View File
@@ -31,12 +31,21 @@ final class UserAgentBuilder {
let clientVersion = InfoPlistReader.app.bundleShortVersionString let clientVersion = InfoPlistReader.app.bundleShortVersionString
#if os(iOS) #if os(iOS)
return String(format: "%@/%@ (%@; iOS %@; Scale/%0.2f)", let scale = UIScreen.main.scale
clientName, return if ProcessInfo.processInfo.isiOSAppOnMac {
clientVersion, String(format: "%@/%@ (Mac; macOS %@; Scale/%0.2f)",
Device.current.safeDescription, clientName,
UIDevice.current.systemVersion, clientVersion,
UIScreen.main.scale) ProcessInfo.processInfo.operatingSystemVersionString,
scale)
} else {
String(format: "%@/%@ (%@; iOS %@; Scale/%0.2f)",
clientName,
clientVersion,
Device.current.safeDescription,
UIDevice.current.systemVersion,
scale)
}
#elseif os(tvOS) #elseif os(tvOS)
return String(format: "%@/%@ (%@; tvOS %@; Scale/%0.2f)", return String(format: "%@/%@ (%@; tvOS %@; Scale/%0.2f)",
clientName, clientName,
@@ -52,7 +61,7 @@ final class UserAgentBuilder {
WKInterfaceDevice.current.systemVersion, WKInterfaceDevice.current.systemVersion,
WKInterfaceDevice.currentDevice.screenScale) WKInterfaceDevice.currentDevice.screenScale)
#elseif os(OSX) #elseif os(OSX)
return String(format: "%@/%@ (Mac; Mac OS X %@)", return String(format: "%@/%@ (Mac; macOS %@)",
clientName, clientName,
clientVersion, clientVersion,
NSProcessInfo.processInfo.operatingSystemVersionString) NSProcessInfo.processInfo.operatingSystemVersionString)
+1
View File
@@ -0,0 +1 @@
Add support for latest iPhones in the User Agent. Also correctly identify when running on a Mac.
+1 -1
View File
@@ -78,7 +78,7 @@ packages:
minorVersion: 1.0.0 minorVersion: 1.0.0
DeviceKit: DeviceKit:
url: https://github.com/devicekit/DeviceKit url: https://github.com/devicekit/DeviceKit
minorVersion: 5.0.0 minorVersion: 5.2.2
DSWaveformImage: DSWaveformImage:
url: https://github.com/dmrschmidt/DSWaveformImage url: https://github.com/dmrschmidt/DSWaveformImage
exactVersion: 14.1.1 exactVersion: 14.1.1