-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathTweak.xm
107 lines (68 loc) · 2.37 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
#import "NTContactsUtil.h"
#import "MaiMaiClient.h"
#import "NTGossipModel.h"
#import "NTGossipInfoViewController.h"
#import "NTGlobalData.h"
#import "RACSubscriber.h"
#import "RACDynamicSignal.h"
#import "RACSignal.h"
%hook NTAppDelegate
-(BOOL)application:(id)application didFinishLaunchingWithOptions:(id)options {
%log;
%orig;
id someobj = [%c(NTContactsUtil) getDist1Contacts];
//NSLog(@" obj : %@",someobj);
if ([someobj isKindOfClass:[NSArray class]]) {
NSArray * array = someobj;
[array enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
ContactSubmodel * smodel = obj;
NSLog(@"%@ %@ %@ %@",smodel.name, smodel.mmid, smodel.title, smodel.company);
}];
}
//id om = [%c(NTContactsUtil) getDist1ContactsByMMIDs:@[@"3180",@"u12372540734003",@"u144221354572539"]];
//NSLog(@" %@ ",om);
return YES;
}
%end
%hook NTGossipInfoViewController
typedef void (^block)(id model);
-(void)reloadGossipTagButtons:(int)buttons {
%log;
%orig;
NTGossipInfoViewController *vc = self;
NTGossipModel* ginfo = vc.gossipinfo;
NSLog(@"mmid : %@",ginfo.mmid);
// Get ID:
MaiMaiClient *mclient = [%c(MaiMaiClient) sharedClient];
id userinfo = [mclient rac_getUserProfileWithMMId:ginfo.mmid getMobile:YES];
NSLog(@"info : %@",userinfo);
RACDynamicSignal * m = (RACDynamicSignal * )[mclient rac_getContactDetailWithMMid:ginfo.mmid cacheMode:2 messageId:5582039];
NSLog(@" Response : %@",m);
[m invalidateGlobalRefIfNoNewSubscribersShowUp];
NSLog(@"didSubscribe : %@",[m didSubscribe]);
//id blocks = ^(id model){
// NSLog(@"model: %@", model);
// };
NSLog(@"bol: %d",[m hasSubscribers]);
RACSubscriber *subscriber = [ %c(RACSubscriber) subscriberWithNext:^(id x) {
NSLog(@"next:%@", x);
} error:nil completed:^(id y){
NSLog(@"completed %@",y);
}];
//[m subscribeNext:subscriber];
[subscriber sendNext:[m didSubscribe]];
NSLog(@"any %@",[m any]);
[m doNext:^(id model){
NSLog(@"m : %@",model);
}];
// RACSubscriber *sb = (RACSubscriber *) [m didSubscribe];
//[sb sendNext:^(id model){
// NSLog(@"RACSubscriber : %@",model);
//} ];
id om = [%c(NTContactsUtil) getDist1ContactsByMMIDs:@[ginfo.mmid]];
NSLog(@"om: %@ ",om);
NTGlobalData *gldata = [%c(NTGlobalData) getInstance];
id info = [gldata getUserByMMID:ginfo.mmid];
NSLog(@"info: %@", info);
}
%end