Make AmoreLicensing cross-platform via injectable DeviceIdentity#6
Merged
Conversation
# Conflicts: # Package.swift # Sources/AmoreLicensing/AmoreLicensing.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the internal, macOS-only
HardwareIdentifierwith a public,injectable
DeviceIdentityprotocol, so AmoreLicensing builds and runs onLinux (and any other platform) while macOS stays zero-config.
Why
Device binding relied on IOKit, which locked the whole SDK to macOS. Apps on
other platforms couldn't use AmoreLicensing at all. Exposing how a device is
identified lets callers bring their own identity while keeping the built-in
macOS behavior unchanged.
How
DeviceIdentityprotocol (public):identifierfor license binding plusa new
deviceNameshown in the licensing dashboard.MacDeviceIdentity(macOS-only): the built-in implementation, serial viaIOKit + computer name via SystemConfiguration. Renamed from
MacHardwareIdentifier.AmoreLicensinginit: the cross-platform initializer takes a requireddeviceIdentity:; a macOS-only convenience initializer defaults it toMacDeviceIdentity(), so existing macOS callers are source-compatible.AmoreStore(Foundation currency formatting) is gated toApple platforms in
Package.swift;FoundationNetworkingimported forURLSession; CI gains aswift:6.2Linux job alongside macOS./etc/machine-idexample); readme and DocC updated to drop macOS-only framing.