Skip to content

Commit

Permalink
YouTubeRebornPlus Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
arichornlover authored May 16, 2023
1 parent ee755ae commit c291257
Show file tree
Hide file tree
Showing 13 changed files with 2,831 additions and 21 deletions.
10 changes: 10 additions & 0 deletions DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package: com.arichorn.youtuberebornplus
Name: YouTubeRebornPlus
Version: 18.14.1
Section: Tweaks
Architecture: iphoneos-arm
Description: YouTubeRebornPlus Tweak with some useful features.
Maintainer: arichorn
Depends: mobilesubstrate (>= 0.9.5000), firmware (>= 14.0)
Conflicts: com.level3tjg.ytminiplayerenabler, com.level3tjg.ytnohovercards, com.devvix.ytcastconfirm, com.ps.ytclassicvideoquality, com.ps.noytpremium, com.ps.ytnopaidpromo, com.ps.ytreexplore, com.galacticdev.bigytminiplayer, me.foxster.donteatmycontent, com.lyvendia.ytspeed, com.lilacvibes.ytstockvolumehud, net.sarahh12099.youtubereborn, com.twickd.sarahh12099.youtube-reborn, h.ryan.youtubereborn, weeb.lillie.enhancerforyoutubepremium, com.ps.uyoucompat, com.ichitaso.uyouplus
Recommends: com.ps.youpip, com.ps.ytabconfig, libflex, weeb.lillie.youtubedislikesreturn, com.arichorn.lowcontrastmode
22 changes: 11 additions & 11 deletions Source/Settings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ static int GetSelection(NSString *key) {
static int colorContrastMode() {
return [[NSUserDefaults standardUserDefaults] integerForKey:@"lcmColor"];
}
static const NSInteger CercubePlusSection = 500;
static const NSInteger YouTubeRebornPlusSection = 500;

@interface YTSettingsSectionItemManager (CercubePlus)
- (void)updateCercubePlusSectionWithEntry:(id)entry;
@interface YTSettingsSectionItemManager (YouTubeRebornPlus)
- (void)updateYouTubeRebornPlusSectionWithEntry:(id)entry;
@end

extern NSBundle *CercubePlusBundle();
extern NSBundle *YouTubeRebornPlusBundle();

// Settings
%hook YTAppSettingsPresentationData
Expand All @@ -30,7 +30,7 @@ extern NSBundle *CercubePlusBundle();
NSMutableArray *mutableOrder = [order mutableCopy];
NSUInteger insertIndex = [order indexOfObject:@(1)];
if (insertIndex != NSNotFound)
[mutableOrder insertObject:@(CercubePlusSection) atIndex:insertIndex + 1];
[mutableOrder insertObject:@(YouTubeRebornPlusSection) atIndex:insertIndex + 1];
return mutableOrder;
}
%end
Expand All @@ -45,9 +45,9 @@ extern NSBundle *CercubePlusBundle();

%hook YTSettingsSectionItemManager
%new(v@:@)
- (void)updateCercubePlusSectionWithEntry:(id)entry {
- (void)updateYouTubeRebornPlusSectionWithEntry:(id)entry {
NSMutableArray *sectionItems = [NSMutableArray array];
NSBundle *tweakBundle = CercubePlusBundle();
NSBundle *tweakBundle = YouTubeRebornPlusBundle();
Class YTSettingsSectionItemClass = %c(YTSettingsSectionItem);
YTSettingsViewController *settingsViewController = [self valueForKey:@"_settingsViewControllerDelegate"];

Expand All @@ -57,7 +57,7 @@ extern NSBundle *CercubePlusBundle();
accessibilityIdentifier:nil
detailTextBlock:nil
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
return [%c(YTUIUtils) openURL:[NSURL URLWithString:@"https://github.com/arichorn/CercubePlusExtra/releases/latest"]];
return [%c(YTUIUtils) openURL:[NSURL URLWithString:@"https://github.com/arichorn/YouTubeRebornPlus/releases/latest"]];
}];
[sectionItems addObject:main];

Expand Down Expand Up @@ -713,12 +713,12 @@ extern NSBundle *CercubePlusBundle();
}];
[sectionItems addObject:miscellaneousGroup];

[settingsViewController setSectionItems:sectionItems forCategory:CercubePlusSection title:@"CercubePlus" titleDescription:LOC(@"TITLE DESCRIPTION") headerHidden:YES];
[settingsViewController setSectionItems:sectionItems forCategory:YouTubeRebornPlusSection title:@"YouTubeRebornPlus" titleDescription:LOC(@"TITLE DESCRIPTION") headerHidden:YES];
}

- (void)updateSectionForCategory:(NSUInteger)category withEntry:(id)entry {
if (category == CercubePlusSection) {
[self updateCercubePlusSectionWithEntry:entry];
if (category == YouTubeRebornPlusSection) {
[self updateYouTubeRebornPlusSectionWithEntry:entry];
return;
}
%orig;
Expand Down
1 change: 1 addition & 0 deletions YouTubeRebornPlus.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.google.ios.youtube" ); }; }
Loading

0 comments on commit c291257

Please sign in to comment.