Merge pull request #25 from aoe-iu/main

解决“设置页面关闭卡槽信息,同时使用默认模板时,发送消息卡槽信息仍显示”
This commit is contained in:
pppscn 2021-07-03 13:19:04 +08:00 committed by GitHub
commit ac5f2d4992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -59,13 +59,14 @@ public class SmsVo implements Serializable {
boolean switchSmsTemplate = SettingUtil.getSwitchSmsTemplate();
String smsTemplate = SettingUtil.getSmsTemplate().trim();
String deviceMark = SettingUtil.getAddExtraDeviceMark().trim();
if (!switchAddExtra) {
smsTemplate = smsTemplate.replace("{{卡槽信息}}\n", "").replace("{{卡槽信息}}", "");
}
if (!switchSmsTemplate) {
smsTemplate = "{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}";
}
if (!switchAddExtra) {
smsTemplate = smsTemplate.replace("{{卡槽信息}}\n", "").replace("{{卡槽信息}}", "");
}
return smsTemplate.replace("{{来源号码}}", mobile)
.replace("{{短信内容}}", content)
.replace("{{卡槽信息}}", simInfo)

View File

@ -49,7 +49,7 @@ public class SimUtil {
Log.d(TAG, "getSimExtra Fail: " + e.getMessage());
}
return 0;
return 1;
}