|
|
@@ -7,13 +7,14 @@
|
|
|
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
|
|
*/
|
|
|
|
|
|
-package net.mamoe.mirai.qqandroid.utils
|
|
|
+package net.mamoe.mirai.utils
|
|
|
|
|
|
import kotlinx.io.core.toByteArray
|
|
|
-import net.mamoe.mirai.utils.Context
|
|
|
-import net.mamoe.mirai.utils.localIpAddress
|
|
|
+import net.mamoe.mirai.utils.io.getRandomByteArray
|
|
|
+import net.mamoe.mirai.utils.io.getRandomString
|
|
|
|
|
|
-actual class SystemDeviceInfo actual constructor(context: Context) : DeviceInfo(context) {
|
|
|
+@UseExperimental(ExperimentalUnsignedTypes::class)
|
|
|
+actual open class SystemDeviceInfo actual constructor(context: Context) : DeviceInfo(context) {
|
|
|
override val display: ByteArray get() = "MIRAI.200122.001".toByteArray()
|
|
|
override val product: ByteArray get() = "mirai".toByteArray()
|
|
|
override val device: ByteArray get() = "mirai".toByteArray()
|
|
|
@@ -22,24 +23,18 @@ actual class SystemDeviceInfo actual constructor(context: Context) : DeviceInfo(
|
|
|
override val model: ByteArray get() = "mirai".toByteArray()
|
|
|
override val bootloader: ByteArray get() = "unknown".toByteArray()
|
|
|
override val fingerprint: ByteArray get() = "mamoe/mirai/mirai:10/MIRAI.200122.001/5891938:user/release-keys".toByteArray()
|
|
|
- override val bootId: ByteArray get() = "5974cb66-bb69-4e82-a436-836b98ebd88c".toByteArray()
|
|
|
+ override val bootId: ByteArray = ExternalImage.generateUUID(md5(getRandomByteArray(16))).toByteArray()
|
|
|
override val procVersion: ByteArray get() = "Linux version 3.0.31-g6fb96c9 ([email protected])".toByteArray()
|
|
|
override val baseBand: ByteArray get() = byteArrayOf()
|
|
|
override val version: DeviceInfo.Version get() = Version
|
|
|
override val simInfo: ByteArray get() = "T-Mobile".toByteArray()
|
|
|
override val osType: ByteArray get() = "android".toByteArray()
|
|
|
override val macAddress: ByteArray get() = "02:00:00:00:00:00".toByteArray()
|
|
|
- override val wifiBSSID: ByteArray?
|
|
|
- get() = "02:00:00:00:00:00".toByteArray()
|
|
|
- override val wifiSSID: ByteArray?
|
|
|
- get() = "<unknown ssid>".toByteArray()
|
|
|
- @UseExperimental(ExperimentalUnsignedTypes::class)
|
|
|
- override val imsiMd5: ByteArray
|
|
|
- get() = ubyteArrayOf(0xD4u, 0x1Du, 0x8Cu, 0xD9u, 0x8Fu, 0x00u, 0xB2u, 0x04u, 0xE9u, 0x80u, 0x09u, 0x98u, 0xECu, 0xF8u, 0x42u, 0x7Eu).toByteArray()
|
|
|
- override val imei: String get() = "858414524711993"
|
|
|
- @UseExperimental(ExperimentalUnsignedTypes::class)
|
|
|
- override val ipAddress: ByteArray
|
|
|
- get() = localIpAddress().split(".").map { it.toUByte().toByte() }.takeIf { it.size == 4 }?.toByteArray() ?: byteArrayOf()
|
|
|
+ override val wifiBSSID: ByteArray? get() = "02:00:00:00:00:00".toByteArray()
|
|
|
+ override val wifiSSID: ByteArray? get() = "<unknown ssid>".toByteArray()
|
|
|
+ override val imsiMd5: ByteArray get() = md5(getRandomByteArray(16))
|
|
|
+ override val imei: String get() = getRandomString(15, '0'..'9')
|
|
|
+ override val ipAddress: ByteArray get() = localIpAddress().split(".").map { it.toUByte().toByte() }.takeIf { it.size == 4 }?.toByteArray() ?: byteArrayOf()
|
|
|
override val androidId: ByteArray get() = display
|
|
|
override val apn: ByteArray get() = "wifi".toByteArray()
|
|
|
|