Xposed第二课(微信篇) 聊天界面修改文字

接上篇继续说Xposed第一课(微信篇) hook含有多个参数的方法

今天来尝试看看修改聊天列表界面的一些消息,首先cmd 输入adb shell dumpsys activity top 接下来上图

QQ截图20180424181612.png

有时候仔细留心你会发现一些有用的东西com.tencent.mm.ui.chatting.ChattingUI$a 这个就是我们此次的目标了

public class ChattingUI$a extends u implements e, com.tencent.mm.plugin.messenger.foundation.a.a.f.a, com.tencent.mm.sdk.e.j.a, b, p 

哟哟切克闹,这次明确目标从继承类和实现类慢慢入手观看,你会发现com.tencent.mm.ui.u是fragment,所以按照开发习惯会在onCreateView方法里面进行初始化操作

QQ截图20180424182429.png

之后关联到了com.tencent.mm.ui.p这个抽象类


QQ截图20180424183322.png

这里有很多有意思的操作,也记录下来,说不定马上就用得到了~

可能会有人疑问,你怎么就定位那这里来了?看得头晕~~
我先上ChattingUI$a的代码

public void onCreate(Bundle bundle) {
        com.tencent.mm.sdk.platformtools.w.i("MicroMsg.ChattingUI", "dktask FragmentonCreate:%s#0x%x task:%s hc:%d", new Object[]{thisActivity().getClass().getSimpleName(), Integer.valueOf(thisActivity().hashCode()), com.tencent.mm.sdk.platformtools.bh.fE(thisActivity()), Integer.valueOf(hashCode())});
        cuW();
        f fVar = this.yRU;
        if (fVar.cvH()) {
            fVar.yUY = new com.tencent.mm.ui.q();
            Object obj = fVar.yUY;
            u cuH = fVar.ejx.cuH();
            obj.yqI = cuH;
            obj.yqJ = new com.tencent.mm.ui.b.b(cuH.thisActivity(), obj);
            fVar.ejx.cuH().setActivityController(fVar.yUY);
        }
        if (this.mController != null) {
            this.mController.ak(3, true);
        }
        super.onCreate(bundle);
    }

里面关联到了new com.tencent.mm.ui.q() 一般这样的情况我会点进去看看这个类里面有些啥

结果找到了这个

protected final void dealContentView(View view) {
        if (this.yqI != null) {
            this.yqI.dealContentView(view);
        }
    }

眼熟吧,刚刚在截图里面出现过,在继续跟下去 就到了com.tencent.mm.ui.p 这就是他们的三角恋关系

接下來上代碼

 /**
     * 微信聊天界面
     *
     * @param applicationContext
     * @param classLoader
     */
    private void hookWxChatUI(final Context applicationContext, final ClassLoader classLoader) {
        final Class<?> classIfExists = XposedHelpers.findClassIfExists("com.tencent.mm.ui.chatting.ChattingUI$a", classLoader);
        if (classIfExists == null) return;
        XposedHelpers.findAndHookMethod(classIfExists,
                "onResume",
                new XC_MethodHook() {
                    @Override
                    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                        super.beforeHookedMethod(param);
                        XposedHelpers.findAndHookMethod(classIfExists, "cuO", new XC_MethodHook() {
                            @Override
                            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                                super.beforeHookedMethod(param);
                                Field ySc = param.thisObject.getClass().getDeclaredField("ySc");
                                ySc.setAccessible(true);
                                ListView listView = (ListView) ySc.get(param.thisObject);
                                ListAdapter adapter = listView.getAdapter();
                                int count = adapter.getCount();
                                Log.e("Demo: hookWxChatUI->", "listview has " + count + " child");
                                for (int i = 0; i < count; i++) {
                                    Object s = adapter.getItem(i);
                                    Log.e("Demo: hookWxChatUI->", "item data -> " + JSONObject.toJSONString(s));
                                }
                            }
                        });
                    }
                });
    }
