1
1
#include " UIKit/UIKit.h"
2
2
#include " support/support.h"
3
3
4
+ #ifdef __cplusplus
5
+ extern " C" {
6
+ #endif // __cplusplus
7
+
8
+ extern void * SecTaskCreateFromSelf (void *);
9
+ extern void * SecTaskCopySigningIdentifier (void *, void *);
10
+ extern CFDictionaryRef SecTaskCopyValuesForEntitlements (void *, CFArrayRef, CFErrorRef _Nullable *);
11
+ extern CFTypeRef SecTaskCopyValueForEntitlement (void *, CFStringRef, CFErrorRef *);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif // __cplusplus
16
+
4
17
BOOL (*orig_didFinishLaunchingWithOptions)(id self, SEL selector, UIApplication* application, NSDictionary * launchOptions);
5
18
BOOL new_didFinishLaunchingWithOptions (id self, SEL selector, UIApplication* application, NSDictionary * launchOptions)
6
19
{
@@ -24,6 +37,16 @@ void new_applicationDidBecomeActive(id self, SEL selector, id arg0)
24
37
25
38
SUPPORT_CTOR
26
39
{
40
+ NSString * teamIdentifier = CFBridgingRelease (SecTaskCopyValueForEntitlement (SecTaskCreateFromSelf (NULL ), CFSTR (" com.apple.developer.team-identifier" ), NULL ));
41
+ NSString * bundleIdentifier = [[NSBundle mainBundle ] bundleIdentifier ];
42
+
43
+ // original bundleIdentifier after removing teamIdentifier
44
+ const char * cBundleIdentifier = [bundleIdentifier hasPrefix: teamIdentifier] ?
45
+ [[bundleIdentifier stringByReplacingOccurrencesOfString: [NSString stringWithFormat: @" .%@ " , teamIdentifier]
46
+ withString: @" " ] UTF8String ] : [bundleIdentifier UTF8String ];
47
+
48
+ // DLOG(@"libSupport(%s) by Rednick16 Injected.", SupportGeVersion());
49
+
27
50
/* Create the structure
28
51
.teamIdentifier -> (Currently paused)
29
52
.bundleIdentifier -> "com.rednick16.myApp"
@@ -37,7 +60,7 @@ void new_applicationDidBecomeActive(id self, SEL selector, id arg0)
37
60
*/
38
61
SupportEntryInfo entry_info = {
39
62
.teamIdentifier = NULL ,
40
- .bundleIdentifier = NULL ,
63
+ .bundleIdentifier = cBundleIdentifier ,
41
64
.files = {
42
65
" CydiaSubstrate" ,
43
66
" libsubstrate" ,
@@ -60,15 +83,18 @@ void new_applicationDidBecomeActive(id self, SEL selector, id arg0)
60
83
61
84
SupportHookInstanceMessage (" UnityAppController" ,
62
85
" application:didFinishLaunchingWithOptions:" ,
63
- new_didFinishLaunchingWithOptions,
64
- orig_didFinishLaunchingWithOptions);
86
+ & new_didFinishLaunchingWithOptions,
87
+ & orig_didFinishLaunchingWithOptions);
65
88
66
89
SupportHookInstanceMessage (" UnityAppController" ,
67
90
" applicationDidBecomeActive:" ,
68
- new_applicationDidBecomeActive,
69
- orig_applicationDidBecomeActive);
91
+ & new_applicationDidBecomeActive,
92
+ & orig_applicationDidBecomeActive);
70
93
71
94
SupportHookSymbolEx (" dyld_get_image_name" ,
72
95
(void *)(new_dyld_get_image_name),
73
96
(void **)(&orig_dyld_get_image_name));
97
+
98
+ SupportHookClassMessage (" APMAEU" , " isFAS" , WRAPPER_OBJC_HOOK_TRUE, NULL );
99
+ SupportHookClassMessage (" GULAppEnvironmentUtil" , " isFromAppStore" , WRAPPER_OBJC_HOOK_TRUE, NULL );
74
100
}
0 commit comments