DeviceID 模块提供设备唯一标识管理功能,生成和维护稳定的设备ID,支持多种ID生成策略和持久化方案。
interface DeviceIDService {
fun getDeviceId(): String
fun resetDeviceId(): String
fun isDeviceIdValid(): Boolean
}
// 获取设备ID
val deviceId = DeviceIDService.getDeviceId()
// 检查ID有效性
if (DeviceIDService.isDeviceIdValid()) {
// 使用设备ID
}
// 重置设备ID(需要用户授权)
val newDeviceId = DeviceIDService.resetDeviceId()
implementation "com.wenext.android:frame-deviceid:6.0.0"