|
|
@@ -27,12 +27,12 @@ class ScreenInspector(val context: AccessibilityService) {
|
|
|
)
|
|
|
val className = node.className?.toString()
|
|
|
val name = node.viewIdResourceName
|
|
|
- val text = Optional.ofNullable(node.text).map { obj: CharSequence -> obj.toString() }
|
|
|
- .orElse(null)
|
|
|
+ val text = node.text?.toString() ?: ""
|
|
|
val id = node.viewIdResourceName
|
|
|
+ val desc = node.contentDescription?.toString() ?: ""
|
|
|
|
|
|
if (log) {
|
|
|
- Log.d(TAG, "Node: class=$className, text=$text, name=$name, id=$id")
|
|
|
+ Log.d(TAG, "Node: class=$className, text=$text, dec=$desc, name=$name, id=$id")
|
|
|
}
|
|
|
|
|
|
if ("Compose:Draft:Send" == name) {
|
|
|
@@ -43,9 +43,10 @@ class ScreenInspector(val context: AccessibilityService) {
|
|
|
result.sendBtn = node
|
|
|
}
|
|
|
|
|
|
- if (text != null && (text.contains("RCS 聊天") || text.contains("RCS chat") || text.contains(
|
|
|
- "Chat with"
|
|
|
- ))
|
|
|
+ if (text.contains("RCS 聊天")
|
|
|
+ || text.contains("聊天对话")
|
|
|
+ || text.contains("RCS chat")
|
|
|
+ || text.contains("Chat with")
|
|
|
) {
|
|
|
result.isRcsCapable = true
|
|
|
}
|
|
|
@@ -54,8 +55,10 @@ class ScreenInspector(val context: AccessibilityService) {
|
|
|
result.isRcsCapable = text.contains("聊天") || text.contains("Chatting with")
|
|
|
}
|
|
|
|
|
|
- if (text != null && (text.contains("Turn on RCS chats") || text.contains("开启 RCS 聊天功能")
|
|
|
- || text.contains("Enable chat features") || text.contains("启用聊天功能"))
|
|
|
+ if (text.contains("Turn on RCS chats")
|
|
|
+ || text.contains("开启 RCS 聊天功能")
|
|
|
+ || text.contains("Enable chat features")
|
|
|
+ || text.contains("启用聊天功能")
|
|
|
) {
|
|
|
fun findSwitch(node: AccessibilityNodeInfo): Boolean {
|
|
|
if ("com.google.android.apps.messaging:id/switchWidget" == node.viewIdResourceName) {
|
|
|
@@ -86,7 +89,12 @@ class ScreenInspector(val context: AccessibilityService) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (text != null && (text.contains("end-to-end encrypted") || text.contains("已经过端到端加密"))) {
|
|
|
+ if (text.contains("end-to-end encrypted")
|
|
|
+ || desc.contains("Send encrypted message")
|
|
|
+ || text.contains("已经过端到端加密")
|
|
|
+ || desc.contains("发送加密信息")
|
|
|
+ ) {
|
|
|
+ result.isRcsCapable = true
|
|
|
result.encrypted = true
|
|
|
}
|
|
|
|