From 9d62ce75ce58b5ee4bf01022b7342bb679bf2b73 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Sun, 1 Sep 2024 14:45:20 -0700 Subject: [PATCH] Fix bugs --- Source/Settings.xm | 2 +- YTLitePlus.xm | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Source/Settings.xm b/Source/Settings.xm index 418d6f4..864275b 100644 --- a/Source/Settings.xm +++ b/Source/Settings.xm @@ -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; }]; diff --git a/YTLitePlus.xm b/YTLitePlus.xm index ae9a152..766395a 100644 --- a/YTLitePlus.xm +++ b/YTLitePlus.xm @@ -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