-
Notifications
You must be signed in to change notification settings - Fork 7
/
Tweak.x
63 lines (50 loc) · 1.43 KB
/
Tweak.x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// Tweak.x
// FBSpNOsor
//
// Created by Jacob Clayden on 13/02/2020.
// Copyright © 2020 JacobCXDev. All rights reserved.
//
#import <Foundation/Foundation.h>
// Facebook Interfaces
@interface FBMemModelObject : NSObject
- (id)initWithFBTree:(void *)arg1;
@end
@interface FBMemNewsFeedEdge : FBMemModelObject
- (id)category;
@end;
@interface FBMemFeedStory : FBMemModelObject
- (id)sponsoredData;
@end
@interface FBVideoChannelPlaylistItem : NSObject
- (id)Bi:(id)arg1 :(id)arg2 :(id)arg3 :(id)arg4 :(id)arg5 :(id)arg6 :(id)arg7;
- (bool)isSponsored;
@end
// Facebook Hooks
%hook FBMemNewsFeedEdge
- (id)initWithFBTree:(void *)arg1 {
id orig = %orig;
id category = [orig category];
return category ? [category isEqual:@"ORGANIC"] ? orig : nil : orig;
}
%end
%hook FBMemFeedStory
- (id)initWithFBTree:(void *)arg1 {
id orig = %orig;
return [orig sponsoredData] == nil ? orig : nil;
}
%end
%hook FBVideoChannelPlaylistItem
- (id)Bi:(id)arg1 :(id)arg2 :(id)arg3 :(id)arg4 :(id)arg5 :(id)arg6 :(id)arg7 {
id orig = %orig;
return [orig isSponsored] ? nil : orig;
}
%end
// Constructor
%ctor {
NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.jacobcxdev.fbspnosor.plist"];
bool enabled = [settings objectForKey:@"enabled"] ? [[settings objectForKey:@"enabled"] boolValue] : true;
if (!enabled) return;
%init();
NSLog(@"FBSpNOsor loaded");
}