-
Notifications
You must be signed in to change notification settings - Fork 27
/
Common.x
74 lines (56 loc) · 1.83 KB
/
Common.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
#import "Header.h"
#import <VideoToolbox/VideoToolbox.h>
#import <sys/sysctl.h>
#import <version.h>
extern BOOL UseVP9();
%hook YTSettings
- (BOOL)isWebMEnabled {
return YES;
}
%end
%group Spoofing
%hook UIDevice
- (NSString *)systemVersion {
return @"15.8.3";
}
%end
%hook NSProcessInfo
- (NSOperatingSystemVersion)operatingSystemVersion {
NSOperatingSystemVersion version;
version.majorVersion = 15;
version.minorVersion = 8;
version.patchVersion = 3;
return version;
}
%end
%hookf(int, sysctlbyname, const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) {
if (strcmp(name, "kern.osversion") == 0) {
if (oldp)
strcpy((char *)oldp, IOS_BUILD);
*oldlenp = strlen(IOS_BUILD);
}
return %orig(name, oldp, oldlenp, newp, newlen);
}
%end
// #ifdef SIDELOADED
// #import "../PSHeader/Misc.h"
// typedef struct OpaqueVTVideoDecoder VTVideoDecoderRef;
// extern OSStatus VTSelectAndCreateVideoDecoderInstance(CMVideoCodecType codecType, CFAllocatorRef allocator, CFDictionaryRef videoDecoderSpecification, VTVideoDecoderRef *decoderInstanceOut);
// #endif
%ctor {
if (UseVP9()) {
%init;
// #ifdef SIDELOADED
// CFMutableDictionaryRef payload = CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
// if (payload) {
// CFDictionarySetValue(payload, CFSTR("RequireHardwareAcceleratedVideoDecoder"), kCFBooleanTrue);
// CFDictionarySetValue(payload, CFSTR("AllowAlternateDecoderSelection"), kCFBooleanTrue);
// VTSelectAndCreateVideoDecoderInstance(kCMVideoCodecType_VP9, kCFAllocatorDefault, payload, NULL);
// CFRelease(payload);
// }
// #endif
if (!IS_IOS_OR_NEWER(iOS_15_0)) {
%init(Spoofing);
}
}
}