|
|
@ -81,7 +81,6 @@ public class SimUtil {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int slot = smsInfo.getSlot();//那张卡收到的短信
|
|
|
|
int slot = smsInfo.getSlot();//那张卡收到的短信
|
|
|
|
String sender = smsInfo.getSender();//收到的短信的手机号
|
|
|
|
String sender = smsInfo.getSender();//收到的短信的手机号
|
|
|
|
String sendmessage = "ERROR";//要回复的短信
|
|
|
|
|
|
|
|
List<Integer> abslist = new ArrayList<>();//收到的短信内容拆分包装成数组
|
|
|
|
List<Integer> abslist = new ArrayList<>();//收到的短信内容拆分包装成数组
|
|
|
|
boolean ifmessageCorrect = false;//用来判断收到的短信内容是否正确
|
|
|
|
boolean ifmessageCorrect = false;//用来判断收到的短信内容是否正确
|
|
|
|
if (StringUtils.isEmpty(content)) {
|
|
|
|
if (StringUtils.isEmpty(content)) {
|
|
|
@ -122,14 +121,13 @@ public class SimUtil {
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
int spilt2len = split2.length;
|
|
|
|
int spilt2len = split2.length;
|
|
|
|
if (split2 != null && spilt2len > 1 && spilt2len % 2 == 1) {
|
|
|
|
if (split2 != null && spilt2len > 0) {
|
|
|
|
String num = split2[0];
|
|
|
|
String num = split2[0];
|
|
|
|
Integer integer = StringUtils.convert2Int(num);
|
|
|
|
Integer integer = StringUtils.convert2Int(num);
|
|
|
|
if (integer != null) {
|
|
|
|
if (integer != null) {
|
|
|
|
if (integer == 0) {//删除所有运维
|
|
|
|
if (integer == 0) {//删除所有运维
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (spilt2len == integer * 2 + 1) {
|
|
|
|
|
|
|
|
int times = 0;
|
|
|
|
int times = 0;
|
|
|
|
for (int i = 0; i < spilt2len; i++) {
|
|
|
|
for (int i = 0; i < spilt2len; i++) {
|
|
|
|
if (i == 0) {
|
|
|
|
if (i == 0) {
|
|
|
@ -137,6 +135,7 @@ public class SimUtil {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String ts = split2[i];
|
|
|
|
String ts = split2[i];
|
|
|
|
Integer time = StringUtils.convert2Int(ts);
|
|
|
|
Integer time = StringUtils.convert2Int(ts);
|
|
|
|
|
|
|
|
if (time != null) {
|
|
|
|
if (i % 2 == 1) {
|
|
|
|
if (i % 2 == 1) {
|
|
|
|
if (time > 23) {
|
|
|
|
if (time > 23) {
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
ifmessageCorrect = false;
|
|
|
@ -181,7 +180,9 @@ public class SimUtil {
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
Integer integer = StringUtils.convert2Int(s);
|
|
|
|
String[] strings = StringUtils.splitString2(s);
|
|
|
|
|
|
|
|
if (strings != null && strings.length >= 1) {
|
|
|
|
|
|
|
|
Integer integer = StringUtils.convert2Int(strings[0]);
|
|
|
|
if (integer != null) {
|
|
|
|
if (integer != null) {
|
|
|
|
if (integer == 0 || integer == 1) {
|
|
|
|
if (integer == 0 || integer == 1) {
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
@ -189,6 +190,7 @@ public class SimUtil {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
restartType = 2;
|
|
|
|
restartType = 2;
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_OPERATE.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_OPERATE.value())) {
|
|
|
@ -230,9 +232,15 @@ public class SimUtil {
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
String cmdid = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
|
|
|
|
String[] strings = StringUtils.splitString2(s);
|
|
|
|
|
|
|
|
if (strings != null && strings.length >= 1) {
|
|
|
|
|
|
|
|
String cmdid = strings[0];
|
|
|
|
|
|
|
|
if (cmdid != null) {
|
|
|
|
UpdateSysConfigUtil.setCmdid(context, cmdid);
|
|
|
|
UpdateSysConfigUtil.setCmdid(context, cmdid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_CMDID.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_CMDID.value())) {
|
|
|
|
String cmdid = UpdateSysConfigUtil.getCmdid(context);
|
|
|
|
String cmdid = UpdateSysConfigUtil.getCmdid(context);
|
|
|
@ -242,32 +250,32 @@ public class SimUtil {
|
|
|
|
restartType = 1;
|
|
|
|
restartType = 1;
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
|
|
|
|
String server = null;
|
|
|
|
|
|
|
|
Integer port = null;
|
|
|
|
|
|
|
|
Integer utcp = null;
|
|
|
|
|
|
|
|
Integer encrypto = null;
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
if (split2 != null && (split2.length == 2 || split2.length == 4)) {
|
|
|
|
if (split2 != null && split2.length > 1) {
|
|
|
|
String server;
|
|
|
|
|
|
|
|
Integer integer;
|
|
|
|
|
|
|
|
server = split2[0];
|
|
|
|
|
|
|
|
String port = split2[1];
|
|
|
|
|
|
|
|
integer = StringUtils.convert2Int(port);
|
|
|
|
|
|
|
|
Integer utcp = -1;
|
|
|
|
|
|
|
|
Integer encrypto = -1;
|
|
|
|
|
|
|
|
if (integer != null) {
|
|
|
|
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
if (split2.length == 4) {
|
|
|
|
if (split2.length > 0) {
|
|
|
|
String s1 = split2[2];
|
|
|
|
server = split2[0];
|
|
|
|
utcp = StringUtils.convert2Int(s1);
|
|
|
|
}
|
|
|
|
utcp = getUtcp(utcp);
|
|
|
|
if (split2.length > 1) {
|
|
|
|
String s2 = split2[3];
|
|
|
|
String s1 = split2[1];
|
|
|
|
encrypto = StringUtils.convert2Int(s2);
|
|
|
|
port = StringUtils.convert2Int(s1);
|
|
|
|
encrypto = getEncrypto(encrypto);
|
|
|
|
|
|
|
|
if (utcp == -1 || encrypto == -1) {
|
|
|
|
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (split2.length > 2) {
|
|
|
|
|
|
|
|
String s2 = split2[2];
|
|
|
|
|
|
|
|
utcp = StringUtils.convert2Int(s2);
|
|
|
|
|
|
|
|
utcp = getUtcp(utcp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (split2.length > 3) {
|
|
|
|
|
|
|
|
String s3 = split2[3];
|
|
|
|
|
|
|
|
encrypto = StringUtils.convert2Int(s3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ifmessageCorrect) {
|
|
|
|
if (ifmessageCorrect) {
|
|
|
|
UpdateSysConfigUtil.setIP(context, server, integer, utcp, encrypto);
|
|
|
|
UpdateSysConfigUtil.setIP(context, server, port, utcp, encrypto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -279,13 +287,13 @@ public class SimUtil {
|
|
|
|
restartType = 1;
|
|
|
|
restartType = 1;
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
if (split1 != null && split1.length >= 2) {
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
JSONObject osdmap = new JSONObject();
|
|
|
|
JSONObject osdmap = new JSONObject();
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
int spilt2len = split2.length;
|
|
|
|
int spilt2len = split2.length;
|
|
|
|
if (split2 != null && spilt2len > 1 && spilt2len % 2 == 1) {
|
|
|
|
if (split2 != null && spilt2len > 1) {
|
|
|
|
String num = split2[0];
|
|
|
|
String num = split2[0];
|
|
|
|
Integer integer = StringUtils.convert2Int(num);
|
|
|
|
Integer integer = StringUtils.convert2Int(num);
|
|
|
|
if (integer != null) {
|
|
|
|
if (integer != null) {
|
|
|
@ -417,7 +425,7 @@ public class SimUtil {
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
if (split2 != null && split2.length == 2) {
|
|
|
|
if (split2 != null && split2.length > 1) {
|
|
|
|
Integer channel = StringUtils.convert2Int(split2[0]);
|
|
|
|
Integer channel = StringUtils.convert2Int(split2[0]);
|
|
|
|
if (channel != null) {
|
|
|
|
if (channel != null) {
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
@ -430,17 +438,21 @@ public class SimUtil {
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_PHOTO_SCHEDULE_LIST.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_PHOTO_SCHEDULE_LIST.value())) {
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
Integer channel = StringUtils.convert2Int(split1[1]);
|
|
|
|
String s = split1[1];
|
|
|
|
String photoSchedules = UpdateSysConfigUtil.getPhotoSchedules(channel);
|
|
|
|
String[] strings = StringUtils.splitString2(s);
|
|
|
|
|
|
|
|
if (strings != null && strings.length >= 1) {
|
|
|
|
|
|
|
|
Integer integer = StringUtils.convert2Int(strings[0]);
|
|
|
|
|
|
|
|
String photoSchedules = UpdateSysConfigUtil.getPhotoSchedules(integer);
|
|
|
|
sendmessage = SmsTypeEnum.GET_PHOTO_SCHEDULE_LIST.value() + "=" + photoSchedules;
|
|
|
|
sendmessage = SmsTypeEnum.GET_PHOTO_SCHEDULE_LIST.value() + "=" + photoSchedules;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (content.contains(SmsTypeEnum.SET_RESOLUTION.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.SET_RESOLUTION.value())) {
|
|
|
|
restartType = 1;
|
|
|
|
restartType = 1;
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
String[] split2 = StringUtils.splitString1(s);
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
if (split2 != null && split2.length == 5) {
|
|
|
|
if (split2 != null && split2.length >= 5) {
|
|
|
|
Integer channel = StringUtils.convert2Int(split2[0]);
|
|
|
|
Integer channel = StringUtils.convert2Int(split2[0]);
|
|
|
|
Integer resolutionCX = StringUtils.convert2Int(split2[1]);
|
|
|
|
Integer resolutionCX = StringUtils.convert2Int(split2[1]);
|
|
|
|
Integer resolutionCY = StringUtils.convert2Int(split2[2]);
|
|
|
|
Integer resolutionCY = StringUtils.convert2Int(split2[2]);
|
|
|
@ -465,12 +477,15 @@ public class SimUtil {
|
|
|
|
sendmessage = SmsTypeEnum.GET_RESOLUTION.value() + "=" + resolutionCX + "," + resolutionCY + "," + videoCX + "," + videoCY;
|
|
|
|
sendmessage = SmsTypeEnum.GET_RESOLUTION.value() + "=" + resolutionCX + "," + resolutionCY + "," + videoCX + "," + videoCY;
|
|
|
|
} else if (content.contains(SmsTypeEnum.TAKE_PHOTO.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.TAKE_PHOTO.value())) {
|
|
|
|
String[] split = StringUtils.splitString1(content);
|
|
|
|
String[] split = StringUtils.splitString1(content);
|
|
|
|
if (split != null && split.length == 3) {
|
|
|
|
if (split != null && split.length > 1) {
|
|
|
|
|
|
|
|
String s = split[1];
|
|
|
|
|
|
|
|
String[] strings = StringUtils.splitString2(s);
|
|
|
|
|
|
|
|
if (strings != null && strings.length >= 3) {
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
Integer channel = StringUtils.convert2Int(split[0]);
|
|
|
|
Integer channel = StringUtils.convert2Int(strings[0]);
|
|
|
|
Integer preset = StringUtils.convert2Int(split[1]);
|
|
|
|
Integer preset = StringUtils.convert2Int(strings[1]);
|
|
|
|
Integer type = StringUtils.convert2Int(split[2]);
|
|
|
|
Integer type = StringUtils.convert2Int(strings[2]);
|
|
|
|
if (channel != null) {
|
|
|
|
if (channel != null && preset != null && type != null) {
|
|
|
|
boolean photoOrVideo;
|
|
|
|
boolean photoOrVideo;
|
|
|
|
if (type == 0) {
|
|
|
|
if (type == 0) {
|
|
|
|
photoOrVideo = true;
|
|
|
|
photoOrVideo = true;
|
|
|
@ -479,6 +494,7 @@ public class SimUtil {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateSysConfigUtil.takePhotoOrVideo(context, channel, preset, photoOrVideo);
|
|
|
|
UpdateSysConfigUtil.takePhotoOrVideo(context, channel, preset, photoOrVideo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (content.contains(SmsTypeEnum.SET_HEART.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.SET_HEART.value())) {
|
|
|
@ -487,9 +503,12 @@ public class SimUtil {
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
Integer integer = StringUtils.convert2Int(s);
|
|
|
|
String[] strings = StringUtils.splitString2(s);
|
|
|
|
|
|
|
|
if (strings != null && strings.length >= 1) {
|
|
|
|
|
|
|
|
Integer integer = StringUtils.convert2Int(strings[0]);
|
|
|
|
UpdateSysConfigUtil.setHB(context, integer);
|
|
|
|
UpdateSysConfigUtil.setHB(context, integer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_HEART.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_HEART.value())) {
|
|
|
|
int hb = UpdateSysConfigUtil.getHB(context);
|
|
|
|
int hb = UpdateSysConfigUtil.getHB(context);
|
|
|
@ -505,9 +524,12 @@ public class SimUtil {
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
Integer integer = StringUtils.convert2Int(s);
|
|
|
|
String[] strings = StringUtils.splitString2(s);
|
|
|
|
|
|
|
|
if (strings != null && strings.length >= 1) {
|
|
|
|
|
|
|
|
Integer integer = StringUtils.convert2Int(strings[0]);
|
|
|
|
UpdateSysConfigUtil.setTB(context, integer);
|
|
|
|
UpdateSysConfigUtil.setTB(context, integer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_TP.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_TP.value())) {
|
|
|
|
int tb = UpdateSysConfigUtil.getTB(context);
|
|
|
|
int tb = UpdateSysConfigUtil.getTB(context);
|
|
|
@ -518,9 +540,12 @@ public class SimUtil {
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
String s = split1[1];
|
|
|
|
String s = split1[1];
|
|
|
|
Integer integer = StringUtils.convert2Int(s);
|
|
|
|
String[] strings = StringUtils.splitString2(s);
|
|
|
|
|
|
|
|
if (strings != null && strings.length > 0) {
|
|
|
|
|
|
|
|
Integer integer = StringUtils.convert2Int(strings[0]);
|
|
|
|
UpdateSysConfigUtil.setPackage(context, integer);
|
|
|
|
UpdateSysConfigUtil.setPackage(context, integer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
sendmessage = getSendString(content, ifmessageCorrect);
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_PACKAGE.value())) {
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_PACKAGE.value())) {
|
|
|
|
int aPackage = UpdateSysConfigUtil.getPackage(context);
|
|
|
|
int aPackage = UpdateSysConfigUtil.getPackage(context);
|
|
|
@ -557,20 +582,34 @@ public class SimUtil {
|
|
|
|
return apputcp;
|
|
|
|
return apputcp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static int getEncrypto(Integer encrypto) {
|
|
|
|
public static int getSmsUtcp(Integer apputcp) {
|
|
|
|
int appencrypto = -1;
|
|
|
|
int smsutcp = -1;
|
|
|
|
//短信文档中 1:密文,2:明文 3:不加密 app应用中 0:不加密 1:明文 2:加密 所以需要转换一下
|
|
|
|
//短信文档中 0:udp 1:tcp app应用中 0:tcp 1:udp 所以需要转换一下
|
|
|
|
if (encrypto != null && (encrypto == 1 || encrypto == 2 || encrypto == 3)) {
|
|
|
|
if (apputcp != null && (apputcp == 0 || apputcp == 1)) {
|
|
|
|
if (encrypto == 1) {
|
|
|
|
if (apputcp == 0) {
|
|
|
|
appencrypto = 2;
|
|
|
|
smsutcp = 1;
|
|
|
|
} else if (encrypto == 2) {
|
|
|
|
} else if (apputcp == 1) {
|
|
|
|
appencrypto = 1;
|
|
|
|
smsutcp = 0;
|
|
|
|
} else if (encrypto == 3) {
|
|
|
|
}
|
|
|
|
appencrypto = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return smsutcp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return appencrypto;
|
|
|
|
|
|
|
|
}
|
|
|
|
// private static int getEncrypto(Integer encrypto) {
|
|
|
|
|
|
|
|
// int appencrypto = -1;
|
|
|
|
|
|
|
|
// //短信文档中 1:密文,2:明文 3:不加密 app应用中 0:不加密 1:明文 2:加密 所以需要转换一下
|
|
|
|
|
|
|
|
// if (encrypto != null && (encrypto == 1 || encrypto == 2 || encrypto == 3)) {
|
|
|
|
|
|
|
|
// if (encrypto == 1) {
|
|
|
|
|
|
|
|
// appencrypto = 2;
|
|
|
|
|
|
|
|
// } else if (encrypto == 2) {
|
|
|
|
|
|
|
|
// appencrypto = 1;
|
|
|
|
|
|
|
|
// } else if (encrypto == 3) {
|
|
|
|
|
|
|
|
// appencrypto = 0;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return appencrypto;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String getSendString(String content, boolean ifmessageCorrect) {
|
|
|
|
private static String getSendString(String content, boolean ifmessageCorrect) {
|
|
|
|
String sendmessage;
|
|
|
|
String sendmessage;
|
|
|
@ -774,19 +813,14 @@ public class SimUtil {
|
|
|
|
} else if (configType == 3) { //数组
|
|
|
|
} else if (configType == 3) { //数组
|
|
|
|
JSONArray objects = new JSONArray(configValue);
|
|
|
|
JSONArray objects = new JSONArray(configValue);
|
|
|
|
JSONUtils.updateConfigFile(filePath, fileName, configName, configType, objects);
|
|
|
|
JSONUtils.updateConfigFile(filePath, fileName, configName, configType, objects);
|
|
|
|
|
|
|
|
} else if (configType == 4) { //对象
|
|
|
|
|
|
|
|
JSONObject objects = new JSONObject(configValue);
|
|
|
|
|
|
|
|
JSONUtils.updateConfigFile(filePath, fileName, configName, configType, objects);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (rebootMpApp != 0) {
|
|
|
|
|
|
|
|
// MicroPhotoContext.restartMpApp(context, "Config Updated From SMS");
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// Intent intent = new Intent();
|
|
|
|
|
|
|
|
// intent.setAction(MicroPhotoContext.ACTION_UPDATE_CONFIGS_MP);
|
|
|
|
|
|
|
|
// intent.setPackage(MicroPhotoContext.PACKAGE_NAME_MPAPP);
|
|
|
|
|
|
|
|
// context.sendBroadcast(intent);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -901,6 +935,8 @@ public class SimUtil {
|
|
|
|
HashMap<String, String> hashMap = ValueTypeUtil.checkFilePathAndName(fileType);
|
|
|
|
HashMap<String, String> hashMap = ValueTypeUtil.checkFilePathAndName(fileType);
|
|
|
|
filePath = hashMap.get(UpdateSysConfigUtil.FILEPATH);
|
|
|
|
filePath = hashMap.get(UpdateSysConfigUtil.FILEPATH);
|
|
|
|
fileName = hashMap.get(UpdateSysConfigUtil.FILENAME);
|
|
|
|
fileName = hashMap.get(UpdateSysConfigUtil.FILENAME);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!TextUtils.isEmpty(filePath + fileName)) {
|
|
|
|
if (!TextUtils.isEmpty(filePath + fileName)) {
|
|
|
|
File file = new File(filePath + fileName);
|
|
|
|
File file = new File(filePath + fileName);
|
|
|
|
if (file.exists()) {
|
|
|
|
if (file.exists()) {
|
|
|
|