mirror of
https://github.com/SoPat712/YTLitePlus.git
synced 2025-08-22 02:58:45 -04:00
Merge pull request #2 from arichorn/main
Added YouTube Version Spoofer (Lite)
This commit is contained in:
10
README.md
10
README.md
@@ -10,14 +10,14 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/Balackburn/YTLitePlus/releases/latest"><img src="https://custom-icon-badges.demolab.com/github/v/release/arichorn/YTLitePlus?color=brightgreen&label=Latest%20release" alt="Badge"></img></a>
|
<a href="https://github.com/Balackburn/YTLitePlus/releases/latest"><img src="https://custom-icon-badges.demolab.com/github/v/release/Balackburn/YTLitePlus?color=brightgreen&label=Latest%20release" alt="Badge"></img></a>
|
||||||
<a href="https://github.com/Balackburn/YTLitePlus/releases/latest"><img src="https://img.shields.io/github/downloads/arichorn/YTLitePlus/total?label=Download" alt="Badge"></img></a>
|
<a href="https://github.com/Balackburn/YTLitePlus/releases/latest"><img src="https://img.shields.io/github/downloads/Balackburn/YTLitePlus/total?label=Download" alt="Badge"></img></a>
|
||||||
<a href="https://github.com/Balackburn/YTLitePlus/commit"><img src="https://custom-icon-badges.demolab.com/github/last-commit/arichorn/YTLitePlus?logo=history&logoColor=white&label=Last commit" alt="Badge"></img></a>
|
<a href="https://github.com/Balackburn/YTLitePlus/commit"><img src="https://custom-icon-badges.demolab.com/github/last-commit/Balackburn/YTLitePlus?logo=history&logoColor=white&label=Last commit" alt="Badge"></img></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://img.shields.io/github/stars/arichorn/YTLitePlus?style=social" alt="Badge"/>
|
<img src="https://img.shields.io/github/stars/Balackburn/YTLitePlus?style=social" alt="Badge"/>
|
||||||
<img src="https://img.shields.io/github/forks/arichorn/YTLitePlus?style=social" alt="Badge"/>
|
<img src="https://img.shields.io/github/forks/Balackburn/YTLitePlus?style=social" alt="Badge"/>
|
||||||
<a href="https://github.com/qnblackcat/uYouPlus#support-the-developers"><img src="https://img.shields.io/badge/-Support-lightgrey?style=social&logo=paypal" alt="Badge"></img></a>
|
<a href="https://github.com/qnblackcat/uYouPlus#support-the-developers"><img src="https://img.shields.io/badge/-Support-lightgrey?style=social&logo=paypal" alt="Badge"></img></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@@ -477,6 +477,85 @@ extern NSBundle *YTLitePlusBundle();
|
|||||||
return YES;
|
return YES;
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
# pragma mark - VersionSpoofer
|
||||||
|
YTSettingsSectionItem *versionSpooferSection = [YTSettingsSectionItemClass itemWithTitle:@"Version Spoofer Picker"
|
||||||
|
accessibilityIdentifier:nil
|
||||||
|
detailTextBlock:^NSString *() {
|
||||||
|
switch (appVersionSpoofer()) {
|
||||||
|
case 1:
|
||||||
|
return @"v18.18.2 (Fixes YTClassicVideoQuality and YTSpeed)";
|
||||||
|
case 2:
|
||||||
|
return @"v17.49.6 (Removes Rounded Miniplayer)";
|
||||||
|
case 3:
|
||||||
|
return @"v17.39.4 (Adds Rounded Thumbnails)";
|
||||||
|
case 4:
|
||||||
|
return @"v17.38.10 (Fixes LowContrastMode)";
|
||||||
|
case 5:
|
||||||
|
return @"v17.11.2 (Removes Chip Video Player Buttons)";
|
||||||
|
case 6:
|
||||||
|
return @"v16.46.5 (Removes New Overflow Video Player Menu)";
|
||||||
|
case 7:
|
||||||
|
return @"v16.42.3";
|
||||||
|
case 8:
|
||||||
|
return @"v16.05.7 (Old Comment+Description Section)";
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return @"Default Version";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Default Version" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}],
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v18.18.2 (Fixes YTClassicVideoQuality and YTSpeed)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}],
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.49.6 (Removes Rounded Miniplayer)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:2 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}],
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.39.4 (Adds Rounded Thumbnails)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:3 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}],
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.38.10 (Fixes LowContrastMode)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:4 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}],
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v17.11.2 (Removes Chip Video Player Buttons)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:5 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}],
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.46.5 (Removes New Overflow Video Player Menu)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:6 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}],
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.42.3" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:7 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}],
|
||||||
|
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v16.05.7 (Old Comment+Description Section)" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setInteger:8 forKey:@"versionSpoofer"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
return YES;
|
||||||
|
}]
|
||||||
|
];
|
||||||
|
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:@"Version Spoofer Picker" pickerSectionTitle:nil rows:rows selectedItemIndex:appVersionSpoofer() parentResponder:[self parentResponder]];
|
||||||
|
[settingsViewController pushViewController:picker];
|
||||||
|
return YES;
|
||||||
|
}];
|
||||||
|
|
||||||
# pragma mark - Theme
|
# pragma mark - Theme
|
||||||
YTSettingsSectionItem *themeGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"THEME_OPTIONS")
|
YTSettingsSectionItem *themeGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"THEME_OPTIONS")
|
||||||
accessibilityIdentifier:nil
|
accessibilityIdentifier:nil
|
||||||
@@ -695,8 +774,17 @@ extern NSBundle *YTLitePlusBundle();
|
|||||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"flex_enabled"];
|
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"flex_enabled"];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
settingItemId:0]
|
settingItemId:0],
|
||||||
];
|
|
||||||
|
[YTSettingsSectionItemClass switchItemWithTitle:@"Enable App Version Spoofer (Lite)"
|
||||||
|
titleDescription:LOC(@"Enable this to use the Version Spoofer and select your perferred version below. App restart is required.")
|
||||||
|
accessibilityIdentifier:nil
|
||||||
|
switchOn:IsEnabled(@"enableVersionSpoofer_enabled")
|
||||||
|
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"enableVersionSpoofer_enabled"];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
settingItemId:0], versionSpooferSection];
|
||||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"MISCELLANEOUS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
|
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"MISCELLANEOUS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
|
||||||
[settingsViewController pushViewController:picker];
|
[settingsViewController pushViewController:picker];
|
||||||
return YES;
|
return YES;
|
||||||
|
125
Source/VersionSpooferLite.xm
Normal file
125
Source/VersionSpooferLite.xm
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
#import "../Header.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
static BOOL IsEnabled(NSString *key) {
|
||||||
|
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
|
||||||
|
}
|
||||||
|
static int appVersionSpoofer() {
|
||||||
|
return [[NSUserDefaults standardUserDefaults] integerForKey:@"versionSpoofer"];
|
||||||
|
}
|
||||||
|
static BOOL version0() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 0;
|
||||||
|
}
|
||||||
|
static BOOL version1() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 1;
|
||||||
|
}
|
||||||
|
static BOOL version2() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 2;
|
||||||
|
}
|
||||||
|
static BOOL version3() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 3;
|
||||||
|
}
|
||||||
|
static BOOL version4() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 4;
|
||||||
|
}
|
||||||
|
static BOOL version5() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 5;
|
||||||
|
}
|
||||||
|
static BOOL version6() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 6;
|
||||||
|
}
|
||||||
|
static BOOL version7() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 7;
|
||||||
|
}
|
||||||
|
static BOOL version8() {
|
||||||
|
return IsEnabled(@"enableVersionSpoofer_enabled") && appVersionSpoofer() == 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
%group gDefault
|
||||||
|
%hook YTVersionUtils // Default
|
||||||
|
+ (NSString *)appVersion {
|
||||||
|
NSString *originalVersion = %orig;
|
||||||
|
return originalVersion;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
%group gVersion1
|
||||||
|
%hook YTVersionUtils // Fix YTClassicVideoQuality & YTSpeed
|
||||||
|
+ (NSString *)appVersion { return @"18.18.2"; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
%group gVersion2
|
||||||
|
%hook YTVersionUtils // Last v17 App Version
|
||||||
|
+ (NSString *)appVersion { return @"17.49.6"; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
%group gVersion3
|
||||||
|
%hook YTVersionUtils // Updated Interface - Breaks LowContrastMode
|
||||||
|
+ (NSString *)appVersion { return @"17.39.4"; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
%group gVersion4
|
||||||
|
%hook YTVersionUtils // LowContrastMode Patch
|
||||||
|
+ (NSString *)appVersion { return @"17.38.10"; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
%group gVersion5
|
||||||
|
%hook YTVersionUtils // Old Video Player Buttons
|
||||||
|
+ (NSString *)appVersion { return @"17.11.2"; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
%group gVersion6
|
||||||
|
%hook YTVersionUtils // Last v16 App Version
|
||||||
|
+ (NSString *)appVersion { return @"16.46.5"; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
%group gVersion7
|
||||||
|
%hook YTVersionUtils // Old Video Player Layout
|
||||||
|
+ (NSString *)appVersion { return @"16.42.3"; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
%group gVersion8
|
||||||
|
%hook YTVersionUtils // Old Comment Section & Description Layout
|
||||||
|
+ (NSString *)appVersion { return @"16.05.7"; }
|
||||||
|
%end
|
||||||
|
%end
|
||||||
|
|
||||||
|
# pragma mark - ctor
|
||||||
|
%ctor {
|
||||||
|
%init;
|
||||||
|
if (version0()) { // 0
|
||||||
|
%init(gDefault);
|
||||||
|
}
|
||||||
|
if (version1()) { // 1
|
||||||
|
%init(gVersion1);
|
||||||
|
}
|
||||||
|
if (version2()) { // 2
|
||||||
|
%init(gVersion2);
|
||||||
|
}
|
||||||
|
if (version3()) { // 3
|
||||||
|
%init(gVersion3);
|
||||||
|
}
|
||||||
|
if (version4()) { // 4
|
||||||
|
%init(gVersion4);
|
||||||
|
}
|
||||||
|
if (version5()) { // 5
|
||||||
|
%init(gVersion5);
|
||||||
|
}
|
||||||
|
if (version6()) { // 6
|
||||||
|
%init(gVersion6);
|
||||||
|
}
|
||||||
|
if (version7()) { // 7
|
||||||
|
%init(gVersion7);
|
||||||
|
}
|
||||||
|
if (version8()) { // 8
|
||||||
|
%init(gVersion8);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user