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
6bfbf2fd
Commit
6bfbf2fd
authored
Dec 03, 2025
by
zhangchengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:优先展示通讯录备注名称,其次手机号
parent
fdb07b69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
MainActivity.kt
...c/main/kotlin/com/secspace/sms/activities/MainActivity.kt
+13
-8
No files found.
app/src/main/kotlin/com/secspace/sms/activities/MainActivity.kt
View file @
6bfbf2fd
...
...
@@ -590,20 +590,25 @@ class MainActivity : SimpleActivity() {
private
fun
handleConversationClick
(
any
:
Any
)
{
Intent
(
this
,
ThreadActivity
::
class
.
java
).
apply
{
val
conversation
=
any
as
Conversation
// Log.d(TAG, "handleConversationClick: conversation = ${conversation}")
Log
.
d
(
TAG
,
"handleConversationClick: snippet = ${conversation.snippet} threadId = ${conversation.threadId}"
)
Log
.
d
(
TAG
,
"handleConversationClick: conversation = ${Gson().toJson(conversation)}"
)
val
userName
=
conversation
.
userName
Log
.
d
(
TAG
,
"handleConversationClick: 通讯录备注名称 = $userName 短信内容 = ${conversation.snippet} threadId = ${conversation.threadId}"
)
val
listMessageData
=
getMessages
(
conversation
.
threadId
,
false
)
Log
.
d
(
TAG
,
"handleConversationClick: listMessageData是否为空 = ${listMessageData.isNotEmpty()}"
)
if
(
listMessageData
.
isNotEmpty
())
{
val
listContains
:
List
<
Message
>
=
listMessageData
.
filter
{
msg
->
msg
.
body
.
contains
(
"\u200B"
)
}
Log
.
d
(
TAG
,
"handleConversationClick: 是否包含零宽度字符 = ${listContains.isNotEmpty()}"
)
if
(
listContains
.
isNotEmpty
()
||
conversation
.
isSFNumber
)
{
val
phoneNumber
=
conversation
.
title
if
(
phoneNumber
.
contains
(
"+86"
))
{
phoneNumber
.
replace
(
"+86"
,
""
)
}
PhoneUtils
.
phoneNumberFormat
(
phoneNumber
)
{
itNumber
->
putExtra
(
THREAD_TITLE
,
itNumber
)
if
(
userName
.
isNotBlank
()){
putExtra
(
THREAD_TITLE
,
userName
)
}
else
{
val
phoneNumber
=
conversation
.
title
if
(
phoneNumber
.
contains
(
"+86"
))
{
phoneNumber
.
replace
(
"+86"
,
""
)
}
PhoneUtils
.
phoneNumberFormat
(
phoneNumber
)
{
itNumber
->
putExtra
(
THREAD_TITLE
,
itNumber
)
}
}
}
}
else
{
...
...
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