V5 #396

Merged
bhackel merged 10 commits from v5 into main 2024-09-03 04:53:43 +00:00
2 changed files with 13 additions and 10 deletions
Showing only changes of commit 9d62ce75ce - Show all commits

View file

@ -396,7 +396,7 @@ static const NSInteger YTLiteSection = 789;
// Toggle for haptic feedback
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];
return YES;
}];

View file

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