Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Simple-Sms
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangchengbo
Simple-Sms
Commits
8258a3bf
Commit
8258a3bf
authored
Feb 12, 2026
by
zhangchengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:解决通讯录回复发送失败问题
parent
57a78b72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
NotificationHelper.kt
...ain/kotlin/com/secspace/sms/helpers/NotificationHelper.kt
+7
-5
SmsReceiver.kt
...src/main/kotlin/com/secspace/sms/receivers/SmsReceiver.kt
+1
-1
No files found.
app/src/main/kotlin/com/secspace/sms/helpers/NotificationHelper.kt
View file @
8258a3bf
...
...
@@ -14,6 +14,7 @@ import android.media.RingtoneManager
import
androidx.core.app.NotificationCompat
import
androidx.core.app.Person
import
androidx.core.app.RemoteInput
import
com.secspace.log.Log
import
com.secspace.sms.R
import
com.secspace.sms.activities.ThreadActivity
import
com.secspace.sms.extensions.config
...
...
@@ -48,7 +49,7 @@ class NotificationHelper(private val context: Context) {
)
{
maybeCreateChannel
(
name
=
context
.
getString
(
R
.
string
.
channel_received_sms
))
//
Log.d("TAG", "showReceivedMessageNotification: messageId = $messageId address = $address body = $body threadId = $threadId sender = $sender normalNumber = $normalNumber")
Log
.
d
(
"TAG"
,
"showReceivedMessageNotification: messageId = $messageId address = $address body = $body threadId = $threadId sender = $sender normalNumber = $normalNumber"
)
val
notificationId
=
threadId
.
hashCode
()
val
contentIntent
=
Intent
(
context
,
ThreadActivity
::
class
.
java
).
apply
{
putExtra
(
THREAD_ID
,
threadId
)
...
...
@@ -71,7 +72,7 @@ class NotificationHelper(private val context: Context) {
PendingIntent
.
getBroadcast
(
context
,
notificationId
,
deleteSmsIntent
,
PendingIntent
.
FLAG_UPDATE_CURRENT
or
PendingIntent
.
FLAG_MUTABLE
)
var
replyAction
:
NotificationCompat
.
Action
?
=
null
//
val isNoReplySms = isShortCodeWithLetters(address)
val
isNoReplySms
=
isShortCodeWithLetters
(
address
)
if
(
isNougatPlus
()
/*&& !isNoReplySms*/
)
{
val
replyLabel
=
context
.
getString
(
R
.
string
.
reply
)
val
remoteInput
=
RemoteInput
.
Builder
(
REPLY
)
...
...
@@ -81,7 +82,7 @@ class NotificationHelper(private val context: Context) {
val
replyIntent
=
Intent
(
context
,
DirectReplyReceiver
::
class
.
java
).
apply
{
putExtra
(
THREAD_ID
,
threadId
)
putExtra
(
THREAD_TITLE
,
address
)
if
(
address
.
contains
(
"*"
))
{
if
(
address
.
contains
(
"*"
)
||
normalNumber
.
isNotEmpty
()
)
{
putExtra
(
THREAD_NUMBER
,
normalNumber
)
}
else
{
putExtra
(
THREAD_NUMBER
,
address
)
...
...
@@ -137,13 +138,14 @@ class NotificationHelper(private val context: Context) {
builder
.
addAction
(
com
.
simplemobiletools
.
commons
.
R
.
drawable
.
ic_check_vector
,
context
.
getString
(
R
.
string
.
mark_as_read
),
markAsReadPendingIntent
)
.
setChannelId
(
NOTIFICATION_CHANNEL
)
// if (isNoReplySms) {
/*Log.d("TAG", "showMessageNotification: isNoReplySms = $isNoReplySms")
if (isNoReplySms) {
builder.addAction(
com.simplemobiletools.commons.R.drawable.ic_delete_vector,
context.getString(com.simplemobiletools.commons.R.string.delete),
deleteSmsPendingIntent
).setChannelId(NOTIFICATION_CHANNEL)
// }
}*/
notificationManager
.
notify
(
notificationId
,
builder
.
build
())
}
...
...
app/src/main/kotlin/com/secspace/sms/receivers/SmsReceiver.kt
View file @
8258a3bf
...
...
@@ -249,7 +249,7 @@ class SmsReceiver : BroadcastReceiver() {
"handleMessage: notificationUserName = $notificationUserName 掩码号码 aesPhoneNumber = $aesPhoneNumber 正常号码 address = $address threadId = $threadId"
)
if
(
notificationUserName
.
isNotEmpty
())
{
context
.
showReceivedMessageNotification
(
newMessageId
,
notificationUserName
,
body
,
threadId
,
bitmap
)
context
.
showReceivedMessageNotification
(
newMessageId
,
notificationUserName
,
body
,
threadId
,
bitmap
,
normalNumber
=
address
)
}
else
if
(
aesPhoneNumber
.
contains
(
"*"
))
{
Log
.
d
(
TAG
,
"handleMessage: 掩码号码"
)
context
.
showReceivedMessageNotification
(
newMessageId
,
aesPhoneNumber
,
body
,
threadId
,
bitmap
,
normalNumber
=
address
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment