Skip to content

Commit

Permalink
2020.10.19:使用so库
Browse files Browse the repository at this point in the history
  • Loading branch information
konewu committed Oct 22, 2020
1 parent 784daa5 commit e3c45d0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static BleData getInstance() {
* 查询是否正在执行命令
* @return boolean
*/
public boolean isExeCmding() {
private boolean isExeCmding() {
return isExeCmding;
}

Expand Down Expand Up @@ -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());
}

Expand Down

0 comments on commit e3c45d0

Please sign in to comment.