uYouEnhanced/Sources/uYouPlusVersionSpoofer.xm
aricloverEXTRA e374b526e8
Updated YouTube Versions Support (uYouPlusVersionSpoofer.xm)
Supports 20.24.4-20.33.2 versions of YouTube.
2025-08-22 18:08:55 -05:00

134 lines
3 KiB
Text

#import "uYouPlus.h"
typedef struct {
int version;
NSString *appVersion;
} VersionMapping;
static VersionMapping versionMappings[] = {
{0, @"20.33.2"},
{1, @"20.32.5"},
{2, @"20.32.4"},
{3, @"20.31.6"},
{4, @"20.31.5"},
{5, @"20.30.5"},
{6, @"20.29.3"},
{7, @"20.28.2"},
{8, @"20.26.7"},
{9, @"20.25.4"},
{10, @"20.24.5"},
{11, @"20.24.4"},
{12, @"20.23.3"},
{13, @"20.22.1"},
{14, @"20.21.6"},
{15, @"20.20.7"},
{16, @"20.20.5"},
{17, @"20.19.3"},
{18, @"20.19.2"},
{19, @"20.18.5"},
{20, @"20.18.4"},
{21, @"20.16.7"},
{22, @"20.15.1"},
{23, @"20.14.2"},
{24, @"20.13.5"},
{25, @"20.12.4"},
{26, @"20.11.6"},
{27, @"20.10.4"},
{28, @"20.10.3"},
{29, @"20.09.3"},
{30, @"20.08.3"},
{31, @"20.07.6"},
{32, @"20.06.03"},
{33, @"20.05.4"},
{34, @"20.03.1"},
{35, @"20.03.02"},
{36, @"20.02.3"},
{37, @"19.49.7"},
{38, @"19.49.5"},
{39, @"19.49.3"},
{40, @"19.47.7"},
{41, @"19.46.3"},
{42, @"19.45.4"},
{43, @"19.44.4"},
{44, @"19.43.2"},
{45, @"19.42.1"},
{46, @"19.41.3"},
{47, @"19.40.4"},
{48, @"19.39.1"},
{49, @"19.38.2"},
{50, @"19.37.2"},
{51, @"19.36.1"},
{52, @"19.35.3"},
{53, @"19.34.2"},
{54, @"19.33.2"},
{55, @"19.32.8"},
{56, @"19.32.6"},
{57, @"19.31.4"},
{58, @"19.30.2"},
{59, @"19.29.1"},
{60, @"19.28.1"},
{61, @"19.26.5"},
{62, @"19.25.4"},
{63, @"19.25.3"},
{64, @"19.24.3"},
{65, @"19.24.2"},
{66, @"19.23.3"},
{67, @"19.22.6"},
{68, @"19.22.3"},
{69, @"19.21.3"},
{70, @"19.21.2"},
{71, @"19.20.2"},
{72, @"19.19.7"},
{73, @"19.19.5"},
{74, @"19.18.2"},
{75, @"19.17.2"},
{76, @"19.16.3"},
{77, @"19.15.1"},
{78, @"19.14.3"},
{79, @"19.14.2"},
{80, @"19.13.1"},
{81, @"19.12.3"},
{82, @"19.10.7"},
{83, @"19.10.6"},
{84, @"19.10.5"},
{85, @"19.09.4"},
{86, @"19.09.3"},
{87, @"19.08.2"},
{88, @"19.07.5"},
{89, @"19.07.4"},
{90, @"19.06.2"},
{91, @"19.05.5"},
{92, @"19.05.3"},
{93, @"19.04.3"},
{94, @"19.03.2"},
{95, @"19.02.1"},
{96, @"19.01.1"}
};
static int appVersionSpoofer() {
return [[NSUserDefaults standardUserDefaults] integerForKey:@"versionSpoofer"];
}
static BOOL isVersionSpooferEnabled() {
return IS_ENABLED(@"enableVersionSpoofer_enabled");
}
static NSString* getAppVersionForSpoofedVersion(int spoofedVersion) {
for (int i = 0; i < sizeof(versionMappings) / sizeof(versionMappings[0]); i++) {
if (versionMappings[i].version == spoofedVersion) {
return versionMappings[i].appVersion;
}
}
return nil;
}
%hook YTVersionUtils
+ (NSString *)appVersion {
if (!isVersionSpooferEnabled()) {
return %orig;
}
int spoofedVersion = appVersionSpoofer();
NSString *appVersion = getAppVersionForSpoofedVersion(spoofedVersion);
return appVersion ? appVersion : %orig;
}
%end