From e3c45d0651f47a3408125556aae5fe470beb1252 Mon Sep 17 00:00:00 2001 From: konewu <379301272@qq.com> Date: Thu, 22 Oct 2020 11:30:46 +0800 Subject: [PATCH] =?UTF-8?q?2020.10.19=EF=BC=9A=E4=BD=BF=E7=94=A8so?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/sinovotec/sinovoble/common/BleData.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sinovoble/src/main/java/com/sinovotec/sinovoble/common/BleData.java b/sinovoble/src/main/java/com/sinovotec/sinovoble/common/BleData.java index f5638ad..389486a 100644 --- a/sinovoble/src/main/java/com/sinovotec/sinovoble/common/BleData.java +++ b/sinovoble/src/main/java/com/sinovotec/sinovoble/common/BleData.java @@ -36,7 +36,7 @@ public static BleData getInstance() { * 查询是否正在执行命令 * @return boolean */ - public boolean isExeCmding() { + private boolean isExeCmding() { return isExeCmding; } @@ -310,20 +310,20 @@ public LinkedHashMap getDataFromBle(String data){ * @param data String */ public void exeCommand(String funcode, String data, boolean toTop){ - String data_send = data; + StringBuilder data_send = new StringBuilder(data); int byteLen = data.length() /2; byteLen += data.length() %2; //如果data 不够16字节,则在后面补ff for (int i=32;i> data.length(); i--) { - data_send += "f"; + data_send.append("f"); } Log.d(TAG, "需要发送的数据,在补f之后:"+data_send + ",长度:"+data_send.length()); //加密处理 if (!funcode.equals("00")){ String mac = SinovoBle.getInstance().getLockMAC().replace(":",""); - data_send = SinovoBle.getInstance().getMyJniLib().encryptAes(data_send,mac); + data_send = new StringBuilder(SinovoBle.getInstance().getMyJniLib().encryptAes(data_send.toString(), mac)); //data_send = encryptData(data_send, SinovoBle.getInstance().getLockMAC()); }