github下載項目源碼,內含app包。git
//紅包消息Model
%hook _TtC3Jst29JST_RedpacketMessageViewModel
- (id)initWithSLCtMessage:(id)arg1
{
%log;
redpacketMessage = %orig;
long long senderId = [redpacketMessage getSenderId];
SLCfGiveRedPacketMessageContentImpl * content = [redpacketMessage getContent];// <SLCfGiveRedPacketMessageContentImpl: 0x17445e240>
NSLog(@"do--initWithSLCtMessage--content= (%@)",content);
NSString * tradeNumber = [content getTradeNumber];
long amount = (long)[content getAmount];
NSString * text = [content getText];
NSLog(@"do--initWithSLCtMessage--(%@, %ld, %@, %@, %@, senderId:%lld)",tradeNumber,amount,text,[content getRedPacketType],[content isCollected]?@"已搶":@"沒搶",senderId);
[self autoGrabRedpacket:redpacketMessage];
return redpacketMessage;
}
%new
-(void)autoGrabRedpacket:(_TtC3Jst29JST_RedpacketMessageViewModel *)redpacket
{
long long senderId = [redpacket getSenderId];
SLCfGiveRedPacketMessageContentImpl * content = [redpacket getContent];// <SLCfGiveRedPacketMessageContentImpl: 0x17445e240>
NSLog(@"do--autoGrabRedpacket--content= (%@)",content);
NSString * tradeNumber = [content getTradeNumber];
long amount = (long)[content getAmount];
NSString * text = [content getText];
NSLog(@"do--autoGrabRedpacket--(%@, %ld, %@, %@, %@, senderId:%lld)",tradeNumber,amount,text,[content getRedPacketType],[content isCollected]?@"已搶":@"沒搶", senderId);
SLCtRedPacketChannel * channel = [%c(SLCtRedPacketChannel) GENERAL];
agent = [%c(SLCtRedPacketAgent) getInstance];
// arg0
// arg1 是 紅包id
// arg2 是 senderId
[agent sendCollectRedPacketRequestWithSLHttpCallback:nil withNSString:tradeNumber withLong:senderId withSLCtRedPacketChannel:channel];
NSLog(@"do--autoGrabRedpacket--finish");
}
%end
複製代碼