LegacyDeviceIdentifier

A compatibility implementation of DeviceIdentifier that provides backward compatibility with legacy device identification methods.

This implementation:

  • First attempts to retrieve a key from the KeyStore using the Android ID as the key alias

  • If found, combines the Android ID with a SHA-1 hash of the key to create a composite identifier

  • If no legacy key exists, falls back to the DefaultDeviceIdentifier implementation

This implementation is useful for maintaining device identity across app updates when transitioning from a legacy identification scheme to the new one.

Note: The SHA-1 algorithm is used for backward compatibility, though it's generally recommended to use SHA-256 for new implementations.

Properties

Link copied to clipboard
open override val id: suspend () -> String

A lazily initialized device identifier string. The value is computed once on first access and cached for subsequent calls.