//Object class_RelationMemberListViewModel= XposedHelpers.callMethod(RelationMemberSelectListAdapter_this, "e", new Object[] { });//调用方法
Method method = RelationMemberSelectListAdapter_this.getClass().getMethod("e", new Class[]{ });
Object class_RelationMemberListViewModel_ = method.invoke(RelationMemberSelectListAdapter_this, new Object[]{});
// public final MutableLiveData<List<IMContact>> r = new MutableLiveData();
//final Object class_r = XposedHelpers.findField(class_RelationMemberListViewModel.getClass(), "r") .get(class_RelationMemberListViewModel);//获取变量 全部好友
Object class_r_ = null;
java.lang.reflect.Field[] fields = class_RelationMemberListViewModel_.getClass().getFields();
for(int i=0;i<fields.length;i++){
java.lang.reflect.Field s = fields[i];
boolean flag = s.isAccessible();
//设置该属性总是可访问
s.setAccessible(true);
// a.Toast("循环 [ "+i+" ] \r\n 成员变量 = "+s.getName() +" \r\n 成员值为="+s.get(class_RelationMemberListViewModel_));
if(s.getName().equals("r")){
class_r_ = s.get(class_RelationMemberListViewModel_);
break;
}
//还原 设置该属性总是可访问
s.setAccessible(flag);
}
//getValue
//Object mData= XposedHelpers.callMethod(class_r, "getValue", new Object[] { }); //调用方法
Method method_r = class_r_.getClass().getMethod("getValue", new Class[]{ });
Object mData_ = method_r.invoke(class_r_, new Object[]{});
//全部好友List=================1=====================
ArrayList<Object> mDataList_ = (ArrayList<Object>) mData_;
int userCount_ = mDataList_.size();//全部好友数
a.Toast("全部好友数:"+userCount_);
//遍历好友信息=================2=====================
//调用静态方法 转换好友聊天
// Class<?> class_zh_ = Class.forName("com.bytedance.im.core.c.e");
Class<?> class_zh_ = cl.loadClass("com.bytedance.im.core.c.e");
Method method_zh = class_zh_.getMethod("a", long.class );
for(int i=0; i<userCount_; i++){
// Class<?> class_qun = cl.loadClass("com.ss.android.ugc.aweme.im.service.model.IMConversation");
// Class<?> class_user= cl.loadClass("com.ss.android.ugc.aweme.im.service.model.IMUser");
Object TpUserinfo = mDataList_.get( i );//class = UserInfo
if(TpUserinfo.getClass().getCanonicalName().contains("IMConversation") ){
//str = (String) XposedHelpers.callMethod(TpUserinfo, "getConversationId", new Object[] { }); //调用方法
//群直接过滤
Method method_us = TpUserinfo.getClass().getMethod("getConversationId", new Class[]{ });
String str = (String) method_us.invoke(TpUserinfo, new Object[]{});
if(str != null && ! arr_.contains(str)){
arr_.add(str);
}
}else if(TpUserinfo.getClass().getCanonicalName().contains("IMUser") ){
//user好友
//str = (String) XposedHelpers.callMethod(TpUserinfo, "getUid", new Object[] { }); //调用方法 取ID
//Log.e("getUid getUid", str);
//str = (String) XposedHelpers.callStaticMethod(class_zh, "a", new Object[] {Long.parseLong(str) });//调用静态方法 转换好友聊天
Method method_us = TpUserinfo.getClass().getMethod("getUid", new Class[]{ });
String user_id_ = (String) method_us.invoke(TpUserinfo, new Object[]{});
String str = (String) method_zh.invoke(null, Long.parseLong(user_id_) );//0:1:xxxxxxxx:yyyyyyy
if(str != null && ! arr_.contains(str)){
arr_.add(str);
}
}
}