Compare commits

..
Author SHA1 Message Date
qnblackcat 5e9d719882 fix app crash upon launching on some devices 2022-05-17 09:44:54 +07:00
qnblackcat f63cfa8b43 update Makefile 2022-05-17 09:43:12 +07:00
qnblackcat 37b6b1e07e update description 2022-05-17 09:43:01 +07:00
3 changed files with 8 additions and 13 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ uYouPlus_INJECT_DYLIBS = Tweaks/uYou/Library/MobileSubstrate/DynamicLibraries/uY
TARGET = iphone:clang:latest:12.0 TARGET = iphone:clang:latest:12.0
uYouPlus_USE_FLEX = 0 uYouPlus_USE_FLEX = 0
uYouPlus_USE_FISHHOOK = 1 uYouPlus_USE_FISHHOOK = 0
ARCHS = arm64 ARCHS = arm64
MODULES = jailed MODULES = jailed
FINALPACKAGE = 1 FINALPACKAGE = 1
+2 -2
View File
@@ -37,7 +37,7 @@ extern BOOL ytMiniPlayer();
%new - (void)updateuYouPlusSectionWithEntry:(id)entry { %new - (void)updateuYouPlusSectionWithEntry:(id)entry {
YTSettingsViewController *delegate = [self valueForKey:@"_dataDelegate"]; YTSettingsViewController *delegate = [self valueForKey:@"_dataDelegate"];
YTSettingsSectionItem *ytMiniPlayer = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Enable the Miniplayer for all videos" titleDescription:@"App restart is required."]; YTSettingsSectionItem *ytMiniPlayer = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Enable the Miniplayer for all YouTube videos" titleDescription:@""];
ytMiniPlayer.hasSwitch = YES; ytMiniPlayer.hasSwitch = YES;
ytMiniPlayer.switchVisible = YES; ytMiniPlayer.switchVisible = YES;
ytMiniPlayer.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"ytMiniPlayer_enabled"]; ytMiniPlayer.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"ytMiniPlayer_enabled"];
@@ -127,7 +127,7 @@ extern BOOL ytMiniPlayer();
return YES; return YES;
}; };
YTSettingsSectionItem *oledKeyBoard = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Keyboard (Experimental)" titleDescription:@"Might not working properly in some cases . App restart is required."]; YTSettingsSectionItem *oledKeyBoard = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Keyboard (Experimental)" titleDescription:@"Might not working properly in some cases. App restart is required."];
oledKeyBoard.hasSwitch = YES; oledKeyBoard.hasSwitch = YES;
oledKeyBoard.switchVisible = YES; oledKeyBoard.switchVisible = YES;
oledKeyBoard.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"]; oledKeyBoard.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"];
+5 -10
View File
@@ -1,7 +1,6 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <objc/runtime.h> #import <objc/runtime.h>
#import <fishhook.h>
#import "Header.h" #import "Header.h"
#import "Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h" #import "Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h"
#import "Tweaks/YouTubeHeader/YTSettingsSectionItem.h" #import "Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
@@ -53,15 +52,12 @@ BOOL ytMiniPlayer() {
// Tweaks // Tweaks
// YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/ // YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/
static BOOL (*orig_class_addMethod)(Class, SEL, IMP, const char *); %hook YTWatchMiniBarViewController
static BOOL hook_class_addMethod(Class cls, SEL name, IMP imp, const char *types) { - (void)updateMiniBarPlayerStateFromRenderer {
if (ytMiniPlayer() && [cls isEqual:%c(YTIMiniplayerRenderer)] && [NSStringFromSelector(name) hasPrefix:@"has"]) { if (ytMiniPlayer()) {}
imp = imp_implementationWithBlock(^BOOL(id self, SEL _cmd) { else { return %orig; }
return NO;
});
}
return orig_class_addMethod(cls, name, imp, types);
} }
%end
// Hide CC / Autoplay switch // Hide CC / Autoplay switch
%hook YTMainAppControlsOverlayView %hook YTMainAppControlsOverlayView
@@ -550,7 +546,6 @@ static void replaceTab(YTIGuideResponse *response) {
%end %end
%ctor { %ctor {
rebind_symbols((struct rebinding[1]){{"class_addMethod", (void *)hook_class_addMethod, (void **)&orig_class_addMethod}}, 1);
%init; %init;
if (oled()) { if (oled()) {
%init(gOLED); %init(gOLED);