This commit is contained in:
Bryce Hackel
2024-09-01 14:45:20 -07:00
parent c73cd63db4
commit 9d62ce75ce
2 changed files with 13 additions and 10 deletions

View File

@@ -396,7 +396,7 @@ static const NSInteger YTLiteSection = 789;
// Toggle for haptic feedback // Toggle for haptic feedback
BASIC_SWITCH(LOC(@"PLAYER_GESTURES_HAPTIC_FEEDBACK"), nil, @"playerGesturesHapticFeedback_enabled"), BASIC_SWITCH(LOC(@"PLAYER_GESTURES_HAPTIC_FEEDBACK"), nil, @"playerGesturesHapticFeedback_enabled"),
]; ];
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"Player Gestures (Beta)") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]]; YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"PLAYER_GESTURES_TITLE") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
[settingsViewController pushViewController:picker]; [settingsViewController pushViewController:picker];
return YES; return YES;
}]; }];

View File

@@ -172,14 +172,17 @@ BOOL isSelf() {
// Disable YouTube Plus incompatibility warning popup - @bhackel // Disable YouTube Plus incompatibility warning popup - @bhackel
%hook HelperVC %hook HelperVC
- (void)viewDidLoad {
%orig; - (void)viewWillAppear:(BOOL)animated {
// Check if it responds to the selector riskButtonTapped %orig; // Call the original implementation
if ([self respondsToSelector:@selector(riskButtonTapped)]) {
// Call the selector riskButtonTapped // // Hide the view before it appears
[self performSelector:@selector(riskButtonTapped)]; // self.view.hidden = YES;
}
// // Optionally, you can remove the view from the superview to ensure it's gone
// [self.view removeFromSuperview];
} }
%end %end
@@ -1240,6 +1243,8 @@ NSInteger pageStyle = 0;
%init; %init;
// Access YouGroupSettings methods // Access YouGroupSettings methods
dlopen([[NSString stringWithFormat:@"%@/Frameworks/YouGroupSettings.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY); dlopen([[NSString stringWithFormat:@"%@/Frameworks/YouGroupSettings.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY);
// Access YouTube Plus methods
dlopen([[NSString stringWithFormat:@"%@/Frameworks/YTLite.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY);
if (IsEnabled(@"hideCastButton_enabled")) { if (IsEnabled(@"hideCastButton_enabled")) {
%init(gHideCastButton); %init(gHideCastButton);
@@ -1322,8 +1327,6 @@ NSInteger pageStyle = 0;
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
NSString *settingsPath = [documentsDirectory stringByAppendingPathComponent:@"iSponsorBlock.plist"]; NSString *settingsPath = [documentsDirectory stringByAppendingPathComponent:@"iSponsorBlock.plist"];
NSMutableDictionary *settings = [NSMutableDictionary dictionary]; NSMutableDictionary *settings = [NSMutableDictionary dictionary];
NSDictionary *existingSettings = [NSDictionary dictionaryWithContentsOfFile:settingsPath];
[settings addEntriesFromDictionary:existingSettings];
[settings setObject:@(NO) forKey:@"enabled"]; [settings setObject:@(NO) forKey:@"enabled"];
[settings writeToFile:settingsPath atomically:YES]; [settings writeToFile:settingsPath atomically:YES];
// Set miscellaneous YTLitePlus features to enabled // Set miscellaneous YTLitePlus features to enabled