v16.42.3 Compatible Code

Enabled and added the code that makes 16.42.3 work perfectly.
This commit is contained in:
Aric 2023-02-28 18:26:31 -06:00 committed by GitHub
parent 93a4664b1e
commit 891c9045da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 101 deletions

View file

@ -191,16 +191,6 @@ extern NSBundle *uYouPlusBundle();
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"RED_PROGRESS_BAR")
titleDescription:LOC(@"RED_PROGRESS_BAR_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"redProgressBar_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"redProgressBar_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_HOVER_CARD")
titleDescription:LOC(@"HIDE_HOVER_CARD_DESC")
accessibilityIdentifier:nil
@ -220,26 +210,6 @@ extern NSBundle *uYouPlusBundle();
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"DONT_EAT_MY_CONTENT")
titleDescription:LOC(@"DONT_EAT_MY_CONTENT_DESC")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"dontEatMyContent_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"dontEatMyContent_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide Heatwaves")
titleDescription:LOC(@"Should hide the Heatwaves in the video player. App restart is required.")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"hideHeatwaves_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideHeatwaves_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide Dark Overlay Background")
titleDescription:LOC(@"Hide video player's dark overlay background.")
@ -435,8 +405,6 @@ extern NSBundle *uYouPlusBundle();
switch (GetSelection(@"appTheme")) {
case 1:
return LOC(@"OLED_DARK_THEME_2");
case 2:
return LOC(@"OLD_DARK_THEME");
case 0:
default:
return LOC(@"DEFAULT_THEME");
@ -454,11 +422,6 @@ extern NSBundle *uYouPlusBundle();
[settingsViewController reloadData];
return YES;
}],
[YTSettingsSectionItemClass checkmarkItemWithTitle:LOC(@"OLD_DARK_THEME") titleDescription:LOC(@"OLD_DARK_THEME_DESC") selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
[[NSUserDefaults standardUserDefaults] setInteger:2 forKey:@"appTheme"];
[settingsViewController reloadData];
return YES;
}],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"OLED_KEYBOARD")
titleDescription:LOC(@"OLED_KEYBOARD_DESC")
@ -468,7 +431,7 @@ extern NSBundle *uYouPlusBundle();
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oledKeyBoard_enabled"];
return YES;
}
settingItemId:0]
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Low Contrast Mode")
titleDescription:LOC(@"this will Low Contrast texts and buttons just like how the old YouTube Interface did. App restart is required.")
@ -518,16 +481,6 @@ extern NSBundle *uYouPlusBundle();
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Remove Modern Interface (YTNoModernUI)")
titleDescription:LOC(@"Toggle this on to remove any Modern Element added to YouTube. Removes Ambient Mode, Rounded Design & More. App restart is required.")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"ytNoModernUI_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"ytNoModernUI_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide YouTube Logo")
titleDescription:LOC(@"Toggle this to hide the YouTube Logo in the YouTube App.")
accessibilityIdentifier:nil
@ -588,16 +541,6 @@ extern NSBundle *uYouPlusBundle();
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide Notifcation button in the Navigation bar")
titleDescription:LOC(@"")
accessibilityIdentifier:nil
switchOn:IsEnabled(@"hideNotificationButton_enabled")
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideNotificationButton_enabled"];
return YES;
}
settingItemId:0],
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide iSponsorBlock button in the Navigation bar")
titleDescription:LOC(@"")
accessibilityIdentifier:nil

View file

