-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tweak.x
executable file
·102 lines (77 loc) · 1.59 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//
//
//
// PMP Protect My Photos By ikghd 2020
// Hide Your Photos With One Click
//
//
// didn't used Cephei because i wanted to be a simple as it be
// may convert it later if get time
//
// i know this is not a good way to write a code but i did :D
//
//
static BOOL pmp;
#define PLIST_PATH "/var/mobile/Library/Preferences/pro.ikghd.pmp.plist"
#define boolValueForKey(key) [[[NSDictionary dictionaryWithContentsOfFile:@(PLIST_PATH)] valueForKey:key] boolValue]
static void loadPrefs() {
pmp = boolValueForKey(@"pmp");
}
// Photos
%hook PUAlbumListViewController
- (long long)numberOfVisualSectionsForSectionedGridLayout:(id)arg1 {
loadPrefs();
if (pmp ){
return 1;
}
else return %orig;
}
%end
%hook PHFetchOptions
- (unsigned long long)includeAssetSourceTypes {
loadPrefs();
if (pmp ){
return 2;
}
else return %orig;
}
%end
%hook PUAlbumListCellContentView
- (void)setSubtitle:(id)arg1 animated:(bool)arg2 {
loadPrefs();
if (pmp ){
arg1 = @"0";
%orig;
}
else return %orig;
}
%end
%hook PUSearchResultsDataSource
- (unsigned long long)numberOfSearchResults {
loadPrefs();
if (pmp ){
return 0;
}
else return %orig;
}
%end
%hook PUSuggestedSearchResultsDataSource
- (void)setDelegate:(id)arg1 {
loadPrefs();
if (pmp ){
arg1 = nil;
}
else return %orig;
}
%end
// Photos End
// Camera access denied
%hook CAMViewfinderViewController
- (id)_imageWell {
loadPrefs();
if (pmp ){
return nil;
}
else return %orig;
}
%end