Commit 7755696d by zhangchengbo

fix:根据[顺丰小哥]App发送短信固定模版检索关键词进行脱敏操作

parent 8dfb15fc
...@@ -540,11 +540,27 @@ class MainActivity : SimpleActivity() { ...@@ -540,11 +540,27 @@ class MainActivity : SimpleActivity() {
getOrCreateConversationsAdapter().notifyDataSetChanged() getOrCreateConversationsAdapter().notifyDataSetChanged()
} }
private fun containsDigit(str: String): Boolean {
return str.matches(".*\\d+.*".toRegex())
}
private fun handleConversationClick(any: Any) { private fun handleConversationClick(any: Any) {
Intent(this, ThreadActivity::class.java).apply { Intent(this, ThreadActivity::class.java).apply {
val conversation = any as Conversation val conversation = any as Conversation
if (conversation.snippet.contains("快递单号") && conversation.snippet.contains("SF") && containsDigit(conversation.snippet)) {
val phoneNumber = conversation.title
if (phoneNumber.contains("+86")) {
phoneNumber.replace("+86", "")
}
PhoneUtils.phoneNumberFormat(phoneNumber) { itNumber ->
putExtra(THREAD_TITLE, itNumber)
}
} else {
putExtra(THREAD_TITLE, conversation.title)
}
putExtra(THREAD_ID, conversation.threadId) putExtra(THREAD_ID, conversation.threadId)
putExtra(THREAD_TITLE, conversation.title)
putExtra(WAS_PROTECTION_HANDLED, wasProtectionHandled) putExtra(WAS_PROTECTION_HANDLED, wasProtectionHandled)
startActivity(this) startActivity(this)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment