-
Notifications
You must be signed in to change notification settings - Fork 0
/
MerdokHelper.m
176 lines (149 loc) · 8.39 KB
/
MerdokHelper.m
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#import "MerdokHelper.h"
#pragma mark MerdokHelper
@implementation MerdokHelper
#pragma mark Piracy protection
static NSNumber *isTweakPirated = nil ;
+ (int) kIsPirated{
if (isTweakPirated != nil) {
return [isTweakPirated intValue];
}
// DRM check
if ([[NSFileManager defaultManager] fileExistsAtPath:kSelfDRMPath] || [[NSFileManager defaultManager] fileExistsAtPath:kReleaseDRMPath])
{
//Do if the file exists
isTweakPirated = [NSNumber numberWithInt:kNotPirated] ;
return kNotPirated ;
}
else
{
//Do if file doesn't exist
isTweakPirated = [NSNumber numberWithInt:rand() % kNotPirated - 1] ;
return rand() % kNotPirated - 1; ;
}
}
+ (void) showPiracyPopupOnController: (UIViewController*) controller{
NSString *msg = [NSString stringWithFormat:@"It seems that you are using a pirated version of %@ so it was disabled! Sorry :( \n\n A lot of effort has gone into the development of this software and the effort will continue to deliver the best possible quality! \n\n Please purchase and support the developer. Thanks!", kTweakName];
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:@"Piracy Hurts :("
message:msg
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action)
{
}];
[alertController addAction:cancelAction];
[controller presentViewController:alertController animated:YES completion:nil];
}
+ (id)alloc {
[NSException raise:@"Cannot be instantiated!" format:@"Static class 'ClassName' cannot be instantiated!"];
return nil;
}
@end
#pragma mark UAObfuscatedString
@implementation NSMutableString (UAObfuscatedString)
#pragma mark - a-z -
- (instancetype)a { [self appendString:@"a"]; return self; }
- (instancetype)b { [self appendString:@"b"]; return self; }
- (instancetype)c { [self appendString:@"c"]; return self; }
- (instancetype)d { [self appendString:@"d"]; return self; }
- (instancetype)e { [self appendString:@"e"]; return self; }
- (instancetype)f { [self appendString:@"f"]; return self; }
- (instancetype)g { [self appendString:@"g"]; return self; }
- (instancetype)h { [self appendString:@"h"]; return self; }
- (instancetype)i { [self appendString:@"i"]; return self; }
- (instancetype)j { [self appendString:@"j"]; return self; }
- (instancetype)k { [self appendString:@"k"]; return self; }
- (instancetype)l { [self appendString:@"l"]; return self; }
- (instancetype)m { [self appendString:@"m"]; return self; }
- (instancetype)n { [self appendString:@"n"]; return self; }
- (instancetype)o { [self appendString:@"o"]; return self; }
- (instancetype)p { [self appendString:@"p"]; return self; }
- (instancetype)q { [self appendString:@"q"]; return self; }
- (instancetype)r { [self appendString:@"r"]; return self; }
- (instancetype)s { [self appendString:@"s"]; return self; }
- (instancetype)t { [self appendString:@"t"]; return self; }
- (instancetype)u { [self appendString:@"u"]; return self; }
- (instancetype)v { [self appendString:@"v"]; return self; }
- (instancetype)w { [self appendString:@"w"]; return self; }
- (instancetype)x { [self appendString:@"x"]; return self; }
- (instancetype)y { [self appendString:@"y"]; return self; }
- (instancetype)z { [self appendString:@"z"]; return self; }
#pragma mark - A-Z -
- (instancetype)A { [self appendString:@"A"]; return self; }
- (instancetype)B { [self appendString:@"B"]; return self; }
- (instancetype)C { [self appendString:@"C"]; return self; }
- (instancetype)D { [self appendString:@"D"]; return self; }
- (instancetype)E { [self appendString:@"E"]; return self; }
- (instancetype)F { [self appendString:@"F"]; return self; }
- (instancetype)G { [self appendString:@"G"]; return self; }
- (instancetype)H { [self appendString:@"H"]; return self; }
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
- (instancetype)I { return [self _I]; }
#endif
- (instancetype)_I { [self appendString:@"I"]; return self; }
- (instancetype)J { [self appendString:@"J"]; return self; }
- (instancetype)K { [self appendString:@"K"]; return self; }
- (instancetype)L { [self appendString:@"L"]; return self; }
- (instancetype)M { [self appendString:@"M"]; return self; }
- (instancetype)N { [self appendString:@"N"]; return self; }
- (instancetype)O { [self appendString:@"O"]; return self; }
- (instancetype)P { [self appendString:@"P"]; return self; }
- (instancetype)Q { [self appendString:@"Q"]; return self; }
- (instancetype)R { [self appendString:@"R"]; return self; }
- (instancetype)S { [self appendString:@"S"]; return self; }
- (instancetype)T { [self appendString:@"T"]; return self; }
- (instancetype)U { [self appendString:@"U"]; return self; }
- (instancetype)V { [self appendString:@"V"]; return self; }
- (instancetype)W { [self appendString:@"W"]; return self; }
- (instancetype)X { [self appendString:@"X"]; return self; }
- (instancetype)Y { [self appendString:@"Y"]; return self; }
- (instancetype)Z { [self appendString:@"Z"]; return self; }
#pragma mark - Numbers -
- (instancetype)_1 { [self appendString:@"1"]; return self; }
- (instancetype)_2 { [self appendString:@"2"]; return self; }
- (instancetype)_3 { [self appendString:@"3"]; return self; }
- (instancetype)_4 { [self appendString:@"4"]; return self; }
- (instancetype)_5 { [self appendString:@"5"]; return self; }
- (instancetype)_6 { [self appendString:@"6"]; return self; }
- (instancetype)_7 { [self appendString:@"7"]; return self; }
- (instancetype)_8 { [self appendString:@"8"]; return self; }
- (instancetype)_9 { [self appendString:@"9"]; return self; }
- (instancetype)_0 { [self appendString:@"0"]; return self; }
#pragma mark - Punctuation -
- (instancetype)space { [self appendString:@" "]; return self; }
- (instancetype)point { [self appendString:@"."]; return self; }
- (instancetype)dash { [self appendString:@"-"]; return self; }
- (instancetype)comma { [self appendString:@","]; return self; }
- (instancetype)semicolon { [self appendString:@";"]; return self; }
- (instancetype)colon { [self appendString:@":"]; return self; }
- (instancetype)apostrophe { [self appendString:@"'"]; return self; }
- (instancetype)quotation { [self appendString:@"\""]; return self; }
- (instancetype)plus { [self appendString:@"+"]; return self; }
- (instancetype)equals { [self appendString:@"="]; return self; }
- (instancetype)paren_left { [self appendString:@"("]; return self; }
- (instancetype)paren_right { [self appendString:@")"]; return self; }
- (instancetype)asterisk { [self appendString:@"*"]; return self; }
- (instancetype)ampersand { [self appendString:@"&"]; return self; }
- (instancetype)caret { [self appendString:@"^"]; return self; }
- (instancetype)percent { [self appendString:@"%"]; return self; }
- (instancetype)$ { [self appendString:@"$"]; return self; }
- (instancetype)pound { [self appendString:@"#"]; return self; }
- (instancetype)at { [self appendString:@"@"]; return self; }
- (instancetype)exclamation { [self appendString:@"!"]; return self; }
- (instancetype)question_mark { [self appendString:@"?"]; return self; }
- (instancetype)back_slash { [self appendString:@"\\"]; return self; }
- (instancetype)forward_slash { [self appendString:@"/"]; return self; }
- (instancetype)curly_left { [self appendString:@"{"]; return self; }
- (instancetype)curly_right { [self appendString:@"}"]; return self; }
- (instancetype)bracket_left { [self appendString:@"["]; return self; }
- (instancetype)bracket_right { [self appendString:@"]"]; return self; }
- (instancetype)bar { [self appendString:@"|"]; return self; }
- (instancetype)less_than { [self appendString:@"<"]; return self; }
- (instancetype)greater_than { [self appendString:@">"]; return self; }
- (instancetype)underscore { [self appendString:@"_"]; return self; }
#pragma mark - Aliases -
- (instancetype)_ { return [self space]; }
- (instancetype)dot { return [self point]; }
@end