Browse Source

1.修复安装App状态上报时机的BUG

JaycePC 2 months ago
parent
commit
8535ad7b17

+ 2 - 1
app/build.gradle

@@ -13,7 +13,7 @@ android {
         //noinspection ExpiredTargetSdkVersion
         targetSdk 28
         versionCode 1
-        versionName "1.6"
+        versionName "2.0"
 
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
@@ -73,5 +73,6 @@ dependencies {
     implementation "androidx.work:work-runtime:2.9.1"
     //noinspection UseTomlInstead
     implementation("org.greenrobot:eventbus:3.3.1")
+    //noinspection UseTomlInstead
     implementation 'com.github.anrwatchdog:anrwatchdog:1.4.0'
 }

+ 1 - 7
app/src/main/java/xn/update/MainActivity.java

@@ -40,16 +40,10 @@ public class MainActivity extends AppCompatActivity {
         // 启动后台任务
         Tool.INSTANCE.startTaskService();
         // 先启动主应用
-        Tool.INSTANCE.startMasterApp();
+        Tool.INSTANCE.openApp("xn.xxp");
 
-        EdgeToEdge.enable(this);
         binding = ActivityMainBinding.inflate(getLayoutInflater());
         setContentView(binding.getRoot());
-        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
-            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
-            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
-            return insets;
-        });
     }
 
     @Override

+ 0 - 4
app/src/main/java/xn/update/Tool.java

@@ -49,10 +49,6 @@ public enum Tool {
         return ShellUtils.execCmd("am force-stop " + packageName, true);
     }
 
-    public void startMasterApp() {
-        openApp(SPUtils.getInstance().getString("masterApp", "xn.xxp"));
-    }
-
     public void startTaskService() {
 
         cmd("am startservice -n xn.update/xn.update.service.TaskService");

+ 5 - 0
app/src/main/java/xn/update/http/HttpTool.java

@@ -49,4 +49,9 @@ public enum HttpTool {
         return OkHttpUtils.INSTANCE.postSync(Tool.INSTANCE.getBaseUrl() + "terminal/sys/config/info/getConfigByType", jsonObject.toString());
     }
 
+    public Response heartbeat() throws JSONException, IOException {
+        JSONObject jsonObject = new JSONObject();
+        return OkHttpUtils.INSTANCE.postSync(Tool.INSTANCE.getBaseUrl() + "terminal/sys/config/info/getConfigByType", jsonObject.toString());
+    }
+
 }

+ 145 - 0
app/src/main/java/xn/update/http/bean/request/DeviceInfo.java

