From 573174feea81f2341aed91cc0e4e6853b13940fe Mon Sep 17 00:00:00 2001 From: pppscn <35696959@qq.com> Date: Thu, 15 Aug 2024 13:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=EF=BC=9AAPP=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E8=BD=AC=E5=8F=91=E8=A7=84=E5=88=99=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E5=8E=BB=E6=8E=89`=E4=BB=BB=E6=84=8F=E5=8D=A1`=20#516?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/idormy/sms/forwarder/database/entity/Rule.kt | 8 ++++---- .../com/idormy/sms/forwarder/fragment/LogsFragment.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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())