9.4 WeChat6.0 tweak 是我代码哪里有问题吗?插件不起作用.求解.谢谢


#1

#import “huigwcvidiodownloader.h”

static MMTableViewCell *huigCell;
static MMTableView *huigView;
static WCTimeLineViewController *huigController;

%hook WCContentItemViewTemplateNewSight
%new

  • (WCMediaItem *)huigMediaItemFromSight
    {
    id responder = self;
    while (![responder isKindOfClass:NSClassFromString(@“WCTimeLineViewController”)])
    {
    if ([responder isKindOfClass:NSClassFromString(@“MMTableViewCell”)])
    {
    huigCell = responder;
    }
    else if ([responder isKindOfClass:NSClassFromString(@“MMTableView”)])
    {
    huigView = responder;
    responder = [responder nextResponder];
    }
    }

    huigController = responder;
    if (!huigCell || !huigView || !huigController)
    {
    NSLog(@“huig: Failed to get video object.”);
    return nil;
    }

    NSIndexPath *indexPath = [huigView indexPathForCell:huigCell];
    int itemIndex = [huigController calcDataItemIndex:[indexPath section]];
    WCFacade *facade = [(MMServiceCenter *) [%c(MMServiceCenter) defaultCenter] getService:[%c(WCFacade) class]];
    WCDataItem *dataItem = [facade getTimelineDataItemOfIndex:itemIndex];
    WCContentItem *contentItem = dataItem.contentObj;
    WCMediaItem *mediaItem = [contentItem.mediaList count] != 0 ? (contentItem.mediaList)[0] : nil;
    return mediaItem;

}

%new

  • (void)huigOnSaveToDisk
    {
    NSString *localPath = [[self huigMediaItemFromSight] pathForSightData];
    UISaveVideoAtPathToSavedPhotosAlbum(localPath, nil, nil, nil);
    }

%new

  • (void)huigOnCopyURL
    {
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    pasteboard.string = [self huigMediaItemFromSight].dataUrl.url;
    }

static int huigCounter;

  • (void)oLongTouch
    {
    huigCounter++;
    if (huigCounter % 2 == 0) return;
    [self becomeFirstResponder];
    UIMenuItem *saveToDiskMenuItem = [[UIMenuItem alloc] initWithTitle:@“Save to Disk” action:@selector(huigOnSaveToDisk)];
    UIMenuItem *copyURLMenuItem = [[UIMenuItem alloc] initWithTitle:@“Copy URL” action:@selector(huigOnCopyURL)];
    UIMenuController *menuController = [UIMenuController sharedMenuController];
    [menuController setMenuItems:@[saveToDiskMenuItem, copyURLMenuItem]];
    [menuController setTargetRect:CGRectZero inView:self];
    [menuController setMenuVisible:YES animated:YES];
    [saveToDiskMenuItem release];
    [copyURLMenuItem release];

}
%end

用 App admin 插件官网下载的微信6.0 tweak 代码如上,安装后长按视频没有出现 添加的 Save to Disk 和 Copy URL .不知怎么回事.求解.谢谢


#2

那个官方地址楼主发一下可以么


#3

不好意思,问题找到了。不哈意思说出来。怕被打:rage:


#4

你说App admin ?哪里下载吗?


#5

是的呢, 你的这个插件的地址, 新手一个…求资源


#6

cydia 里面 搜索 App admin