|
@@ -0,0 +1,42 @@
|
|
1
|
+package com.xhly.corelib.utils
|
|
2
|
+
|
|
3
|
+import android.os.Build
|
|
4
|
+
|
|
5
|
+class CustomOSUtils {
|
|
6
|
+ companion object {
|
|
7
|
+ /**
|
|
8
|
+ * 获得所有属性
|
|
9
|
+ */
|
|
10
|
+ public fun getAllSign(): String {
|
|
11
|
+ return Build::class.java.fields.joinToString("\n") {
|
|
12
|
+ "Build.${it.name} = ${
|
|
13
|
+ it.get(
|
|
14
|
+ it.name
|
|
15
|
+ )
|
|
16
|
+ }"
|
|
17
|
+ }
|
|
18
|
+
|
|
19
|
+ }
|
|
20
|
+
|
|
21
|
+ /**
|
|
22
|
+ * 获得系统版本
|
|
23
|
+ */
|
|
24
|
+ public fun getSystemDisplay(): String {
|
|
25
|
+ return Build.DISPLAY
|
|
26
|
+ }
|
|
27
|
+
|
|
28
|
+ /**
|
|
29
|
+ * 获得厂商
|
|
30
|
+ */
|
|
31
|
+ public fun getSystemBrand(): String {
|
|
32
|
+ return Build.BRAND
|
|
33
|
+ }
|
|
34
|
+
|
|
35
|
+ /**
|
|
36
|
+ * 获得手机型号
|
|
37
|
+ */
|
|
38
|
+ public fun getSystemDevice(): String {
|
|
39
|
+ return Build.DEVICE
|
|
40
|
+ }
|
|
41
|
+ }
|
|
42
|
+}
|