@@ -0,0 +1,145 @@
+package xn.update.http.bean.request;
+
+import java.util.List;
+
+public class DeviceInfo {
+    // 状态栏是否开启
+    private boolean isStatusBarEnable;
+    // 导航栏是否开启
+    private boolean isNavBarEnable;
+    // 网络配置
+    private NetworkInfo networkInfo;
+    // 时间配置
+    private TimeInfo timeInfo;
+    // 系统配置
+    private SystemInfo systemInfo;
+    // App配置
+    private List<AppInfo> appInfoList;
+
+
+    private static class AppInfo {
+        private String versionName;
+        private String packageName;
+        private boolean isShow;
+    }
+
+    private static class TimeInfo {
+        // 开机时间  默认-1
+        private long onTime;
+        // 关机时间 默认-1
+        private long offTime;
+        /**
+         * 门禁点锁状态1
+         * true-当前锁处于上电锁门状态
+         * false-当前锁处于断电开门状态或参数错误
+         */
+        private boolean electricLock1;
+        /**
+         * 门禁点锁状态2
+         * true-当前锁处于上电锁门状态
+         * false-当前锁处于断电开门状态或参数错误
+         */
+        private boolean electricLock2;
+    }
+
+    private static class SystemInfo {
+        /**
+         * 设备型号
+         * 返回设备型号,获取失败时返回默认值 DS-D60A
+         */
+        private String deviceType;
+        /**
+         * 设备序列号
+         * 返回设备序列号, 获取失败时返回默认值 40000000
+         */
+        private String sn;
+        /**
+         * adb状态
+         * 0 代表 ADB 未打开
+         * 1 代表 ADB 打开
+         */
+        private int adbStatus;
+        /**
+         * 设备箱体温度
+         * 返回失败或没有温度传感器,”faild”字符串
+         * 成功返回例 37
+         */
+        private String temperature;
+        /**
+         * 系统编译版本号
+         * 获取失败返回”unknown”字符串
+         * 成功返回例 V2.0.0 build 171226
+         */
+        private String buildDesc;
+        /**
+         * 系统MCU版本号
+         * 获取失败返回 null
+         * 成功返回例 V1.0.0 build 171226
+         */
+        private String mcuVersion;
+
+        /**
+         * CPU使用率 当前 Cpu 的使用率,百分比,
+         * 获取失败时返回”-1.00”字符串
+         */
+        private String cpuUsageRate;
+        /**
+         * GPU使用率 当前 Gpu 的使用率,百分比,
+         * 获取失败时返回”-1.00”字符串
+         */
+        private String gpuUsageRate;
+        // 已使用内存大小(单位 MB)
+        private int used;
+        // 总内存大小(MB)
+        private int total;
+        // 583.00MB/1.96GB
+        private String describe;
+        private int describeContents;
+        // 获取SDK版本 返回 SDK 版本号,获取失败返回”none”字符串
+        private String sdkVersion;
+        // 为当前生效的默认 Launcher 应用包名,默认(始终)Launcher 应用修改后该值即时更新。如果当前系统未设置默认(始终)Launcher,则该值为空字符串(“”)。
+        private String currentLauncherName;
+        // 为持久化文件中保存的默认 Launcher 应用包名,默认 Launcher 应用修改后约 10 秒后该值才会更新,该值仅当系统内存在 2 个及以上Launcher 应用时才会存在,否则为空字符串(“”)。
+        private String preferredLauncherName;
+    }
+
+    private static class NetworkInfo {
+        /**
+         * ip
+         * 代表有线网络 ip 地址
+         * 默认值:”0.0.0.0”
+         */
+        private String ip;
+        /**
+         * dhcp
+         * 0—代表自动获取网络(默认)
+         * 1—代表静态设置网络信息模式
+         */
+        private int dhcp;
+        // dns1 默认值:”0.0.0.0”
+        private String dns1;
+        // dns2 默认值:”0.0.0.0”
+        private String dns2;
+        /**
+         * mac
+         * 代表有线网络 mac 地址,
+         * 有线网络未连接时,该属性仍有值,
+         * 默认值:”00:00:00:00:00:00”
+         */
+        private String mac;
+        /**
+         * route
+         * 代表有线网络网关地址
+         * 默认值:”0.0.0.0”
+         */
+        private String route;
+        /**
+         * subnetMask
+         * 代表有线网络子网掩码地址
+         * 默认值:”0.0.0.0”
+         */
+        private String subnetMask;
+        // 最优Ip地址   以太网>无线网>3、4G
+        private String optimalIp;
+    }
+}

+ 8 - 8
app/src/main/java/xn/update/http/bean/response/UpdateTask.java

