app/src/main/java/safeluck/drive/evaluation/MainActivity.java
@@ -56,10 +56,12 @@
import safeluck.drive.evaluation.im.MessageProcessor;
import safeluck.drive.evaluation.platformMessage.JKMessage0100;
import safeluck.drive.evaluation.platformMessage.JKMessage0101;
import safeluck.drive.evaluation.platformMessage.PlatFormConstant;
import safeluck.drive.evaluation.util.CThreadPoolExecutor;
import safeluck.drive.evaluation.util.FileUtil;
import safeluck.drive.evaluation.util.PermissionManager;
import safeluck.drive.evaluation.util.SPUtils;
import safeluck.drive.evaluation.util.Utils;
import safeluck.drive.evaluation.viewmodels.ExamPlatformModel;
import safeluck.drive.evaluation.viewmodels.MainViewModel;
import safeluck.drive.evaluation.viewmodels.RTKConnAndLogin;
@@ -82,7 +84,7 @@
        @Override
        public void onCEvent(String topic, int msgCode, int resultCode, Object obj) {
            if (msgCode == Constant.FETCH_RTK_PLATFORM_INFO) {
              sendRtkConfigInfo();
//              sendRtkConfigInfo();
            }
            if (msgCode == Constant.RTK_PLATFORM_REGISTER_STATUS) {
                try {
@@ -102,8 +104,8 @@
                }
            }
            if (msgCode == Constant.NDK_START){
                MyLog.i(TAG,"NDK_start,发送RTK配置");
                sendRtkConfigInfo();
                MyLog.i(TAG,"NDK_start");
//                sendRtkConfigInfo();
                sendMcuUprgrade();
            }
        }
@@ -134,27 +136,27 @@
    }
    private void sendRtkConfigInfo() {
        if (mRTKConfig != null) {
            String rtkjson = gson.toJson(mRTKConfig);
            //去除id字段
            JSONObject jsonObject = null;
            try {
                jsonObject = new JSONObject(rtkjson);
            } catch (JSONException e) {
                e.printStackTrace();
            }
            jsonObject.remove("_id");
            rtkjson = null;
            rtkjson = jsonObject.toString();
            MyLog.i(TAG, "RTK配置信息:" + rtkjson);
            AYSdk.getInstance().sendCmd(Constant.PUSH_RTK_PLATFORM_INFO, rtkjson);
        } else {
            MyLog.d(TAG, "RTKConfig未取到数据");
            onlySendOnceRTKConfig = true;
        }
    }
//    private void sendRtkConfigInfo() {
//        if (mRTKConfig != null) {
//            String rtkjson = gson.toJson(mRTKConfig);
//
//            //去除id字段
//            JSONObject jsonObject = null;
//            try {
//                jsonObject = new JSONObject(rtkjson);
//            } catch (JSONException e) {
//                e.printStackTrace();
//            }
//            jsonObject.remove("_id");
//            rtkjson = null;
//            rtkjson = jsonObject.toString();
//            MyLog.i(TAG, "RTK配置信息:" + rtkjson);
//            AYSdk.getInstance().sendCmd(Constant.PUSH_RTK_PLATFORM_INFO, rtkjson);
//        } else {
//            MyLog.d(TAG, "RTKConfig未取到数据");
//            onlySendOnceRTKConfig = true;
//        }
//    }
public ExamPlatformModel examPlatformModel;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
@@ -200,13 +202,13 @@
                MyLog.i(TAG, "RTKConfig Changed: " + (rtkConfig != null ? rtkConfig.toString() : "null"));
                mRTKConfig = rtkConfig;
                if (rtkConfig != null)
                ExamPlatformData.getInstance().setPhone(rtkConfig.getPhone());
                ExamPlatformData.getInstance().setPhone(rtkConfig.getSn());
                synchronized (MainActivity.this){
                    if (onlySendOnceRTKConfig){
                        MyLog.i(TAG,"进入 synchronized (MainActivity.this)");
                        onlySendOnceRTKConfig = false;
                        sendRtkConfigInfo();
                    }
//                    if (onlySendOnceRTKConfig){
//                        MyLog.i(TAG,"进入 synchronized (MainActivity.this)");
//                        onlySendOnceRTKConfig = false;
//                        sendRtkConfigInfo();
//                    }
                }
            }
@@ -365,8 +367,15 @@
        }else{
            JKMessage0101 jkMessage0101 = new JKMessage0101();
            jkMessage0101.phone = ExamPlatformData.getInstance().getPhone();
            jkMessage0101.des =hexPwd;
            jkMessage0101.timestamp = (int) System.currentTimeMillis();
            String des = hexPwd;
            int time = (int) System.currentTimeMillis();
            jkMessage0101.timestamp = time;
            byte[] miwen = Utils.encrypt(com.anyun.im_lib.util.ByteUtil.intGetBytes(time),des);
            MyLog.i(PlatFormConstant.TAG,"鉴权密文="+BytesUtils.bytesToHexString(miwen)+" time="+time);
            jkMessage0101.des = BytesUtils.bytesToHexString(miwen);
            MessageProcessor.getInstance().sendMessage(jkMessage0101);
        }
    }