Commit 387f1818 by zhangchengbo

fix:移除isPhoneNumber判断条件,

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