有时候吧。需要转发一点收到的信息到朋友圈去。特别是别人发来的图片先下载到本地再去通过朋友圈发出来。 感觉好麻烦。 文字也是一样的需要先复制再去打开朋友圈来粘贴。麻烦死了。
目前实现的功能,在聊天界面选中要转发的文字或者图片(目前只能一个),然后长按会出现 菜单,选中朋友圈就可以转发到朋友圈,在编辑界面也可以正常的编辑文字或者给图片加上文字描述什么的。
有人感兴趣的话我就发一下代码。
1
murmur 2016-11-13 20:51:16 +08:00
这不就锤子的 1step 么
|
2
fchypzero 2016-11-13 21:00:03 +08:00 via Android
xposed 不就有转发模块了么
|
3
yivanus OP 我说的是 ios 上的啊。所以 xposed 是给 android 用的啊
|
4
yivanus OP 用苹果的人不会为了这个功能去买个锤子吧?
|
5
akaayy 2016-11-13 21:13:03 +08:00 via Android
感兴趣 发
|
6
Lonely 2016-11-13 21:16:27 +08:00 via iPhone
直接贴 github 地址呗
|
7
yivanus OP @protocol messageNodeViewDelegate <NSObject>
- (MMUIViewController *) getViewController; @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; @end @interface CMessageWrap:NSObject { NSString *m_nsContent; unsigned int m_uiMessageType; } @property(nonatomic) unsigned int m_uiMessageType; @property(retain, nonatomic) NSString *m_nsContent; + (id)getMsgImg:(id)arg1; - (_Bool)IsImgMsg; - (_Bool)IsTextMsg; @end @interface BaseMessageNodeView : NSObject { CMessageWrap *m_oMessageWrap; id <messageNodeViewDelegate> m_delegate; } - (id)m_msgWrap; @end @interface MMImage : NSObject {} - (id)initWithImage:(id)arg1; - (void)commonInit; @end int sharetext = 0; NSString *sharemsg = @""; %hook ImageMessageNodeView %new(v@:@) - (void)sharetotimeline{ 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]; id <messageNodeViewDelegate> delegate = MSHookIvar<id>(self,"m_delegate"); MMUIViewController *vc= [delegate getViewController]; [vc presentViewController:navC animated:YES completion:nil]; [wcvc release]; [navC release]; } %end %hook TextMessageNodeView %new(v@:@) - (void)sharetotimeline{ %log; 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]; id <messageNodeViewDelegate> delegate = MSHookIvar<id>(self,"m_delegate"); MMUIViewController *vc= [delegate getViewController]; [vc presentViewController:navC animated:YES completion:nil]; [wcvc release]; [navC release]; } %end %hook WCNewCommitViewController - (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 %hook BaseMessageNodeView - (void)showOperationMenu:(id)arg1 NeedDelete:(_Bool)arg2 { NSLog(@"=======%s",object_getClassName(self)); CMessageWrap *mw = [self m_msgWrap]; if([mw IsTextMsg] || [mw IsImgMsg]]){ NSMutableArray *menuarray = [[NSMutableArray alloc]initWithArray:arg1]; UIMenuItem *menu_timeline = [[UIMenuItem alloc] initWithTitle:@"朋友圈" action:@selector(sharetotimeline)]; [menuarray insertObject:menu_timeline atIndex:0]; [menu_timeline release]; %orig(menuarray,arg2); }else{ %orig; } } %end github 上不去。只好贴这里了。(方便自己发而已) |
8
designer 2016-11-13 22:06:30 +08:00 via iPhone
谢谢
|
9
coreki 2016-11-13 22:37:56 +08:00 via iPhone
mark ios 使用的?怎么试用
|
10
hewigovens 2016-11-14 07:08:58 +08:00 via iPhone
嗯,不 hook 微信果然做不到
|
11
yivanus OP @coreki 用 theos 编译一下就可以用了。创建一个新工程,然后把里面的 Tweak.xm 用这个内容替换掉。
|
12
yfmir 2016-11-22 09:03:53 +08:00 via iPhone
mark
|
13
kensla 2017-01-10 17:01:01 +08:00
能给份完整的代码研究下吗
|
17
kensla 2017-01-11 14:12:07 +08:00
> Making all for tweak TimeLineTweak …
==> Preprocessing Tweak.xm … ==> Compiling Tweak.xm (armv7)… Tweak.xm:1:38: error: cannot find interface declaration for 'MMUIViewController', superclass of 'WCNewCommitViewController'; did you mean 'UIViewController'? @interface WCNewCommitViewController:MMUIViewController ^~~~~~~~~~~~~~~~~~ UIViewController |
18
kensla 2017-01-11 14:12:55 +08:00
直接替换 Tweak.xm 的内容 编译报错了
|
19
kensla 2017-01-11 14:18:29 +08:00
6.5.3 版本还能用吗
|
20
yivanus OP @kensla 你这前后茅盾啊。。前面说运行起来没有效果。。。后面又说编译错误。。这就很奇怪了。如果你前面没有编译过又是如何运行起来的?这些代码的编译 如果有问题一开始就会报错。。。
|
21
yivanus OP @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; @end int 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 吧。想玩的就调试下吧。 |
23
kensla 2017-01-11 19:56:13 +08:00
https://git.oschina.net/604217454/timelinetweak.git 这个是代码,方便测试下么
|
24
yivanus OP 2017-01-11 23:35:57.780 xcodebuild[8802:302869] [MT] DVTPlugInManager: Required plug-in compatibility UUID E0A62D1F-3C18-4D74-BFE5-A4167D643966 for HHEnumeration-Xcode.ideplugin (com.huaxi.HHEnumeration) not present
> Making all for tweak timeline … ==> Preprocessing Tweak.xm … ==> Compiling Tweak.xm (armv7)… ==> Linking tweak timeline (armv7)… clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of iOS 7 ==> Preprocessing Tweak.xm … ==> Compiling Tweak.xm (arm64)… ==> Linking tweak timeline (arm64)… clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of iOS 7 ==> Merging tweak timeline … 2017-01-11 23:36:22.202 xcodebuild[9043:303448] [MT] DVTPlugInManager: Required plug-in compatibility UUID E0A62D1F-3C18-4D74-BFE5-A4167D643966 for HHEnumeration-Xcode.ideplugin (com.huaxi.HHEnumeration) not present ==> Signing timeline … > Making stage for tweak timeline … dpkg-deb: warning: deprecated compression type 'lzma'; use xz instead dpkg-deb: warning: ignoring 1 warning about the control file(s) dpkg-deb: building package 'com.xfunforx.timeline' in './packages/com.xfunforx.timeline_0.0.1-66+debug_iphoneos-arm.deb'. |
28
kensla 2017-01-13 17:58:55 +08:00 via iPhone
@yivanus 你最开始发的代码不能编译,后面发的我放到开源中国的码云上了,码云那个可以编译。但是装到越狱手机上没有效果
|
29
yivanus OP 微信的新版本更新后,有类找不到了。
Jan 14 14:14:09 maruko WeChat[1501] <Error>: [timeline] Tweak.xm:241 ERROR: logos: nil class ImageMessageNodeView Jan 14 14:14:09 maruko WeChat[1501] <Error>: [timeline] Tweak.xm:241 ERROR: logos: nil class TextMessageNodeView Jan 14 14:14:09 maruko WeChat[1501] <Error>: [timeline] Tweak.xm:241 ERROR: logos: nil class VideoMessageNodeView Jan 14 14:14:09 maruko WeChat[1501] <Error>: [timeline] Tweak.xm:241 ERROR: logos: nil class BaseMessageNodeView |