Matthew 1 year ago
commit dc9251bba4

@ -192,14 +192,14 @@ public class SimUtil {
if (split1 != null && split1.length > 1) {
ifmessageCorrect = true;
String cmdid = split1[1];
UpdateSysConfigUtil.setCmdid(context, cmdid);
UpdateSysConfigUtil.setCmdid(context, cmdid); //
}
sendmessage = getSendString(content, ifmessageCorrect);
} else if (content.contains(SmsTypeEnum.GET_CMDID.value())) {
sendtype = SmsTypeEnum.GET_CMDID.value();
ifmessageCorrect = true;
String cmdid = UpdateSysConfigUtil.getCmdid(context);
String serialNo = SysApi.getSerialNo(context);
String serialNo = UpdateSysConfigUtil.getSerialNo();
sendmessage = SmsTypeEnum.GET_CMDID.value() + "=" + serialNo + "," + cmdid;
} else if (content.contains(SmsTypeEnum.SET_IP.value())) {
sendtype = SmsTypeEnum.SET_IP.value();
@ -552,38 +552,12 @@ public class SimUtil {
int slot = -1;
Set<String> keySet = bundle.keySet();
for (String key : keySet) {
switch (key) {
case "slot":
slot = bundle.getInt("slot", -1);
break;
case "simId":
slot = bundle.getInt("simId", -1);
break;
case "simSlot":
slot = bundle.getInt("simSlot", -1);
break;
case "slot_id":
slot = bundle.getInt("slot_id", -1);
break;
case "simnum":
slot = bundle.getInt("simnum", -1);
break;
case "slotId":
slot = bundle.getInt("slotId", -1);
break;
case "slotIdx":
slot = bundle.getInt("slotIdx", -1);
break;
case "android.telephony.extra.SLOT_INDEX":
slot = bundle.getInt("android.telephony.extra.SLOT_INDEX", -1);
break;
default:
if (key.toLowerCase().contains("slot") | key.toLowerCase().contains("sim")) {
if (key.toLowerCase().contains("slot") || key.toLowerCase().contains("sim")) {
String value = bundle.getString(key, "-1");
if (value.equals("0") | value.equals("1") | value.equals("2")) {
slot = bundle.getInt(key, -1);
}
}
break;
}
}
return slot;

@ -63,6 +63,17 @@ public class UpdateSysConfigUtil {
return path;
}
//获取配置文件地址
public static String getSerialNo() {
String mSerialNo;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mSerialNo = Build.getSerial();
} else {
mSerialNo = Build.SERIAL;
}
return mSerialNo;
}
//获取配置文件地址
public static String getScheduleDir(int channel) {
String appPath = buildAppDir(PACKAGE_NAME_MPAPP);

Loading…
Cancel
Save