Skip to content

Instantly share code, notes, and snippets.

@updateing
Created September 30, 2016 05:25
Show Gist options
  • Save updateing/7a48a0f6613c6355cef95c6787e63927 to your computer and use it in GitHub Desktop.
Save updateing/7a48a0f6613c6355cef95c6787e63927 to your computer and use it in GitHub Desktop.
QQ group message filter (smali)
From 587b64539a8033adf407bd6978526a33c2a6a0da Mon Sep 17 00:00:00 2001
From: Hamster Tian <haotia@gmail.com>
Date: Thu, 29 Sep 2016 23:54:35 +0800
Subject: [PATCH 2/4] FSpammer intergration
---
.../BaseMessageProcessorForTroopAndDisc.smali | 41 +++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/classes/com/tencent/mobileqq/app/message/BaseMessageProcessorForTroopAndDisc.smali b/classes/com/tencent/mobileqq/app/message/BaseMessageProcessorForTroopAndDisc.smali
index 46da9e7..4dd750a 100644
--- a/classes/com/tencent/mobileqq/app/message/BaseMessageProcessorForTroopAndDisc.smali
+++ b/classes/com/tencent/mobileqq/app/message/BaseMessageProcessorForTroopAndDisc.smali
@@ -262,8 +262,47 @@
:cond_a
const/4 v3, 0x0
- .line 894
+ return-object v3
+
:goto_b
+ # Read ArrayList into v4
+ move-object/from16 v4, p2
+
+ const/4 v1, 0x0
+
+ # p2.get(0)
+ invoke-virtual {v4, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
+
+ move-result-object v0
+
+ check-cast v0, Lcom/tencent/mobileqq/data/MessageRecord;
+
+ # v0(msg) = p2.get(0)
+ .local v0, "msg":Lcom/tencent/mobileqq/data/MessageRecord;
+
+ # v1 = v0.msg
+ iget-object v1, v0, Lcom/tencent/mobileqq/data/MessageRecord;->msg:Ljava/lang/String;
+
+ # if v1 == null, goto exit
+
+ if-eqz v1, :cond_23333
+
+ const-string v2, "^(\u6211\u627e|\u731c\u6570|\u6279\u91cf\u62bd\u5956|\u9886\u53d6\u5e2e\u6d3e\u798f\u5229|(\u83dc\u5355|\u7b7e\u5230|\u62bd\u7b7e|\u89e3\u7b7e|\u67e5\u8be2|[\\u4e00-\\u9fa5]{2}(\u529f\u80fd|\u7cfb\u7edf)|(\u8d4c\u535a|\u62a2\u52ab|\u5ba0\u7269PK)\\s*\\d{0,11}|(\u6536\u83b7|\u8d2d\u4e70|\u4eba\u54c1)\\s+[\\u4e00-\\u9fa5]{1,4}|\u5145\u503c\\s*\\d{0,12}\\*\\d{0,20})$|\u5ba0\u7269[\\u4e00-\\u9fa5]{2}($|\\s+)|\\+[\\u4e00-\\u9fa5]+).*"
+
+ # Execute v1.matches(....)
+ invoke-virtual {v1, v2}, Ljava/lang/String;->matches(Ljava/lang/String;)Z
+
+ # Get the boolean result into v1
+ move-result v1
+
+ # If not match, goto exit
+ if-eqz v1, :cond_23333
+
+ # If matches, clear it
+ invoke-virtual {v4}, Ljava/util/ArrayList;->clear()V
+
+ :cond_23333
+ .line 894
return-object v3
.line 159
--
2.8.4 (Apple Git-73)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment