diff --git a/app/src/main/java/com/idormy/sms/forwarder/database/entity/Rule.kt b/app/src/main/java/com/idormy/sms/forwarder/database/entity/Rule.kt index bfa2dae664..92e8f9a413 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/database/entity/Rule.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/database/entity/Rule.kt @@ -59,10 +59,10 @@ data class Rule( companion object { val TAG: String = Rule::class.java.simpleName - fun getRuleMatch(filed: String?, check: String?, value: String?, simSlot: String?, senderList: List? = null): String { + fun getRuleMatch(type: String?, filed: String?, check: String?, value: String?, simSlot: String?, senderList: List? = null): String { val blank = if (App.isNeedSpaceBetweenWords) " " else "" val sb = StringBuilder() - sb.append(SIM_SLOT_MAP[simSlot]).append(blank).append(getString(R.string.rule_card)).append(blank) + if (type != "app") sb.append(SIM_SLOT_MAP[simSlot]).append(blank).append(getString(R.string.rule_card)).append(blank) when (filed) { null, FILED_TRANSPOND_ALL -> sb.append(getString(R.string.rule_all_fw_to)) FILED_CALL_TYPE -> sb.append(getString(R.string.rule_when)) @@ -127,9 +127,9 @@ data class Rule( fun getName(appendSenderList: Boolean = true): String { return if (appendSenderList) { - getRuleMatch(filed, check, value, simSlot, senderList) + getRuleMatch(type, filed, check, value, simSlot, senderList) } else { - getRuleMatch(filed, check, value, simSlot, null) + getRuleMatch(type, filed, check, value, simSlot, null) } } diff --git a/app/src/main/java/com/idormy/sms/forwarder/fragment/LogsFragment.kt b/app/src/main/java/com/idormy/sms/forwarder/fragment/LogsFragment.kt index c0d96ac9c0..d3bb73f6f0 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/fragment/LogsFragment.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/fragment/LogsFragment.kt @@ -188,7 +188,7 @@ class LogsFragment : BaseFragment(), MsgPagingAdapter.OnIt override fun onLogsClicked(view: View?, item: LogsDetail) { Log.d(TAG, "item: $item") val ruleStr = StringBuilder() - ruleStr.append(Rule.getRuleMatch(item.ruleFiled, item.ruleCheck, item.ruleValue, item.ruleSimSlot)).append(item.senderName) + ruleStr.append(Rule.getRuleMatch(item.type, item.ruleFiled, item.ruleCheck, item.ruleValue, item.ruleSimSlot)).append(item.senderName) val detailStr = StringBuilder() detailStr.append(getString(R.string.rule)).append(ruleStr.toString()).append("\n\n") @SuppressLint("SimpleDateFormat") val utcFormatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())