Min〆 发表于 2015-7-23 12:19:23

IOS版PPTV视频 Tweak


适用于4.x及4.x.x版本的iPhone版的PPTV客户端.(更低版本由于没有软件测试,适用性未知.)目前功能:
1.去除启动广告;
2.VIP会员;3.免登录观看下载视频.
4.去除搜索页面广告(待修复);
5.去除下载页面广告(待修复);
6.增加年费会员


预览:

代码如下:
@interface LoginModel                  
-(BOOL) isVIP;
-(BOOL) vipType;
@end

@interface ChannelDetail
-(BOOL) denyDownload;
-(BOOL) isVipChannel;
@end

@interface PHLaunchViewController                  
-(id) init;
@end

@interface PHAppRecModule
-(id) init;
@end

static BOOL enabled = NO;

static BOOL ebvip = NO;
static BOOL ebyearvip = NO;
static BOOL dendown = NO;
static BOOL launchad = NO;
static BOOL moread = NO;

static void loadPrefs()
{
    NSMutableDictionary *prefs = [ initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.min.pptvtweaksettings.plist"];
    if(prefs) {

      enabled = ( ? [ boolValue] : enabled );

      ebvip = ( ? [ boolValue] : ebvip );
        ebyearvip = ( ? [ boolValue] : ebyearvip );
        dendown = ( ? [ boolValue] : dendown );
        launchad = ( ? [ boolValue] : launchad );
        moread = ( ? [ boolValue] : moread );
       
       
    }

    ;
}

%hook LoginModel                  
-(BOOL) isVIP {
        %orig;
                  
        if (ebvip && enabled) {               
       return true;                     
       }

        else {
        return %orig;
        }
}

-(BOOL) vipType {
        %orig;

        if (ebyearvip && enabled) {
       return 2;
       }

        else {
        return %orig;
        }
}
%end

%hook ChannelDetail
-(BOOL) denyDownload {
        %orig;

        if (dendown && enabled) {
       return false;
       }

        else {
        return %orig;
        }
}

-(BOOL) isVipChannel {
        %orig;

        if (dendown && enabled) {
       return false;
       }

        else {
        return %orig;
        }
}
%end

%hook PHLaunchViewController                  
-(id) init {            
        %orig;      

        if (launchad && enabled) {               
       return nil;                     
       }

        else {
        return %orig;
        }
}
%end

%hook PHAppRecModule
-(id) init {
        %orig;

        if (moread && enabled) {
       return 0;
       }

        else {
        return %orig;
        }
}
%end

%ctor
{
    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("com.min.pptvtweaksettings/settingschanged"), NULL, CFNotificationSuspensionBehaviorCoalesce);
    loadPrefs();
}



cxqdly 发表于 2015-7-23 13:58:40

吃不起水果的路过支持下

creantan 发表于 2015-7-23 14:54:27

不错不错。。期待楼主更多的教程和作品。。{:soso_e179:}

0xcb 发表于 2015-7-23 15:14:41

{:soso_e142:}

九食堂堂主 发表于 2015-7-23 16:00:14

好强的的说,支持下

harkin12 发表于 2015-7-24 09:05:25

这个可以有,感谢

小幸福_ 发表于 2015-7-24 12:44:05

这个真的是好东西啊 支持ios8.4吗

cheninye 发表于 2015-7-24 15:36:59

这应该是一个越狱后的插件吧什么时候出个爱奇艺的啊
页: [1]
查看完整版本: IOS版PPTV视频 Tweak