添加好友
AddFriendEntryViewController
https://github.com/Afirefish/...
%hook MMSearchBar
- (_Bool)searchBar:(id)arg1 shouldChangeTextInRange:(struct _NSRange)arg2 replacementText:(id)arg3 {
%log;
return YES;
}
%end
- (void)onGetSearchContactRet:(id)arg1 req:(id)arg2
{
%log;
%orig;
SearchContactResponse *res = (SearchContactResponse *)arg1;
SearchContactRequest *req = (SearchContactRequest *)arg2;
NSLog(@"responder data----%@,%zd,%zd,%@, %@,%@", res.albumBgimgId,res.albumFlag,res.albumStyle,res.alias,res.antispamTicket,res.baseResponse);
NSLog(@"request data----%@,%zd,%zd,%@,%zd,%@", req.baseRequest,req.fromScene,req.opCode,req.reqBuf,req.searchScene,req.userName);
NSLog(@"setM_nsLinkedInName----%zd,%@,%@,%zd,%@,%zd",req.baseRequest.clientVersion,req.baseRequest.deviceId,req.baseRequest.deviceType,req.baseRequest.scene,req.baseRequest.sessionKey,req.baseRequest);
NSLog(@"stringent-----%@",req.userName.string);
}
Nov 18 14:38:11 iPhone WeChat[4884] <Warning>: KNHooklog :-(id)initWithContentController:backGroundView:(have 2 value)
return:(null)
value1:AddFriendEntryViewController--><AddFriendEntryViewController: 0x16960400>
value2:MMTableView--><MMTableView: 0x179ca600; baseClass = UITableView; frame = (0 0; 320 568); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x173eb570>; layer = <CALayer: 0x1719eb50>; contentOffset: {-0, -64}; contentSize: {320, 45}>
object:<FindContactSearchViewCellInfo: 0x1754de00>
##########################################
Nov 18 14:38:15 iPhone WeChat[4884] <Warning>: KNHooklog :-(void)doSearch:Pre:(have 2 value)
return:(null)
value1:__NSCFString-->Sha
value2:__NSCFNumber-->1
object:<FindContactSearchViewCellInfo: 0x1754de
Nov 18 15:45:23 iPhone WeChat[693] <Notice>: [weiliu] /Users/devzkn/code/tweak/weiliu/weiliu/weiliu.xm:37 DEBUG: -[<FindContactSearchViewCellInfo: 0x16cb6b90> onGetSearchContactRet:<SearchContactResponse: 0x16eb9590> req:<SearchContactRequest: 0x16e5d690>]
Nov 18 15:45:23 iPhone WeChat[693] <Warning>: responder data----,0,0,shancci, v2_8f527f682333fb74431bb77f51bee552583cea128816f3434deb3c75b0386c9fc0b2c44b8f912bb06d65a9f73ede6821@stranger,<BaseResponse: 0x169564e0>
Nov 18 15:45:23 iPhone WeChat[693] <Warning>: KNHooklog :-(void)sendBrandContactListRequest(have 0 value)
return:(null)
object:<FindContactSearchViewCellInfo: 0x16cb6b90>
##########################################
Nov 18 16:00:12 iPhone WeChat[916] <Warning>: KNHooklog :-(void)addFriendScene:(have 1 value)
return:(null)
value1:CSearchedContact-->{m_nsUsrName=v1_*ger~108, m_nsEncodeUserName=(null), alias=sh*ci~7, m_nsNickName=没谱的曲, m_uiType=0, m_uiConType=0, m_nsRemark=(null), m_nsCountry=CN m_nsProvince=Hunan m_nsCity=Changsha m_nsSignature= m_uiSex=1 m_uiCerFlag=0 m_nsCer= scene=0 }
object:<FindContactSearchViewCellInfo: 0x1839a300>
##########################################
Nov 18 16:00:12 iPhone WeChat[916] <Warning>: KNHooklog :-(void)showContactInfoView:(have 1 value)
return:(null)
value1:CSearchedContact-->{m_nsUsrName=v1_*ger~108, m_nsEncodeUserName=(null), alias=sh*ci~7, m_nsNickName=没谱的曲, m_uiType=0, m_uiConType=0, m_nsRemark=(null), m_nsCountry=CN m_nsProvince=Hunan m_nsCity=Changsha m_nsSignature= m_uiSex=1 m_uiCerFlag=0 m_nsCer= scene=0 }
object:<FindContactSearchViewCellInfo: 0x1839a300>
##########################################
showContactInfoView
onGetSearchDetailPageResponse调用了howContactInfoView:
FindContactSearchViewCellInfo onGetSearchDetailPageResponse
void -[FindContactSearchViewCellInfo sendBrandContactListRequest](void * self, void * _cmd) {
*((sp - 0x14) + 0xfffffffffffffffc) = r8;
loc_1c0d080(@class(MMServiceCenter), @selector(defaultCenter), 0x344e938);
r5 = loc_1c0d08c();
loc_1c0d080(r5, @selector(getService:), loc_1c0d080(@class(BrandServiceSearchMgr), @selector(class), 0x345347c));
r6 = loc_1c0d08c();
loc_1c0d080(self, @selector(getSearchBarText));
r4 = loc_1c0d08c();
self->_requestEventID = loc_1c0d080(r6, @selector(sendDetailPageDataQuickRequest:Keyword:), 0x1, 0x0, r4);
loc_1c0d090(r4, *ivar_offset(_requestEventID));
loc_1c0d090(r6);
loc_1c0d0a4(r5);
return;
}
Nov 18 16:35:52 iPhone WeChat[1020] <Warning>: KNHooklog :-(void)onGetSearchDetailPageResponse:eventID:(have 2 value)
return:(null)
value1:ProtobufCGIWrap--><ProtobufCGIWrap: 0x16c678e0>
value2:__NSCFNumber-->31
object:<FindContactSearchViewCellInfo: 0x16951e00>
##########################################
void -[FindContactSearchViewCellInfo MessageReturn:Event:](void * self, void * _cmd, void * arg2, unsigned long arg3) {
r7 = (sp - 0x14) + 0xc;
sp = sp - 0x54;
r5 = self;
r4 = loc_1c0d094(arg2, _cmd, arg2, arg3);
loc_1c0d080(@class(CAppUtil), @selector(removePBEventObserverListItemByObject:), r5);
if (loc_1c0d080(r4, @selector(m_uiCgi)) != 0x6a) goto loc_17454f0;
找到了创建CSearchedContact 的地方,这个是关键
void -[FindContactSearchViewCellInfo onGetSearchContactRet:req:](void * self, void * _cmd, void * arg2, void * arg3) {
r7 = (sp - 0x14) + 0xc;
sp = sp - 0x2c;
r8 = self;
r5 = loc_1c0d094(arg2, _cmd, arg2, arg3);
r11 = loc_1c0d080(@class(CSearchedContact), @selector(contactFromSearchContactResp:Req:), r5, arg3);
%hook FindContactSearchViewCellInfo
- (void)onGetSearchContactRet:(id)arg1 req:(id)arg2
{
%log;
%orig;
SearchContactResponse *res = (SearchContactResponse *)arg1;
NSLog(@"responder data----%@,%zd,%zd,alias:%@, antispamTicket:%@,%@", res.albumBgimgId,res.albumFlag,res.albumStyle,res.alias,res.antispamTicket,res.baseResponse);
//alias:shancci, antispamTicket
CContact *resultContact = [%c(CSearchedContact) contactFromSearchContactResp:arg1 Req:arg2];
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。