New Options - Contribute

This commit is contained in:
arichorn
2023-09-16 21:00:47 -05:00
committed by GitHub
parent 70e58ced3f
commit 9b699debb8
2 changed files with 124 additions and 45 deletions

View File

@@ -123,6 +123,95 @@ extern NSBundle *YTLitePlusBundle();
}]; }];
[sectionItems addObject:videoControlOverlayGroup]; [sectionItems addObject:videoControlOverlayGroup];
# pragma mark - App Settings Overlay Options
YTSettingsSectionItem *appSettingsOverlayGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"App Settings Overlay Options") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
NSArray <YTSettingsSectionItem *> *rows = @[
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_DONTEATMYCONTENT_SECTION")
titleDescription:LOC(@"APP_RESTART_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableDontEatMyContentSection_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableDontEatMyContentSection_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_YOUTUBERETURNDISLIKE_SECTION")
titleDescription:LOC(@"APP_RESTART_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableReturnYouTubeDislikeSection_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableReturnYouTubeDislikeSection_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_YOUPIP_SECTION")
titleDescription:LOC(@"APP_RESTART_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableYouPiPSection_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableYouPiPSection_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_AUTOPLAY_SECTION")
titleDescription:LOC(@"APP_RESTART_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableAutoplaySection_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableAutoplaySection_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_TRYNEWFEATURES_SECTION")
titleDescription:LOC(@"APP_RESTART_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableTryNewFeaturesSection_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableTryNewFeaturesSection_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_NOTIFICATIONS_SECTION")
titleDescription:LOC(@"APP_RESTART_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableNotificationsSection_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableNotificationsSection_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_HISTORYANDPRIVACY_SECTION")
titleDescription:LOC(@"APP_RESTART_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableHistoryAndPrivacySection_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableHistoryAndPrivacySection_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_LIVECHAT_SECTION")
titleDescription:LOC(@"APP_RESTART_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableLiveChatSection_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableLiveChatSection_enabled"];
return YES;
}
settingItemId:0]
];
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"App Settings Overlay Options") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
[settingsViewController pushViewController:picker];
return YES;
}];
[sectionItems addObject:appSettingsOverlayGroup];
# pragma mark - LowContrastMode # pragma mark - LowContrastMode
YTSettingsSectionItem *lowContrastModeSection = [YTSettingsSectionItemClass itemWithTitle:LOC(@"Low Contrast Mode") YTSettingsSectionItem *lowContrastModeSection = [YTSettingsSectionItemClass itemWithTitle:LOC(@"Low Contrast Mode")
accessibilityIdentifier:nil accessibilityIdentifier:nil
@@ -154,26 +243,26 @@ extern NSBundle *YTLitePlusBundle();
}]; }];
# pragma mark - VersionSpoofer # pragma mark - VersionSpoofer
YTSettingsSectionItem *versionSpooferSection = [YTSettingsSectionItemClass itemWithTitle:@"Version Spoofer Picker" YTSettingsSectionItem *versionSpooferSection = [YTSettingsSectionItemClass itemWithTitle:@"VERSION_SPOOFER_TITLE"
accessibilityIdentifier:nil accessibilityIdentifier:nil
detailTextBlock:^NSString *() { detailTextBlock:^NSString *() {
switch (appVersionSpoofer()) { switch (appVersionSpoofer()) {
case 1: case 1:
return @"v18.18.2 (Fixes YTClassicVideoQuality and YTSpeed)"; return @"v18.18.2 (Fixes YTClassicVideoQuality & YTSpeed)";
case 2: case 2:
return @"v17.49.6 (Removes Rounded Miniplayer)"; return @"v17.49.6 (Removes Rounded Miniplayer)";
case 3: case 3:
return @"v17.39.4 (Adds Rounded Thumbnails)";
case 4:
return @"v17.38.10 (Fixes LowContrastMode)"; return @"v17.38.10 (Fixes LowContrastMode)";
case 4:
return @"v17.01.4 (Removes New Overflow Video Player Menu)";
case 5: case 5:
return @"v17.11.2 (Removes Chip Video Player Buttons)"; return @"v16.46.5 (Removes Rounded Video Player Buttons)";
case 6: case 6:
return @"v16.46.5 (Removes New Overflow Video Player Menu)";
case 7:
return @"v16.42.3"; return @"v16.42.3";
case 7:
return @"v16.08.2 (Old Comments & Description Menus)";
case 8: case 8:
return @"v16.05.7 (Old Comment+Description Section)"; return @"v16.05.7 (Oldest Working Version)";
case 0: case 0:
default: default:
return @"Default Version"; return @"Default Version";
@@ -186,7 +275,7 @@ extern NSBundle *YTLitePlusBundle();
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
}], }],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v18.18.2 (Fixes YTClassicVideoQuality and YTSpeed)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { [YTSettingsSectionItemClass checkmarkItemWithTitle:@"v18.18.2 (Fixes YTClassicVideoQuality & YTSpeed)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"versionSpoofer"]; [[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"versionSpoofer"];
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
@@ -196,32 +285,32 @@ extern NSBundle *YTLitePlusBundle();
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
}], }],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.39.4 (Adds Rounded Thumbnails)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { [YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.38.10 (Fixes LowContrastMode)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:3 forKey:@"versionSpoofer"]; [[NSUserDefaults standardUserDefaults] setInteger:3 forKey:@"versionSpoofer"];
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
}], }],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.38.10 (Fixes LowContrastMode)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { [YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.01.4 (Removes New Overflow Video Player Menu)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:4 forKey:@"versionSpoofer"]; [[NSUserDefaults standardUserDefaults] setInteger:4 forKey:@"versionSpoofer"];
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
}], }],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.11.2 (Removes Chip Video Player Buttons)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { [YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.46.5 (Removes Rounded Video Player Buttons)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:5 forKey:@"versionSpoofer"]; [[NSUserDefaults standardUserDefaults] setInteger:5 forKey:@"versionSpoofer"];
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
}], }],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.46.5 (Removes New Overflow Video Player Menu)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { [YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.42.3" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:6 forKey:@"versionSpoofer"]; [[NSUserDefaults standardUserDefaults] setInteger:6 forKey:@"versionSpoofer"];
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
}], }],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.42.3" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { [YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.08.2 (Old Comments & Description Menus)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:7 forKey:@"versionSpoofer"]; [[NSUserDefaults standardUserDefaults] setInteger:7 forKey:@"versionSpoofer"];
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
}], }],
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.05.7 (Old Comment+Description Section)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { [YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.05.7 (Oldest Working Version)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:8 forKey:@"versionSpoofer"]; [[NSUserDefaults standardUserDefaults] setInteger:8 forKey:@"versionSpoofer"];
[settingsViewController reloadData]; [settingsViewController reloadData];
return YES; return YES;
@@ -382,16 +471,6 @@ extern NSBundle *YTLitePlusBundle();
} }
settingItemId:0], settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"DISABLE_WIFI_RELATED_SETTINGS")
titleDescription:LOC(@"DISABLE_WIFI_RELATED_SETTINGS_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"disableWifiRelatedSettings_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"disableWifiRelatedSettings_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"YT_SPEED") [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"YT_SPEED")
titleDescription:LOC(@"YT_SPEED_DESC") titleDescription:LOC(@"YT_SPEED_DESC")
accessibilityIdentifier:nil accessibilityIdentifier:nil
@@ -412,8 +491,8 @@ extern NSBundle *YTLitePlusBundle();
} }
settingItemId:0], settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Enable App Version Spoofer (Lite)") [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"APP_VERSION_SPOOFER_LITE")
titleDescription:LOC(@"Enable this to use the Version Spoofer and select your perferred version below. App restart is required.") titleDescription:LOC(@"APP_VERSION_SPOOFER_LITE_DESC")
accessibilityIdentifier:nil accessibilityIdentifier:nil
switchOn:IsEnabled(@"enableVersionSpoofer_enabled") switchOn:IsEnabled(@"enableVersionSpoofer_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {

View File

@@ -41,55 +41,55 @@ static BOOL version8() {
NSURL *versionURL = [NSURL URLWithString:@"https://raw.githubusercontent.com/arichorn/YTAppVersionSpoofer-WIP/main/version.txt"]; NSURL *versionURL = [NSURL URLWithString:@"https://raw.githubusercontent.com/arichorn/YTAppVersionSpoofer-WIP/main/version.txt"];
NSString *latestVersion = [NSString stringWithContentsOfURL:versionURL encoding:NSUTF8StringEncoding error:nil]; NSString *latestVersion = [NSString stringWithContentsOfURL:versionURL encoding:NSUTF8StringEncoding error:nil];
return latestVersion ?: @"18.27.3"; // <-- Fallback Version return latestVersion ?: @"18.35.4"; // <-- Fallback Version
} }
%end %end
%end %end
%group gVersion1 %group gVersion1
%hook YTVersionUtils // Fix YTClassicVideoQuality & YTSpeed %hook YTVersionUtils // Fixes YTClassicVideoQuality & YTSpeed
+ (NSString *)appVersion { return @"18.18.2"; } + (NSString *)appVersion { return @"18.18.2"; }
%end %end
%end %end
%group gVersion2 %group gVersion2
%hook YTVersionUtils // Last v17 App Version %hook YTVersionUtils // Final v17 App Version
+ (NSString *)appVersion { return @"17.49.6"; } + (NSString *)appVersion { return @"17.49.6"; }
%end %end
%end %end
%group gVersion3 %group gVersion3
%hook YTVersionUtils // Updated Interface - Breaks LowContrastMode %hook YTVersionUtils // v17.38.10 Fixes the LowContrastMode Tweak + No Rounded Thumbnails
+ (NSString *)appVersion { return @"17.39.4"; }
%end
%end
%group gVersion4
%hook YTVersionUtils // LowContrastMode Patch
+ (NSString *)appVersion { return @"17.38.10"; } + (NSString *)appVersion { return @"17.38.10"; }
%end %end
%end %end
%group gVersion5 %group gVersion4
%hook YTVersionUtils // Old Video Player Buttons %hook YTVersionUtils // Last 2nd Supported YouTube App Version
+ (NSString *)appVersion { return @"17.11.2"; } + (NSString *)appVersion { return @"17.01.4"; }
%end %end
%end %end
%group gVersion6 %group gVersion5
%hook YTVersionUtils // Last v16 App Version %hook YTVersionUtils // Final v16 App Version
+ (NSString *)appVersion { return @"16.46.5"; } + (NSString *)appVersion { return @"16.46.5"; }
%end %end
%end %end
%group gVersion7 %group gVersion6
%hook YTVersionUtils // Old Video Player Layout %hook YTVersionUtils // Popular v16 App Version
+ (NSString *)appVersion { return @"16.42.3"; } + (NSString *)appVersion { return @"16.42.3"; }
%end %end
%end %end
%group gVersion8 %group gVersion7
%hook YTVersionUtils // Old Comment Section & Description Layout %hook YTVersionUtils // Old Comment Section & Description Layout
+ (NSString *)appVersion { return @"16.08.2"; }
%end
%end
%group gVersion8
%hook YTVersionUtils // Last Supported YouTube App Version
+ (NSString *)appVersion { return @"16.05.7"; } + (NSString *)appVersion { return @"16.05.7"; }
%end %end
%end %end