Xp根据数据库insert获取微信聊天记录

时间:2017-08-24 01:05:29   收藏:0   阅读:338

https://mp.weixin.qq.com/s?__biz=MzIzNDA3MDgwNA==&mid=2649230245&idx=1&sn=3746423a481976b0d6062c508803e415&chksm=f0e75ddec790d4c8b60a905b844e782ddb310d18cb87c985510113dfabf8a82e4bee1ba8f0a0&mpshare=1&scene=23&srcid=0823VdBOlxgj3ccUc92hdYQA#rd

 

"EnMicroMsg.db"

 


public class WXMain implements IXposedHookLoadPackage{
private String CLASS_NAME_DB="com.tencent.mm.bj.e";

@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
if (lpparam.packageName.equals("com.tencent.mm")){
final Context context = (Context) callMethod(callStaticMethod(findClass("android.app.ActivityThread", null), "currentActivityThread", new Object[0]), "getSystemContext", new Object[0]);

Class<?> dbClazz= XposedHelpers.findClass(CLASS_NAME_DB,lpparam.classLoader);
XposedHelpers.findAndHookMethod(dbClazz, "insert", String.class, String.class, ContentValues.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
super.afterHookedMethod(param);
Toast.makeText(context, "insert", Toast.LENGTH_SHORT).show();
printTableInfo(param);
}
});


}
}

private void printTableInfo(XC_MethodHook.MethodHookParam param) {
XposedBridge.log("\n-------------记录数据START--------\n");
String tableName= (String) param.args[0];
String str1= (String) param.args[1];
ContentValues contentValues= (ContentValues) param.args[2];
XposedBridge.log("tablename===:"+tableName+"-----"+str1+"\n");
for (String key :
contentValues.keySet()) {
XposedBridge.log("key--:"+key+":------:"+"value---:"+contentValues.get(key
)+"\n");
}
XposedBridge.log("\n-------------记录数据END--------\n");

}
}
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!