Xposed第二课(微信篇) 聊天界面修改文字
2018-04-24 本文已影响1589人
KingZd
接上篇继续说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对象了基本可以随意修改了,后期会进行完善,实现撤回消息展示