mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-20 10:52:07 +00:00
Will this fix the logos?
This commit is contained in:
parent
877d969580
commit
0805fe053a
1 changed files with 35 additions and 0 deletions
35
uYouPlus.xm
35
uYouPlus.xm
|
|
@ -165,6 +165,37 @@ static void repositionCreateTab(YTIGuideResponse *response) {
|
|||
%orig;
|
||||
}
|
||||
%end
|
||||
%hook UIImage
|
||||
+ (UIImage *)imageNamed:(NSString *)name {
|
||||
NSString *customDarkLogo = @"/Library/Application Support/uYouPlus.bundle/youtube_logo_dark.png";
|
||||
NSString *customLightLogo = @"/Library/Application Support/uYouPlus.bundle/youtube_logo.png";
|
||||
|
||||
if ([name isEqualToString:@"youtube_logo_dark"]) {
|
||||
return [UIImage imageWithContentsOfFile:customDarkLogo];
|
||||
} else if ([name isEqualToString:@"youtube_logo"]) {
|
||||
return [UIImage imageWithContentsOfFile:customLightLogo];
|
||||
}
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
%hook UIImageView
|
||||
- (void)setImage:(UIImage *)image {
|
||||
NSString *customDarkLogo = @"/Library/Application Support/uYouPlus.bundle/youtube_logo_dark.png";
|
||||
NSString *customLightLogo = @"/Library/Application Support/uYouPlus.bundle/youtube_logo.png";
|
||||
|
||||
if ([NSStringFromClass([image class]) isEqualToString:@"UIImage"] &&
|
||||
[NSStringFromCGSize(image.size) isEqualToString:@"{122, 48}"] &&
|
||||
[NSStringFromCGRect(self.bounds) isEqualToString:@"{{0, 0}, {122, 48}}"]) {
|
||||
|
||||
if ([image.accessibilityIdentifier isEqualToString:@"youtube_logo_dark"]) {
|
||||
image = [UIImage imageWithContentsOfFile:customDarkLogo];
|
||||
} else if ([image.accessibilityIdentifier isEqualToString:@"youtube_logo"]) {
|
||||
image = [UIImage imageWithContentsOfFile:customLightLogo];
|
||||
}
|
||||
}
|
||||
%orig(image);
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
%group gPremiumYouTubeLogo
|
||||
|
|
@ -173,6 +204,10 @@ static void repositionCreateTab(YTIGuideResponse *response) {
|
|||
isPremiumLogo = YES;
|
||||
%orig;
|
||||
}
|
||||
- (void)setTopbarLogoRenderer:(id)renderer {
|
||||
[renderer setEnabled:NO];
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue