Open jscpkare opened 4 years ago
@implementation UIViewController (Hook1) +(void)load { struct rebinding _request_binding = { "CFReadStreamCreateForHTTPRequest", wt_CFReadStreamCreateForHTTPRequest, (void *)&original_CFReadStreamCreateForHTTPRequest}; struct rebinding rebs[]={_request_binding}; rebind_symbols(rebs, 1); } static CFReadStreamRef wt_CFReadStreamCreateForHTTPRequest(CFAllocatorRef __nullable alloc, CFHTTPMessageRef request); CFReadStreamRef wt_CFReadStreamCreateForHTTPRequest(CFAllocatorRef __nullable alloc, CFHTTPMessageRef request) { NSURL *url = (__bridge NSURL *)CFHTTPMessageCopyRequestURL(request); NSString *method = (__bridge NSString *)CFHTTPMessageCopyRequestMethod(request); CFReadStreamRef readStream = original_CFReadStreamCreateForHTTPRequest(alloc, request); return readStream; } static CFReadStreamRef (*original_CFReadStreamCreateForHTTPRequest)(CFAllocatorRef, CFHTTPMessageRef); @end
This's my code, bind CFNetwork CFReadStreamCreateForHttpRequest function, I want monitoring network status, but, i don't recive result in wt_CFReadStreamCreateForHTTPRequest function, please help me, thanks
CFReadStreamCreateForHttpRequest
wt_CFReadStreamCreateForHTTPRequest
hi, It works in my project in your way, maybe you are not using the latest version.
This's my code, bind CFNetwork
CFReadStreamCreateForHttpRequest
function, I want monitoring network status, but, i don't recive result inwt_CFReadStreamCreateForHTTPRequest
function, please help me, thanks