Administrator 1 week ago
parent
commit
c7caddbcbb
2 changed files with 25 additions and 6 deletions
  1. 18 6
      src/main/kotlin/cn/qqck/kotlin/tools/Android.kt
  2. 7 0
      src/test/kotlin/Main.kt

+ 18 - 6
src/main/kotlin/cn/qqck/kotlin/tools/Android.kt

@@ -14,6 +14,12 @@ object Android {
          * - Xiaomi
          */
         val brand: String,
+        /**
+         * 主板、cpu代号?
+         * - ro.product.board
+         * - Xiaomi
+         */
+        val board: String,
         /**
          * 手机型号
          * - ro.product.model
@@ -32,6 +38,12 @@ object Android {
          * - Xiaomi
          */
         val manufacturer: String,
+        /**
+         * 硬件名
+         * - ro.hardware
+         * - qcom
+         */
+        val hardware: String,
         /**
          * 系统版本
          * - Build.VERSION.RELEASE
@@ -70,27 +82,27 @@ object Android {
 
     private val array = arrayOf(
         Info(
-            "cmi", "Xiaomi", "M2001J1E", "cmi", "Xiaomi", "10", "29",
+            "cmi", "Xiaomi", "lahaina", "M2001J1E", "cmi", "Xiaomi", "qcom", "10", "29",
             "Qualcomm", "Adreno (TM) 650", 8, "Linux aarch64",
         ),
         Info(
-            "cmi", "Xiaomi", "M2001J1E", "cmi", "Xiaomi", "10", "29",
+            "cmi", "Xiaomi", "lahaina", "M2001J1E", "cmi", "Xiaomi", "qcom", "10", "29",
             "Qualcomm", "Adreno (TM) 650", 12, "Linux aarch64",
         ),
         Info(
-            "nuwa", "Xiaomi", "2210132C", "nuwa", "Xiaomi", "13", "33",
+            "nuwa", "Xiaomi", "kalama", "2210132C", "nuwa", "Xiaomi", "qcom", "13", "33",
             "Qualcomm", "Adreno (TM) 740", 8, "Linux aarch64",
         ),
         Info(
-            "nuwa", "Xiaomi", "2210132C", "nuwa", "Xiaomi", "13", "33",
+            "nuwa", "Xiaomi", "kalama", "2210132C", "nuwa", "Xiaomi", "qcom", "13", "33",
             "Qualcomm", "Adreno (TM) 740", 12, "Linux aarch64",
         ),
         Info(
-            "shennong", "Xiaomi", "23116PN5BC", "shennong", "Xiaomi", "13", "33",
+            "shennong", "Xiaomi", "kalama", "23116PN5BC", "shennong", "Xiaomi", "qcom", "13", "33",
             "Qualcomm", "Adreno (TM) 750", 12, "Linux aarch64",
         ),
         Info(
-            "shennong", "Xiaomi", "23116PN5BC", "shennong", "Xiaomi", "13", "33",
+            "shennong", "Xiaomi", "kalama", "23116PN5BC", "shennong", "Xiaomi", "qcom", "13", "33",
             "Qualcomm", "Adreno (TM) 750", 16, "Linux aarch64",
         ),
     )

+ 7 - 0
src/test/kotlin/Main.kt

@@ -1,4 +1,6 @@
 import cn.qqck.kotlin.tools.*
+import okhttp3.MediaType.Companion.toMediaType
+import okhttp3.RequestBody.Companion.toRequestBody
 import java.io.File
 
 fun main() {
@@ -9,6 +11,11 @@ fun main() {
         defer { println(2) }
         defer { println(3) }
     }
+    val j_url = "http://www.baidu.com"
+    val j_post = "id=aaaaaaaaaaaaa".toRequestBody("application/x-www-form-urlencoded".toMediaType())
+    Okhttp.call(j_url) { it.post(j_post) }
+    Okhttp.call(j_url) { it.post(j_post) }
+    Okhttp.call(j_url) { it.post(j_post) }
 }
 
 fun ggcz_用户() {