@
interface MMUIViewController : UIViewController
{
UINavigationController *m_navigationController;
}
@
end@
interface CMessageWrap:NSObject
{}
@
property(retain, nonatomic) NSString *m_nsContent;
+ (id)getMsgImg:(id)arg1;
+ (id)getMaskedVideoMsgImgThumb:(id)arg1;
@
end@
protocol messageNodeViewDelegate <NSObject>
- (MMUIViewController *)getViewController;
@
end@
interface BaseMessageNodeView : NSObject
{
CMessageWrap *m_oMessageWrap;
id <messageNodeViewDelegate> m_delegate;
}
@
end@
interface MMTextView : NSObject
{}
- (void)setText:(id)arg1;
@
end@
interface MMGrowTextView : NSObject
{
MMTextView *_textView;
}
- (void)postTextChangeNotification;
@
end@
interface WCNewCommitViewController:MMUIViewController
{
MMGrowTextView *_textView;
}
@
property(nonatomic) _Bool bCommmitOnlyText;
- (id)initWithImages:(id)arg1 contacts:(id)arg2;
- (void)OnDone;
@
end@
interface SightMomentEditViewController : MMUIViewController
{
NSString *_realMoviePath;
NSString *_moviePath;
UIImage *_thumbImage;
UIImage *_realThumbImage;
}
@
property(nonatomic) _Bool directClose;
@
property(nonatomic) _Bool fromDraft;
@
property(retain, nonatomic) NSString *moviePath;
@
property(retain, nonatomic) NSString *realMoviePath;
@
property(retain, nonatomic) UIImage *realThumbImage;
@
property(retain, nonatomic) UIImage *thumbImage;
- (id)init;
@
end@
interface ImageMessageNodeView : BaseMessageNodeView
{}
- (void)onForward:(id)arg1;
@
end@
interface MMImage : NSObject
{}
- (id)initWithImage:(id)arg1;
- (void)commonInit;
@
end@
interface TextMessageNodeView : BaseMessageNodeView
{}
- (void)onForward:(id)arg1;
@
end@
interface VideoMessageNodeView : BaseMessageNodeView
{
NSString *m_videoPath;
}
- (id)getCoverImage;
- (id)getMessageImageView;
- (id)thumbImage;
- (void)onForward:(id)arg1;
@
endint sharetext = 0;
NSString *sharemsg = @"";
%hook ImageMessageNodeView
- (void)onForward:(id)arg1{
id <messageNodeViewDelegate> delegate = MSHookIvar<id>(self,"m_delegate");
MMUIViewController *vc= [delegate getViewController];
UIImage *uimage = [%c(CMessageWrap) getMsgImg: MSHookIvar<CMessageWrap *>(self,"m_oMessageWrap")];
MMImage *mmimage = [[%c(MMImage) alloc] initWithImage:uimage];
[mmimage commonInit];
NSMutableArray* array = [[NSMutableArray alloc] initWithObjects:mmimage, nil];
WCNewCommitViewController *wcvc = [[%c(WCNewCommitViewController) alloc] initWithImages:array contacts:nil];
UINavigationController *navC = [[UINavigationController alloc] initWithRootViewController:wcvc];
[vc presentViewController:navC animated:YES completion:nil];
[wcvc release];
[navC release];
}
%end
%hook TextMessageNodeView
- (void)onForward:(id)arg1{
%log;
id <messageNodeViewDelegate> delegate = MSHookIvar<id>(self,"m_delegate");
MMUIViewController *vc= [delegate getViewController];
CMessageWrap *msgwrap = MSHookIvar<CMessageWrap *>(self,"m_oMessageWrap");
NSString *msgtext =[msgwrap m_nsContent];
sharemsg = msgtext;
sharetext = 1;
WCNewCommitViewController *wcvc = [[%c(WCNewCommitViewController) alloc] initWithImages:nil contacts:nil];
UINavigationController *navC = [[UINavigationController alloc] initWithRootViewController:wcvc];
[wcvc setBCommmitOnlyText:1];
[vc presentViewController:navC animated:YES completion:nil];
[wcvc release];
[navC release];
}
%end
%hook VideoMessageNodeView
- (void)onForward:(id)arg1{
%log;
SightMomentEditViewController *wcvc = [[%c(SightMomentEditViewController) alloc] init];
NSLog(@"============all oc init here");
NSString *vpath=MSHookIvar<NSString *>(self,"m_videoPath");
NSLog(@"====video path%@",vpath);
[wcvc setMoviePath:vpath];
[wcvc setRealMoviePath:vpath];
[wcvc setThumbImage:[%c(CMessageWrap) getMaskedVideoMsgImgThumb: MSHookIvar<CMessageWrap *>(self,"m_oMessageWrap")]];
[wcvc setRealThumbImage: [%c(CMessageWrap) getMaskedVideoMsgImgThumb: MSHookIvar<CMessageWrap *>(self,"m_oMessageWrap")]];
[wcvc setFromDraft:1];
[wcvc setDirectClose:1];
UINavigationController *navC = [[UINavigationController alloc] initWithRootViewController:wcvc];
id <messageNodeViewDelegate> delegate = MSHookIvar<id>(self,"m_delegate");
MMUIViewController *vc= [delegate getViewController];
NSLog(@"===%@",vc);
[vc presentViewController:navC animated:YES completion:nil];
[wcvc release];
[navC release];
}
%end
%hook WCNewCommitViewController
- (id)initWithImages:(id)arg1 contacts:(id)arg2{
NSLog(@"==%@",arg1);
%log;
return %orig;
}
- (void)viewDidAppear:(_Bool)arg1{
if(sharetext){
MMGrowTextView *grow = MSHookIvar<MMGrowTextView *>(self,"_textView");
MMTextView *mmtext = MSHookIvar<MMTextView *>(grow,"_textView");
[mmtext setText:sharemsg];
[grow postTextChangeNotification];
sharemsg = @"";
sharetext = 0;
}
}
%end
这个是以前的代码。。。。后面自己也不想玩了。可能还有 bug 吧。想玩的就调试下吧。