@@ -56,7 +56,7 @@ public class UpdateTask {
         private String versionName;
         private String startLaunchPackage;
         private boolean isForceUpdate;
-        private String appPackageName;
+//        private String appPackageName = "xn.xxp";
 
         public boolean isForceUpdate() {
             return isForceUpdate;
@@ -66,13 +66,13 @@ public class UpdateTask {
             isForceUpdate = forceUpdate;
         }
 
-        public String getAppPackageName() {
-            return appPackageName;
-        }
-
-        public void setAppPackageName(String appPackageName) {
-            this.appPackageName = appPackageName;
-        }
+//        public String getAppPackageName() {
+//            return appPackageName;
+//        }
+//
+//        public void setAppPackageName(String appPackageName) {
+//            this.appPackageName = appPackageName;
+//        }
 
         public String getTaskId() {
             return taskId;

+ 4 - 0
app/src/main/java/xn/update/receiver/BootReceiver.java

@@ -0,0 +1,4 @@
+package xn.update.receiver;
+
+public class BootReceiver {
+}

+ 35 - 34
app/src/main/java/xn/update/receiver/TimeTickReceiver.java

@@ -79,14 +79,16 @@ public class TimeTickReceiver extends BroadcastReceiver {
                                         LogUtils.e(Log.getStackTraceString(e));
                                     }
                                 });
+                                // 当前App自升级
                                 if (task.getStartLaunchPackage().equals(AppUtils.getAppPackageName())) {
                                     AsyncTask.execute(() -> {
                                         try {
-                                            if (AppUtils.getAppPackageName().equals(task.getAppPackageName())) {
+                                            HttpTool.INSTANCE.updateCallBack(task.getTaskId(), task.getDeviceCode(), true, true);
+                                            if (AppUtils.getAppPackageName().equals("xn.xxp")) {
                                                 Tool.INSTANCE.cmd("pm install -d -g " + apkPath + apkName);
                                                 Tool.INSTANCE.openApp(task.getStartLaunchPackage());
                                             } else {
-                                                ShellUtils.execCmdAsync("pm uninstall " + task.getAppPackageName(), true, new Utils.Consumer<ShellUtils.CommandResult>() {
+                                                ShellUtils.execCmdAsync("pm uninstall " + "xn.xxp", true, new Utils.Consumer<ShellUtils.CommandResult>() {
                                                     @Override
                                                     public void accept(ShellUtils.CommandResult commandResult) {
                                                         LogUtils.d(commandResult);
@@ -95,12 +97,13 @@ public class TimeTickReceiver extends BroadcastReceiver {
                                                     }
                                                 });
                                             }
-                                            HttpTool.INSTANCE.updateCallBack(task.getTaskId(), task.getDeviceCode(), true, true);
                                         } catch (IOException | JSONException e) {
                                             LogUtils.e(Log.getStackTraceString(e));
                                         }
                                     });
-                                } else {
+                                }
+                                // 升级其它App
+                                else {
                                     ShellUtils.CommandResult commandResult = ShellUtils.execCmd("pm install -d -g " + apkPath + apkName, true);
                                     LogUtils.d("安装app", commandResult);
                                     if (commandResult.result == 0) {
@@ -112,7 +115,7 @@ public class TimeTickReceiver extends BroadcastReceiver {
                                                 LogUtils.e(Log.getStackTraceString(e));
                                             }
                                         });
-                                        Tool.INSTANCE.startMasterApp();
+                                        Tool.INSTANCE.openApp("xn.xxp");
                                     } else {
                                         LogUtils.e(commandResult.errorMsg);
                                     }
@@ -173,42 +176,40 @@ public class TimeTickReceiver extends BroadcastReceiver {
     }
 
     private void startMasterApp() {
-        if (SPUtils.getInstance().getBoolean(AppConstant.AUTO_MASTER, true)) {
-            ThreadUtils.executeByCached(new ThreadUtils.SimpleTask<Object>() {
-                @Override
-                public Object doInBackground() throws Throwable {
-                    try {
-                        ShellUtils.CommandResult commandResult = ShellUtils.execCmd("dumpsys activity activities", true);
-                        BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(commandResult.successMsg.getBytes())));
-                        String line;
-                        while ((line = reader.readLine()) != null) {
-                            if (line.contains("mResumedActivity") || line.contains("mCurrentFocus")) {
-                                String[] itemArray = line.split(" ", -1);
-                                for (String item : itemArray) {
-                                    if (item.contains("/")) {
-                                        String packageName = item.substring(0, item.indexOf("/"));
-                                        if (!"xn.xxp".equals(packageName)) {
-                                            LogUtils.d("定时拉起主应用");
-                                            Tool.INSTANCE.stopApp("xn.xxp");
-                                            Tool.INSTANCE.startMasterApp();
-                                        }
-                                        break;
+        ThreadUtils.executeByCached(new ThreadUtils.SimpleTask<Object>() {
+            @Override
+            public Object doInBackground() throws Throwable {
+                try {
+                    ShellUtils.CommandResult commandResult = ShellUtils.execCmd("dumpsys activity activities", true);
+                    BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(commandResult.successMsg.getBytes())));
+                    String line;
+                    while ((line = reader.readLine()) != null) {
+                        if (line.contains("mResumedActivity") || line.contains("mCurrentFocus")) {
+                            String[] itemArray = line.split(" ", -1);
+                            for (String item : itemArray) {
+                                if (item.contains("/")) {
+                                    String packageName = item.substring(0, item.indexOf("/"));
+                                    if (!"xn.xxp".equals(packageName)) {
+                                        LogUtils.d("定时拉起主应用");
+                                        Tool.INSTANCE.stopApp("xn.xxp");
+                                        Tool.INSTANCE.openApp("xn.xxp");
                                     }
+                                    break;
                                 }
-                                break;
                             }
+                            break;
                         }
-                    } catch (Exception e) {
-                        LogUtils.e(Log.getStackTraceString(e));
                     }
-                    return null;
+                } catch (Exception e) {
+                    LogUtils.e(Log.getStackTraceString(e));
                 }
+                return null;
+            }
 
-                @Override
-                public void onSuccess(Object result) {
+            @Override
+            public void onSuccess(Object result) {
 
-                }
-            });
-        }
+            }
+        });
     }
 }

+ 126 - 22
app/src/main/java/xn/update/service/TaskService.java

@@ -27,9 +27,14 @@ import com.blankj.utilcode.util.LogUtils;
 import com.blankj.utilcode.util.NetworkUtils;
 import com.blankj.utilcode.util.SPUtils;
 import com.blankj.utilcode.util.ThreadUtils;
+import com.hikvision.dmb.EthernetConfig;
+import com.hikvision.dmb.LauncherInfo;
+import com.hikvision.dmb.MemoryInfo;
+import com.hikvision.dmb.TimeSwitchConfig;
 import com.hikvision.dmb.display.InfoDisplayApi;
 import com.hikvision.dmb.network.InfoNetworkApi;
 import com.hikvision.dmb.system.InfoSystemApi;
+import com.hikvision.dmb.time.InfoTimeApi;
 import com.hikvision.dmb.util.InfoUtilApi;
 import com.hjq.permissions.OnPermissionCallback;
 import com.hjq.permissions.Permission;
@@ -41,8 +46,11 @@ import org.json.JSONObject;
 
 import java.io.File;
 import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import okhttp3.Response;
 import xn.update.R;
@@ -56,7 +64,8 @@ import xn.update.works.TaskWork;
 public class TaskService extends Service {
 
     private TimeTickReceiver timeTickReceiver;
-    private CountDownTimer permissionCdt;
+    private final AtomicBoolean isUploading = new AtomicBoolean(false);
+    private ScheduledExecutorService scheduler;
 
     @Nullable
     @Override
@@ -67,6 +76,28 @@ public class TaskService extends Service {
     @Override
     public void onCreate() {
         super.onCreate();
+        scheduler = Executors.newSingleThreadScheduledExecutor();
+        scheduler.scheduleWithFixedDelay(new Runnable() {
+            @Override
+            public void run() {
+                if (!isUploading.compareAndSet(false, true)) {
+                    return;
+                }
+                ThreadUtils.executeByCached(new ThreadUtils.SimpleTask<Object>() {
+                    @Override
+                    public Object doInBackground() throws Throwable {
+                        Response response = HttpTool.INSTANCE.heartbeat();
+                        LogUtils.d("发送心跳");
+                        return null;
+                    }
+
+                    @Override
+                    public void onSuccess(Object result) {
+                        isUploading.set(false);
+                    }
+                });
+            }
+        }, 0, 2, TimeUnit.SECONDS);
         // 卸载老旧app
         Tool.INSTANCE.cmd("pm uninstall com.dlc.xn.eboard");
 
@@ -81,7 +112,6 @@ public class TaskService extends Service {
         InfoSystemApi.openAdb();
         InfoDisplayApi.setStatusBarEnable(false);
         InfoDisplayApi.setNavigationBarEnable(false);
-        InfoUtilApi.setUsbSwitch(false);
         SPUtils.getInstance().put("isRoot", 0 == InfoUtilApi.getRoot());
         SPUtils.getInstance().put("IP", InfoNetworkApi.getEthernetConfig().ipAddress);
         InfoUtilApi.enableProtection(AppUtils.getAppPackageName(), false);
@@ -95,31 +125,33 @@ public class TaskService extends Service {
         Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.READ_EXTERNAL_STORAGE");
         Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.WRITE_EXTERNAL_STORAGE");
         Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.NOTIFICATION_SERVICE");
-        permissionCdt = new CountDownTimer(1000, 1000) {
+        ThreadUtils.executeByCachedAtFixRate(new ThreadUtils.SimpleTask<Boolean>() {
             @Override
-            public void onTick(long millisUntilFinished) {
-
-            }
-
-            @Override
-            public void onFinish() {
-                if (!XXPermissions.isGranted(ActivityUtils.getTopActivity(), Permission.READ_EXTERNAL_STORAGE)
-                        || !XXPermissions.isGranted(ActivityUtils.getTopActivity(), Permission.WRITE_EXTERNAL_STORAGE)
-                        || !XXPermissions.isGranted(ActivityUtils.getTopActivity(), Permission.NOTIFICATION_SERVICE)
-                ) {
-                    Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.READ_EXTERNAL_STORAGE");
-                    Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.WRITE_EXTERNAL_STORAGE");
-                    Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.NOTIFICATION_SERVICE");
-                    permissionCdt.start();
+            public Boolean doInBackground() throws Throwable {
+                if (null == ActivityUtils.getTopActivity()) {
+                    Tool.INSTANCE.stopApp(AppUtils.getAppPackageName());
+                    Tool.INSTANCE.openApp(AppUtils.getAppPackageName());
                 } else {
-                    requestPermission();
-                    permissionCdt.cancel();
-                    permissionCdt = null;
+                    if (!XXPermissions.isGranted(ActivityUtils.getTopActivity(), Permission.READ_EXTERNAL_STORAGE)
+                            || !XXPermissions.isGranted(ActivityUtils.getTopActivity(), Permission.WRITE_EXTERNAL_STORAGE)
+                            || !XXPermissions.isGranted(ActivityUtils.getTopActivity(), Permission.NOTIFICATION_SERVICE)
+                    ) {
+                        Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.READ_EXTERNAL_STORAGE");
+                        Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.WRITE_EXTERNAL_STORAGE");
+                        Tool.INSTANCE.cmd("pm grant " + AppUtils.getAppPackageName() + " android.permission.NOTIFICATION_SERVICE");
+                    } else {
+                        return true;
+                    }
                 }
+                return false;
+            }
 
+            @Override
+            public void onSuccess(Boolean result) {
+                requestPermission();
+                cancel();
             }
-        };
-        permissionCdt.start();
+        }, 1, 1, TimeUnit.SECONDS);
     }
 
     @Override
@@ -140,6 +172,9 @@ public class TaskService extends Service {
     @Override
     public void onDestroy() {
         super.onDestroy();
+        if (null != scheduler) {
+            scheduler.shutdown();
+        }
         if (null != timeTickReceiver) {
             unregisterReceiver(timeTickReceiver);
             timeTickReceiver = null;
@@ -247,6 +282,75 @@ public class TaskService extends Service {
                     @Override
                     public void onSuccess(Pair<Boolean, String> result) {
                         if (result.first) {
+//                            // 状态栏是否开启
+//                            boolean isStatusBarEnable = InfoDisplayApi.getStatusBarEnable();
+//                            // 导航栏是否开启
+//                            boolean isNavBarEnable = InfoDisplayApi.getNavigationBarEnable();
+//
+//                            EthernetConfig ethernetConfig = InfoNetworkApi.getEthernetConfig();
+//                            // Ip
+//                            String ip = ethernetConfig.getIpAddress();
+//                            // dhcp
+//                            int dhcp = ethernetConfig.getDhcp();
+//                            // dns1
+//                            String dns1 = ethernetConfig.getDns1Address();
+//                            // dns2
+//                            String dns2 = ethernetConfig.getDns2Address();
+//                            // mac
+//                            String mac = ethernetConfig.getMacAddress();
+//                            // route
+//                            String route = ethernetConfig.getRouteAddress();
+//                            // subnetMask
+//                            String subnetMask = ethernetConfig.getSubnetMask();
+//                            // 最优Ip地址   以太网>无线网>3、4G
+//                            String optimalIp = InfoNetworkApi.getOptimalIp();
+//                            // 设备型号
+//                            String deviceType = InfoSystemApi.getDeviceType();
+//                            // 设备序列号
+//                            String sn = InfoSystemApi.getSerialNumber();
+//                            // adb状态
+//                            int adbStatus = InfoSystemApi.getAdbStatus();
+//                            // 设备箱体温度
+//                            String temperature = InfoSystemApi.getTemperature();
+//                            // 系统编译版本号 V2.0.0 build 171226
+//                            String buildDesc = InfoSystemApi.getBuildDesc();
+//                            // 系统MCU版本号 V1.0.0 build 171226
+//                            String mcuVersion = InfoSystemApi.getMcuVersion();
+//                            // CPU使用率 当前 Cpu 的使用率,百分比,获取失败时返回”-1.00”字符串
+//                            String cpuUsageRate = InfoSystemApi.getCpuUsageRate();
+//                            // GPU使用率 当前 Gpu 的使用率,百分比,获取失败时返回”-1.00”字符串
+//                            String gpuUsageRate = InfoSystemApi.getGpuUsageRate();
+//                            // 获取内存使用情况
+//                            MemoryInfo memoryInfo = InfoSystemApi.getMemoryUsage();
+//                            // MemoryInfo .used 已使用内存大小(单位 MB)
+//                            int used = memoryInfo.used;
+//                            // MemoryInfo.total 总内存大小(MB)
+//                            int total = memoryInfo.total;
+//                            // MemoryInfo.describe 583.00MB/1.96GB
+//                            String describe = memoryInfo.describe;
+//                            int describeContents = memoryInfo.describeContents();
+//                            // 获取SDK版本 返回 SDK 版本号,获取失败返回”none”字符串
+//                            String sdkVersion = InfoSystemApi.getSdkVersion();
+//                            // 如果系统不支持该接口,则 currentLauncherName 和 preferredLauncherName 的值均为空字符串(“”)。
+//                            // 关于“默认“一词,默认 Launcher 即多个 Launcher 应用中优先级最高的,默认启动的。
+//                            LauncherInfo launcherInfo = InfoSystemApi.getLauncherName();
+//                            // 为当前生效的默认 Launcher 应用包名,默认(始终)Launcher 应用修改后该值即时更新。如果当前系统未设置默认(始终)Launcher,则该值为空字符串(“”)。
+//                            String currentLauncherName = launcherInfo.getCurrentLauncherName();
+//                            // 为持久化文件中保存的默认 Launcher 应用包名,默认 Launcher 应用修改后约 10 秒后该值才会更新,该值仅当系统内存在 2 个及以上Launcher 应用时才会存在,否则为空字符串(“”)。
+//                            String preferredLauncherName = launcherInfo.getPreferredLauncherName();
+//                            // 获取定时开关机计划
+//                            TimeSwitchConfig timeSwitchConfig = InfoTimeApi.getTimeSwitch();
+//                            // 开机时间  默认-1
+//                            long onTime = timeSwitchConfig.setOnTime;
+//                            // 关机时间 默认-1
+//                            long offTime = timeSwitchConfig.setOffTime;
+//                            // 门禁点锁状态1 true-当前锁处于上电锁门状态
+//                            //             false-当前锁处于断电开门状态或参数错误
+//                            boolean electricLock1 = InfoUtilApi.getElectricLock(1);
+//                            // 门禁点锁状态2
+//                            boolean electricLock2 = InfoUtilApi.getElectricLock(2);
+
+
                             EventBus.getDefault().post(new UpdateUiEvent(result.second));
                             ThreadUtils.cancel(simpleTask);
                         } else {