Create lowercase device IDs

For consistency with the other implementations
This commit is contained in:
Albert Vaca Cintora
2024-12-29 19:27:10 +01:00
parent 89fecbe330
commit d69f448fca

View File

@@ -61,12 +61,12 @@ class KdeConnectSettings: NSObject, ObservableObject {
#if !os(macOS)
// identifierForVendor can be nil if called when a device has restarted but not been unlocked yet
if let identifierForVendor = UIDevice.current.identifierForVendor {
cachedUuid = identifierForVendor.uuidString.replacingOccurrences(of: "-", with: "")
cachedUuid = identifierForVendor.uuidString.replacingOccurrences(of: "-", with: "_").lowercased()
wrapper.setObject(cachedUuid, forKey: kSecValueData as String)
}
#else
let identifierForVendor = NetworkPacket.getMacUUID()
cachedUuid = identifierForVendor.replacingOccurrences(of: "-", with: "")
cachedUuid = identifierForVendor.replacingOccurrences(of: "-", with: "_").lowercased()
wrapper.setObject(cachedUuid, forKey: kSecValueData as String)
#endif
}