Parcourir la source

兼容潼南老版本需求

weizhengliang il y a 2 ans
Parent
commit
96f1fcc287

+ 2 - 2
build.gradle

@@ -47,12 +47,12 @@ buildscript {
     /**
      * APP版本码
      */
-    ext.app_version_code = 5
+    ext.app_version_code = 6
 
     /**
      * APP版本号
      */
-    ext.app_version = "1.0.5"
+    ext.app_version = "1.0.6"
 
     /**
      * 项目依赖库

+ 5 - 2
lcd_board/src/main/java/com/wdkl/lcd_board/activity/MainActivity.kt

@@ -108,8 +108,11 @@ class MainActivity :BaseActivity<MainActivityPresenter, ActivityMainLayoutBindin
     override fun init() {
 
         //获取mac地址
-        //Constant.LOCAL_MAC = NetHelper.getInstance().macAddress
-        Constant.LOCAL_MAC = NetHelper.getCPUSerial()
+        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
+            Constant.LOCAL_MAC = NetHelper.getInstance().macAddress
+        } else {
+            Constant.LOCAL_MAC = NetHelper.getCPUSerial()
+        }
 
         //注册广播
         regReceiver()

+ 1 - 2
lcd_board/src/main/java/com/wdkl/lcd_board/helper/NetHelper.java

@@ -511,8 +511,7 @@ public class NetHelper {
                     //查找到序列号所在行
                     if (str.indexOf("Serial") > -1) {
                         //提取序列号
-                        strCPU = str.substring(str.indexOf(":") + 1,
-                                str.length());
+                        strCPU = str.substring(str.indexOf(":") + 1, str.length());
                         //去空格
                         cpuAddress = strCPU.trim();
                         break;