Skip to content

Commit

Permalink
新增:多重匹配增加匹配字段——通知标题、卡槽信息
Browse files Browse the repository at this point in the history
  • Loading branch information
pppscn committed Dec 24, 2021
1 parent 86ed3f5 commit 52834b4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CallInfo {
public String number; //号码
public Long dateLong; //获取通话日期
public int duration;//获取通话时长,值为多少秒
public int type; //获取通话类型:1.呼入2.呼出3.未接
public int type; //获取通话类型:1.呼入 2.呼出 3.未接
public int subscriptionId;

public CallInfo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ private void sendReceiveCallMsg(Context context, String phoneNumber) {
}

String name = callInfo.getName();
Log.d(TAG, "getSubscriptionId = " + callInfo.getSubscriptionId());
int simId = SimUtil.getSimIdBySubscriptionId(callInfo.getSubscriptionId());
String simInfo = simId == 2 ? SettingUtil.getAddExtraSim2() : SettingUtil.getAddExtraSim1(); //自定义备注优先
if (!simInfo.isEmpty()) {
Expand All @@ -98,7 +99,6 @@ private void sendReceiveCallMsg(Context context, String phoneNumber) {
if (TextUtils.isEmpty(name)) name = context.getString(R.string.unknown_number);
}


//TODO:同一卡槽同一秒的重复未接来电广播不再重复处理(部分机型会收到两条广播?)
String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINESE).format(new Date());
String prevHash = SettingUtil.getPrevNoticeHash(phoneNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class RuleLine {
public static final String FILED_PACKAGE_NAME = "APP包名";
public static final String FILED_MSG_CONTENT = "短信内容";
public static final String FILED_INFORM_CONTENT = "通知内容";
public static final String FILED_INFORM_TITLE = "通知标题";
public static final String FILED_SIM_SLOT_INFO = "卡槽信息";
public static final String SURE_YES = "是";
public static final String SURE_NOT = "不是";
public static final String CHECK_EQUALS = "相等";
Expand Down Expand Up @@ -47,6 +49,8 @@ class RuleLine {
FILED_LIST.add(FILED_PACKAGE_NAME);
FILED_LIST.add(FILED_MSG_CONTENT);
FILED_LIST.add(FILED_INFORM_CONTENT);
FILED_LIST.add(FILED_INFORM_TITLE);
FILED_LIST.add(FILED_SIM_SLOT_INFO);
}

static {
Expand Down Expand Up @@ -278,6 +282,10 @@ public boolean checkMsg(SmsVo msg) {
case FILED_INFORM_CONTENT:
mixChecked = checkValue(msg.getContent());
break;
case FILED_INFORM_TITLE:
case FILED_SIM_SLOT_INFO:
mixChecked = checkValue(msg.getSimInfo());
break;
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<string name="user_app">User App</string>
<string name="system_app">System App</string>
<string name="tips_battery_optimization">Please deactivate power optimization for SmsForwarder, in order to keep the App alive!</string>
<string name="tips_notification_listener">Please grant Notification reading permission to SmsForwarder, before other Apps\' notification could be forwarded. Forwarding automatically canceled!</string>
<string name="tips_notification_listener">Please grant Notification reading permission to SmsForwarder, before other Apps\'s notification could be forwarded. Forwarding automatically canceled!</string>
<string name="notification_listener_service_enabled">The notification service is enabled</string>
<string name="notification_listener_service_disabled">The notification service is disabled</string>
<string name="pushplus_token">Token</string>
Expand Down

0 comments on commit 52834b4

Please sign in to comment.