mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
fix app crash upon launching on some devices
This commit is contained in:
parent
f63cfa8b43
commit
5e9d719882
1 changed files with 5 additions and 10 deletions
15
uYouPlus.xm
15
uYouPlus.xm
|
|
@ -1,7 +1,6 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <fishhook.h>
|
||||
#import "Header.h"
|
||||
#import "Tweaks/YouTubeHeader/YTVideoQualitySwitchOriginalController.h"
|
||||
#import "Tweaks/YouTubeHeader/YTSettingsSectionItem.h"
|
||||
|
|
@ -53,15 +52,12 @@ BOOL ytMiniPlayer() {
|
|||
|
||||
// Tweaks
|
||||
// YTMiniPlayerEnabler: https://github.com/level3tjg/YTMiniplayerEnabler/
|
||||
static BOOL (*orig_class_addMethod)(Class, SEL, IMP, const char *);
|
||||
static BOOL hook_class_addMethod(Class cls, SEL name, IMP imp, const char *types) {
|
||||
if (ytMiniPlayer() && [cls isEqual:%c(YTIMiniplayerRenderer)] && [NSStringFromSelector(name) hasPrefix:@"has"]) {
|
||||
imp = imp_implementationWithBlock(^BOOL(id self, SEL _cmd) {
|
||||
return NO;
|
||||
});
|
||||
}
|
||||
return orig_class_addMethod(cls, name, imp, types);
|
||||
%hook YTWatchMiniBarViewController
|
||||
- (void)updateMiniBarPlayerStateFromRenderer {
|
||||
if (ytMiniPlayer()) {}
|
||||
else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
// Hide CC / Autoplay switch
|
||||
%hook YTMainAppControlsOverlayView
|
||||
|
|
@ -550,7 +546,6 @@ static void replaceTab(YTIGuideResponse *response) {
|
|||
%end
|
||||
|
||||
%ctor {
|
||||
rebind_symbols((struct rebinding[1]){{"class_addMethod", (void *)hook_class_addMethod, (void **)&orig_class_addMethod}}, 1);
|
||||
%init;
|
||||
if (oled()) {
|
||||
%init(gOLED);
|
||||
|
|
|
|||
Loading…
Reference in a new issue