04-24 11:09:22.852 14258-14258/com.tencent.mm E/Demo: hookWxChatUI->: item data -> {"field_bizChatId":-1,"field_content":"11","field_createTime":1524476692210,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":17,"field_msgSeq":0,"field_msgSvrId":1668889994317991936,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"11","field_createTime":1524476823387,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":18,"field_msgSeq":0,"field_msgSvrId":8474293780838038858,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"111","field_createTime":1524476844609,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":19,"field_msgSeq":0,"field_msgSvrId":6653271127666416555,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"1212","field_createTime":1524485459311,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":20,"field_msgSeq":0,"field_msgSvrId":2114493083199734898,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"121212","field_createTime":1524485463545,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":21,"field_msgSeq":0,"field_msgSvrId":7558821650917329750,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"214313213213","field_createTime":1524485480190,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":22,"field_msgSeq":0,"field_msgSvrId":5232431166967661431,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"123213","field_createTime":1524485488837,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":23,"field_msgSeq":0,"field_msgSvrId":4701952791003989140,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"23232332","field_createTime":1524488542994,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":24,"field_msgSeq":0,"field_msgSvrId":3276437544320249088,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"3242342342","field_createTime":1524488544942,"field_flag":0,"field_isSend":1,"field_isShowTimer":0,"field_msgId":25,"field_msgSeq":0,"field_msgSvrId":8359852131019167698,"field_status":2,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnE":0,"fnG":0,"fnH":0,"fnI":0,"fnJ":0,"fnK":0,"fnL":0,"fnP":0,"fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"121212","field_createTime":1524493949000,"field_flag":0,"field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":26,"field_msgSeq":693100185,"field_msgSvrId":4087517586865899304,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"测测测","field_createTime":1524493952000,"field_flag":0,"field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":27,"field_msgSeq":693100186,"field_msgSvrId":4304233982588880065,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"MP57k7k","field_createTime":1524493953000,"field_flag":0,"field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":28,"field_msgSeq":693100187,"field_msgSvrId":1339402192637447304,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"9","field_createTime":1524493955000,"field_flag":0,"field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":29,"field_msgSeq":693100188,"field_msgSvrId":6529286450608948563,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"8","field_createTime":1524493956000,"field_flag":0,"field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":30,"field_msgSeq":693100189,"field_msgSvrId":4863229452800660294,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
04-24 11:09:22.853 14258-14258/com.tencent.mm E/Demo: hookWxChatUI->: item data -> {"field_bizChatId":-1,"field_content":"7","field_createTime":1524493957000,"field_flag":0,"field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":31,"field_msgSeq":693100190,"field_msgSvrId":5874664197203595525,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"7","field_createTime":1524493958000,"field_flag":0,"field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":32,"field_msgSeq":693100191,"field_msgSvrId":4513073562811263806,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":false,"type":1,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"\".\" 撤回了一条消息","field_createTime":1524581864000,"field_flag":0,"field_imgPath":"59178461038f6b9266e691365c438df6","field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":34,"field_msgSeq":693100215,"field_msgSvrId":7834983257743585568,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":true,"type":10000,"xPj":-1,"yfD":false}
    item data -> {"field_bizChatId":-1,"field_content":"\".\" 撤回了一条消息","field_createTime":1524581873000,"field_flag":0,"field_isSend":0,"field_isShowTimer":0,"field_lvbuffer":"ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9","field_msgId":35,"field_msgSeq":693100217,"field_msgSvrId":3664309103777276282,"field_status":3,"field_talker":"luoyeguigen742689","field_talkerId":52,"fjw":false,"fnD":"","fnE":0,"fnF":"","fnG":0,"fnH":0,"fnI":0,"fnJ":1,"fnK":0,"fnL":0,"fnM":"","fnN":"","fnO":"","fnP":0,"fnQ":"","fnm":false,"fnp":false,"fnr":false,"fnt":false,"system":true,"type":10000,"xPj":-1,"yfD":false}
04-24 11:10:06.420 15667-15667/? E/libprocessgroup: failed to make and chown /acct/uid_10009: Read-only file system
QQ截图20180424231132.png

偷个懒,只到这一步,我想你有了listview对象了基本可以随意修改了,后期会进行完善,实现撤回消息展示

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 213,558评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,002评论 3 387
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 159,036评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,024评论 1 285
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,144评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,255评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,295评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,068评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,478评论 1 305
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,789评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,965评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,649评论 4 336
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,267评论 3 318
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,982评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,223评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,800评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,847评论 2 351

推荐阅读更多精彩内容