Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit e2cd37a

Browse files
committed
formating, remove old code, update IAmYouTube
1 parent e5b9ff2 commit e2cd37a

File tree

1 file changed

+39
-72
lines changed

1 file changed

+39
-72
lines changed

uYouPlus.xm

Lines changed: 39 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#import "Tweaks/YouTubeHeader/YTIPivotBarRenderer.h"
1313
#import "Tweaks/YouTubeHeader/YTIBrowseRequest.h"
1414
#import "Tweaks/YouTubeHeader/YTCommonColorPalette.h"
15-
#import "Tweaks/YouTubeHeader/YTColorPalette.h"
1615
#import "Tweaks/YouTubeHeader/ASCollectionView.h"
1716
#import "Tweaks/YouTubeHeader/YTPlayerOverlay.h"
1817
#import "Tweaks/YouTubeHeader/YTPlayerOverlayProvider.h"
@@ -202,23 +201,23 @@ BOOL hidePaidPromotionCard() {
202201
// Workaround for MiRO92/uYou-for-YouTube#12, qnblackcat/uYouPlus#263
203202
%hook YTDataUtils
204203
+ (NSMutableDictionary *)spamSignalsDictionary {
205-
return nil;
204+
return nil;
206205
}
207206
%end
208207

209208
// Workaround for https://github.com/MiRO92/uYou-for-YouTube/issues/94
210209
%hook UIResponder
211210
%new
212211
- (id)entry {
213-
return nil;
212+
return nil;
214213
}
215214
%end
216215

217216
// Workaround for https://github.com/MiRO92/uYou-for-YouTube/issues/140
218217
%hook YTLocalPlaybackController
219218
%new
220219
- (id)activeVideoController {
221-
return [self activeVideo];
220+
return [self activeVideo];
222221
}
223222
%end
224223

@@ -248,7 +247,6 @@ BOOL hidePaidPromotionCard() {
248247
// YouRememberCaption: https://poomsmart.github.io/repo/depictions/youremembercaption.html
249248
%hook YTColdConfig
250249
- (BOOL)respectDeviceCaptionSetting { return NO; }
251-
- (BOOL)shouldUseAppThemeSetting { return YES; } // v16.xx
252250
%end
253251

254252
// NOYTPremium - https://github.com/PoomSmart/NoYTPremium/
@@ -287,10 +285,6 @@ BOOL hidePaidPromotionCard() {
287285
- (void)setUserInteractionEnabled:(BOOL)enabled { %orig(YES); }
288286
%end
289287

290-
%hook YTReelPlayerViewControllerSub // v16.42.3 - @level3tjg: https://reddit.com/r/jailbreak/comments/v29yvk/_/iasl1l0/
291-
- (BOOL)shouldEnablePlayerBar { return YES; }
292-
%end
293-
294288
// Workaround for issue #54
295289
%hook YTMainAppVideoPlayerOverlayViewController
296290
- (void)updateRelatedVideos {
@@ -302,10 +296,10 @@ BOOL hidePaidPromotionCard() {
302296
// Workaround for qnblackcat/uYouPlus#253, qnblackcat/uYouPlus#170
303297
%hook YTReelWatchPlaybackOverlayView
304298
- (YTQTMButton *)overflowButton {
305-
if ([self respondsToSelector:@selector(orderedRightSideButtons)] &&
306-
[self orderedRightSideButtons].count != 0)
307-
return [self orderedRightSideButtons][0];
308-
return %orig;
299+
if ([self respondsToSelector:@selector(orderedRightSideButtons)] &&
300+
[self orderedRightSideButtons].count != 0)
301+
return [self orderedRightSideButtons][0];
302+
return %orig;
309303
}
310304
%end
311305

@@ -317,32 +311,31 @@ BOOL hidePaidPromotionCard() {
317311
attribute:(NSLayoutAttribute)attr2
318312
multiplier:(CGFloat)multiplier
319313
constant:(CGFloat)c {
320-
if (![view1 isKindOfClass:%c(YTReelPlayerBottomButton)] &&
321-
![view1.accessibilityIdentifier isEqualToString:@"com.miro.uyou"])
322-
return %orig;
323-
if (!view2) {
324-
view1.hidden = YES;
314+
if (![view1 isKindOfClass:%c(YTReelPlayerBottomButton)] &&
315+
![view1.accessibilityIdentifier isEqualToString:@"com.miro.uyou"])
316+
return %orig;
317+
if (!view2) {
318+
view1.hidden = YES;
325319
return [NSLayoutConstraint alloc];
326-
}
327-
YTReelPlayerBottomButton *uYouButton = (YTReelPlayerBottomButton *)view1;
328-
YTReelPlayerBottomButton *topButton = (YTReelPlayerBottomButton *)view2;
329-
NSString *uYouButtonTitle =
330-
[view2.accessibilityIdentifier isEqualToString:@"com.miro.uyou"]
331-
? @"uYou"
332-
: @"uYouLocal";
333-
uYouButton.accessibilityLabel = uYouButtonTitle;
334-
uYouButton.uppercaseTitle = NO;
335-
[uYouButton setTitle:uYouButtonTitle forState:UIControlStateNormal];
336-
[uYouButton
337-
setTitleTypeKind:MSHookIvar<NSInteger>(topButton, "_typeKind")
320+
}
321+
YTReelPlayerBottomButton *uYouButton = (YTReelPlayerBottomButton *)view1;
322+
YTReelPlayerBottomButton *topButton = (YTReelPlayerBottomButton *)view2;
323+
NSString *uYouButtonTitle =
324+
[view2.accessibilityIdentifier isEqualToString:@"com.miro.uyou"]
325+
? @"uYou"
326+
: @"uYouLocal";
327+
uYouButton.accessibilityLabel = uYouButtonTitle;
328+
uYouButton.uppercaseTitle = NO;
329+
[uYouButton setTitle:uYouButtonTitle forState:UIControlStateNormal];
330+
[uYouButton
331+
setTitleTypeKind:MSHookIvar<NSInteger>(topButton, "_typeKind")
338332
typeVariant:MSHookIvar<NSInteger>(topButton, "_typeVariant")];
339-
uYouButton.applyRightSideLayoutImageSize =
340-
topButton.applyRightSideLayoutImageSize;
341-
uYouButton.buttonImageTitlePadding = topButton.buttonImageTitlePadding;
342-
uYouButton.buttonLayoutStyle = topButton.buttonLayoutStyle;
343-
uYouButton.sizeWithPaddingAndInsets = topButton.sizeWithPaddingAndInsets;
344-
uYouButton.verticalContentPadding = topButton.verticalContentPadding;
345-
return %orig;
333+
uYouButton.applyRightSideLayoutImageSize = topButton.applyRightSideLayoutImageSize;
334+
uYouButton.buttonImageTitlePadding = topButton.buttonImageTitlePadding;
335+
uYouButton.buttonLayoutStyle = topButton.buttonLayoutStyle;
336+
uYouButton.sizeWithPaddingAndInsets = topButton.sizeWithPaddingAndInsets;
337+
uYouButton.verticalContentPadding = topButton.verticalContentPadding;
338+
return %orig;
346339
}
347340
%end
348341

@@ -441,6 +434,14 @@ BOOL hidePaidPromotionCard() {
441434
}
442435
%end
443436

437+
%hook APMAEU
438+
+ (BOOL)isFAS { return YES; }
439+
%end
440+
441+
%hook GULAppEnvironmentUtil
442+
+ (BOOL)isFromAppStore { return YES; }
443+
%end
444+
444445
%hook NSBundle
445446
- (NSString *)bundleIdentifier {
446447
NSArray *address = [NSThread callStackReturnAddresses];
@@ -543,39 +544,6 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
543544
}
544545
%end
545546

546-
%hook YTColorPalette // v16.42.3
547-
- (UIColor *)brandBackgroundSolid {
548-
if (self.pageStyle == 1) {
549-
return [UIColor blackColor];
550-
}
551-
return %orig;
552-
}
553-
- (UIColor *)brandBackgroundPrimary {
554-
if (self.pageStyle == 1) {
555-
return [UIColor blackColor];
556-
}
557-
return %orig;
558-
}
559-
- (UIColor *)brandBackgroundSecondary {
560-
if (self.pageStyle == 1) {
561-
return [[UIColor blackColor] colorWithAlphaComponent:0.9];
562-
}
563-
return %orig;
564-
}
565-
- (UIColor *)staticBrandBlack {
566-
if (self.pageStyle == 1) {
567-
return [UIColor blackColor];
568-
}
569-
return %orig;
570-
}
571-
- (UIColor *)generalBackgroundA {
572-
if (self.pageStyle == 1) {
573-
return [UIColor blackColor];
574-
}
575-
return %orig;
576-
}
577-
%end
578-
579547
// Account view controller
580548
%hook YTAccountPanelBodyViewController
581549
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
@@ -601,7 +569,7 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
601569
- (void)didMoveToWindow {
602570
%orig;
603571
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
604-
self.superview.backgroundColor = [UIColor clearColor];
572+
self.superview.backgroundColor = [UIColor blackColor];
605573
}
606574
}
607575
%end
@@ -726,7 +694,6 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
726694
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = [UIColor blackColor]; }
727695
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = [UIColor blackColor]; }
728696
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
729-
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = [UIColor blackColor]; }
730697
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor blackColor]; }
731698
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor blackColor]; }
732699
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = [UIColor blackColor]; }

0 commit comments

Comments
 (0)