Skip to content
This repository was archived by the owner on Jul 15, 2026. It is now read-only.

Commit 8bb5f49

Browse files
committed
feat: implement WeProfileCleaner for clearing user profile data via CGI request
1 parent 53e1ce5 commit 8bb5f49

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package moe.ouom.wekit.hooks.item.dev
2+
3+
import android.content.Context
4+
import com.afollestad.materialdialogs.MaterialDialog
5+
import moe.ouom.wekit.core.model.BaseClickableFunctionHookItem
6+
import moe.ouom.wekit.dexkit.cache.DexCacheManager
7+
import moe.ouom.wekit.hooks.core.annotation.HookItem
8+
import moe.ouom.wekit.hooks.sdk.protocol.WePkgHelper
9+
import moe.ouom.wekit.util.log.WeLogger
10+
11+
@HookItem(path = "娱乐功能/清空资料信息", desc = "点击清空你之前所选择的微信地区和性别等资料信息")
12+
class WeProfileCleaner : BaseClickableFunctionHookItem() {
13+
override fun entry(classLoader: ClassLoader) {}
14+
15+
override fun onClick(context: Context?) {
16+
context?.let {
17+
MaterialDialog(it)
18+
.title(text = "提示")
19+
.message(text = "确定清空吗?清空后你任然可以重新选择资料信息")
20+
.positiveButton(text = "清除") { dialog ->
21+
val payload = """{"1":{"1":1,"2":{"1":1,"2":{"1":91,"2":{"1":128,"2":{"1":""},"3":{"1":""},"4":0,"5":{"1":""},"6":{"1":""},"7":0,"8":0,"9":"","10":0,"11":"","12":"","13":"","14":1,"16":0,"17":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":"","25":0,"27":"","28":"","29":0,"30":0,"31":0,"33":0,"34":0,"36":0,"38":""}}}}}"""
22+
23+
WePkgHelper.INSTANCE?.sendCgi(
24+
"/cgi-bin/micromsg-bin/oplog",
25+
681, 0, 0,
26+
jsonPayload = payload
27+
) {
28+
onSuccess { json, bytes ->
29+
WeLogger.i("WeProfileCleaner", "成功,回包: $json")
30+
MaterialDialog(it)
31+
.title(text = "提示")
32+
.message(text = "微信响应了你的请求,你可能需要重启才能看到更改。\n服务器响应数据: $json")
33+
.positiveButton(text = "我知道了") { dialog ->
34+
dialog.dismiss()
35+
}
36+
.show()
37+
}
38+
39+
onFail { errType, errCode, errMsg ->
40+
MaterialDialog(it)
41+
.title(text = "出错了!")
42+
.message(text = "微信拒绝了你的请求!\n错误: $errType, $errCode, $errMsg")
43+
.positiveButton(text = "我知道了") { dialog ->
44+
dialog.dismiss()
45+
}
46+
.show()
47+
}
48+
}
49+
}
50+
.negativeButton(text = "取消") { dialog ->
51+
dialog.dismiss()
52+
}
53+
.show()
54+
}
55+
}
56+
57+
override fun noSwitchWidget(): Boolean {
58+
return true
59+
}
60+
}

0 commit comments

Comments
 (0)