|
@@ -0,0 +1,99 @@
|
|
|
+package cn.qqck.kotlin.tools
|
|
|
+
|
|
|
+object Android {
|
|
|
+ data class Info(
|
|
|
+ /**
|
|
|
+ * 手机正式名称、手机品牌
|
|
|
+ * - ro.product.name
|
|
|
+ * - cmi
|
|
|
+ */
|
|
|
+ val name: String,
|
|
|
+ /**
|
|
|
+ * 手机品牌
|
|
|
+ * - ro.product.brand
|
|
|
+ * - Xiaomi
|
|
|
+ */
|
|
|
+ val brand: String,
|
|
|
+ /**
|
|
|
+ * 手机型号
|
|
|
+ * - ro.product.model
|
|
|
+ * - M2001J1E
|
|
|
+ */
|
|
|
+ val model: String,
|
|
|
+ /**
|
|
|
+ * 设备名
|
|
|
+ * - ro.product.device
|
|
|
+ * - cmi
|
|
|
+ */
|
|
|
+ val device: String,
|
|
|
+ /**
|
|
|
+ * 制造商
|
|
|
+ * - ro.product.manufacturer
|
|
|
+ * - Xiaomi
|
|
|
+ */
|
|
|
+ val manufacturer: String,
|
|
|
+ /**
|
|
|
+ * 系统版本
|
|
|
+ * - Build.VERSION.RELEASE
|
|
|
+ * - 10、11
|
|
|
+ */
|
|
|
+ val version: String,
|
|
|
+ /**
|
|
|
+ * 设备首次使用的 API 级别(Android 版本)
|
|
|
+ * - ro.product.firstApiLevel
|
|
|
+ * - Android(29、32、33)
|
|
|
+ */
|
|
|
+ val firstApiLevel: String,
|
|
|
+ /**
|
|
|
+ * GPU 供应商
|
|
|
+ * - ro.gpu.vendor
|
|
|
+ * - Qualcomm
|
|
|
+ */
|
|
|
+ val gpu_vendor: String,
|
|
|
+ /**
|
|
|
+ * GPU 型号
|
|
|
+ * - ro.gpu.renderer
|
|
|
+ * - Adreno (TM) 650
|
|
|
+ */
|
|
|
+ val gpu_renderer: String,
|
|
|
+ /**
|
|
|
+ * 运行内存
|
|
|
+ * - 8、12
|
|
|
+ */
|
|
|
+ val ram: Int,
|
|
|
+ /**
|
|
|
+ * 手机平台信息
|
|
|
+ * - Linux aarch64、Linux armv8l
|
|
|
+ */
|
|
|
+ val platfrom: String,
|
|
|
+ )
|
|
|
+
|
|
|
+ private val array = arrayOf(
|
|
|
+ Info(
|
|
|
+ "cmi", "Xiaomi", "M2001J1E", "cmi", "Xiaomi", "10", "29",
|
|
|
+ "Qualcomm", "Adreno (TM) 650", 8, "Linux aarch64",
|
|
|
+ ),
|
|
|
+ Info(
|
|
|
+ "cmi", "Xiaomi", "M2001J1E", "cmi", "Xiaomi", "10", "29",
|
|
|
+ "Qualcomm", "Adreno (TM) 650", 12, "Linux aarch64",
|
|
|
+ ),
|
|
|
+ Info(
|
|
|
+ "nuwa", "Xiaomi", "2210132C", "nuwa", "Xiaomi", "13", "33",
|
|
|
+ "Qualcomm", "Adreno (TM) 740", 8, "Linux aarch64",
|
|
|
+ ),
|
|
|
+ Info(
|
|
|
+ "nuwa", "Xiaomi", "2210132C", "nuwa", "Xiaomi", "13", "33",
|
|
|
+ "Qualcomm", "Adreno (TM) 740", 12, "Linux aarch64",
|
|
|
+ ),
|
|
|
+ Info(
|
|
|
+ "shennong", "Xiaomi", "23116PN5BC", "shennong", "Xiaomi", "13", "33",
|
|
|
+ "Qualcomm", "Adreno (TM) 750", 12, "Linux aarch64",
|
|
|
+ ),
|
|
|
+ Info(
|
|
|
+ "shennong", "Xiaomi", "23116PN5BC", "shennong", "Xiaomi", "13", "33",
|
|
|
+ "Qualcomm", "Adreno (TM) 750", 16, "Linux aarch64",
|
|
|
+ ),
|
|
|
+ )
|
|
|
+
|
|
|
+ fun random(): Info = array.random()
|
|
|
+}
|