From: SnickerSun Date: Thu, 8 Jul 2021 06:49:31 +0000 (+0800) Subject: release protocolV2 V889 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=e0c8b4a31d828f49e611f6b9c6be6d59ff00c031;p=protocol_srv.git release protocolV2 V889 更新一版Gator协议。 识别AP09 闹铃,AP22 静默时段 , 微聊BP34 三个指令只做到解析回复,未完全实现与功能对接,或者有bug 增加了语言切换 通讯录 音量设置 BP34查询app下载url等 --- diff --git a/app/release/ICSer_V888_2107070948_release.apk b/app/release/ICSer_V889_2107081444_release.apk similarity index 76% rename from app/release/ICSer_V888_2107070948_release.apk rename to app/release/ICSer_V889_2107081444_release.apk index d7e1499a..6f1acefb 100644 Binary files a/app/release/ICSer_V888_2107070948_release.apk and b/app/release/ICSer_V889_2107081444_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 95b0cf6c..1835b9fb 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":888,"versionName":"2107070948","enabled":true,"outputFile":"ICSer_V888_2107070948_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V888_2107070948_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":889,"versionName":"2107081444","enabled":true,"outputFile":"ICSer_V889_2107081444_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V889_2107081444_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/utils/AESCipher.java b/app/src/main/java/com/enqualcomm/support/utils/AESCipher.java index 130de512..76b2efba 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/AESCipher.java +++ b/app/src/main/java/com/enqualcomm/support/utils/AESCipher.java @@ -197,7 +197,15 @@ public class AESCipher { } return null; } + public static byte[] aesDecryptBytesgFixedKey(byte[] bytes){ + try{ + return aesDecryptBytes(bytes,AES_KEY.getBytes(charset)); + }catch(Exception e){ + ICLogger.e(e.getMessage(),e); + } + return null; + } public static byte[] aesEncryptBytesFixedKey(byte[] bytes){ try{ diff --git a/app/src/main/java/com/enqualcomm/support/utils/LanguageUtils.java b/app/src/main/java/com/enqualcomm/support/utils/LanguageUtils.java index 88ef6f1d..69f419f6 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/LanguageUtils.java +++ b/app/src/main/java/com/enqualcomm/support/utils/LanguageUtils.java @@ -21,6 +21,7 @@ public class LanguageUtils { public static void changeLanguageByIndex(Context mContext, String index){ + //1 意大利,2 德语,3 法语,4 中文,5, 英文 , 6 俄语 String languageName=mContext.getResources().getString(R.string.zh); String msg_index_no=index; if(msg_index_no.equals("1")){ @@ -33,6 +34,8 @@ public class LanguageUtils { languageName=mContext.getResources().getString(R.string.zh); }else if(msg_index_no.equals("5")){ languageName=mContext.getResources().getString(R.string.en); + }else if(msg_index_no.equals("6")){ + languageName=mContext.getResources().getString(R.string.ru); } ICLogger.i("切换到语言 "+languageName); LanguageUtils.changeLanguage(mContext,languageName); @@ -92,6 +95,11 @@ public class LanguageUtils { config.getClass().getDeclaredField("userSetLocale").setBoolean(config, true); am.getClass().getMethod("updateConfiguration", new Class[]{android.content.res.Configuration.class}).invoke(am, new Object[]{config}); BackupManager.dataChanged("com.android.providers.settings"); + }else if (language.equals(context.getResources().getString(R.string.ru))) { + config.getClass().getDeclaredField("locale").set(config, new Locale("ru", "RU")); + config.getClass().getDeclaredField("userSetLocale").setBoolean(config, true); + am.getClass().getMethod("updateConfiguration", new Class[]{android.content.res.Configuration.class}).invoke(am, new Object[]{config}); + BackupManager.dataChanged("com.android.providers.settings"); } } catch (Exception e) { diff --git a/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java b/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java index ec455f9e..98a4d751 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java +++ b/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java @@ -200,13 +200,28 @@ public class NettyConnection implements Connection { if (!isServerConnected()) { - log("skipedBytes " + new String(cmdArray)); - if (Config.LOG_TOFILE) ICLogger.logToFile("APILog", " skiped " + new String(cmdArray)); +// log("skipedBytes " + new String(cmdArray)); + if(Config.protocol_no != Config.PROTOCOL_GATOR) { + ICLogger.logToFile("APILog", " sentBytes skiped " + new String(cmdArray)); + }else{ + byte[] tmparray=new byte[cmdArray.length-8]; + System.arraycopy(cmdArray,8,tmparray,0,tmparray.length); + + ICLogger.logToFile("APILog", new String(AESCipher.aesDecryptBytesgFixedKey(tmparray))+" sentBytes skiped " + new String(cmdArray)); + } return false; } else { - log("sendBytes " + new String(cmdArray)); - if (Config.LOG_TOFILE) - ICLogger.logToFile("APILog", " sentBytes " + new String(cmdArray)); + // log("sendBytes " + new String(cmdArray)); + if (Config.LOG_TOFILE) { + if(Config.protocol_no != Config.PROTOCOL_GATOR) { + ICLogger.logToFile("APILog", " sentBytes " + new String(cmdArray)); + }else{ + byte[] tmparray=new byte[cmdArray.length-8]; + System.arraycopy(cmdArray,8,tmparray,0,tmparray.length); + + ICLogger.logToFile("APILog", new String(AESCipher.aesDecryptBytesgFixedKey(tmparray))+" sentBytes " + new String(cmdArray)); + } + } //向RxSocket写数据 //示例数据:IWAP00867155030001063# ByteBuffer byteBuffer = ByteBuffer.wrap(cmdArray); diff --git a/app/src/main/java/com/ic/protocols/protocol_gator.java b/app/src/main/java/com/ic/protocols/protocol_gator.java index 55b05f87..b949aa3a 100644 --- a/app/src/main/java/com/ic/protocols/protocol_gator.java +++ b/app/src/main/java/com/ic/protocols/protocol_gator.java @@ -22,10 +22,12 @@ import com.enqualcomm.support.bean.Contact; import com.enqualcomm.support.bean.Content; import com.enqualcomm.support.bean.ICLocation; import com.enqualcomm.support.bean.Runtime; +import com.enqualcomm.support.bean.Silent; import com.enqualcomm.support.bean.StringMessage; import com.enqualcomm.support.bean.VoiceContent; import com.enqualcomm.support.bean.voicePacket; import com.enqualcomm.support.provider.FZDDatabaseHelper; +import com.enqualcomm.support.provider.FZDMembersProvider; import com.enqualcomm.support.provider.FZDMessageProvider; import com.enqualcomm.support.service.HeartRateManager; import com.enqualcomm.support.utils.AESCipher; @@ -34,6 +36,7 @@ import com.enqualcomm.support.utils.Connection; import com.enqualcomm.support.utils.DeviceInfoUtil; import com.enqualcomm.support.utils.ICAudioManager; import com.enqualcomm.support.utils.ICLogger; +import com.enqualcomm.support.utils.LanguageUtils; import com.enqualcomm.support.utils.TemperatureUtil; import com.enqualcomm.support.utils.TimeUtil; import com.enqualcomm.support.utils.Util; @@ -493,6 +496,48 @@ public class protocol_gator { } } + private void appendSOS(Runtime runtime,ArrayList numbers,ArrayList names,ArrayList types){ + ArrayList contactArray = new ArrayList<>(); + ContentValues contentValues = new ContentValues(); + contentValues.put(FZDDatabaseHelper.fType, FZDDatabaseHelper.MemberType.SOS); + for(int i=0;i< numbers.size();i++) { + if (regexUtil.isMobileNumber(numbers.get(i)) || regexUtil.isPhoneNumber(numbers.get(i))) { + contactArray.add(new Contact(Contact.CATEGORY_SOS, names.get(i), numbers.get(i))); + ICLogger.i("find SOS "+ names.get(i)+" number " + numbers.get(i)); + contentValues.put(FZDDatabaseHelper.fUserName, names.get(i)); + contentValues.put(FZDDatabaseHelper.fPhoneNum, numbers.get(i)); + //runtime.getContextProxy().getResolver().insert(Uri.parse(FZDMembersProvider.MEMBERS), contentValues); + } + } + runtime.getDbHelper().saveContacts(contactArray, false, false, false, false, false, true); + } + + private void appendContact(Runtime runtime,ArrayList numbers,ArrayList names){ + ArrayList contactArray = new ArrayList<>(); + ContentValues contentValues = new ContentValues(); + ContentResolver resolver = runtime.getContextProxy().getResolver(); + resolver.delete(Uri.parse(FZDMembersProvider.MEMBERS), "type=?", new String[]{ + FZDDatabaseHelper.MemberType.WHITE_LIST + "" + }); + for (int i = 0; i < numbers.size(); i ++) { + String phoneNum = numbers.get(i); + String name = names.get(i); + ICLogger.i(i / 2 + " 姓名 " + name + ", 电话 " + phoneNum); + contactArray.add(new Contact(Contact.CATEGORY_CALL, name, phoneNum)); + contentValues.put(FZDDatabaseHelper.fType, FZDDatabaseHelper.MemberType.WHITE_LIST); + contentValues.put(FZDDatabaseHelper.fPhoneNum, phoneNum); + contentValues.put(FZDDatabaseHelper.fID, phoneNum); + contentValues.put(FZDDatabaseHelper.fUserName, name); + contentValues.put(FZDDatabaseHelper.fCreateTime, System.currentTimeMillis()); + contentValues.put(FZDDatabaseHelper.fUpdateTime, System.currentTimeMillis()); + //保存到新的数据库中,为了防止问题,先兼容原来的库 + //后面所有地方都切换到新库了,才删除上面的代码 + // TODO:需要修改白名单拦截的地方. + resolver.insert(Uri.parse(FZDMembersProvider.MEMBERS), contentValues); + } + //TODO:保存到fzd的联系人列表,类型为白名单 + runtime.getDbHelper().saveContacts(contactArray, false, false, true, false, false, false); + } //设置亲情号码 public void handleAP06(Runtime ds, Connection connection, String cmd) { log("AP06 设置亲情号码 " + cmd); @@ -523,13 +568,40 @@ uncle:13141516175 String cmdlist1[] = cmdlist[0].split("#"); int index = 0; if (cmdlist1.length % 3 == 1) { + ArrayList numbers=new ArrayList<>(); + ArrayList names=new ArrayList<>(); + ArrayList types=new ArrayList<>(); + for (int i = 1; i < cmdlist1.length; i += 3) { String number = cmdlist1[i]; String name = cmdlist1[i + 1]; String type = cmdlist1[i + 2]; index++; sb.append(index + " " + name + " " + number + " " + type + "\n"); + if (index <=3){ + //SOS + if(!number.trim().equals("0")){ + numbers.add(number); + names.add(name); + types.add(type); + } + if(index==3){ + //触发保存sos + appendSOS(ds,numbers,names,types); + //保存sos后清除临时数据 + numbers.clear(); + names.clear(); + types.clear(); + } + }else{ + if(!number.trim().equals("0")){ + numbers.add(number); + names.add(name); + types.add(type); + } + } } + appendContact(ds,numbers,names); } else { ICLogger.e("AP06 format error1 !"); @@ -569,7 +641,8 @@ uncle:13141516175 } } - public void handleAP09(Runtime ds, Connection connection, String cmd) { + //设置闹钟 + public void handleAP09(Runtime runtime, Connection connection, String cmd) { // AP09,A,B,C,YYMMDD,HHMMSS //A:表示删除、添加(修改)闹钟功能,分别用0、1表示(类型%d) @@ -583,21 +656,42 @@ uncle:13141516175 //删除一条索引为0的闹铃 String cmdlist[] = cmd.split(CMDSPLIT); if (cmdlist.length == 7) { + String cmdindex = cmdlist[6]; + try { + String do_cmd = ""; + int alarmindex = 0 /*alarm索引*/; + int alarmswitch = 0 /*1为开,0 为关*/; + int alarmcount = 0 /*表示闹钟个数*/; + String alarmtime = "";//0900表示早上09:00 + int repeat = 0;// //0:一次,不重复;0x01:星期日;0x02:星期一;0x04:星期二;0x08:星期三;0x10:星期四;0x20:星期五;0x40星期六 + // 0x01|0x02|0x04|0x08|0x10|0x20|0x40=0x7F + do_cmd = cmdlist[1];//0删除、1添加(修改)闹钟功能 + alarmtime=cmdlist[4]+cmdlist[5]; //YYMMDDHHMMSS + alarmindex = Integer.parseInt(cmdlist[2]); + + ArrayList alarmList = new ArrayList<>(); + alarmList.add(new Alarm("ST" + alarmtime.substring(0, 2) + "." + alarmtime.substring(2), "W" + repeat, "CON", alarmswitch == 1 ? "ON" : "OFF", "闹铃")); + //do clean and set alarm things + runtime.getDbHelper().saveAlarm(alarmList); + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP09, cmdindex, true)); + }catch (Exception e){ + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP09, cmdindex, false)); + } - - log("AP09 设置闹铃 "); - - connection.send(BPXX_REPLY(ds, CMD_TYPE.BP09, cmdlist[6], true)); + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP09, cmdlist[6], true)); } else if (cmdlist.length == 4) { +//(002E357593060153353AP09,0,0,0000000000000008) +//删除一条索引为0的闹铃 log("AP09 删除闹铃 "); - connection.send(BPXX_REPLY(ds, CMD_TYPE.BP09, cmdlist[3], true)); + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP09, cmdlist[3], true)); } else { ICLogger.e("AP09 format error!"); } } + //静音设置 public void handleAP10(Runtime ds, Connection connection, String cmd) { // (002C357593060153353AP10,1,0000000000000009) @@ -619,7 +713,7 @@ uncle:13141516175 } } - + //AP11回执,告知客户要接收哪条消息 public static StringMessage BP11(Runtime ds, String MSGType, String MSGCount) { //(00250106357593060153353BP11,AP12,01) //表示请求服务器下载1条微聊信息 @@ -655,6 +749,7 @@ uncle:13141516175 } + //给服务器的微聊消息回执 public static StringMessage BP12(Runtime ds, String sourceNumber, int count, int index, String time, boolean success) { // 失败: // (00400106357593060153353BP12,13026618172,1704131633000000,6,1,0) @@ -816,6 +911,7 @@ uncle:13141516175 } } + //状态上报,当做心跳用 public static StringMessage BP33(Runtime ds) { //(00520106357593060153353BP33,0,000000FF,5,46000024820000DE127,151028,163100,0,0,0) //报警类型:0x0 无报警;0x02 SOS报警;0x08 电池低电量报警;0x20 设备脱离 @@ -853,18 +949,19 @@ uncle:13141516175 return ret; } - + //读取版本 public void handleAP04(Runtime ds, Connection connection, String cmd) { log("AP04读取版本,返回BP00"); connection.send(BP00(ds)); } + //立即定位 public void handleAP00(Connection connection, Runtime ds, String cmd) { log("AP00立即定位,返回BP30"); } /*** - * + * 定位信息上传 * @param ds * @return */ @@ -1061,6 +1158,38 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255æ­¥,电量等级5,数 } } + //设置语言 + public void handleAP20(Runtime runtime, Connection connection, String cmd) { + //(002F357593060153353AP20,0044,0000000000000015) + //注意:目前仅支持中文(0086)、英文(0044)、俄文(0007) + String cmdlist[] = cmd.split(CMDSPLIT); + if (cmdlist.length == 3) { + String index = cmdlist[2]; + try { + String language = cmdlist[1]; + ////1 意大利,2 德语,3 法语,4 中文,5, 英文 , 6 俄语 + ICLogger.d("set language " + language); + if (language.equals("0044")) + { + LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context,"5"); + }else if (language.equals("0086")){ + LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context,"4"); + }else if (language.equals("0007")){ + LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context,"6"); + } + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP20, index, true)); + } catch (Exception e) { + ICLogger.e(e.getMessage(), e); + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP20, index, false)); + } + + } else { + ICLogger.e("AP21 format error"); + } + + } + + //设置音量 public void handleAP21(Runtime runtime, Connection connection, String cmd) { ICLogger.d(cmd); //(002C357593060153353AP21,7,0000000000000016) @@ -1087,6 +1216,60 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255æ­¥,电量等级5,数 ICLogger.e("AP21 format error"); } } + + //隐身时段 + public void handleAP22(Runtime runtime, Connection connection, String cmd) { + ICLogger.d(cmd); + //AP22,A,B,起始时间(HHMM),结束时间(HHMM) ,C + //A:总开关,分别用0、1表示(类型%d) + //B: 对应时间段小开关,分别用0、1表示(类型%d) + //C:表示重复类型(0-0x7F),如下: + //0x01:星期日;0x02:星期一;0x04:星期二;0x08:星期三;0x10:星期四;0x20:星期五;0x40星期六 + //如果每天重复:0x01|0x02|0x04|0x08|0x10|0x20|0x40=0x7F + //(006A357593060153353AP22,1,1,0900,1000,127,1,1032,1100,127,1,1400,1500,62,1,1530,1600,62,0000000000000017) + // 005F357593061269893AP22,1,1,0000,0000,0 ,0,0000,0004,2 ,1,0004,0000,48,0,0 ,0 ,0 ,168FBD831BF0D729 + //1、隐身时段功能开启 + //2、09:00-10:00开启隐身时段,每天重复 + //3、10:32-11:00开启隐身时段,每天重复 + //4、14:00-15:00开启隐身时段,周一、二、三、四、五重复 + //5、15:30-16:00开启隐身时段,周一、二、三、四、五重复 + String[] silent_items = cmd.split(CMDSPLIT); + ArrayList slist = new ArrayList<>(); + + if (silent_items.length ==19) { + String index=silent_items[18]; +// for (String si : silent_items) { +// String[] sl = si.split("-"); +// if (sl.length == 4) { +// String start, end, status; +// start = "ST" + sl[0]; +// end = "ST" + sl[1]; +// status = sl[2].equals("1") ? "ON" : "OFF"; +// char[] week = sl[3].toCharArray(); +// StringBuilder week_sb = new StringBuilder(); +// for (int i = 0; i < week.length; i++) { +// if (week[i] == '1') { +// week_sb.append(i + 1); +// } +// } +// Silent silent = new Silent(start, end, week_sb.toString(), status); +// slist.add(silent); +// ICLogger.i("set silence " + start + " " + end + " " + week_sb.toString() + " " + status); +// } else { +// ICLogger.i("免打扰时间格式错误,skip"); +// } +// } + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP22, index, true)); + + }else{ + ICLogger.i("免打扰时间格式错误,skip"); + } + runtime.getDbHelper().saveSilent(slist); + + + } + + //请求消息 public static StringMessage BP32(Runtime ds) { //(001D0106357593060153353BP32,AP26) //终端请求下发APP URL数据(AP26) @@ -1096,6 +1279,7 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255æ­¥,电量等级5,数 ret = genStringMessage(cmdMap.get(CMD_TYPE.BP32), AddHeader(ds, sb.toString())); return ret; } + public void handleAP34(Runtime runtime, Connection connection, String cmd) { ICLogger.d(cmd); //失败: @@ -1107,24 +1291,25 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255æ­¥,电量等级5,数 //(003D357593060153353AP34,13026618172,170413163300,2710,6,1,1) String cmdlist[] = cmd.split(CMDSPLIT); - if (cmdlist.length == 7) { - String index = cmdlist[2]; - - try { + if (cmdlist.length ==7) { + try { String time = cmdlist[2]; - String senderNum=cmdlist[1]; + String sender = cmdlist[1]; + String duration = cmdlist[3]; int packetCount = Integer.parseInt(cmdlist[4]); int packetIndex = Integer.parseInt(cmdlist[5]); int receiveSuccess = Integer.parseInt(cmdlist[6]); - ICLogger.i("服务器在" + time + " 收到 "+senderNum+" 的语音 " + packetIndex + "/" + packetCount + " " + (receiveSuccess == 1 ? "成功" : (receiveSuccess==0?"失敗":"非好友消息"))); + ICLogger.i("服务器在" + time + " 收到 "+sender+" 语音 " +duration+" "+ packetIndex + "/" + packetCount + " " + (receiveSuccess == 1 ? "成功" : (receiveSuccess==0?"失敗":"非亲情号"))); if (receiveSuccess == 1) { //如果服务器接收 语音成功,则设置下一个要发送的语音包Index,当index == packetCount的时候表示所有包发送完毕,停止继续发送 voicePacket.getInstanceSent().setCurrentIndexToSent(packetIndex); //发送消息,再次检查要发送的语音包,确认其发送完毕 connection.DeliverCMDMessageToSystem("SentVoicePacket", "SentVoicePacket"); - } else if (receiveSuccess == 0){ + }else if( receiveSuccess == 0){ //发送消息,再次检查要发送的语音包,确认其发送完毕 connection.DeliverCMDMessageToSystem("SentVoicePacket", "SentVoicePacket"); + }else{ + ICLogger.d("联系人不是亲情号!" ); } } catch (Exception e) { @@ -1132,12 +1317,40 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255æ­¥,电量等级5,数 } } else { - ICLogger.e("AP34 format error"); + ICLogger.e("AP21 format error"); + } + } + public void handleAP26(Runtime runtime, Connection connection, String cmd) { + ICLogger.d(cmd); + //(0035357593060153353AP26,2,AA,3,BBB,0000000000000020) + //2:表示ios app url的数据长度 + //AA:表示ios app的url数据 + //3:表示android app url的数据长度 + //BBB:表示android app的url数据 + + String cmdlist[] = cmd.split(CMDSPLIT); + if (cmdlist.length == 6) { + String index = cmdlist[5]; + + try { + String androidappurl = cmdlist[4]; + String iosappurl=cmdlist[2]; + ICLogger.i("收到 app 下载链接 android "+androidappurl+" ios "+iosappurl); + + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP26, index, true)); + } catch (Exception e) { + ICLogger.e(e.getMessage(), e); + connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP26, index, false)); + } + + } else { + ICLogger.e("AP26 format error"); } } public static byte[] BP34_Raw(String senderNumb,String packetTime, String recordtimelenHex, int count, int index, int datalen, byte[] amrdata) { + //recordtimelenHex 是yyyymmddhhmmss的,为了兼容其它协议,就不变了,自己修正一下放进现在的协议 //(03C80106357593060153353BP34,13026618172,170413163300,2710,6,1,700,数据) //BP34:命令字符 //1:亲情号码 (0表示发给所有人) @@ -1159,20 +1372,20 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255æ­¥,电量等级5,数 StringBuffer sb = new StringBuffer(CMDHEADER).append("0000").append("0106").append(runtime.IMEI()); sb.append(cmdMap.get(CMD_TYPE.BP34)) .append(CMDSPLIT).append(senderNumb) - .append(CMDSPLIT).append(packetTime) + .append(CMDSPLIT).append(packetTime.substring(2)) .append(CMDSPLIT).append(recordtimelenHex) .append(CMDSPLIT).append(count) .append(CMDSPLIT).append(index) .append(CMDSPLIT).append(datalen) .append(CMDSPLIT).toString(); - int len=1 + 4 + 4 + 15 + sb.length() +datalen+ 1; + int len= sb.length() +datalen+ 1; String lenstr = String.format("%04X",len); byte[] sentbuf = new byte[len]; - System.arraycopy(sb.toString().getBytes(), 0, sentbuf, 0, len-1-datalen); + System.arraycopy(sb.toString().getBytes(), 0, sentbuf, 0, sb.length()); System.arraycopy(amrdata, 0, sentbuf, sb.length(), datalen); System.arraycopy(lenstr.getBytes(),0,sentbuf,1,4); sentbuf[len-1] = ')'; - + ICLogger.d(new String(sentbuf)); return encrepteMsgBytes(sentbuf); } @@ -1180,6 +1393,9 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255æ­¥,电量等级5,数 public void sendVoicePackage(int duration, String remoteNum, String content, String voiceId) { //创建voiceConent并添加到数据 + if (remoteNum==null || remoteNum.isEmpty()) { + remoteNum="123"; + } final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, remoteNum,String.format("%04X",duration), content, 1, 3); // 把voiceContent拆解成1024的分包 Util.parseToVoicePacketSent(voiceContent,900); @@ -1249,9 +1465,21 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255æ­¥,电量等级5,数 case AP11://服务器推送待接收消息 handleAP11(mRuntime,mConnection,cmd); break; + case AP20://服务器设置语言 + handleAP20(mRuntime,mConnection,cmd); + break; case AP21://服务器推送音量设置消息 handleAP21(mRuntime,mConnection,cmd); break; + case AP22://服务器设置静默时段 + handleAP22(mRuntime,mConnection,cmd); + break; + case AP26://服务器下发app下载url + handleAP26(mRuntime,mConnection,cmd); + break; + case AP34://服务器回复语音接收 + handleAP34(mRuntime,mConnection,cmd); + break; // case AP14:// wifi定位包 // handleBP02(cmd); // ICLogger.i("服务器收到定位AP02"); diff --git a/app/src/main/res/values-de-rCH/strings.xml b/app/src/main/res/values-de-rCH/strings.xml index d4303234..8d57142e 100644 --- a/app/src/main/res/values-de-rCH/strings.xml +++ b/app/src/main/res/values-de-rCH/strings.xml @@ -1,154 +1,154 @@ - - ICProtocolServer - Sorry, the program is abnormal and will quit! - Sorry, Program Error, will quit! - - "%1$s hasn't been installed" - - Cancel - - Push Service - - FamilyGroup - GroupAll - - SMS - You have new Message! - \'s not answered call! - - - You have - - Missed Call - - Find Device! - - successRateAnalytics - - Cancel - - Favorite - - A Favorites icon will be created on the home screen. You can touch the icon to view all your favorite notifications. - - OK - - Delete - - Delete notifications - - A maximum of 1000 favorite notifications can be saved. Delete some notifications before you can add new ones. Go to your favorite notifications list? - - Go - - Note - - Forward - - Back - - Loading... Please wait. - - Favorites - - Favorite notifications - - No favorite notifications - - Refresh - - Store messages - - Rich media - - Select all - - Deselect all - - no Name - - PhoneNum - - Now - - Missed calls! - - minutes before - - Chat - - new Message! - - [表情] - - [图片] - - [视频] - - [语音] - - OK - - 您暂未激活该功能哦,快去APP上激活吧~ - - spring_ding_dong.mp3 - - Search - - Chat Message - - 正在发起视频通话... - - statistics - - 999+ - - \"微聊消息:\" + \"您有新微聊消息,请注意查收!\" - - dialog主题 - - The call has been disconnected because the watch is overheated - - Dear, to protect your eyes, the call will be disconnected - - 宝贝 - - From : - - Chat message! - - Low battery, please charge! - Locking success! - Congratulations on your successful unbind! - Illegal to unlock! - You have crossed the line, please return as soon as possible! - You have crossed the boundary! - Wristband has fallen off - Wristband has been wear - - HotLine - - - - 通知消息 - 知道了 - 消息提醒 - 关闭 - 阅读 - - 久坐提醒 - Sedentary reminder ! - - - - English - 日本語 - ภาษาไทย - 简体中文 - 繁體中文 - 意大利 - 法语 - 德语 - - - + + ICProtocolServer + Sorry, the program is abnormal and will quit! + Sorry, Program Error, will quit! + + "%1$s hasn't been installed" + + Cancel + + Push Service + + FamilyGroup + GroupAll + + SMS + You have new Message! + \'s not answered call! + + + You have + + Missed Call + + Find Device! + + successRateAnalytics + + Cancel + + Favorite + + A Favorites icon will be created on the home screen. You can touch the icon to view all your favorite notifications. + + OK + + Delete + + Delete notifications + + A maximum of 1000 favorite notifications can be saved. Delete some notifications before you can add new ones. Go to your favorite notifications list? + + Go + + Note + + Forward + + Back + + Loading... Please wait. + + Favorites + + Favorite notifications + + No favorite notifications + + Refresh + + Store messages + + Rich media + + Select all + + Deselect all + + no Name + + PhoneNum + + Now + + Missed calls! + + minutes before + + Chat + + new Message! + + [表情] + + [图片] + + [视频] + + [语音] + + OK + + 您暂未激活该功能哦,快去APP上激活吧~ + + spring_ding_dong.mp3 + + Search + + Chat Message + + 正在发起视频通话... + + statistics + + 999+ + + \"微聊消息:\" + \"您有新微聊消息,请注意查收!\" + + dialog主题 + + The call has been disconnected because the watch is overheated + + Dear, to protect your eyes, the call will be disconnected + + 宝贝 + + From : + + Chat message! + + Low battery, please charge! + Locking success! + Congratulations on your successful unbind! + Illegal to unlock! + You have crossed the line, please return as soon as possible! + You have crossed the boundary! + Wristband has fallen off + Wristband has been wear + + HotLine + + + + 通知消息 + 知道了 + 消息提醒 + 关闭 + 阅读 + + 久坐提醒 + Sedentary reminder ! + + + + English + 日本語 + ภาษาไทย + 简体中文 + 繁體中文 + 意大利 + 法语 + 德语 + 俄语 + + diff --git a/app/src/main/res/values-fr-rCH/strings.xml b/app/src/main/res/values-fr-rCH/strings.xml index d4303234..8d57142e 100644 --- a/app/src/main/res/values-fr-rCH/strings.xml +++ b/app/src/main/res/values-fr-rCH/strings.xml @@ -1,154 +1,154 @@ - - ICProtocolServer - Sorry, the program is abnormal and will quit! - Sorry, Program Error, will quit! - - "%1$s hasn't been installed" - - Cancel - - Push Service - - FamilyGroup - GroupAll - - SMS - You have new Message! - \'s not answered call! - - - You have - - Missed Call - - Find Device! - - successRateAnalytics - - Cancel - - Favorite - - A Favorites icon will be created on the home screen. You can touch the icon to view all your favorite notifications. - - OK - - Delete - - Delete notifications - - A maximum of 1000 favorite notifications can be saved. Delete some notifications before you can add new ones. Go to your favorite notifications list? - - Go - - Note - - Forward - - Back - - Loading... Please wait. - - Favorites - - Favorite notifications - - No favorite notifications - - Refresh - - Store messages - - Rich media - - Select all - - Deselect all - - no Name - - PhoneNum - - Now - - Missed calls! - - minutes before - - Chat - - new Message! - - [表情] - - [图片] - - [视频] - - [语音] - - OK - - 您暂未激活该功能哦,快去APP上激活吧~ - - spring_ding_dong.mp3 - - Search - - Chat Message - - 正在发起视频通话... - - statistics - - 999+ - - \"微聊消息:\" + \"您有新微聊消息,请注意查收!\" - - dialog主题 - - The call has been disconnected because the watch is overheated - - Dear, to protect your eyes, the call will be disconnected - - 宝贝 - - From : - - Chat message! - - Low battery, please charge! - Locking success! - Congratulations on your successful unbind! - Illegal to unlock! - You have crossed the line, please return as soon as possible! - You have crossed the boundary! - Wristband has fallen off - Wristband has been wear - - HotLine - - - - 通知消息 - 知道了 - 消息提醒 - 关闭 - 阅读 - - 久坐提醒 - Sedentary reminder ! - - - - English - 日本語 - ภาษาไทย - 简体中文 - 繁體中文 - 意大利 - 法语 - 德语 - - - + + ICProtocolServer + Sorry, the program is abnormal and will quit! + Sorry, Program Error, will quit! + + "%1$s hasn't been installed" + + Cancel + + Push Service + + FamilyGroup + GroupAll + + SMS + You have new Message! + \'s not answered call! + + + You have + + Missed Call + + Find Device! + + successRateAnalytics + + Cancel + + Favorite + + A Favorites icon will be created on the home screen. You can touch the icon to view all your favorite notifications. + + OK + + Delete + + Delete notifications + + A maximum of 1000 favorite notifications can be saved. Delete some notifications before you can add new ones. Go to your favorite notifications list? + + Go + + Note + + Forward + + Back + + Loading... Please wait. + + Favorites + + Favorite notifications + + No favorite notifications + + Refresh + + Store messages + + Rich media + + Select all + + Deselect all + + no Name + + PhoneNum + + Now + + Missed calls! + + minutes before + + Chat + + new Message! + + [表情] + + [图片] + + [视频] + + [语音] + + OK + + 您暂未激活该功能哦,快去APP上激活吧~ + + spring_ding_dong.mp3 + + Search + + Chat Message + + 正在发起视频通话... + + statistics + + 999+ + + \"微聊消息:\" + \"您有新微聊消息,请注意查收!\" + + dialog主题 + + The call has been disconnected because the watch is overheated + + Dear, to protect your eyes, the call will be disconnected + + 宝贝 + + From : + + Chat message! + + Low battery, please charge! + Locking success! + Congratulations on your successful unbind! + Illegal to unlock! + You have crossed the line, please return as soon as possible! + You have crossed the boundary! + Wristband has fallen off + Wristband has been wear + + HotLine + + + + 通知消息 + 知道了 + 消息提醒 + 关闭 + 阅读 + + 久坐提醒 + Sedentary reminder ! + + + + English + 日本語 + ภาษาไทย + 简体中文 + 繁體中文 + 意大利 + 法语 + 德语 + 俄语 + + diff --git a/app/src/main/res/values-it-rCH/strings.xml b/app/src/main/res/values-it-rCH/strings.xml index d4303234..8d57142e 100644 --- a/app/src/main/res/values-it-rCH/strings.xml +++ b/app/src/main/res/values-it-rCH/strings.xml @@ -1,154 +1,154 @@ - - ICProtocolServer - Sorry, the program is abnormal and will quit! - Sorry, Program Error, will quit! - - "%1$s hasn't been installed" - - Cancel - - Push Service - - FamilyGroup - GroupAll - - SMS - You have new Message! - \'s not answered call! - - - You have - - Missed Call - - Find Device! - - successRateAnalytics - - Cancel - - Favorite - - A Favorites icon will be created on the home screen. You can touch the icon to view all your favorite notifications. - - OK - - Delete - - Delete notifications - - A maximum of 1000 favorite notifications can be saved. Delete some notifications before you can add new ones. Go to your favorite notifications list? - - Go - - Note - - Forward - - Back - - Loading... Please wait. - - Favorites - - Favorite notifications - - No favorite notifications - - Refresh - - Store messages - - Rich media - - Select all - - Deselect all - - no Name - - PhoneNum - - Now - - Missed calls! - - minutes before - - Chat - - new Message! - - [表情] - - [图片] - - [视频] - - [语音] - - OK - - 您暂未激活该功能哦,快去APP上激活吧~ - - spring_ding_dong.mp3 - - Search - - Chat Message - - 正在发起视频通话... - - statistics - - 999+ - - \"微聊消息:\" + \"您有新微聊消息,请注意查收!\" - - dialog主题 - - The call has been disconnected because the watch is overheated - - Dear, to protect your eyes, the call will be disconnected - - 宝贝 - - From : - - Chat message! - - Low battery, please charge! - Locking success! - Congratulations on your successful unbind! - Illegal to unlock! - You have crossed the line, please return as soon as possible! - You have crossed the boundary! - Wristband has fallen off - Wristband has been wear - - HotLine - - - - 通知消息 - 知道了 - 消息提醒 - 关闭 - 阅读 - - 久坐提醒 - Sedentary reminder ! - - - - English - 日本語 - ภาษาไทย - 简体中文 - 繁體中文 - 意大利 - 法语 - 德语 - - - + + ICProtocolServer + Sorry, the program is abnormal and will quit! + Sorry, Program Error, will quit! + + "%1$s hasn't been installed" + + Cancel + + Push Service + + FamilyGroup + GroupAll + + SMS + You have new Message! + \'s not answered call! + + + You have + + Missed Call + + Find Device! + + successRateAnalytics + + Cancel + + Favorite + + A Favorites icon will be created on the home screen. You can touch the icon to view all your favorite notifications. + + OK + + Delete + + Delete notifications + + A maximum of 1000 favorite notifications can be saved. Delete some notifications before you can add new ones. Go to your favorite notifications list? + + Go + + Note + + Forward + + Back + + Loading... Please wait. + + Favorites + + Favorite notifications + + No favorite notifications + + Refresh + + Store messages + + Rich media + + Select all + + Deselect all + + no Name + + PhoneNum + + Now + + Missed calls! + + minutes before + + Chat + + new Message! + + [表情] + + [图片] + + [视频] + + [语音] + + OK + + 您暂未激活该功能哦,快去APP上激活吧~ + + spring_ding_dong.mp3 + + Search + + Chat Message + + 正在发起视频通话... + + statistics + + 999+ + + \"微聊消息:\" + \"您有新微聊消息,请注意查收!\" + + dialog主题 + + The call has been disconnected because the watch is overheated + + Dear, to protect your eyes, the call will be disconnected + + 宝贝 + + From : + + Chat message! + + Low battery, please charge! + Locking success! + Congratulations on your successful unbind! + Illegal to unlock! + You have crossed the line, please return as soon as possible! + You have crossed the boundary! + Wristband has fallen off + Wristband has been wear + + HotLine + + + + 通知消息 + 知道了 + 消息提醒 + 关闭 + 阅读 + + 久坐提醒 + Sedentary reminder ! + + + + English + 日本語 + ภาษาไทย + 简体中文 + 繁體中文 + 意大利 + 法语 + 德语 + 俄语 + + diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 4f8ed821..373daa25 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -147,4 +147,5 @@ 意大利 法语 德语 + 俄语 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ccc9ccf5..1ac3339c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -149,6 +149,7 @@ 意大利 法语 德语 + 俄语 Untitled diff --git a/app/version_code.properties b/app/version_code.properties index dd2bb559..438d9499 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Wed Jul 07 09:48:55 CST 2021 -VERSION_CODE=888 +#Thu Jul 08 14:44:19 CST 2021 +VERSION_CODE=889