mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 03:32:08 +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 <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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue