增加序列号

hdrplus
liuguijing 1 year ago
parent 15f9ee62f1
commit ae8be7fd93

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

@ -63,6 +63,17 @@ public class UpdateSysConfigUtil {
return path; 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) { public static String getScheduleDir(int channel) {
String appPath = buildAppDir(PACKAGE_NAME_MPAPP); String appPath = buildAppDir(PACKAGE_NAME_MPAPP);

Loading…
Cancel
Save