Commit 387f1818 by zhangchengbo

fix:移除isPhoneNumber判断条件,

parent 0b271619
...@@ -35,6 +35,9 @@ import com.simplemobiletools.commons.models.PhoneNumber ...@@ -35,6 +35,9 @@ import com.simplemobiletools.commons.models.PhoneNumber
import com.simplemobiletools.commons.models.SimpleContact import com.simplemobiletools.commons.models.SimpleContact
import com.simplemobiletools.commons.util.GsonUtil import com.simplemobiletools.commons.util.GsonUtil
/**
* 短信接收
*/
class SmsReceiver : BroadcastReceiver() { class SmsReceiver : BroadcastReceiver() {
private val TAG: String = "SmsReceiver" private val TAG: String = "SmsReceiver"
...@@ -186,7 +189,7 @@ class SmsReceiver : BroadcastReceiver() { ...@@ -186,7 +189,7 @@ class SmsReceiver : BroadcastReceiver() {
if (!PhoneFromUtil.isNumeric(conversation.userName)) { if (!PhoneFromUtil.isNumeric(conversation.userName)) {
notificationUserName = conversation.userName notificationUserName = conversation.userName
} }
if (!aesPhoneNumber.isPhoneNumber() || aesPhoneNumber.contains("*") || body.contains("\u200B") ) { if (aesPhoneNumber.contains("*") || body.contains("\u200B") ) {
conversation.title = aesPhoneNumber conversation.title = aesPhoneNumber
conversation.isSFNumber = true conversation.isSFNumber = true
} }
...@@ -229,12 +232,13 @@ class SmsReceiver : BroadcastReceiver() { ...@@ -229,12 +232,13 @@ class SmsReceiver : BroadcastReceiver() {
refreshMessages() refreshMessages()
Log.d( Log.d(
TAG, TAG,
"handleMessage: notificationUserName = $notificationUserName aesPhoneNumber = $aesPhoneNumber address = $address threadId = $threadId" "handleMessage: notificationUserName = $notificationUserName 掩码号码 aesPhoneNumber = $aesPhoneNumber 正常号码 address = $address threadId = $threadId"
) )
if (notificationUserName.isNotEmpty()) { if (notificationUserName.isNotEmpty()) {
context.showReceivedMessageNotification(newMessageId, notificationUserName, body, threadId, bitmap) context.showReceivedMessageNotification(newMessageId, notificationUserName, body, threadId, bitmap)
} else if (!aesPhoneNumber.isPhoneNumber() || aesPhoneNumber.contains("*")) { } else if (aesPhoneNumber.contains("*")) {
context.showReceivedMessageNotification(newMessageId, aesPhoneNumber, body, threadId, bitmap) Log.d(TAG, "handleMessage: 掩码号码")
context.showReceivedMessageNotification(newMessageId, aesPhoneNumber, body, threadId, bitmap, normalNumber = address)
} else { } else {
context.showReceivedMessageNotification(newMessageId, address, body, threadId, bitmap) context.showReceivedMessageNotification(newMessageId, address, body, threadId, bitmap)
} }
......
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