forked from yangzhenglun/hookPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTweak的副本.xm
544 lines (413 loc) · 20.2 KB
/
Tweak的副本.xm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
//文章阅读
#import <UIKIT/UIKIT.h>
#import <Foundation/Foundation.h>
#import <substrate.h>
#import "curl/curl.h"
#import <time.h>
#import <iostream>
#import <string>
#pragma GCC diagnostic ignored "-Wgnu"
#pragma GCC diagnostic ignored "-Wundef"
#pragma GCC diagnostic ignored "-Wselector"
static NSString *environmentPath = @"http://www.vogueda.com/shareplatformWxTest-test/weixin/";
static dispatch_group_t group = dispatch_group_create();
static dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
//去掉特殊字符
extern "C" NSString *conversionSpecialCharacter(NSString *character){
NSString *characterTemp = character;
//
// //去掉nickname 的特殊字符
for(int i=0; i<3;i++){
if([characterTemp rangeOfString:@"\""].location != NSNotFound){
characterTemp = [characterTemp stringByReplacingOccurrencesOfString:@"\"" withString:@""];
NSLog(@"");
}else if([characterTemp rangeOfString:@"&"].location != NSNotFound){
characterTemp = [characterTemp stringByReplacingOccurrencesOfString:@"&" withString:@""];
}else if([characterTemp rangeOfString:@"%"].location != NSNotFound){
characterTemp = [characterTemp stringByReplacingOccurrencesOfString:@"%" withString:@""];
}else{
characterTemp = [NSString stringWithFormat:@"%@",characterTemp];
break;
}
}
return characterTemp;
}
/*
是否有等待请求数据回来
-1:处于初始化状态
0: 没有数据
1: 等待数据返回
2: 数据返回了
3: 数据返回错误
*/
NSInteger m_isRequestResult = -1;
NSMutableArray *m_taskArrayData = [[NSMutableArray alloc] init];
NSMutableDictionary *m_taskDataDic = [NSMutableDictionary dictionaryWithCapacity:1];
static int m_interval = 2; //间隔秒数
static int m_spaceCount = 10; //间隔个数
//字符串转dictionary
extern "C" NSMutableDictionary * strngToDictionary(NSString * strData) {
// @autoreleasepool {
NSData *nsData = [strData dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
NSMutableDictionary *jsonData = [NSJSONSerialization
JSONObjectWithData:nsData
options:kNilOptions
error:&error];
return jsonData;
// }
}
//写文件
extern "C" BOOL write2File(NSString *fileName, NSString *content) {
[content writeToFile:fileName atomically:NO encoding:NSUTF8StringEncoding error:nil];
return YES;
}
@interface CSetting : NSObject <NSCoding>
@property(copy) NSString *m_nsGoogleContactName; // @synthesize m_nsGoogleContactName;
@property(copy) NSString *m_nsMicroBlogUsrName; // @synthesize m_nsMicroBlogUsrName;
@property(copy) NSString *m_nsMobile; // @synthesize m_nsMobile;
@property(copy) NSString *m_nsEmail; // @synthesize m_nsEmail;
@property(copy) NSString *m_nsAliasName; // @synthesize m_nsAliasName;
@property(copy) NSString *m_nsUsrName; // @synthesize m_nsUsrName;
@property(nonatomic) _Bool m_emotionReinit; // @synthesize m_emotionReinit;
@property(nonatomic) unsigned int m_walletType; // @synthesize m_walletType;
@property(retain, nonatomic) NSData *m_patternInfoSign; // @synthesize m_patternInfoSign;
@property(nonatomic) unsigned int m_patternLockStatus; // @synthesize m_patternLockStatus;
@property(nonatomic) unsigned int m_patternVersion; // @synthesize m_patternVersion;
@property(retain) NSString *m_nsMsgPushSound; // @synthesize m_nsMsgPushSound;
@property(retain) NSString *m_nsVoipPushSound; // @synthesize m_nsVoipPushSound;
@property(retain) NSData *m_dtNewInitTempMaxBuffer; // @synthesize m_dtNewInitTempMaxBuffer;
@property(retain) NSData *m_dtNewInitTempBuffer; // @synthesize m_dtNewInitTempBuffer;
@property(retain) NSString *m_nsLastUUID; // @synthesize m_nsLastUUID;
@property(nonatomic) unsigned int m_uiReaderFontSize; // @synthesize m_uiReaderFontSize;
@property(nonatomic) unsigned int m_uiProfileFlag; // @synthesize m_uiProfileFlag;
@property(retain) NSData *m_dtA2KeyNew; // @synthesize m_dtA2KeyNew;
@property(retain) NSData *m_dtA2Key; // @synthesize m_dtA2Key;
//@property(retain) SubscriptBrandInfo *m_subBrandInfo; // @synthesize m_subBrandInfo;
@property(nonatomic) unsigned int m_uiBrandSubscriptionSettings; // @synthesize m_uiBrandSubscriptionSettings;
@property(retain) NSString *m_nsBrandSubscriptConfigUrl; // @synthesize m_nsBrandSubscriptConfigUrl;
@property(retain) NSString *m_nsExternalInfo; // @synthesize m_nsExternalInfo;
@property(retain) NSString *m_pcWCBGImgID; // @synthesize m_pcWCBGImgID;
@property(nonatomic) int m_iWCFlagExt; // @synthesize m_iWCFlagExt;
@property(nonatomic) int m_iWCFlag; // @synthesize m_iWCFlag;
@property(retain) NSString *m_nsWCBGImgObjectID; // @synthesize m_nsWCBGImgObjectID;
@property(retain) NSString *m_nsAuthKey; // @synthesize m_nsAuthKey;
@property(nonatomic) unsigned int m_uiRegType; // @synthesize m_uiRegType;
@property(nonatomic) unsigned int m_uiGMailSwitch; // @synthesize m_uiGMailSwitch;
@property(nonatomic) unsigned int m_uiGMailStatus; // @synthesize m_uiGMailStatus;
@property(retain) NSString *m_nsGMailAccount; // @synthesize m_nsGMailAccount;
@property(nonatomic) unsigned int m_uiPluginSwitch; // @synthesize m_uiPluginSwitch;
@property(retain) NSString *m_nsFacebookToken; // @synthesize m_nsFacebookToken;
@property(retain) NSString *m_nsFacebookName; // @synthesize m_nsFacebookName;
@property(retain) NSString *m_nsFacebookID; // @synthesize m_nsFacebookID;
@property(nonatomic) unsigned int m_uiFacebookFlag; // @synthesize m_uiFacebookFlag;
@property(nonatomic) unsigned int m_uiWeiboFlag; // @synthesize m_uiWeiboFlag;
@property(retain) NSString *m_nsWeiboNickName; // @synthesize m_nsWeiboNickName;
@property(retain) NSString *m_nsWeiboAddress; // @synthesize m_nsWeiboAddress;
@property(retain) NSString *m_nsCertificationInfo; // @synthesize m_nsCertificationInfo;
@property(nonatomic) unsigned int m_uiCertificationFlag; // @synthesize m_uiCertificationFlag;
@property(nonatomic) unsigned int m_uiSelfShowType; // @synthesize m_uiSelfShowType;
@property(nonatomic) unsigned int m_uiPluginInstallStatus; // @synthesize m_uiPluginInstallStatus;
//@property(retain) CNoDisturbInfo *m_oNoDisturbInfo; // @synthesize m_oNoDisturbInfo;
@property(retain) NSString *m_nsHDImgStatus; // @synthesize m_nsHDImgStatus;
@property(retain) NSString *m_nsHDHeadImgMD5; // @synthesize m_nsHDHeadImgMD5;
@property(nonatomic) unsigned int m_uiPersonalCardStatus; // @synthesize m_uiPersonalCardStatus;
@property(nonatomic) unsigned int m_uiSex; // @synthesize m_uiSex;
@property(retain) NSString *m_nsCity; // @synthesize m_nsCity;
@property(retain) NSString *m_nsProvince; // @synthesize m_nsProvince;
@property(retain) NSString *m_nsCountry; // @synthesize m_nsCountry;
@property(retain) NSString *m_nsUin16PwdMD5; // @synthesize m_nsUin16PwdMD5;
@property(retain) NSString *m_nsUinPwdMD5; // @synthesize m_nsUinPwdMD5;
@property(retain) NSData *m_dtSyncBuffer; // @synthesize m_dtSyncBuffer;
@property(nonatomic) _Bool m_bQQOfflineSwitchStatus; // @synthesize m_bQQOfflineSwitchStatus;
@property(retain) NSString *m_nsPushmailFolderUrl; // @synthesize m_nsPushmailFolderUrl;
@property(nonatomic) unsigned int m_uiSendCardType; // @synthesize m_uiSendCardType;
@property(nonatomic) _Bool m_bReplyToAddContact; // @synthesize m_bReplyToAddContact;
@property(nonatomic) unsigned int m_uiShowFirstTimeTipsVersion; // @synthesize m_uiShowFirstTimeTipsVersion;
@property(nonatomic) unsigned int m_uiDefaultChatState; // @synthesize m_uiDefaultChatState;
@property(nonatomic) unsigned int m_uiPushMailSwitchStatus; // @synthesize m_uiPushMailSwitchStatus;
@property(nonatomic) _Bool m_bAuthAnotherPlace; // @synthesize m_bAuthAnotherPlace;
@property(retain) NSString *m_nsPwd16MD5; // @synthesize m_nsPwd16MD5;
@property(nonatomic) unsigned int m_uiInitStatus; // @synthesize m_uiInitStatus;
@property(retain) NSString *m_nsInitBuffer; // @synthesize m_nsInitBuffer;
@property(nonatomic) unsigned int m_uiInitSyncKey; // @synthesize m_uiInitSyncKey;
@property(nonatomic) unsigned int m_uiLastInitVersion; // @synthesize m_uiLastInitVersion;
@property(nonatomic) unsigned int m_uiCryptUin; // @synthesize m_uiCryptUin;
@property(nonatomic) unsigned int m_uiShowWhatsnewVersion; // @synthesize m_uiShowWhatsnewVersion;
@property(nonatomic) _Bool m_bPushPrivateMsg; // @synthesize m_bPushPrivateMsg;
@property(nonatomic) _Bool m_bRevPrivateMsg; // @synthesize m_bRevPrivateMsg;
@property(nonatomic) unsigned int m_uiLastTimeOfNotifyOpenPush; // @synthesize m_uiLastTimeOfNotifyOpenPush;
@property(retain) NSString *m_nsMMdevNick; // @synthesize m_nsMMdevNick;
@property(retain) NSString *m_nsMMdevName; // @synthesize m_nsMMdevName;
@property(nonatomic) _Bool m_bNewMsgVibration; // @synthesize m_bNewMsgVibration;
@property(nonatomic) _Bool m_bNewMsgSound; // @synthesize m_bNewMsgSound;
@property(retain) NSString *m_nsSyncBuffer; // @synthesize m_nsSyncBuffer;
@property(nonatomic) unsigned int m_uiSyncKey; // @synthesize m_uiSyncKey;
@property(nonatomic) unsigned int m_uiNextAuthType; // @synthesize m_uiNextAuthType;
@property(retain) NSData *m_dtAutoAuthKey; // @synthesize m_dtAutoAuthKey;
@property(retain) NSString *m_nsPassWordMD5; // @synthesize m_nsPassWordMD5;
@property(nonatomic) unsigned int m_uiStatus; // @synthesize m_uiStatus;
@property(nonatomic) _Bool m_bSyncNickName; // @synthesize m_bSyncNickName;
@property(nonatomic) unsigned int m_uiUin; // @synthesize m_uiUin;
//- (void).cxx_destruct;
- (id)getDicSetting;
- (void)theadSafeRemoveObjectForKey:(id)arg1;
- (void)theadSafeSetObject:(id)arg1 forKey:(id)arg2;
- (id)theadSafeGetObject:(id)arg1;
- (int)getInt32ForKey:(id)arg1;
- (void)setInt32:(int)arg1 forKey:(id)arg2;
- (unsigned int)getUInt32ForKey:(id)arg1;
- (void)setUInt32:(unsigned int)arg1 forKey:(id)arg2;
- (_Bool)getBoolForKey:(id)arg1;
- (void)setBool:(_Bool)arg1 forKey:(id)arg2;
- (_Bool)IsVoipSoundOpen;
- (id)description;
- (id)keyPaths;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (void)copyFromSetting:(id)arg1;
- (void)dealloc;
- (id)init;
- (void)preInit;
- (_Bool)isiPodTouch;
@property(copy) NSString *m_nsSignature; // @synthesize m_nsSignature;
@property(copy) NSString *m_nsNickName; // @synthesize m_nsNickName;
@end
//微信聊天页面
@interface NewMainFrameViewController
- (void)viewDidLoad;
- (void)batchMpDocReadCount;
@end
//跑微信文章阅读量
@interface MMWebViewController
- (_Bool)isPageDidLoad;
- (id)getCurrentUrl;
- (id)webviewController;
- (void)permitTempAccessOfJSApi:(id)arg1;
- (void)onPageNotifyFinishedLoading:(id)arg1;
- (void)onDomReady:(id)arg1;
- (void)shareToFB;
- (void)setDisableWebAlertView:(_Bool)arg1;
- (id)getRequestingOrCurrentUrl;
- (void)showAlertUploadingVideo;
- (void)cleanJSAPIDelegate;
- (_Bool)isSvrErrorTipForbidden;
- (void)viewDidLoad;
- (_Bool)isPhoneNumberUrl:(id)arg1;
- (id)getLastUrl;
- (void)goToURL:(id)arg1;
- (void)goForward;
- (void)goBack;
- (void)stop;
- (void)clearWebviewCacheAndCookie:(_Bool)arg1;
- (void)reload;
- (id)getRoutUrls;
- (void)done:(id)arg1;
- (void)notifyToJSBridgeVisibilityChanged:(_Bool)arg1;
- (void)loadHTMLString:(id)arg1 baseURL:(id)arg2;
- (id)extraInfo;
- (void)doDNS;
- (void)StartLoadWeb;
- (id)initWithURL:(id)arg1 presentModal:(_Bool)arg2 extraInfo:(id)arg3;
- (id)getInitUrl;
- (id)getShareUrl;
- (void)saveJSAPIPermissions:(id)arg1 url:(id)arg2;
@end
// 跑微信文章阅读量
extern "C" size_t CurlWrite_CallbackFunc_StdString(void *contents, size_t size, size_t nmemb, std::string *s)
{
size_t newLength = size*nmemb;
size_t oldLength = s->size();
try
{
s->resize(oldLength + newLength);
}
catch(std::bad_alloc &e)
{
//handle memory problem
return 0;
}
std::copy((char*)contents,(char*)contents+newLength,s->begin()+oldLength);
return size*nmemb;
}
extern "C" BOOL fetchMpDocWithCurl(NSString *url) {
CURL *web = curl_easy_init();
CURLcode result;
std::string s;
BOOL flag = NO;
if (web) {
curl_easy_setopt(web, CURLOPT_URL, [url UTF8String]);
curl_easy_setopt(web, CURLOPT_USERAGENT, "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A403 MicroMessenger/6.3.30 NetType/WIFI Language/zh_CN");
curl_easy_setopt(web, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(web, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(web, CURLOPT_POSTFIELDS, "is_only_read=1");
curl_easy_setopt(web, CURLOPT_WRITEFUNCTION, CurlWrite_CallbackFunc_StdString);
curl_easy_setopt(web, CURLOPT_WRITEDATA, &s);
result = curl_easy_perform(web);
if(result != CURLE_OK){
NSLog(@"MYHOOK-curl Cannot grab the url: %@!", url);
flag = NO;
}
}
curl_easy_cleanup(web);
flag = YES;
// [NSString stringWithUTF8String:s.c_str()];
NSLog(@"MYHOOK get html:%@, =====> %@ : result : %@", flag ? @"YES":@"NO", url,[NSString stringWithUTF8String:s.c_str()]);
return flag;
}
%hook MMWebViewController
- (void)saveJSAPIPermissions:(id)arg1 url:(id)arg2 {
%orig;
// NSLog(@"this is add read saveJSAPIPermissions: arg1:%@ url(arg2):%@",arg1,arg2);
// dispatch_async(myMpDocQueue, ^{
// NSString *readCountUrl = [arg2 stringByReplacingOccurrencesOfString:@"https://mp.weixin.qq.com/s" withString:@"https://mp.weixin.qq.com/mp/getappmsgext"];
// fetchMpDocWithCurl(readCountUrl);
// });
}
%end
static CSetting *m_nCSetting = [[NSClassFromString(@"CSetting") alloc] init]; //下面的table页
//启动时请求的的任务数据
extern "C" void getServerData(NSString *nsUsrName,NSString *nsMobile,NSString *nsNickName,NSString *nsAliasName){
//([m_nCSetting m_nsUsrName],[m_nCSetting m_nsMobile],[m_nCSetting m_nsNickName],[m_nCSetting m_nsAliasName]);
m_isRequestResult = 1;
// 1. URL
NSString *urlStr = [NSString stringWithFormat:@"%@getWeixinArticleList.htm?uuid=%@&phone=%@&aliasName=%@",environmentPath,nsUsrName,nsMobile,nsAliasName];
NSURL *url = [NSURL URLWithString:urlStr];
// 2. Request
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSLog(@"============ 请求回来的数据为 url:%@",urlStr);
// 3. Connection
[NSURLConnection sendAsynchronousRequest:request queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
if (connectionError == nil) {
// 网络请求结束之后执行!
// 将Data转换成字符串
NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSMutableDictionary *taskAll = strngToDictionary(str);
NSLog(@"HKWeChat 请求回来的数据为:%@ url:%@ ",taskAll,urlStr);
if([[taskAll objectForKey:@"code"] intValue] == 0 && taskAll != nil){
// for(NSArray *obj in [taskAll objectForKey:@"weixinListData"]){
// [m_taskArrayData addObject:[obj mutableCopy]];
//
// }
// m_taskDataDic = m_taskArrayData[0];
NSLog(@"%@",[taskAll objectForKey:@"weixinListData"]);
write2File(@"/var/root/hkwx/wxRedMap.plist", [taskAll objectForKey:@"weixinListData"]);
// m_taskDataDic = m_taskArrayData[0];
m_isRequestResult = 2;
}else{
m_isRequestResult = 3;
}
// num = 2
// m_taskData = str;
// 更新界面
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
// self.logonResult.text = @"登录完成";
}];
}
}];
// num = 1
NSLog(@"come here %@", [NSThread currentThread]);
// NSURLResponse *response = nil;
// [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:NULL];
}
//发送成功标示给服务端
extern "C" void hookSuccessTask(NSString *uuid){
// 1. URL
NSString *urlStr = [NSString stringWithFormat:@"%@markWeixinArticleComplate.htm?uuid=%@",environmentPath,uuid];
NSLog(@"hkWeixinArticle 发送成功给服务器 %@",urlStr);
NSURL *url = [NSURL URLWithString:urlStr];
// 2. Request
NSURLRequest *request = [NSURLRequest requestWithURL:url];
// 3. Connection
[NSURLConnection sendAsynchronousRequest:request queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
if (connectionError == nil) {
// 网络请求结束之后执行!
// 将Data转换成字符串
// NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
// num = 2
// m_chatMsgData = str;
// NSLog(@"HKWX this is request chat (requestURL:%@) return msg %@",URLEncodedString(chatUrl),str);
// 更新界面
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
// self.logonResult.text = @"登录完成";
}];
}
}];
// num = 1
NSLog(@"come here %@", [NSThread currentThread]);
}
%hook NewMainFrameViewController
%new
- (void)batchMpDocReadCount {
NSMutableDictionary *config = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/root/hkwx/wxRedMap.plist"];
BOOL enableMpDoc = [config[@"enableMpDoc"] boolValue];
int interval = [config[@"interval"] intValue];
int spaceCount = [config[@"spaceCount"] intValue];
NSLog(@"HKWX this is batchMpDocReadCount:%@",config);
if (!config[@"mpDocList"]) {
NSLog(@"HKWX this is mpDocList is null");
return ;
}
dispatch_group_async(group, queue, ^{
for (int i = 0; i < [config[@"mpDocList"] count]; i++) {
NSString *text = [NSString stringWithFormat:@"%lu/%lu",(unsigned long)(i + 1), [config[@"mpDocList"] count]];
// m_current_readCount = i;
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"HKWX this is NSURL:%@",config[@"mpDocList"][i]);
id web = [[NSClassFromString(@"MMWebViewController") alloc] initWithURL:[NSURL URLWithString:config[@"mpDocList"][i]] presentModal:NO extraInfo:nil];
});
if(spaceCount == 0 || spaceCount == 1){
[NSThread sleepForTimeInterval:interval];
}else{
if ( i % spaceCount == 0 && i > 0) {
[NSThread sleepForTimeInterval:interval];
}
}
}
});
}
- (void)viewDidLoad{
%orig;
NSLog(@"hkWeixinArticle this is NewMainFrameViewController");
NSString *userInfo = [NSString stringWithFormat:@"{\"nsAliasName\":\"%@\",\"nsNickName\":\"%@\",\"nsMobile\":\"%@\",\"nsUsrName\":\"%@\",\"uiSex\":\"%d\"}",[m_nCSetting m_nsAliasName],[m_nCSetting m_nsNickName],[m_nCSetting m_nsMobile],[m_nCSetting m_nsUsrName],[m_nCSetting m_uiSex]];
NSLog(@"hkWeixinArticle %@",userInfo);
//异步请求数据
dispatch_group_async(group, queue, ^{
[NSThread sleepForTimeInterval:2];
//请求数据
getServerData([m_nCSetting m_nsUsrName],[m_nCSetting m_nsMobile],[m_nCSetting m_nsNickName],[m_nCSetting m_nsAliasName]);
//等待数据返回
while(true){
NSLog(@"hkWeixinArticle 等待大数据的返回(微信页面开始)---");
[NSThread sleepForTimeInterval:2];
if(m_isRequestResult != 1){
break;
}
}
[NSThread sleepForTimeInterval:5];
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"m_taskArrayData:hkWeixinArticle %@",m_taskArrayData);
if(m_isRequestResult == 2){
//进行刷阅读量
[self batchMpDocReadCount];
}
});
});
}
%end
%hook CSetting
- (id)init{
id ret = %orig;
NSLog(@"hkwxChecnAccount this is enter CSetting");
m_nCSetting = self;
return ret;
}
%end
%hook YYUIWebView
- (void)webViewDidFinishLoad:(id)arg1{
%orig;
NSString *jsCode = @"document.location.href";
NSString *currentURl = [self stringByEvaluatingJavaScriptFromString:jsCode];
NSLog(@"YYUIWebView document.location.href -------------%@",currentURl);
}
%end