@ -4,41 +4,23 @@
cd "$(dirname "$0")"
# Check uYou
if [ ! -f Tweaks/uYou/com.miro.uyou_2.3~1_iphoneos-arm.deb ]
if [ ! -f Tweaks/uYou/com.miro.uyou_2.1_iphoneos-arm.deb ]
then
echo -e "==> \033[1muYou v2.3~1 is not found. Downloading uYou (v2.3~1)...\033[0m"
(set -x ; curl https://miro92.com/repo/debs/com.miro.uyou_2.3~1_iphoneos-arm.deb --output Tweaks/uYou/com.miro.uyou_2.3~1_iphoneos-arm.deb)
echo -e "==> \033[1muYou v2.1 is not found. Downloading uYou (v2.1)...\033[0m"
(set -x ; curl https://miro92.com/repo/debs/com.miro.uyou_2.1_iphoneos-arm.deb --output Tweaks/uYou/com.miro.uyou_2.1_iphoneos-arm.deb)
else
echo -e "==> \033[1mFounded uYou (v2.3~1)!\033[0m"
echo -e "==> \033[1mFounded uYou (v2.1)!\033[0m"
fi
# Extract uYou
echo -e "==> \033[1mExtracting uYou...\033[0m"
if (cd Tweaks/uYou && tar -xf com.miro.uyou_2.3~1_iphoneos-arm.deb && tar -xf data.tar.*)
if (cd Tweaks/uYou && tar -xf com.miro.uyou_2.1_iphoneos-arm.deb && tar -xf data.tar.*)
then
echo -e "\033[1m> Extracted uYou!\033[0m"
else
echo "> \033[1mCouldn't extract uYou\033[0m"
fi
# Check Reborn
if [ ! -f Tweaks/uYou/YouTube.Reborn.v4.0.9.deb ]
then
echo -e "==> \033[1mReborn v4.0.9 is not found. Downloading Reborn (v4.0.9)...\033[0m"
(set -x ; curl https://github.com/LillieH1000/YouTube-Reborn/releases/download/4.0.9/YouTube.Reborn.v4.0.9.deb --output Tweaks/uYou/YouTube.Reborn.v4.0.9.deb)
else
echo -e "==> \033[1mFounded Reborn (v4.0.9)!\033[0m"
fi
# Extract Reborn
echo -e "==> \033[1mExtracting Reborn...\033[0m"
if (cd Tweaks/uYou && tar -xf YouTube.Reborn.v4.0.9.deb && tar -xf data.tar.*)
then
echo -e "\033[1m> Extracted Reborn!\033[0m"
else
echo "> \033[1mCouldn't extract Reborn\033[0m"
fi
# Makefile
if [ -d tmp ]
then
@ -68,6 +50,6 @@ else
fi
# Clean up
tput setaf 1 && echo -e "==> \033[1mCleaning up...\033[0m"
find Tweaks/uYou -mindepth 1 ! -name "com.miro.uyou_2.3~1_iphoneos-arm.deb" ! -name ".gitkeep" -exec rm -rf {} \; 2>/dev/null
find Tweaks/uYou -mindepth 1 ! -name "com.miro.uyou_2.1_iphoneos-arm.deb" ! -name ".gitkeep" -exec rm -rf {} \; 2>/dev/null
rm -rf tmp/ Resources .theos/_/Payload
echo -e "==> \033[1mSHASUM256: $(shasum -a 256 packages/*.ipa)\033[0m"
echo -e "==> \033[1mSHASUM256: $(shasum -a 256 packages/*.ipa)\033[0m"

View file

@ -160,8 +160,9 @@ static BOOL pinkContrastMode() {
- (void)didTapOverflowButton:(id)sender {}
%end
%subclass YTReelPlayerBottomButton : YTReelPlayerButton
%end
// Not Compatible for the releases 16.42.3 LTS + 17.49.6 LTS because this code will crash shorts in those versions since the app can't recognize some of the subclasses now.
// %subclass YTReelPlayerBottomButton : YTReelPlayerButton
// %end
%hook NSLayoutConstraint
+ (instancetype)constraintWithItem:(UIView *)view1
@ -484,10 +485,10 @@ static BOOL didFinishLaunching;
- (BOOL)shouldShowUpgradeDialog { return NO;}
%end
// Disable Autoplay Settings Section - @qnblackcat
%hook YTSettingsSectionItemManager
- (void)updateAutoplaySectionWithEntry:(id)arg1 {}
%end
// Disable Autoplay Settings Section - @qnblackcat (not needed, autoplay section works normal on v16.42.3)
// %hook YTSettingsSectionItemManager
// - (void)updateAutoplaySectionWithEntry:(id)arg1 {}
// %end
// NOYTPremium - https://github.com/PoomSmart/NoYTPremium/
%hook YTCommerceEventGroupHandler
@ -1005,17 +1006,17 @@ void DEMC_centerRenderingView() {
- (BOOL)removePreviousPaddleForSingletonVideos { return YES; }
%end
// %hook YTMainAppControlsOverlayView // this is only used for v16.42.3 (incompatible with YouTube v17.22.3-newer)
// - (void)layoutSubviews { // hide Next & Previous legacy buttons
// %orig;
// if (IsEnabled(@"hidePreviousAndNextButton_enabled")) {
// MSHookIvar<YTMainAppControlsOverlayView *>(self, "_nextButton").hidden = YES;
// MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES;
// MSHookIvar<YTTransportControlsButtonView *>(self, "_nextButtonView").hidden = YES;
// MSHookIvar<YTTransportControlsButtonView *>(self, "_previousButtonView").hidden = YES;
// }
// }
// %end
%hook YTMainAppControlsOverlayView // this is only used for v16.42.3 (incompatible with YouTube v17.22.3-newer)
- (void)layoutSubviews { // hide Next & Previous legacy buttons
%orig;
if (IsEnabled(@"hidePreviousAndNextButton_enabled")) {
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_nextButton").hidden = YES;
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES;
MSHookIvar<YTTransportControlsButtonView *>(self, "_nextButtonView").hidden = YES;
MSHookIvar<YTTransportControlsButtonView *>(self, "_previousButtonView").hidden = YES;
}
}
%end
%end
// Replace Next & Previous button with Fast forward & Rewind button
@ -1150,7 +1151,7 @@ void DEMC_centerRenderingView() {
// OLED dark mode by BandarHL
UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:1.0];
%group gOLED
%hook YTCommonColorPalette
%hook YTColorPalette
- (UIColor *)brandBackgroundSolid {
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
}