mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
Merge pull request #575 from bhackel/feature/fake-premium
Feature/fake premium
This commit is contained in:
commit
c4b5dc63d6
27 changed files with 266 additions and 59 deletions
6
.github/workflows/buildapp.yml
vendored
6
.github/workflows/buildapp.yml
vendored
|
|
@ -16,6 +16,11 @@ on:
|
|||
default: "3.0.3"
|
||||
required: true
|
||||
type: string
|
||||
uyouenhanced_version:
|
||||
description: "The version of uYouEnhanced (Commit ID)"
|
||||
default: ""
|
||||
required: false
|
||||
type: string
|
||||
decrypted_youtube_url:
|
||||
description: "The direct URL to the decrypted YouTube ipa"
|
||||
default: ""
|
||||
|
|
@ -58,6 +63,7 @@ jobs:
|
|||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
path: main
|
||||
ref: ${{ github.event.inputs.uyouenhanced_version || github.ref }}
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Dependencies
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "إصلاح تسجيل الدخول بحساب جوجل (لمستخدمي TrollStore فقط)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "هذا الخيار لا يعمل إلا إذا كان التطبيق مثبت بواسطة TrollStore: فعل هذا الخيار لتتمكن من تسجيل الدخول بحساب جوجل. يتطلب إعادة تشغيل التطبيق.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Opravit přihlášení přes Google (pouze pro uživatele TrollStore)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Tuto možnost zapněte pouze v případě, že se nemůžete přihlásit pomocí svého účtu Google a aplikace byla nainstalována prostřednictvím TrollStore. Pokud se můžete normálně přihlásit, ponechte ji deaktivovanou. Je vyžadován restart aplikace.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Google-Anmeldung reparieren (nur für TrollStore-Benutzer!)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Aktiviere diese Option nur, wenn Sie sich nicht mit Ihrem Google-Account anmelden können und die App über TrollStore installiert wurde. Wenn Sie sich normal anmelden können, halte diese Option deaktiviert! App-Neustart erforderlich!";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Διόρθωση σύνδεσης Google (μόνο για χρήστες του TrollStore)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Ενεργοποιήστε αυτήν την επιλογή μόνο όταν δεν μπορείτε να συνδεθείτε με τον λογαριασμό σας Google και η εφαρμογή έχει εγκατασταθεί μέσω του TrollStore. Εάν μπορείτε να συνδεθείτε κανονικά, διατηρήστε την απενεργοποιημένη. Απαιτείται επανεκκίνηση της εφαρμογής.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Fix Google Sign in (for TrollStore user only)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Only turn on this option when you can't sign in with your Google account and the app was installed via TrollStore. If you can log in normally, keep it disabled. App restart is required.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Reparar el inicio de sesión de Google (solo para usuarios de TrollStore)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Active esta opción solo cuando no pueda iniciar sesión con su cuenta de Google y la aplicación se instaló a través de TrollStore. Si puede iniciar sesión normalmente, manténgala desactivada. Es necesario reiniciar la aplicación.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Réparer l'identification Google (pour les utilisateurs de TrollStore uniquement)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Activez cette option uniquement si vous ne pouvez pas vous connecter avec votre compte Google et que l'application a été installée via TrollStore. Si vous pouvez vous connecter normalement, laissez-la désactivée. Un redémarrage de l'application est nécessaire.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "תקן כניסה של Google (עבור משתמש TrollStore בלבד)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "הפעל אפשרות זו רק כאשר אינך יכול להיכנס עם חשבון Google שלך והאפליקציה הותקנה דרך TrollStore. אם אתה יכול להתחבר כרגיל, השאר אותה מושבתת. נדרשת הפעלה מחדש של האפליקציה.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "A Google bejelentkezés javítása (csak a TrollStore-felhasználók számára)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Csak akkor kapcsolja be ezt az opciót, ha nem tud bejelentkezni Google-fiókjával, és az alkalmazást a TrollStore-on keresztül telepítették. Ha normálisan be tud jelentkezni, tartsa letiltva. Az alkalmazás újraindítása szükséges.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Ripara Google Sign in (solo per utenti TrollStore)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Attiva questa opzione solo quando non puoi accedere al tuo account Google e l'app è stata installata attraverso TrollStore. Se puoi accedere normalmente, tienila disabilitata. È richiesto un riavvio dell'app.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Googleのサインインを修正 (TrollStoreユーザーのみ)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Googleアカウントでサインインできない場合で、アプリがTrollStore経由でインストールされている場合のみ、このオプションをオンにしてください。通常通りサインインできる場合はオフのままにしてください。アプリの再起動が必要です。";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "구글 로그인 문제 수정 (TrollStore 사용자만 해당)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "TrollStore를 통해 설치된 앱에만 적용됩니다: 구글 계정으로 로그인하려면 이 설정을 켜 주세요. 앱을 다시 시작해야 합니다.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Fix Inloggen met Google (Alleen voor TrollStore gebruikers)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Zet dit aan wanneer je niet kan inloggen met je Google account en je de app hebt geïnstalleerd met Trollstore. Als je in kan loggen laat dit dan met rust. Om dit te activeren moet je de app opnieuw opstarten.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Jouw Premium-voordelen";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Napraw logowanie się z Google (tylko dla użytkowników TrollStore)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Włącz tą opcję tylko wtedy, kiedy nie możesz zalogować się swoim kontem Google, a aplikacja została zainstalowana przez TrollStore. Jeżeli da się zalogować normalnie, zostaw to wyłączone. Restart aplikacji jest wymagany.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -146,4 +146,7 @@
|
|||
"ENABLE_FLEX_DESC" = "Ativa o FLEX para depuração (não recomendado). Deixe isso desligado, a menos que você saiba o que está fazendo.";
|
||||
|
||||
"FIX_GOOGLE_SIGNIN" = "Corrigir o login do Google (somente para usuários da TrollStore)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Ative esta opção somente quando você não conseguir fazer login com sua conta do Google e o aplicativo foi instalado via TrollStore. Se você conseguir fazer login normalmente, mantenha-o desativado. A reinicialização do app é necessária.";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Ative esta opção somente quando você não conseguir fazer login com sua conta do Google e o aplicativo foi instalado via TrollStore. Se você conseguir fazer login normalmente, mantenha-o desativado. A reinicialização do app é necessária.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Rezolvare problemă autentificare cont Google (doar pentru utilizatorii TrollStore)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Activează această opțiune doar în cazul în care nu te poți autentifica în contul tău Google și apariția a fost instalată via TrollStore. Dacă te poți autentifica fără probleme, țineți setarea dezactivată. Este necesară repornirea aplicației.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Исправить авторизацию (TrollStore)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Включите данную опцию только, если не можете войти в учетную запись Google, а приложение установлено через TrollStore. Если удается авторизоваться как обычно, оставьте данную опцию отключенной. Потребуется перезагрузка.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -162,3 +162,6 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Fix Google Sign in (for TrollStore user only)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Only turn on this option when you can't sign in with your Google account and the app was installed via TrollStore. If you can log in normally, keep it disabled. App restart is required.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -146,3 +146,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "แก้ไขปัญหาการเข้าสู่ระบบบัญชี Google (ใช้ได้สำหรับผู้ใช้ TrollStore เท่านั้น)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "ใช้ได้เฉพาะเมื่อใช้ TrollStore เพื่อติดตั้งแอปพลิเคชันนี้: หลังจากเปิดใช้งานการตั้งค่านี้ คุณสามารถเข้าสู่ระบบบัญชี Google ของคุณได้ตามปกติ และคุณต้องรีสตาร์ทแอปพลิเคชัน";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -138,3 +138,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Google Oturumu Açma'yı düzeltin (yalnızca TrollStore kullanıcıları için)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Bu seçeneği yalnızca Google hesabınızla oturum açamadığınızda ve uygulama TrollStore aracılığıyla yüklendiyse aç. Normal olarak giriş yapabiliyorsan, devre dışı bırak. Uygulamanın yeniden başlatılması gerekir.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "Sửa lỗi không thể đăng nhập tài khoản Google";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "Chỉ bật tính năng này khi bạn không thể đăng nhập tài khoản Google và ứng dụng được cài qua TrollStore. Nếu bạn có thể đăng nhập bình thường thì hãy tắt tính năng này. Cần khởi động lại ứng dụng.";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "修复 Google 账号登录问题(仅 TrollStore 用户有效)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "仅在使用 TrollStore 安装本 App 的情况下生效:启用本设置后即可正常登录您的 Google 账号。更改本设置后需要重启 App。";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -147,3 +147,6 @@
|
|||
|
||||
"FIX_GOOGLE_SIGNIN" = "修復 Google 帳號登入問題(僅TrollStore 使用者有效)";
|
||||
"FIX_GOOGLE_SIGNIN_DESC" = "僅在使用 TrollStore 安裝此應用程式時有效:啟用本設定後即可正常登入 Google 帳號,需要重新啟動應用程式。";
|
||||
|
||||
"FAKE_YOUR_PREMIUM_BENEFITS" = "Your Premium benefits";
|
||||
"FAKE_DOWNLOADS" = "Downloads";
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@
|
|||
#import <YouTubeHeader/YTInnerTubeCollectionViewController.h>
|
||||
#import <YouTubeHeader/YTPivotBarItemView.h>
|
||||
#import <YouTubeHeader/YTCollectionViewCell.h>
|
||||
#import <YouTubeHeader/YTIFormattedString.h>
|
||||
#import <YouTubeHeader/GPBMessage.h>
|
||||
#import <YouTubeHeader/YTIStringRun.h>
|
||||
#import <YouTubeHeader/YTWatchViewController.h>
|
||||
|
||||
// Hide buttons under the video player by @PoomSmart
|
||||
|
|
@ -68,6 +71,44 @@
|
|||
@property(readonly, nonatomic) YTIIcon *iconImage;
|
||||
@end
|
||||
|
||||
// Hide Premium Promo in You tab - @bhackel
|
||||
@interface YTIIconThumbnailRenderer : GPBMessage
|
||||
@property (nonatomic, strong) YTIIcon *icon;
|
||||
- (bool)hasIcon;
|
||||
@end
|
||||
@interface YTICompactListItemThumbnailSupportedRenderers : GPBMessage
|
||||
@property (nonatomic, strong) YTIIconThumbnailRenderer *iconThumbnailRenderer;
|
||||
- (bool)hasIconThumbnailRenderer;
|
||||
@end
|
||||
@interface YTICompactListItemRenderer : GPBMessage
|
||||
@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail;
|
||||
@property (nonatomic, strong) YTIFormattedString *title;
|
||||
- (bool)hasThumbnail;
|
||||
- (bool)hasTitle;
|
||||
@end
|
||||
@interface YTIIcon (uYouEnhanced)
|
||||
- (bool)hasIconType;
|
||||
@end
|
||||
@interface YTICompactLinkRenderer : GPBMessage
|
||||
@property (nonatomic, strong) YTIIcon *icon;
|
||||
@property (nonatomic, strong) YTIFormattedString *title;
|
||||
@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail;
|
||||
- (bool)hasIcon;
|
||||
- (bool)hasThumbnail;
|
||||
@end
|
||||
@interface YTIItemSectionSupportedRenderers (uYouEnhanced)
|
||||
@property(readonly, nonatomic) YTICompactLinkRenderer *compactLinkRenderer;
|
||||
@property(readonly, nonatomic) YTICompactListItemRenderer *compactListItemRenderer;
|
||||
- (bool)hasCompactLinkRenderer;
|
||||
- (bool)hasCompactListItemRenderer;
|
||||
@end
|
||||
@interface YTAppCollectionViewController : YTInnerTubeCollectionViewController
|
||||
- (void)uYouEnhancedFakePremiumModel:(YTISectionListRenderer *)model;
|
||||
@end
|
||||
@interface YTInnerTubeCollectionViewController (uYouEnhanced)
|
||||
@property(readonly, nonatomic) YTISectionListRenderer *model;
|
||||
@end
|
||||
|
||||
// Disable Pull to Full for landscape videos - @bhackel
|
||||
@interface YTWatchPullToFullController : NSObject
|
||||
@property(nonatomic, strong) YTWatchViewController *playerViewSource;
|
||||
|
|
|
|||
|
|
@ -181,57 +181,6 @@ BOOL isAd(YTIElementRenderer *self) {
|
|||
%end
|
||||
%end
|
||||
|
||||
// YouTube Premium Logo - @arichornlover & bhackel
|
||||
%group gPremiumYouTubeLogo
|
||||
%hook YTHeaderLogoController
|
||||
- (void)setTopbarLogoRenderer:(id)renderer {
|
||||
// Modify the type of the icon before setting the renderer
|
||||
YTITopbarLogoRenderer *logoRenderer = (YTITopbarLogoRenderer *)renderer;
|
||||
YTIIcon *iconImage = logoRenderer.iconImage;
|
||||
iconImage.iconType = 537; // magic number for Premium icon, hopefully it doesnt change. 158 is default logo.
|
||||
// Use this modified renderer
|
||||
%orig(logoRenderer);
|
||||
}
|
||||
// For when spoofing before 18.34.5
|
||||
- (void)setPremiumLogo:(BOOL)isPremiumLogo {
|
||||
isPremiumLogo = YES;
|
||||
%orig;
|
||||
}
|
||||
- (BOOL)isPremiumLogo {
|
||||
return YES;
|
||||
}
|
||||
%end
|
||||
|
||||
/*
|
||||
%hook YTHeaderLogoController
|
||||
- (void)setPremiumLogo:(BOOL)isPremiumLogo {
|
||||
isPremiumLogo = YES;
|
||||
%orig;
|
||||
}
|
||||
- (BOOL)isPremiumLogo {
|
||||
return YES;
|
||||
}
|
||||
- (void)setTopbarLogoRenderer:(id)renderer {
|
||||
}
|
||||
%end
|
||||
|
||||
// Workaround: fix YouTube Premium Logo not working on v18.35.4 or above.
|
||||
%hook YTVersionUtils // Working Version for Premium Logo
|
||||
+ (NSString *)appVersion { return @"18.34.5"; }
|
||||
%end
|
||||
|
||||
%hook YTSettingsCell // Remove v18.34.5 Version Number - @Dayanch96
|
||||
- (void)setDetailText:(id)arg1 {
|
||||
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
|
||||
NSString *appVersion = infoDictionary[@"CFBundleShortVersionString"];
|
||||
|
||||
if ([arg1 isEqualToString:@"18.34.5"]) {
|
||||
arg1 = appVersion;
|
||||
} %orig(arg1);
|
||||
}
|
||||
%end
|
||||
*/
|
||||
%end
|
||||
|
||||
// Fix App Group Directory by move it to document directory
|
||||
%hook NSFileManager
|
||||
|
|
@ -322,6 +271,147 @@ BOOL isAd(YTIElementRenderer *self) {
|
|||
- (BOOL)savedSettingShouldExpire { return NO; }
|
||||
%end
|
||||
|
||||
// Hide "Get Youtube Premium" in "You" tab - @bhackel
|
||||
%group gHidePremiumPromos
|
||||
%hook YTAppCollectionViewController
|
||||
- (void)loadWithModel:(YTISectionListRenderer *)model {
|
||||
NSMutableArray <YTISectionListSupportedRenderers *> *overallContentsArray = model.contentsArray;
|
||||
// Check each item in the overall array - this represents the whole You page
|
||||
YTISectionListSupportedRenderers *supportedRenderers;
|
||||
for (supportedRenderers in overallContentsArray) {
|
||||
YTIItemSectionRenderer *itemSectionRenderer = supportedRenderers.itemSectionRenderer;
|
||||
// Check each subobject - this would be visible as a cell in the You page
|
||||
NSMutableArray <YTIItemSectionSupportedRenderers *> *subContentsArray = itemSectionRenderer.contentsArray;
|
||||
bool found = NO;
|
||||
YTIItemSectionSupportedRenderers *itemSectionSupportedRenderers;
|
||||
for (itemSectionSupportedRenderers in subContentsArray) {
|
||||
// Check for a link cell
|
||||
if ([itemSectionSupportedRenderers hasCompactLinkRenderer]) {
|
||||
YTICompactLinkRenderer *compactLinkRenderer = [itemSectionSupportedRenderers compactLinkRenderer];
|
||||
// Check for an icon in this cell
|
||||
if ([compactLinkRenderer hasIcon]) {
|
||||
YTIIcon *icon = [compactLinkRenderer icon];
|
||||
// Check if the icon is for the premium promo
|
||||
if ([icon hasIconType] && icon.iconType == 117) {
|
||||
found = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Remove object from array - perform outside of loop to avoid error
|
||||
if (found) {
|
||||
[subContentsArray removeObject:itemSectionSupportedRenderers];
|
||||
break;
|
||||
}
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// Fake premium - @bhackel
|
||||
%group gFakePremium
|
||||
// YouTube Premium Logo - @arichornlover & bhackel
|
||||
%hook YTHeaderLogoController
|
||||
- (void)setTopbarLogoRenderer:(id)renderer {
|
||||
// Modify the type of the icon before setting the renderer
|
||||
YTITopbarLogoRenderer *logoRenderer = (YTITopbarLogoRenderer *)renderer;
|
||||
YTIIcon *iconImage = logoRenderer.iconImage;
|
||||
iconImage.iconType = 537; // magic number for Premium icon, hopefully it doesnt change. 158 is default logo.
|
||||
// Use this modified renderer
|
||||
%orig(logoRenderer);
|
||||
}
|
||||
// For when spoofing before 18.34.5
|
||||
- (void)setPremiumLogo:(BOOL)isPremiumLogo {
|
||||
isPremiumLogo = YES;
|
||||
%orig;
|
||||
}
|
||||
- (BOOL)isPremiumLogo {
|
||||
return YES;
|
||||
}
|
||||
%end
|
||||
%hook YTAppCollectionViewController
|
||||
/**
|
||||
* Modify a given renderer data model to fake premium in the You tab
|
||||
* Replaces the "Get YouTube Premium" cell with a "Your Premium benefits" cell
|
||||
* and adds a "Downloads" cell below the "Your videos" cell
|
||||
* @param model The model for the You tab
|
||||
*/
|
||||
%new
|
||||
- (void)uYouEnhancedFakePremiumModel:(YTISectionListRenderer *)model {
|
||||
NSUInteger yourVideosCellIndex = -1;
|
||||
NSMutableArray <YTISectionListSupportedRenderers *> *overallContentsArray = model.contentsArray;
|
||||
// Check each item in the overall array - this represents the whole You page
|
||||
YTISectionListSupportedRenderers *supportedRenderers;
|
||||
for (supportedRenderers in overallContentsArray) {
|
||||
YTIItemSectionRenderer *itemSectionRenderer = supportedRenderers.itemSectionRenderer;
|
||||
// Check each subobject - this would be visible as a cell in the You page
|
||||
NSMutableArray <YTIItemSectionSupportedRenderers *> *subContentsArray = itemSectionRenderer.contentsArray;
|
||||
YTIItemSectionSupportedRenderers *itemSectionSupportedRenderers;
|
||||
for (itemSectionSupportedRenderers in subContentsArray) {
|
||||
// Check for Get Youtube Premium cell, which is of type CompactLinkRenderer
|
||||
if ([itemSectionSupportedRenderers hasCompactLinkRenderer]) {
|
||||
YTICompactLinkRenderer *compactLinkRenderer = [itemSectionSupportedRenderers compactLinkRenderer];
|
||||
// Check for an icon in this cell
|
||||
if ([compactLinkRenderer hasIcon]) {
|
||||
YTIIcon *icon = [compactLinkRenderer icon];
|
||||
// Check if the icon is for the premium advertisement - 117 is magic number for the icon
|
||||
if ([icon hasIconType] && icon.iconType == 117) {
|
||||
// Modify the icon type to be Premium
|
||||
icon.iconType = 741; // Magic number for premium icon
|
||||
// Modify the text
|
||||
((YTIStringRun *)(compactLinkRenderer.title.runsArray.firstObject)).text = LOC(@"FAKE_YOUR_PREMIUM_BENEFITS");
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check for Your Videos cell using similar logic explained above
|
||||
if ([itemSectionSupportedRenderers hasCompactListItemRenderer]) {
|
||||
YTICompactListItemRenderer *compactListItemRenderer = itemSectionSupportedRenderers.compactListItemRenderer;
|
||||
if ([compactListItemRenderer hasThumbnail]) {
|
||||
YTICompactListItemThumbnailSupportedRenderers *thumbnail = compactListItemRenderer.thumbnail;
|
||||
if ([thumbnail hasIconThumbnailRenderer]) {
|
||||
YTIIconThumbnailRenderer *iconThumbnailRenderer = thumbnail.iconThumbnailRenderer;
|
||||
if ([iconThumbnailRenderer hasIcon]) {
|
||||
YTIIcon *icon = iconThumbnailRenderer.icon;
|
||||
if ([icon hasIconType] && icon.iconType == 658) {
|
||||
// Store the index of this cell
|
||||
yourVideosCellIndex = [subContentsArray indexOfObject:itemSectionSupportedRenderers];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (yourVideosCellIndex != -1 && subContentsArray[yourVideosCellIndex].accessibilityLabel == nil) {
|
||||
// Create the fake Downloads page by copying the Your Videos page and modifying it
|
||||
// Note that this must be done outside the loop to avoid a runtime exception
|
||||
// TODO Link this to the uYou downloads page
|
||||
YTIItemSectionSupportedRenderers *newItemSectionSupportedRenderers = [subContentsArray[yourVideosCellIndex] copy];
|
||||
((YTIStringRun *)(newItemSectionSupportedRenderers.compactListItemRenderer.title.runsArray.firstObject)).text = LOC(@"FAKE_DOWNLOADS");
|
||||
newItemSectionSupportedRenderers.compactListItemRenderer.thumbnail.iconThumbnailRenderer.icon.iconType = 147;
|
||||
// Insert this cell after the Your Videos cell
|
||||
[subContentsArray insertObject:newItemSectionSupportedRenderers atIndex:yourVideosCellIndex + 1];
|
||||
// Inject a note to not modify this again
|
||||
subContentsArray[yourVideosCellIndex].accessibilityLabel = @"uYouEnhanced Modified";
|
||||
yourVideosCellIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
- (void)loadWithModel:(YTISectionListRenderer *)model {
|
||||
// This method is called on first load of the You page
|
||||
[self uYouEnhancedFakePremiumModel:model];
|
||||
%orig;
|
||||
}
|
||||
- (void)setupSectionListWithModel:(YTISectionListRenderer *)model isLoadingMore:(BOOL)isLoadingMore isRefreshingFromContinuation:(BOOL)isRefreshingFromContinuation {
|
||||
// This method is called on refresh of the You page
|
||||
[self uYouEnhancedFakePremiumModel:model];
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
|
||||
// YTShortsProgress - https://github.com/PoomSmart/YTShortsProgress/
|
||||
%hook YTShortsPlayerViewController
|
||||
- (BOOL)shouldAlwaysEnablePlayerBar { return YES; }
|
||||
|
|
@ -1296,9 +1386,6 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
|
|||
if (IS_ENABLED(@"centerYouTubeLogo_enabled")) {
|
||||
%init(gCenterYouTubeLogo);
|
||||
}
|
||||
if (IS_ENABLED(@"premiumYouTubeLogo_enabled")) {
|
||||
%init(gPremiumYouTubeLogo);
|
||||
}
|
||||
if (IS_ENABLED(@"hideSubscriptionsNotificationBadge_enabled")) {
|
||||
%init(gHideSubscriptionsNotificationBadge);
|
||||
}
|
||||
|
|
@ -1389,6 +1476,12 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
|
|||
if (IS_ENABLED(@"YTTapToSeek_enabled")) {
|
||||
%init(YTTTS_Tweak);
|
||||
}
|
||||
if (IS_ENABLED(@"hidePremiumPromos_enabled")) {
|
||||
%init(gHidePremiumPromos);
|
||||
}
|
||||
if (IS_ENABLED(@"youTabFakePremium_enabled")) {
|
||||
%init(gFakePremium);
|
||||
}
|
||||
if (IS_ENABLED(@"disablePullToFull_enabled")) {
|
||||
%init(gDisablePullToFull);
|
||||
}
|
||||
|
|
@ -1398,14 +1491,11 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
|
|||
if (ytNoModernUIEnabled) {
|
||||
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
||||
[userDefaults setBool:NO forKey:@"enableVersionSpoofer_enabled"];
|
||||
[userDefaults setBool:NO forKey:@"premiumYouTubeLogo_enabled"];
|
||||
} else {
|
||||
BOOL enableVersionSpooferEnabled = IS_ENABLED(@"enableVersionSpoofer_enabled");
|
||||
BOOL premiumYouTubeLogoEnabled = IS_ENABLED(@"premiumYouTubeLogo_enabled");
|
||||
|
||||
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
||||
[userDefaults setBool:enableVersionSpooferEnabled forKey:@"enableVersionSpoofer_enabled"];
|
||||
[userDefaults setBool:premiumYouTubeLogoEnabled forKey:@"premiumYouTubeLogo_enabled"];
|
||||
}
|
||||
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
||||
[userDefaults setBool:ytNoModernUIEnabled ? ytNoModernUIEnabled : [userDefaults boolForKey:@"fixLowContrastMode_enabled"] forKey:@"fixLowContrastMode_enabled"];
|
||||
|
|
|
|||
|
|
@ -327,6 +327,7 @@ extern NSBundle *uYouPlusBundle();
|
|||
SWITCH_ITEM2(LOC(@"Hide `Your data in YouTube` Section"), LOC(@"App restart is required."), @"disableYourDataInYouTubeSection_enabled");
|
||||
SWITCH_ITEM2(LOC(@"Hide `Privacy` Section"), LOC(@"App restart is required."), @"disablePrivacySection_enabled");
|
||||
SWITCH_ITEM2(LOC(@"Hide `Live Chat` Section"), LOC(@"App restart is required."), @"disableLiveChatSection_enabled");
|
||||
SWITCH_ITEM2(LOC(@"Hide `Get Youtube Premium` Section"), LOC(@"App restart is required."), @"hidePremiumPromos_enabled");
|
||||
|
||||
# pragma mark - UI interface options
|
||||
SECTION_HEADER(LOC(@"UI Interface Options"));
|
||||
|
|
@ -1001,7 +1002,7 @@ YTSettingsSectionItem *lowContrastModeButton = [%c(YTSettingsSectionItem)
|
|||
# pragma mark - Miscellaneous
|
||||
SECTION_HEADER(LOC(@"MISCELLANEOUS"));
|
||||
|
||||
SWITCH_ITEM(LOC(@"YouTube Premium Logo"), LOC(@"Toggle this to use the official YouTube Premium Logo. App restart is required."), @"premiumYouTubeLogo_enabled");
|
||||
SWITCH_ITEM2(LOC(@"Fake Premium"), LOC(@"Uses Premium logo and creates fake buttons in the You tab"), @"youTabFakePremium_enabled");
|
||||
// SWITCH_ITEM(LOC(@"Center YouTube Logo"), LOC(@"Toggle this to move the official YouTube Logo to the Center. App restart is required."), @"centerYouTubeLogo_enabled");
|
||||
SWITCH_ITEM(LOC(@"Hide YouTube Logo"), LOC(@"Toggle this to hide the YouTube Logo in the YouTube App."), @"hideYouTubeLogo_enabled");
|
||||
SWITCH_ITEM2(LOC(@"ENABLE_YT_STARTUP_ANIMATION"), LOC(@"ENABLE_YT_STARTUP_ANIMATION_DESC"), @"ytStartupAnimation_enabled");
|
||||
|
|
|
|||
Loading…
Reference in a new issue