uYouEnhanced/Sources/uYouPlusVersionSpoofer.xm
aricloverEXALT 380ab69246
Revamp uYouPlusVersionSpoofer.xm 🛠️
An overhaul with the App Version Spoofer, this update was made to improve maintainability and the structure of the code. Will work the exact same! 
2025-01-12 05:05:16 -06:00

164 lines
3.7 KiB
Text

#import "uYouPlus.h"
typedef struct {
int version;
NSString *appVersion;
} VersionMapping;
static VersionMapping versionMappings[] = {
{0, @"19.49.7"},
{1, @"19.49.5"},
{2, @"19.49.3"},
{3, @"19.47.7"},
{4, @"19.46.3"},
{5, @"19.45.4"},
{6, @"19.44.4"},
{7, @"19.43.2"},
{8, @"19.42.1"},
{9, @"19.41.3"},
{10, @"19.40.4"},
{11, @"19.39.1"},
{12, @"19.38.2"},
{13, @"19.37.2"},
{14, @"19.36.1"},
{15, @"19.35.3"},
{16, @"19.34.2"},
{17, @"19.33.2"},
{18, @"19.32.8"},
{19, @"19.32.6"},
{20, @"19.31.4"},
{21, @"19.30.2"},
{22, @"19.29.1"},
{23, @"19.28.1"},
{24, @"19.26.5"},
{25, @"19.25.4"},
{26, @"19.25.3"},
{27, @"19.24.3"},
{28, @"19.24.2"},
{29, @"19.23.3"},
{30, @"19.22.6"},
{31, @"19.22.3"},
{32, @"19.21.3"},
{33, @"19.21.2"},
{34, @"19.20.2"},
{35, @"19.19.7"},
{36, @"19.19.5"},
{37, @"19.18.2"},
{38, @"19.17.2"},
{39, @"19.16.3"},
{40, @"19.15.1"},
{41, @"19.14.3"},
{42, @"19.14.2"},
{43, @"19.13.1"},
{44, @"19.12.3"},
{45, @"19.10.7"},
{46, @"19.10.6"},
{47, @"19.10.5"},
{48, @"19.09.4"},
{49, @"19.09.3"},
{50, @"19.08.2"},
{51, @"19.07.5"},
{52, @"19.07.4"},
{53, @"19.06.2"},
{54, @"19.05.5"},
{55, @"19.05.3"},
{56, @"19.04.3"},
{57, @"19.03.2"},
{58, @"19.02.1"},
{59, @"19.01.1"},
{60, @"18.49.3"},
{61, @"18.48.3"},
{62, @"18.46.3"},
{63, @"18.45.2"},
{64, @"18.44.3"},
{65, @"18.43.4"},
{66, @"18.41.5"},
{67, @"18.41.3"},
{68, @"18.41.2"},
{69, @"18.40.1"},
{70, @"18.39.1"},
{71, @"18.38.2"},
{72, @"18.35.4"},
{73, @"18.34.5"},
{74, @"18.33.3"},
{75, @"18.33.2"},
{76, @"18.32.2"},
{77, @"18.31.3"},
{78, @"18.30.7"},
{79, @"18.30.6"},
{80, @"18.29.1"},
{81, @"18.28.3"},
{82, @"18.27.3"},
{83, @"18.25.1"},
{84, @"18.23.3"},
{85, @"18.22.9"},
{86, @"18.21.3"},
{87, @"18.20.3"},
{88, @"18.19.1"},
{89, @"18.18.2"},
{90, @"18.17.2"},
{91, @"18.16.2"},
{92, @"18.15.1"},
{93, @"18.14.1"},
{94, @"18.13.4"},
{95, @"18.12.2"},
{96, @"18.11.2"},
{97, @"18.10.1"},
{98, @"18.09.4"},
{99, @"18.08.1"},
{100, @"18.07.5"},
{101, @"18.05.2"},
{102, @"18.04.3"},
{103, @"18.03.3"},
{104, @"18.02.03"},
{105, @"18.01.6"},
{106, @"18.01.4"},
{107, @"18.01.2"},
{108, @"17.49.6"},
{109, @"17.49.4"},
{110, @"17.46.4"},
{111, @"17.45.1"},
{112, @"17.44.4"},
{113, @"17.43.1"},
{114, @"17.42.7"},
{115, @"17.42.6"},
{116, @"17.41.2"},
{117, @"17.40.5"},
{118, @"17.39.4"},
{119, @"17.38.10"},
{120, @"17.38.9"},
{121, @"17.37.3"},
{122, @"17.36.4"},
{123, @"17.36.3"},
{124, @"17.35.3"},
{125, @"17.34.3"},
{126, @"17.33.2"}
};
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