Add check for DeviceInfo.imsiMd5.size on init. #979

This commit is contained in:
Him188 2021-02-05 22:39:52 +08:00
parent 13faff5471
commit fd3b32482e

View File

@ -43,6 +43,10 @@ public class DeviceInfo(
public val androidId: ByteArray get() = display
public val ipAddress: ByteArray get() = byteArrayOf(192.toByte(), 168.toByte(), 1, 123)
init {
require(imsiMd5.size == 16) { "Bad `imsiMd5.size`. Required 16, given ${imsiMd5.size}." }
}
@Transient
@MiraiInternalApi
public val guid: ByteArray = generateGuid(androidId, macAddress)