-
Notifications
You must be signed in to change notification settings - Fork 4
/
Tweak.xm
32 lines (26 loc) · 915 Bytes
/
Tweak.xm
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
#import <substrate.h>
#import <os/log.h>
#import "pac_helpers.h"
extern "C" {
size_t (*UIApplicationInitialize)(void) = NULL;
void *(*fakeCTFontSetAltTextStyleSpec)(void) = NULL;
void *CTFontSetAltTextStyleSpec(void) __attribute__((weak_import));
}
MSHook(size_t, UIApplicationInitialize) {
size_t orig = _UIApplicationInitialize();
CTFontSetAltTextStyleSpec();
return orig;
}
%ctor {
MSImageRef image = MSGetImageByName("/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore");
if (!image) {
NSLog(@"[compactor] no UIKit");
return;
}
UIApplicationInitialize = (size_t (*)(void))MSFindSymbol(image, "_UIApplicationInitialize");
if (!UIApplicationInitialize) {
NSLog(@"[compactor] no _UIApplicationInitialize wtf???");
return;
}
MSHookFunction(UIApplicationInitialize, MSHake(UIApplicationInitialize));
}